mirror of
https://github.com/carbon-language/carbon-lang.git
synced 2026-10-06 07:34:45 +01:00
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:
@@ -33,9 +33,10 @@ var a: [i32; Negate(1)];
|
||||
// CHECK:STDOUT: .Negate = %Negate.decl
|
||||
// CHECK:STDOUT: .a = %a
|
||||
// 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: %import_ref.2: %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: %import_ref.2: %Int32.type = import_ref ir3, inst+4, loaded [template = constants.%Int32]
|
||||
// CHECK:STDOUT: %Negate.decl: %Negate.type = fn_decl @Negate [template = constants.%Negate] {
|
||||
// CHECK:STDOUT: %int.make_type_32.loc11_14: init type = call constants.%Int32() [template = i32]
|
||||
// CHECK:STDOUT: %.loc11_14.1: type = value_of_initializer %int.make_type_32.loc11_14 [template = i32]
|
||||
@@ -47,7 +48,7 @@ var a: [i32; Negate(1)];
|
||||
// CHECK:STDOUT: %.loc11_22.2: type = converted %int.make_type_32.loc11_22, %.loc11_22.1 [template = i32]
|
||||
// CHECK:STDOUT: @Negate.%return: ref i32 = var <return slot>
|
||||
// CHECK:STDOUT: }
|
||||
// CHECK:STDOUT: %import_ref.3: %Int32.type = import_ref ir3, inst+3, loaded [template = constants.%Int32]
|
||||
// CHECK:STDOUT: %import_ref.3: %Int32.type = import_ref ir3, inst+4, loaded [template = constants.%Int32]
|
||||
// CHECK:STDOUT: %int.make_type_32.loc16: init type = call constants.%Int32() [template = i32]
|
||||
// CHECK:STDOUT: %Negate.ref: %Negate.type = name_ref Negate, %Negate.decl [template = constants.%Negate]
|
||||
// CHECK:STDOUT: %.loc16_21: i32 = int_literal 1 [template = constants.%.2]
|
||||
|
||||
Reference in New Issue
Block a user