mirror of
https://github.com/carbon-language/carbon-lang.git
synced 2026-10-05 22:02:55 +01:00
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:
@@ -14,11 +14,12 @@ namespace Carbon::SemIR {
|
||||
CppFile::CppFile(std::shared_ptr<clang::CompilerInstance> clang,
|
||||
std::unique_ptr<clang::MangleContext> mangle_context,
|
||||
llvm::LLVMContext* llvm_context,
|
||||
clang::CodeGenerator* code_generator)
|
||||
clang::CodeGenerator* code_generator, CppDomain* cpp_domain)
|
||||
: clang_(std::move(clang)),
|
||||
mangle_context_(std::move(mangle_context)),
|
||||
llvm_context_(llvm_context),
|
||||
code_generator_(code_generator) {}
|
||||
code_generator_(code_generator),
|
||||
cpp_domain_(cpp_domain) {}
|
||||
|
||||
CppFile::~CppFile() = default;
|
||||
|
||||
|
||||
Reference in New Issue
Block a user