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
@@ -3930,12 +3930,12 @@ fn F() {
// CHECK:STDOUT: %value.patt: @EchoValue.%pattern_type (%pattern_type.f4e) = symbolic_binding_pattern value, 1 [concrete]
// CHECK:STDOUT: } {
// CHECK:STDOUT: %.loc10_23: type = splice_block %I.ref [concrete = constants.%I.type] {
// CHECK:STDOUT: %.Self.2: %type = symbolic_binding .Self [symbolic_self = constants.%.Self]
// CHECK:STDOUT: %.Self.loc10_20: %type = symbolic_binding .Self [symbolic_self = constants.%.Self]
// CHECK:STDOUT: %I.ref: type = name_ref I, file.%I.decl [concrete = constants.%I.type]
// CHECK:STDOUT: }
// CHECK:STDOUT: %ValueT.loc10_20.2: %I.type = symbolic_binding ValueT, 0 [symbolic = %ValueT.loc10_20.1 (constants.%ValueT)]
// CHECK:STDOUT: %.loc10_41.1: type = splice_block %.loc10_41.2 [symbolic = %ValueT.as_type.loc10_41.1 (constants.%ValueT.as_type)] {
// CHECK:STDOUT: %.Self.1: %type = symbolic_binding .Self [symbolic_self = constants.%.Self]
// CHECK:STDOUT: %.Self.loc10_38: %type = symbolic_binding .Self [symbolic_self = constants.%.Self]
// CHECK:STDOUT: %ValueT.ref: %I.type = name_ref ValueT, %ValueT.loc10_20.2 [symbolic = %ValueT.loc10_20.1 (constants.%ValueT)]
// CHECK:STDOUT: %ValueT.as_type.loc10_41.2: type = facet_access_type %ValueT.ref [symbolic = %ValueT.as_type.loc10_41.1 (constants.%ValueT.as_type)]
// CHECK:STDOUT: %.loc10_41.2: type = converted %ValueT.ref, %ValueT.as_type.loc10_41.2 [symbolic = %ValueT.as_type.loc10_41.1 (constants.%ValueT.as_type)]