mirror of
https://github.com/carbon-language/carbon-lang.git
synced 2026-10-05 13:21:05 +01:00
Encapsulate clang::ASTUnit in SemIR::CppFile. (#6459)
This intends to avoid proliferation of dependencies on the exact API of `clang::ASTUnit`, and would enable us to more easily switch to a different approach that gives us more control over the construction of the Clang AST. Also remove some unnecessary tracking of the `CppFile` and instead always retrieve it from the `SemIR::File`. --------- Co-authored-by: Jon Ross-Perkins <jperkins@google.com>
This commit is contained in:
co-authored by
Jon Ross-Perkins
parent
78025fed70
commit
d208e950c7
@@ -571,7 +571,6 @@ class CompilationUnit {
|
||||
std::optional<std::function<auto()->const Parse::TreeAndSubtrees&>>
|
||||
tree_and_subtrees_getter_;
|
||||
std::optional<SemIR::File> sem_ir_;
|
||||
std::unique_ptr<clang::ASTUnit> clang_ast_unit_;
|
||||
std::unique_ptr<llvm::LLVMContext> llvm_context_;
|
||||
std::unique_ptr<llvm::Module> module_;
|
||||
std::unique_ptr<llvm::TargetMachine> target_machine_;
|
||||
@@ -764,8 +763,7 @@ auto CompilationUnit::GetCheckUnit() -> Check::Unit {
|
||||
.value_stores = &value_stores_,
|
||||
.timings = timings_ ? &*timings_ : nullptr,
|
||||
.sem_ir = &*sem_ir_,
|
||||
.total_ir_count = total_ir_count_,
|
||||
.clang_ast_unit = &clang_ast_unit_};
|
||||
.total_ir_count = total_ir_count_};
|
||||
}
|
||||
|
||||
auto CompilationUnit::PostCheck() -> void {
|
||||
|
||||
Reference in New Issue
Block a user