Don't include the library name in most fingerprints. (#7292)

When we import from another library in the same package, its entities
end up with our library as their parent scope, resulting in cross-file
fingerprint mismatches. Instead, only include the library ID when
fingerprinting either a package-private entity or an `ImportIRId` that
refers to a particular `SemIR::File`.
This commit is contained in:
Richard Smith
2026-06-02 19:31:30 +00:00
committed by GitHub
parent e7ed217d4e
commit f5e9c61f11
640 changed files with 50114 additions and 49559 deletions
@@ -23,7 +23,7 @@ fn G(a: i32);
// CHECK:STDOUT: %Int.type: type = generic_class_type @Int [concrete]
// CHECK:STDOUT: %Int.generic: %Int.type = struct_value () [concrete]
// CHECK:STDOUT: %i32: type = class_type @Int, @Int(%int_32) [concrete]
// CHECK:STDOUT: %pattern_type.c6b: type = pattern_type %i32 [concrete]
// CHECK:STDOUT: %pattern_type.104: type = pattern_type %i32 [concrete]
// CHECK:STDOUT: %F.type: type = fn_type @F [concrete]
// CHECK:STDOUT: %F: %F.type = struct_value () [concrete]
// CHECK:STDOUT: %G.type: type = fn_type @G [concrete]
@@ -47,16 +47,16 @@ fn G(a: i32);
// CHECK:STDOUT: }
// CHECK:STDOUT: %Core.import = import Core
// CHECK:STDOUT: %F.decl: %F.type = fn_decl @F [concrete = constants.%F] {
// CHECK:STDOUT: %a.param_patt: %pattern_type.c6b = value_param_pattern [concrete]
// CHECK:STDOUT: %a.patt: %pattern_type.c6b = at_binding_pattern a, %a.param_patt [concrete]
// CHECK:STDOUT: %a.param_patt: %pattern_type.104 = value_param_pattern [concrete]
// CHECK:STDOUT: %a.patt: %pattern_type.104 = at_binding_pattern a, %a.param_patt [concrete]
// CHECK:STDOUT: } {
// CHECK:STDOUT: %a.param: %i32 = value_param call_param0
// CHECK:STDOUT: %i32: type = type_literal constants.%i32 [concrete = constants.%i32]
// CHECK:STDOUT: %a: %i32 = value_binding a, %a.param
// CHECK:STDOUT: }
// CHECK:STDOUT: %G.decl: %G.type = fn_decl @G [concrete = constants.%G] {
// CHECK:STDOUT: %a.param_patt: %pattern_type.c6b = value_param_pattern [concrete]
// CHECK:STDOUT: %a.patt: %pattern_type.c6b = at_binding_pattern a, %a.param_patt [concrete]
// CHECK:STDOUT: %a.param_patt: %pattern_type.104 = value_param_pattern [concrete]
// CHECK:STDOUT: %a.patt: %pattern_type.104 = at_binding_pattern a, %a.param_patt [concrete]
// CHECK:STDOUT: } {
// CHECK:STDOUT: %a.param: %i32 = value_param call_param0
// CHECK:STDOUT: %i32: type = type_literal constants.%i32 [concrete = constants.%i32]