Create modules for header imports. (#7613)

Make multiple imports of the same header only parse it once per C++
domain. Reuse of the same header in `--share-cpp-ast` mode now reuses
the representation.

Importing a Carbon file with C++ dependencies now makes those transitive
C++ dependencies in the same C++ domain visible too.

Assisted-by: Gemini via Antigravity
This commit is contained in:
Richard Smith
2026-08-06 13:32:37 +00:00
committed by GitHub
parent b9692a0e77
commit a1e843718e
19 changed files with 324 additions and 164 deletions
+1 -2
View File
@@ -6,11 +6,10 @@
#include "clang/AST/Mangle.h"
#include "clang/Frontend/CompilerInstance.h"
#include "toolchain/check/cpp/domain.h"
namespace Carbon::Check {
CppContext::CppContext(CppDomain& domain,
CppContext::CppContext(SemIR::CppDomain& domain,
std::unique_ptr<CppDiagnosticListener> listener)
: domain_(&domain), diagnostic_listener_(std::move(listener)) {}