mirror of
https://github.com/carbon-language/carbon-lang.git
synced 2026-10-05 22:02:55 +01:00
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:
+23
-23
@@ -92,26 +92,26 @@ fn F() {
|
||||
// CHECK:STDOUT: %F: %F.type = struct_value () [concrete]
|
||||
// CHECK:STDOUT: %int_16: Core.IntLiteral = int_value 16 [concrete]
|
||||
// CHECK:STDOUT: %i16: type = class_type @Int, @Int(%int_16) [concrete]
|
||||
// CHECK:STDOUT: %pattern_type.0cb: type = pattern_type %i16 [concrete]
|
||||
// CHECK:STDOUT: %pattern_type.e1b: type = pattern_type %i16 [concrete]
|
||||
// CHECK:STDOUT: %Enum: type = class_type @Enum [concrete]
|
||||
// CHECK:STDOUT: %int_0.167: %Enum = int_value 0 [concrete]
|
||||
// CHECK:STDOUT: %int_0.713: %i16 = int_value 0 [concrete]
|
||||
// CHECK:STDOUT: %int_0.640: %i16 = int_value 0 [concrete]
|
||||
// CHECK:STDOUT: %pattern_type.361: type = pattern_type %Enum [concrete]
|
||||
// CHECK:STDOUT: %int_42.20e: Core.IntLiteral = int_value 42 [concrete]
|
||||
// CHECK:STDOUT: %As.type.457: type = facet_type <@As, @As(%i16)> [concrete]
|
||||
// CHECK:STDOUT: %As.type.fff: type = facet_type <@As, @As(%i16)> [concrete]
|
||||
// CHECK:STDOUT: %To: Core.IntLiteral = symbolic_binding To, 0 [symbolic]
|
||||
// CHECK:STDOUT: %Core.IntLiteral.as.As.impl.Convert.type.fc5: type = fn_type @Core.IntLiteral.as.As.impl.Convert, @Core.IntLiteral.as.As.impl(%To) [symbolic]
|
||||
// CHECK:STDOUT: %Core.IntLiteral.as.As.impl.Convert.3a8: %Core.IntLiteral.as.As.impl.Convert.type.fc5 = struct_value () [symbolic]
|
||||
// CHECK:STDOUT: %As.impl_witness.bca: <witness> = impl_witness imports.%As.impl_witness_table.2e6, @Core.IntLiteral.as.As.impl(%int_16) [concrete]
|
||||
// CHECK:STDOUT: %Core.IntLiteral.as.As.impl.Convert.type.36d: type = fn_type @Core.IntLiteral.as.As.impl.Convert, @Core.IntLiteral.as.As.impl(%int_16) [concrete]
|
||||
// CHECK:STDOUT: %Core.IntLiteral.as.As.impl.Convert.036: %Core.IntLiteral.as.As.impl.Convert.type.36d = struct_value () [concrete]
|
||||
// CHECK:STDOUT: %As.facet: %As.type.457 = facet_value Core.IntLiteral, (%As.impl_witness.bca) [concrete]
|
||||
// CHECK:STDOUT: %As.WithSelf.Convert.type.9f1: type = fn_type @As.WithSelf.Convert, @As.WithSelf(%i16, %As.facet) [concrete]
|
||||
// CHECK:STDOUT: %.3ca: type = fn_type_with_self_type %As.WithSelf.Convert.type.9f1, %As.facet [concrete]
|
||||
// CHECK:STDOUT: %Core.IntLiteral.as.As.impl.Convert.bound: <bound method> = bound_method %int_42.20e, %Core.IntLiteral.as.As.impl.Convert.036 [concrete]
|
||||
// CHECK:STDOUT: %Core.IntLiteral.as.As.impl.Convert.specific_fn: <specific function> = specific_function %Core.IntLiteral.as.As.impl.Convert.036, @Core.IntLiteral.as.As.impl.Convert(%int_16) [concrete]
|
||||
// CHECK:STDOUT: %Core.IntLiteral.as.As.impl.Convert.type.f55: type = fn_type @Core.IntLiteral.as.As.impl.Convert, @Core.IntLiteral.as.As.impl(%To) [symbolic]
|
||||
// CHECK:STDOUT: %Core.IntLiteral.as.As.impl.Convert.44f: %Core.IntLiteral.as.As.impl.Convert.type.f55 = struct_value () [symbolic]
|
||||
// CHECK:STDOUT: %As.impl_witness.16a: <witness> = impl_witness imports.%As.impl_witness_table.2b9, @Core.IntLiteral.as.As.impl(%int_16) [concrete]
|
||||
// CHECK:STDOUT: %Core.IntLiteral.as.As.impl.Convert.type.ced: type = fn_type @Core.IntLiteral.as.As.impl.Convert, @Core.IntLiteral.as.As.impl(%int_16) [concrete]
|
||||
// CHECK:STDOUT: %Core.IntLiteral.as.As.impl.Convert.0b6: %Core.IntLiteral.as.As.impl.Convert.type.ced = struct_value () [concrete]
|
||||
// CHECK:STDOUT: %As.facet: %As.type.fff = facet_value Core.IntLiteral, (%As.impl_witness.16a) [concrete]
|
||||
// CHECK:STDOUT: %As.WithSelf.Convert.type.28f: type = fn_type @As.WithSelf.Convert, @As.WithSelf(%i16, %As.facet) [concrete]
|
||||
// CHECK:STDOUT: %.696: type = fn_type_with_self_type %As.WithSelf.Convert.type.28f, %As.facet [concrete]
|
||||
// CHECK:STDOUT: %Core.IntLiteral.as.As.impl.Convert.bound: <bound method> = bound_method %int_42.20e, %Core.IntLiteral.as.As.impl.Convert.0b6 [concrete]
|
||||
// CHECK:STDOUT: %Core.IntLiteral.as.As.impl.Convert.specific_fn: <specific function> = specific_function %Core.IntLiteral.as.As.impl.Convert.0b6, @Core.IntLiteral.as.As.impl.Convert(%int_16) [concrete]
|
||||
// CHECK:STDOUT: %bound_method: <bound method> = bound_method %int_42.20e, %Core.IntLiteral.as.As.impl.Convert.specific_fn [concrete]
|
||||
// CHECK:STDOUT: %int_42.50d: %i16 = int_value 42 [concrete]
|
||||
// CHECK:STDOUT: %int_42.6a7: %i16 = int_value 42 [concrete]
|
||||
// CHECK:STDOUT: %int_42.3d1: %Enum = int_value 42 [concrete]
|
||||
// CHECK:STDOUT: %Other: type = class_type @Other [concrete]
|
||||
// CHECK:STDOUT: %pattern_type.7cb: type = pattern_type %Other [concrete]
|
||||
@@ -127,8 +127,8 @@ fn F() {
|
||||
// CHECK:STDOUT: }
|
||||
// CHECK:STDOUT: %Enum.decl: type = class_decl @Enum [concrete = constants.%Enum] {} {}
|
||||
// CHECK:STDOUT: %int_0: %Enum = int_value 0 [concrete = constants.%int_0.167]
|
||||
// CHECK:STDOUT: %Core.import_ref.6c4: @Core.IntLiteral.as.As.impl.%Core.IntLiteral.as.As.impl.Convert.type (%Core.IntLiteral.as.As.impl.Convert.type.fc5) = import_ref Core//prelude/parts/int, loc{{\d+_\d+}}, loaded [symbolic = @Core.IntLiteral.as.As.impl.%Core.IntLiteral.as.As.impl.Convert (constants.%Core.IntLiteral.as.As.impl.Convert.3a8)]
|
||||
// CHECK:STDOUT: %As.impl_witness_table.2e6 = impl_witness_table (%Core.import_ref.6c4), @Core.IntLiteral.as.As.impl [concrete]
|
||||
// CHECK:STDOUT: %Core.import_ref.fd7: @Core.IntLiteral.as.As.impl.%Core.IntLiteral.as.As.impl.Convert.type (%Core.IntLiteral.as.As.impl.Convert.type.f55) = import_ref Core//prelude/parts/int, loc{{\d+_\d+}}, loaded [symbolic = @Core.IntLiteral.as.As.impl.%Core.IntLiteral.as.As.impl.Convert (constants.%Core.IntLiteral.as.As.impl.Convert.44f)]
|
||||
// CHECK:STDOUT: %As.impl_witness_table.2b9 = impl_witness_table (%Core.import_ref.fd7), @Core.IntLiteral.as.As.impl [concrete]
|
||||
// CHECK:STDOUT: %Other.decl: type = class_decl @Other [concrete = constants.%Other] {} {}
|
||||
// CHECK:STDOUT: }
|
||||
// CHECK:STDOUT:
|
||||
@@ -139,14 +139,14 @@ fn F() {
|
||||
// CHECK:STDOUT: fn @F() {
|
||||
// CHECK:STDOUT: !entry:
|
||||
// CHECK:STDOUT: name_binding_decl {
|
||||
// CHECK:STDOUT: %a.patt: %pattern_type.0cb = value_binding_pattern a [concrete]
|
||||
// CHECK:STDOUT: %a.patt: %pattern_type.e1b = value_binding_pattern a [concrete]
|
||||
// CHECK:STDOUT: }
|
||||
// CHECK:STDOUT: %Cpp.ref.loc8: <namespace> = name_ref Cpp, imports.%Cpp [concrete = imports.%Cpp]
|
||||
// CHECK:STDOUT: %Enum.ref.loc8: type = name_ref Enum, imports.%Enum.decl [concrete = constants.%Enum]
|
||||
// CHECK:STDOUT: %a.ref.loc8: %Enum = name_ref a, imports.%int_0 [concrete = constants.%int_0.167]
|
||||
// CHECK:STDOUT: %i16.loc8_37: type = type_literal constants.%i16 [concrete = constants.%i16]
|
||||
// CHECK:STDOUT: %.loc8_34.1: %i16 = as_compatible %a.ref.loc8 [concrete = constants.%int_0.713]
|
||||
// CHECK:STDOUT: %.loc8_34.2: %i16 = converted %a.ref.loc8, %.loc8_34.1 [concrete = constants.%int_0.713]
|
||||
// CHECK:STDOUT: %.loc8_34.1: %i16 = as_compatible %a.ref.loc8 [concrete = constants.%int_0.640]
|
||||
// CHECK:STDOUT: %.loc8_34.2: %i16 = converted %a.ref.loc8, %.loc8_34.1 [concrete = constants.%int_0.640]
|
||||
// CHECK:STDOUT: %i16.loc8_17: type = type_literal constants.%i16 [concrete = constants.%i16]
|
||||
// CHECK:STDOUT: %a: %i16 = value_binding a, %.loc8_34.2
|
||||
// CHECK:STDOUT: name_binding_decl {
|
||||
@@ -154,13 +154,13 @@ fn F() {
|
||||
// CHECK:STDOUT: }
|
||||
// CHECK:STDOUT: %int_42: Core.IntLiteral = int_value 42 [concrete = constants.%int_42.20e]
|
||||
// CHECK:STDOUT: %i16.loc9: type = type_literal constants.%i16 [concrete = constants.%i16]
|
||||
// CHECK:STDOUT: %impl.elem0: %.3ca = impl_witness_access constants.%As.impl_witness.bca, element0 [concrete = constants.%Core.IntLiteral.as.As.impl.Convert.036]
|
||||
// CHECK:STDOUT: %impl.elem0: %.696 = impl_witness_access constants.%As.impl_witness.16a, element0 [concrete = constants.%Core.IntLiteral.as.As.impl.Convert.0b6]
|
||||
// CHECK:STDOUT: %bound_method.loc9_32.1: <bound method> = bound_method %int_42, %impl.elem0 [concrete = constants.%Core.IntLiteral.as.As.impl.Convert.bound]
|
||||
// CHECK:STDOUT: %specific_fn: <specific function> = specific_function %impl.elem0, @Core.IntLiteral.as.As.impl.Convert(constants.%int_16) [concrete = constants.%Core.IntLiteral.as.As.impl.Convert.specific_fn]
|
||||
// CHECK:STDOUT: %bound_method.loc9_32.2: <bound method> = bound_method %int_42, %specific_fn [concrete = constants.%bound_method]
|
||||
// CHECK:STDOUT: %Core.IntLiteral.as.As.impl.Convert.call: init %i16 = call %bound_method.loc9_32.2(%int_42) [concrete = constants.%int_42.50d]
|
||||
// CHECK:STDOUT: %.loc9_32.1: %i16 = value_of_initializer %Core.IntLiteral.as.As.impl.Convert.call [concrete = constants.%int_42.50d]
|
||||
// CHECK:STDOUT: %.loc9_32.2: %i16 = converted %int_42, %.loc9_32.1 [concrete = constants.%int_42.50d]
|
||||
// CHECK:STDOUT: %Core.IntLiteral.as.As.impl.Convert.call: init %i16 = call %bound_method.loc9_32.2(%int_42) [concrete = constants.%int_42.6a7]
|
||||
// CHECK:STDOUT: %.loc9_32.1: %i16 = value_of_initializer %Core.IntLiteral.as.As.impl.Convert.call [concrete = constants.%int_42.6a7]
|
||||
// CHECK:STDOUT: %.loc9_32.2: %i16 = converted %int_42, %.loc9_32.1 [concrete = constants.%int_42.6a7]
|
||||
// CHECK:STDOUT: %Cpp.ref.loc9_43: <namespace> = name_ref Cpp, imports.%Cpp [concrete = imports.%Cpp]
|
||||
// CHECK:STDOUT: %Enum.ref.loc9_46: type = name_ref Enum, imports.%Enum.decl [concrete = constants.%Enum]
|
||||
// CHECK:STDOUT: %.loc9_40.1: %Enum = as_compatible %.loc9_32.2 [concrete = constants.%int_42.3d1]
|
||||
|
||||
+6
-6
@@ -40,10 +40,10 @@ fn F() {
|
||||
// CHECK:STDOUT: %Copy.type: type = facet_type <@Copy> [concrete]
|
||||
// CHECK:STDOUT: %Enum.Op.type: type = fn_type @Enum.Op [concrete]
|
||||
// CHECK:STDOUT: %Enum.Op: %Enum.Op.type = struct_value () [concrete]
|
||||
// CHECK:STDOUT: %custom_witness.b8d: <witness> = custom_witness (%Enum.Op), @Copy [concrete]
|
||||
// CHECK:STDOUT: %Copy.facet.4ef: %Copy.type = facet_value %Enum, (%custom_witness.b8d) [concrete]
|
||||
// CHECK:STDOUT: %Copy.WithSelf.Op.type.bb4: type = fn_type @Copy.WithSelf.Op, @Copy.WithSelf(%Copy.facet.4ef) [concrete]
|
||||
// CHECK:STDOUT: %.a09: type = fn_type_with_self_type %Copy.WithSelf.Op.type.bb4, %Copy.facet.4ef [concrete]
|
||||
// CHECK:STDOUT: %custom_witness.b05: <witness> = custom_witness (%Enum.Op), @Copy [concrete]
|
||||
// CHECK:STDOUT: %Copy.facet.9d2: %Copy.type = facet_value %Enum, (%custom_witness.b05) [concrete]
|
||||
// CHECK:STDOUT: %Copy.WithSelf.Op.type.fc7: type = fn_type @Copy.WithSelf.Op, @Copy.WithSelf(%Copy.facet.9d2) [concrete]
|
||||
// CHECK:STDOUT: %.2fc: type = fn_type_with_self_type %Copy.WithSelf.Op.type.fc7, %Copy.facet.9d2 [concrete]
|
||||
// CHECK:STDOUT: %Enum.Op.bound.c3d: <bound method> = bound_method %int_0, %Enum.Op [concrete]
|
||||
// CHECK:STDOUT: %int_1: %Enum = int_value 1 [concrete]
|
||||
// CHECK:STDOUT: %Enum.Op.bound.6f8: <bound method> = bound_method %int_1, %Enum.Op [concrete]
|
||||
@@ -75,7 +75,7 @@ fn F() {
|
||||
// CHECK:STDOUT: %Cpp.ref.loc8_21: <namespace> = name_ref Cpp, imports.%Cpp [concrete = imports.%Cpp]
|
||||
// CHECK:STDOUT: %Enum.ref.loc8_24: type = name_ref Enum, imports.%Enum.decl [concrete = constants.%Enum]
|
||||
// CHECK:STDOUT: %a.ref.loc8: %Enum = name_ref a, imports.%int_0 [concrete = constants.%int_0]
|
||||
// CHECK:STDOUT: %impl.elem0.loc8: %.a09 = impl_witness_access constants.%custom_witness.b8d, element0 [concrete = constants.%Enum.Op]
|
||||
// CHECK:STDOUT: %impl.elem0.loc8: %.2fc = impl_witness_access constants.%custom_witness.b05, element0 [concrete = constants.%Enum.Op]
|
||||
// CHECK:STDOUT: %bound_method.loc8: <bound method> = bound_method %a.ref.loc8, %impl.elem0.loc8 [concrete = constants.%Enum.Op.bound.c3d]
|
||||
// CHECK:STDOUT: %Enum.Op.call.loc8: init %Enum = call %bound_method.loc8(%a.ref.loc8) [concrete = constants.%int_0]
|
||||
// CHECK:STDOUT: assign %a.var, %Enum.Op.call.loc8
|
||||
@@ -88,7 +88,7 @@ fn F() {
|
||||
// CHECK:STDOUT: %Cpp.ref.loc10: <namespace> = name_ref Cpp, imports.%Cpp [concrete = imports.%Cpp]
|
||||
// CHECK:STDOUT: %Enum.ref.loc10: type = name_ref Enum, imports.%Enum.decl [concrete = constants.%Enum]
|
||||
// CHECK:STDOUT: %b.ref: %Enum = name_ref b, imports.%int_1 [concrete = constants.%int_1]
|
||||
// CHECK:STDOUT: %impl.elem0.loc10: %.a09 = impl_witness_access constants.%custom_witness.b8d, element0 [concrete = constants.%Enum.Op]
|
||||
// CHECK:STDOUT: %impl.elem0.loc10: %.2fc = impl_witness_access constants.%custom_witness.b05, element0 [concrete = constants.%Enum.Op]
|
||||
// CHECK:STDOUT: %bound_method.loc10: <bound method> = bound_method %b.ref, %impl.elem0.loc10 [concrete = constants.%Enum.Op.bound.6f8]
|
||||
// CHECK:STDOUT: %Enum.Op.call.loc10: init %Enum = call %bound_method.loc10(%b.ref) [concrete = constants.%int_1]
|
||||
// CHECK:STDOUT: assign %a.ref.loc10, %Enum.Op.call.loc10
|
||||
|
||||
Reference in New Issue
Block a user