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:
Richard Smith
2025-12-10 18:55:22 +00:00
committed by GitHub
parent bf45b1cbf5
commit 6114df59ee
13 changed files with 512 additions and 381 deletions
+1 -1
View File
@@ -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);