mirror of
https://github.com/carbon-language/carbon-lang.git
synced 2026-11-19 18:56:40 +00:00
Refactor BindName to support tracking the enclosing scope. (#3566)
This is a step towards adding enclosing scopes for imports. It creates an indirection for all bind names. We discussed specializing for bindings that are in function scope (i.e., not a useful enclosing scope for imports or diagnostics). However, the thought is to go ahead with this singular approach for now, and only change structure if it's a performance issues so that we have incrementally fewer instructions to handle.
This commit is contained in:
1 parent
dfb27ded9c
commit
0205645e7d
18 files changed
+82
-16
No files matched your search
@@ -262,8 +262,9 @@ auto HandleFunctionDefinitionStart(Context& context,
|
||||
});
|
||||
|
||||
if (auto fn_param = param.TryAs<SemIR::BindName>()) {
|
||||
context.AddNameToLookup(fn_param->parse_node, fn_param->name_id,
|
||||
param_id);
|
||||
context.AddNameToLookup(
|
||||
fn_param->parse_node,
|
||||
context.bind_names().Get(fn_param->bind_name_id).name_id, param_id);
|
||||
} else {
|
||||
CARBON_FATAL() << "Unexpected kind of parameter in function definition "
|
||||
<< param;
|
||||
|
||||
Reference in new issue
Block a user