mirror of
https://github.com/carbon-language/carbon-lang.git
synced 2026-10-05 22:02:55 +01:00
Improve SemIR naming of import_refs (#4824)
Changes the name of SemIR `import_ref`s to use the format `<package>.<entity>`. <table> <tr><th>Before</th><th>After</th></tr> <tr> <td><code>%import_ref.05a: type</code></td> <td><code>%Main.D: type</code></td> </tr> <tr> <td><code>%import_ref.8f2: <witness></code></td> <td><code>%Main.import_ref.8f2: <witness></code></td> </tr> </table> * [Discord discussion in #toolchain](https://discord.com/channels/655572317891461132/655578254970716160/1330253540999827577) * Closes #4769
This commit is contained in:
+12
-12
@@ -218,7 +218,7 @@ fn CallImplicitNotDeducible() {
|
||||
// CHECK:STDOUT:
|
||||
// CHECK:STDOUT: imports {
|
||||
// CHECK:STDOUT: %Core: <namespace> = namespace file.%Core.import, [template] {
|
||||
// CHECK:STDOUT: .Int = %import_ref.485
|
||||
// CHECK:STDOUT: .Int = %Core.Int
|
||||
// CHECK:STDOUT: import Core//prelude
|
||||
// CHECK:STDOUT: import Core//prelude/...
|
||||
// CHECK:STDOUT: }
|
||||
@@ -657,7 +657,7 @@ fn CallImplicitNotDeducible() {
|
||||
// CHECK:STDOUT:
|
||||
// CHECK:STDOUT: imports {
|
||||
// CHECK:STDOUT: %Core: <namespace> = namespace file.%Core.import, [template] {
|
||||
// CHECK:STDOUT: .Int = %import_ref.485
|
||||
// CHECK:STDOUT: .Int = %Core.Int
|
||||
// CHECK:STDOUT: import Core//prelude
|
||||
// CHECK:STDOUT: import Core//prelude/...
|
||||
// CHECK:STDOUT: }
|
||||
@@ -786,7 +786,7 @@ fn CallImplicitNotDeducible() {
|
||||
// CHECK:STDOUT: %tuple.type.4c8: type = tuple_type (Core.IntLiteral, %i32) [template]
|
||||
// CHECK:STDOUT: %TupleParam.specific_fn: <specific function> = specific_function %TupleParam, @TupleParam(Core.IntLiteral) [template]
|
||||
// CHECK:STDOUT: %Convert.type.1b6: type = fn_type @Convert.1, @ImplicitAs(%i32) [template]
|
||||
// CHECK:STDOUT: %impl_witness.d39: <witness> = impl_witness (imports.%import_ref.a5b), @impl.1(%int_32) [template]
|
||||
// CHECK:STDOUT: %impl_witness.d39: <witness> = impl_witness (imports.%Core.import_ref.a5b), @impl.1(%int_32) [template]
|
||||
// CHECK:STDOUT: %Convert.type.035: type = fn_type @Convert.2, @impl.1(%int_32) [template]
|
||||
// CHECK:STDOUT: %Convert.956: %Convert.type.035 = struct_value () [template]
|
||||
// CHECK:STDOUT: %Convert.bound: <bound method> = bound_method %int_2.ecc, %Convert.956 [template]
|
||||
@@ -798,8 +798,8 @@ fn CallImplicitNotDeducible() {
|
||||
// CHECK:STDOUT:
|
||||
// CHECK:STDOUT: imports {
|
||||
// CHECK:STDOUT: %Core: <namespace> = namespace file.%Core.import, [template] {
|
||||
// CHECK:STDOUT: .Int = %import_ref.485
|
||||
// CHECK:STDOUT: .ImplicitAs = %import_ref.d44
|
||||
// CHECK:STDOUT: .Int = %Core.Int
|
||||
// CHECK:STDOUT: .ImplicitAs = %Core.ImplicitAs
|
||||
// CHECK:STDOUT: import Core//prelude
|
||||
// CHECK:STDOUT: import Core//prelude/...
|
||||
// CHECK:STDOUT: }
|
||||
@@ -901,7 +901,7 @@ fn CallImplicitNotDeducible() {
|
||||
// CHECK:STDOUT: %struct_type.a.b.a13: type = struct_type {.a: Core.IntLiteral, .b: %i32} [template]
|
||||
// CHECK:STDOUT: %StructParam.specific_fn: <specific function> = specific_function %StructParam, @StructParam(Core.IntLiteral) [template]
|
||||
// CHECK:STDOUT: %Convert.type.1b6: type = fn_type @Convert.1, @ImplicitAs(%i32) [template]
|
||||
// CHECK:STDOUT: %impl_witness.d39: <witness> = impl_witness (imports.%import_ref.a5b), @impl.1(%int_32) [template]
|
||||
// CHECK:STDOUT: %impl_witness.d39: <witness> = impl_witness (imports.%Core.import_ref.a5b), @impl.1(%int_32) [template]
|
||||
// CHECK:STDOUT: %Convert.type.035: type = fn_type @Convert.2, @impl.1(%int_32) [template]
|
||||
// CHECK:STDOUT: %Convert.956: %Convert.type.035 = struct_value () [template]
|
||||
// CHECK:STDOUT: %Convert.bound: <bound method> = bound_method %int_2.ecc, %Convert.956 [template]
|
||||
@@ -913,8 +913,8 @@ fn CallImplicitNotDeducible() {
|
||||
// CHECK:STDOUT:
|
||||
// CHECK:STDOUT: imports {
|
||||
// CHECK:STDOUT: %Core: <namespace> = namespace file.%Core.import, [template] {
|
||||
// CHECK:STDOUT: .Int = %import_ref.485
|
||||
// CHECK:STDOUT: .ImplicitAs = %import_ref.d44
|
||||
// CHECK:STDOUT: .Int = %Core.Int
|
||||
// CHECK:STDOUT: .ImplicitAs = %Core.ImplicitAs
|
||||
// CHECK:STDOUT: import Core//prelude
|
||||
// CHECK:STDOUT: import Core//prelude/...
|
||||
// CHECK:STDOUT: }
|
||||
@@ -1015,7 +1015,7 @@ fn CallImplicitNotDeducible() {
|
||||
// CHECK:STDOUT:
|
||||
// CHECK:STDOUT: imports {
|
||||
// CHECK:STDOUT: %Core: <namespace> = namespace file.%Core.import, [template] {
|
||||
// CHECK:STDOUT: .Int = %import_ref.485
|
||||
// CHECK:STDOUT: .Int = %Core.Int
|
||||
// CHECK:STDOUT: import Core//prelude
|
||||
// CHECK:STDOUT: import Core//prelude/...
|
||||
// CHECK:STDOUT: }
|
||||
@@ -1100,7 +1100,7 @@ fn CallImplicitNotDeducible() {
|
||||
// CHECK:STDOUT:
|
||||
// CHECK:STDOUT: imports {
|
||||
// CHECK:STDOUT: %Core: <namespace> = namespace file.%Core.import, [template] {
|
||||
// CHECK:STDOUT: .Int = %import_ref.485
|
||||
// CHECK:STDOUT: .Int = %Core.Int
|
||||
// CHECK:STDOUT: import Core//prelude
|
||||
// CHECK:STDOUT: import Core//prelude/...
|
||||
// CHECK:STDOUT: }
|
||||
@@ -1183,7 +1183,7 @@ fn CallImplicitNotDeducible() {
|
||||
// CHECK:STDOUT:
|
||||
// CHECK:STDOUT: imports {
|
||||
// CHECK:STDOUT: %Core: <namespace> = namespace file.%Core.import, [template] {
|
||||
// CHECK:STDOUT: .Int = %import_ref.485
|
||||
// CHECK:STDOUT: .Int = %Core.Int
|
||||
// CHECK:STDOUT: import Core//prelude
|
||||
// CHECK:STDOUT: import Core//prelude/...
|
||||
// CHECK:STDOUT: }
|
||||
@@ -1265,7 +1265,7 @@ fn CallImplicitNotDeducible() {
|
||||
// CHECK:STDOUT:
|
||||
// CHECK:STDOUT: imports {
|
||||
// CHECK:STDOUT: %Core: <namespace> = namespace file.%Core.import, [template] {
|
||||
// CHECK:STDOUT: .Int = %import_ref.485
|
||||
// CHECK:STDOUT: .Int = %Core.Int
|
||||
// CHECK:STDOUT: import Core//prelude
|
||||
// CHECK:STDOUT: import Core//prelude/...
|
||||
// CHECK:STDOUT: }
|
||||
|
||||
+6
-6
@@ -132,14 +132,14 @@ fn H() {
|
||||
// CHECK:STDOUT: }
|
||||
// CHECK:STDOUT:
|
||||
// CHECK:STDOUT: imports {
|
||||
// CHECK:STDOUT: %import_ref.b37: %F.type = import_ref Main//library, F, loaded [template = constants.%F]
|
||||
// CHECK:STDOUT: %import_ref.ad0: %G.type = import_ref Main//library, G, loaded [template = constants.%G]
|
||||
// CHECK:STDOUT: %Main.F: %F.type = import_ref Main//library, F, loaded [template = constants.%F]
|
||||
// CHECK:STDOUT: %Main.G: %G.type = import_ref Main//library, G, loaded [template = constants.%G]
|
||||
// CHECK:STDOUT: }
|
||||
// CHECK:STDOUT:
|
||||
// CHECK:STDOUT: file {
|
||||
// CHECK:STDOUT: package: <namespace> = namespace [template] {
|
||||
// CHECK:STDOUT: .F = imports.%import_ref.b37
|
||||
// CHECK:STDOUT: .G = imports.%import_ref.ad0
|
||||
// CHECK:STDOUT: .F = imports.%Main.F
|
||||
// CHECK:STDOUT: .G = imports.%Main.G
|
||||
// CHECK:STDOUT: .C = %C.decl
|
||||
// CHECK:STDOUT: .H = %H.decl
|
||||
// CHECK:STDOUT: }
|
||||
@@ -158,11 +158,11 @@ fn H() {
|
||||
// CHECK:STDOUT:
|
||||
// CHECK:STDOUT: fn @H() {
|
||||
// CHECK:STDOUT: !entry:
|
||||
// CHECK:STDOUT: %F.ref: %F.type = name_ref F, imports.%import_ref.b37 [template = constants.%F]
|
||||
// CHECK:STDOUT: %F.ref: %F.type = name_ref F, imports.%Main.F [template = constants.%F]
|
||||
// CHECK:STDOUT: %C.ref.loc10: type = name_ref C, file.%C.decl [template = constants.%C]
|
||||
// CHECK:STDOUT: %F.specific_fn: <specific function> = specific_function %F.ref, @F(constants.%C) [template = constants.%F.specific_fn.04a]
|
||||
// CHECK:STDOUT: %F.call: init %empty_tuple.type = call %F.specific_fn()
|
||||
// CHECK:STDOUT: %G.ref: %G.type = name_ref G, imports.%import_ref.ad0 [template = constants.%G]
|
||||
// CHECK:STDOUT: %G.ref: %G.type = name_ref G, imports.%Main.G [template = constants.%G]
|
||||
// CHECK:STDOUT: %C.ref.loc12: type = name_ref C, file.%C.decl [template = constants.%C]
|
||||
// CHECK:STDOUT: %G.specific_fn: <specific function> = specific_function %G.ref, @G(constants.%C) [template = constants.%G.specific_fn]
|
||||
// CHECK:STDOUT: %G.call: init %empty_tuple.type = call %G.specific_fn()
|
||||
|
||||
@@ -18,7 +18,7 @@ fn F(N:! i32, a: [i32; N]*);
|
||||
// CHECK:STDOUT: %N.51e: %i32 = bind_symbolic_name N, 0 [symbolic]
|
||||
// CHECK:STDOUT: %N.patt.8e2: %i32 = symbolic_binding_pattern N, 0 [symbolic]
|
||||
// CHECK:STDOUT: %Convert.type.71e: type = fn_type @Convert.1, @ImplicitAs(Core.IntLiteral) [template]
|
||||
// CHECK:STDOUT: %impl_witness.023: <witness> = impl_witness (imports.%import_ref.85c), @impl.2(%int_32) [template]
|
||||
// CHECK:STDOUT: %impl_witness.023: <witness> = impl_witness (imports.%Core.import_ref.85c), @impl.2(%int_32) [template]
|
||||
// CHECK:STDOUT: %Convert.type.4ad: type = fn_type @Convert.3, @impl.2(%int_32) [template]
|
||||
// CHECK:STDOUT: %Convert.960: %Convert.type.4ad = struct_value () [template]
|
||||
// CHECK:STDOUT: %Convert.bound: <bound method> = bound_method %N.51e, %Convert.960 [symbolic]
|
||||
@@ -32,8 +32,8 @@ fn F(N:! i32, a: [i32; N]*);
|
||||
// CHECK:STDOUT:
|
||||
// CHECK:STDOUT: imports {
|
||||
// CHECK:STDOUT: %Core: <namespace> = namespace file.%Core.import, [template] {
|
||||
// CHECK:STDOUT: .Int = %import_ref.485
|
||||
// CHECK:STDOUT: .ImplicitAs = %import_ref.d44
|
||||
// CHECK:STDOUT: .Int = %Core.Int
|
||||
// CHECK:STDOUT: .ImplicitAs = %Core.ImplicitAs
|
||||
// CHECK:STDOUT: import Core//prelude
|
||||
// CHECK:STDOUT: import Core//prelude/...
|
||||
// CHECK:STDOUT: }
|
||||
|
||||
@@ -58,13 +58,13 @@ fn CallNegative() {
|
||||
// CHECK:STDOUT:
|
||||
// CHECK:STDOUT: imports {
|
||||
// CHECK:STDOUT: %Core: <namespace> = namespace file.%Core.import, [template] {
|
||||
// CHECK:STDOUT: .IntLiteral = %import_ref.72f
|
||||
// CHECK:STDOUT: .Int = %import_ref.485
|
||||
// CHECK:STDOUT: .IntLiteral = %Core.IntLiteral
|
||||
// CHECK:STDOUT: .Int = %Core.Int
|
||||
// CHECK:STDOUT: import Core//prelude
|
||||
// CHECK:STDOUT: import Core//prelude/...
|
||||
// CHECK:STDOUT: }
|
||||
// CHECK:STDOUT: %import_ref.72f: %IntLiteral.type = import_ref Core//prelude/types/int_literal, IntLiteral, loaded [template = constants.%IntLiteral]
|
||||
// CHECK:STDOUT: %import_ref.485: %Int.type = import_ref Core//prelude/types/int, Int, loaded [template = constants.%Int.generic]
|
||||
// CHECK:STDOUT: %Core.IntLiteral: %IntLiteral.type = import_ref Core//prelude/types/int_literal, IntLiteral, loaded [template = constants.%IntLiteral]
|
||||
// CHECK:STDOUT: %Core.Int: %Int.type = import_ref Core//prelude/types/int, Int, loaded [template = constants.%Int.generic]
|
||||
// CHECK:STDOUT: }
|
||||
// CHECK:STDOUT:
|
||||
// CHECK:STDOUT: file {
|
||||
@@ -81,7 +81,7 @@ fn CallNegative() {
|
||||
// CHECK:STDOUT: %N.param: Core.IntLiteral = value_param runtime_param<invalid>
|
||||
// CHECK:STDOUT: %.loc4_39.1: type = splice_block %.loc4_39.3 [template = Core.IntLiteral] {
|
||||
// CHECK:STDOUT: %Core.ref.loc4: <namespace> = name_ref Core, imports.%Core [template = imports.%Core]
|
||||
// CHECK:STDOUT: %IntLiteral.ref: %IntLiteral.type = name_ref IntLiteral, imports.%import_ref.72f [template = constants.%IntLiteral]
|
||||
// CHECK:STDOUT: %IntLiteral.ref: %IntLiteral.type = name_ref IntLiteral, imports.%Core.IntLiteral [template = constants.%IntLiteral]
|
||||
// CHECK:STDOUT: %int_literal.make_type: init type = call %IntLiteral.ref() [template = Core.IntLiteral]
|
||||
// CHECK:STDOUT: %.loc4_39.2: type = value_of_initializer %int_literal.make_type [template = Core.IntLiteral]
|
||||
// CHECK:STDOUT: %.loc4_39.3: type = converted %int_literal.make_type, %.loc4_39.2 [template = Core.IntLiteral]
|
||||
@@ -108,7 +108,7 @@ fn CallNegative() {
|
||||
// CHECK:STDOUT: %v.var: ref @ErrorIfNIsZero.%Int.loc15_20.2 (%Int) = var v
|
||||
// CHECK:STDOUT: %.loc15_20: type = splice_block %Int.loc15_20.1 [symbolic = %Int.loc15_20.2 (constants.%Int)] {
|
||||
// CHECK:STDOUT: %Core.ref.loc15: <namespace> = name_ref Core, imports.%Core [template = imports.%Core]
|
||||
// CHECK:STDOUT: %Int.ref: %Int.type = name_ref Int, imports.%import_ref.485 [template = constants.%Int.generic]
|
||||
// CHECK:STDOUT: %Int.ref: %Int.type = name_ref Int, imports.%Core.Int [template = constants.%Int.generic]
|
||||
// CHECK:STDOUT: %N.ref: Core.IntLiteral = name_ref N, %N.loc4_19.1 [symbolic = %N.loc4_19.2 (constants.%N)]
|
||||
// CHECK:STDOUT: %Int.loc15_20.1: type = class_type @Int, @Int(constants.%N) [symbolic = %Int.loc15_20.2 (constants.%Int)]
|
||||
// CHECK:STDOUT: }
|
||||
|
||||
@@ -64,7 +64,7 @@ fn G() {
|
||||
// CHECK:STDOUT:
|
||||
// CHECK:STDOUT: imports {
|
||||
// CHECK:STDOUT: %Core: <namespace> = namespace file.%Core.import, [template] {
|
||||
// CHECK:STDOUT: .Int = %import_ref.485
|
||||
// CHECK:STDOUT: .Int = %Core.Int
|
||||
// CHECK:STDOUT: import Core//prelude
|
||||
// CHECK:STDOUT: import Core//prelude/...
|
||||
// CHECK:STDOUT: }
|
||||
|
||||
@@ -67,7 +67,7 @@ fn CallUndefined() -> i32 {
|
||||
// CHECK:STDOUT: %complete_type.f8a: <witness> = complete_type_witness %i32.builtin [template]
|
||||
// CHECK:STDOUT: %int_0.5c6: Core.IntLiteral = int_value 0 [template]
|
||||
// CHECK:STDOUT: %Convert.type.99b: type = fn_type @Convert.1, @As(%i32) [template]
|
||||
// CHECK:STDOUT: %impl_witness.882: <witness> = impl_witness (imports.%import_ref.78a), @impl.3(%int_32) [template]
|
||||
// CHECK:STDOUT: %impl_witness.882: <witness> = impl_witness (imports.%Core.import_ref.78a), @impl.3(%int_32) [template]
|
||||
// CHECK:STDOUT: %Convert.type.4fd: type = fn_type @Convert.5, @impl.3(%int_32) [template]
|
||||
// CHECK:STDOUT: %Convert.197: %Convert.type.4fd = struct_value () [template]
|
||||
// CHECK:STDOUT: %Convert.bound: <bound method> = bound_method %int_0.5c6, %Convert.197 [template]
|
||||
@@ -78,8 +78,8 @@ fn CallUndefined() -> i32 {
|
||||
// CHECK:STDOUT:
|
||||
// CHECK:STDOUT: imports {
|
||||
// CHECK:STDOUT: %Core: <namespace> = namespace file.%Core.import, [template] {
|
||||
// CHECK:STDOUT: .Int = %import_ref.485
|
||||
// CHECK:STDOUT: .As = %import_ref.16b
|
||||
// CHECK:STDOUT: .Int = %Core.Int
|
||||
// CHECK:STDOUT: .As = %Core.As
|
||||
// CHECK:STDOUT: import Core//prelude
|
||||
// CHECK:STDOUT: import Core//prelude/...
|
||||
// CHECK:STDOUT: }
|
||||
@@ -181,7 +181,7 @@ fn CallUndefined() -> i32 {
|
||||
// CHECK:STDOUT: %complete_type.f8a: <witness> = complete_type_witness %i32.builtin [template]
|
||||
// CHECK:STDOUT: %int_0.5c6: Core.IntLiteral = int_value 0 [template]
|
||||
// CHECK:STDOUT: %Convert.type.99b: type = fn_type @Convert.1, @As(%i32) [template]
|
||||
// CHECK:STDOUT: %impl_witness.882: <witness> = impl_witness (imports.%import_ref.78a), @impl.3(%int_32) [template]
|
||||
// CHECK:STDOUT: %impl_witness.882: <witness> = impl_witness (imports.%Core.import_ref.78a), @impl.3(%int_32) [template]
|
||||
// CHECK:STDOUT: %Convert.type.4fd: type = fn_type @Convert.5, @impl.3(%int_32) [template]
|
||||
// CHECK:STDOUT: %Convert.197: %Convert.type.4fd = struct_value () [template]
|
||||
// CHECK:STDOUT: %Convert.bound: <bound method> = bound_method %int_0.5c6, %Convert.197 [template]
|
||||
@@ -193,8 +193,8 @@ fn CallUndefined() -> i32 {
|
||||
// CHECK:STDOUT:
|
||||
// CHECK:STDOUT: imports {
|
||||
// CHECK:STDOUT: %Core: <namespace> = namespace file.%Core.import, [template] {
|
||||
// CHECK:STDOUT: .Int = %import_ref.485
|
||||
// CHECK:STDOUT: .As = %import_ref.16b
|
||||
// CHECK:STDOUT: .Int = %Core.Int
|
||||
// CHECK:STDOUT: .As = %Core.As
|
||||
// CHECK:STDOUT: import Core//prelude
|
||||
// CHECK:STDOUT: import Core//prelude/...
|
||||
// CHECK:STDOUT: }
|
||||
@@ -311,7 +311,7 @@ fn CallUndefined() -> i32 {
|
||||
// CHECK:STDOUT: %CallUndefined: %CallUndefined.type = struct_value () [template]
|
||||
// CHECK:STDOUT: %int_0.5c6: Core.IntLiteral = int_value 0 [template]
|
||||
// CHECK:STDOUT: %Convert.type.99b: type = fn_type @Convert.1, @As(%i32) [template]
|
||||
// CHECK:STDOUT: %impl_witness.882: <witness> = impl_witness (imports.%import_ref.78a), @impl.3(%int_32) [template]
|
||||
// CHECK:STDOUT: %impl_witness.882: <witness> = impl_witness (imports.%Core.import_ref.78a), @impl.3(%int_32) [template]
|
||||
// CHECK:STDOUT: %Convert.type.4fd: type = fn_type @Convert.5, @impl.3(%int_32) [template]
|
||||
// CHECK:STDOUT: %Convert.197: %Convert.type.4fd = struct_value () [template]
|
||||
// CHECK:STDOUT: %Convert.bound: <bound method> = bound_method %int_0.5c6, %Convert.197 [template]
|
||||
@@ -322,8 +322,8 @@ fn CallUndefined() -> i32 {
|
||||
// CHECK:STDOUT:
|
||||
// CHECK:STDOUT: imports {
|
||||
// CHECK:STDOUT: %Core: <namespace> = namespace file.%Core.import, [template] {
|
||||
// CHECK:STDOUT: .Int = %import_ref.485
|
||||
// CHECK:STDOUT: .As = %import_ref.16b
|
||||
// CHECK:STDOUT: .Int = %Core.Int
|
||||
// CHECK:STDOUT: .As = %Core.As
|
||||
// CHECK:STDOUT: import Core//prelude
|
||||
// CHECK:STDOUT: import Core//prelude/...
|
||||
// CHECK:STDOUT: }
|
||||
|
||||
Reference in New Issue
Block a user