Add a location to indirect imports. (#4098)

By adding an `ImportDecl` instruction, this creates something that can
be referenced through `ImportIRInst`.
packages/no_prelude/implicit_imports_entities.carbon is getting a test
of this (import_conflict and import_conflict_reverse).

Also re-packs ImportIR from 24 bytes to 16 on 64-bit, since I'm touching
everywhere that makes one anyways.
This commit is contained in:
Jon Ross-Perkins
2024-07-03 17:34:39 +00:00
committed by GitHub
parent d437e4bffe
commit 5ebcbae2e8
488 changed files with 4158 additions and 2886 deletions
+4 -3
View File
@@ -51,8 +51,9 @@ var c: [(); 5] = ((), (), (), (), (),);
// CHECK:STDOUT: .b = %b
// CHECK:STDOUT: .c = %c
// CHECK:STDOUT: }
// CHECK:STDOUT: %Core: <namespace> = namespace [template] {}
// CHECK:STDOUT: %import_ref.1: %Int32.type = import_ref ir3, inst+3, loaded [template = constants.%Int32]
// CHECK:STDOUT: %Core.import = import Core
// CHECK:STDOUT: %Core: <namespace> = namespace %Core.import, [template] {}
// CHECK:STDOUT: %import_ref.1: %Int32.type = import_ref ir3, inst+4, loaded [template = constants.%Int32]
// CHECK:STDOUT: %int.make_type_32: init type = call constants.%Int32() [template = i32]
// CHECK:STDOUT: %.loc11_14: i32 = int_literal 1 [template = constants.%.2]
// CHECK:STDOUT: %.loc11_9.1: type = value_of_initializer %int.make_type_32 [template = i32]
@@ -61,7 +62,7 @@ var c: [(); 5] = ((), (), (), (), (),);
// CHECK:STDOUT: %a.var: ref %.3 = var a
// CHECK:STDOUT: %a: ref %.3 = bind_name a, %a.var
// CHECK:STDOUT: %.loc12_9.1: i32 = int_literal 64 [template = constants.%.7]
// CHECK:STDOUT: %import_ref.2: %Float.type = import_ref ir3, inst+31, loaded [template = constants.%Float]
// CHECK:STDOUT: %import_ref.2: %Float.type = import_ref ir3, inst+32, loaded [template = constants.%Float]
// CHECK:STDOUT: %float.make_type: init type = call constants.%Float(%.loc12_9.1) [template = f64]
// CHECK:STDOUT: %.loc12_14: i32 = int_literal 2 [template = constants.%.8]
// CHECK:STDOUT: %.loc12_9.2: type = value_of_initializer %float.make_type [template = f64]