mirror of
https://github.com/carbon-language/carbon-lang.git
synced 2026-09-24 17:00:25 +01:00
Exporting class fields in class specifics will require looking up `ClangDecl`s by the field's `InstId` and the class's `SpecificId`. Add the `specific_id` to ClangeDecl, and rework the reverse lookup to use a `Set` with a `KeyContext` rather than a `Map`. The `Lookup` method now takes an optional `SpecificId` argument, although currently it is always `None`. For `VarStorage`, reverse lookup is performed by the pattern `InstId` rather than the `InstId` of the `VarStorage` itself, so also add `pattern_inst_id` to `ClangDecl`, and provide a separate `LookupByPatternInstId` method for reverse lookups. For this lookup, the `inst_id` part of the key is set to `None`, so only the pattern's `InstId` is used for lookup.