mirror of
https://github.com/carbon-language/carbon-lang.git
synced 2026-10-05 10:51:06 +01:00
Factor out a Check::CppContext holding C++-specific check state (#6482)
* Move `Sema` access from `CppFile` into `CppContext`. * Move the mangle context from `SemIR::File` into `CppContext`. * Move source location mapping state from `Context` into `CppContext`. Also factor out the `GenerateAst` function that builds the `CppContext` and `CppFile` into its own file.
This commit is contained in:
@@ -33,7 +33,7 @@ static auto GetFileInfo(Context& context, SemIR::CheckIRId ir_id) -> FileInfo {
|
||||
}
|
||||
|
||||
// If we've seen this file before, reuse the same FileID.
|
||||
auto& file_start_locs = context.cpp_carbon_file_locations();
|
||||
auto& file_start_locs = context.cpp_context()->carbon_file_locations();
|
||||
if (static_cast<int>(file_start_locs.size()) <= file_index) {
|
||||
// Never valid; prepare a slot for the caching below.
|
||||
file_start_locs.resize(file_index + 1);
|
||||
|
||||
Reference in New Issue
Block a user