Give the .Self instruction a location (#7147)

This lets us stop eliding it in textual semir tests with dump ranges.
Previously it would always get elided, even though it was part of the
range being dumped, and was referred to by other instructions in the
dump range.

Since each `.Self` is unique (can change its type if not its value) in a
facet type, having each one distinct by location also aids
understanding.
This commit is contained in:
Dana Jansens
2026-05-04 14:45:06 +00:00
committed by GitHub
parent c6253b93f9
commit 88931a4196
81 changed files with 586 additions and 497 deletions
+2 -3
View File
@@ -411,13 +411,12 @@ auto HandleParseNode(Context& context, Parse::FormBindingPatternId node_id)
}
auto HandleParseNode(Context& context,
Parse::CompileTimeBindingPatternStartId /*node_id*/)
-> bool {
Parse::CompileTimeBindingPatternStartId node_id) -> bool {
// Make a scope to contain the `.Self` facet value for use in the type of the
// compile time binding. This is popped when handling the
// CompileTimeBindingPatternId.
context.scope_stack().PushForSameRegion();
MakePeriodSelfFacetValue(context, GetEmptyFacetType(context));
MakePeriodSelfFacetValue(context, node_id, GetEmptyFacetType(context));
return true;
}