mirror of
https://github.com/carbon-language/carbon-lang.git
synced 2026-10-06 08:44:41 +01:00
Initial 'export name' handling. (#3949)
This adds a `BindExport` instruction in order to better track the location of the `export` itself, but a `bind_name_id` is also added to `ImportRef` so that we know quickly where to put it in name lookup. Merging identical names is a TODO. I haven't quite decided how best to achieve that, because I do think the BindExport should be what's actually added to name lookup. Also, I will probably add a mode to DeclNameStack that blocks non-namespace scopes. This seems to already be an error, but the wrong one (maybe due to lack of support for cross-file decl/def support).
This commit is contained in:
@@ -1065,6 +1065,9 @@ auto TryEvalInst(Context& context, SemIR::InstId inst_id, SemIR::Inst inst)
|
||||
case CARBON_KIND(SemIR::BindAlias typed_inst): {
|
||||
return context.constant_values().Get(typed_inst.value_id);
|
||||
}
|
||||
case CARBON_KIND(SemIR::BindExport typed_inst): {
|
||||
return context.constant_values().Get(typed_inst.value_id);
|
||||
}
|
||||
case CARBON_KIND(SemIR::NameRef typed_inst): {
|
||||
return context.constant_values().Get(typed_inst.value_id);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user