Reduce Clang header exposure in check_unit.h (#7509)

Remove clang/Frontend/CompilerInvocation.h from check_unit.h and forward
declare clang::CompilerInvocation instead to reduce header exposure.

Add an explicit include of CompilerInvocation.h to check_unit.cpp.

Assisted-by: Antigravity with Gemini
This commit is contained in:
Chandler Carruth
2026-07-15 00:59:58 +00:00
committed by GitHub
parent 730db0f903
commit 0a09ab1e3c
2 changed files with 5 additions and 1 deletions
+1
View File
@@ -9,6 +9,7 @@
#include <tuple>
#include <utility>
#include "clang/Frontend/CompilerInvocation.h"
#include "clang/Sema/Sema.h"
#include "common/growing_range.h"
#include "common/pretty_stack_trace_function.h"
+4 -1
View File
@@ -5,7 +5,6 @@
#ifndef CARBON_TOOLCHAIN_CHECK_CHECK_UNIT_H_
#define CARBON_TOOLCHAIN_CHECK_CHECK_UNIT_H_
#include "clang/Frontend/CompilerInvocation.h"
#include "common/map.h"
#include "llvm/ADT/SmallVector.h"
#include "toolchain/check/check.h"
@@ -14,6 +13,10 @@
#include "toolchain/parse/node_ids.h"
#include "toolchain/sem_ir/ids.h"
namespace clang {
class CompilerInvocation;
}
namespace Carbon::Check {
struct UnitAndImports;