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 authored and GitHub committed 2026-05-04 14:45:06 +00:00
1 parent c6253b93f9
commit 88931a4196
81 files changed
+586 -497

No files matched your search

+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;
}