mirror of
https://github.com/carbon-language/carbon-lang.git
synced 2026-10-03 22:02:51 +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
@@ -56,7 +56,7 @@ static auto GetFileInfo(Context& context, SemIR::CheckIRId ir_id) -> FileInfo {
|
||||
|
||||
auto GetCppLocation(Context& context, SemIR::LocId loc_id)
|
||||
-> clang::SourceLocation {
|
||||
if (!context.sem_ir().clang_ast_unit()) {
|
||||
if (!context.sem_ir().cpp_file()) {
|
||||
return clang::SourceLocation();
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user