mirror of
https://github.com/carbon-language/carbon-lang.git
synced 2026-10-05 09:51:04 +01:00
Remove CppGlobalVarStore (#7309)
Replace all uses of CppGlobalVarStore store with ClangDeclStore. Adding a VarStorage->VarDecl mapping to ClangDeclStore is now done with the `AddVar` method, which takes an extra `pattern_id` arg. While the corresponding `ClangDecl` is unchanged from before, the reverse mapping in `inst_id_to_clang_decl_id_` now uses the `pattern_id` as the key. This is necessary because in some places the original VarStorage instructions gets replaced (e.g. by a call to `Convert`). The `pattern_id` remains stable in those cases. --------- Co-authored-by: Richard Smith <richard@metafoo.co.uk>
This commit is contained in:
co-authored by
Richard Smith
parent
d652cb0dfd
commit
1aa34d7642
@@ -436,8 +436,7 @@ auto CarbonExternalASTSource::MapInstIdToClangDeclOrType(LookupResult lookup)
|
||||
return ExportFieldToCpp(*context_, target_inst_id, field_decl);
|
||||
}
|
||||
case CARBON_KIND(SemIR::VarStorage var_storage): {
|
||||
return ExportVarToCpp(*context_, SemIR::LocId(target_inst_id),
|
||||
var_storage);
|
||||
return ExportVarToCpp(*context_, target_inst_id, var_storage);
|
||||
}
|
||||
default:
|
||||
return nullptr;
|
||||
|
||||
Reference in New Issue
Block a user