mirror of
https://github.com/carbon-language/carbon-lang.git
synced 2026-10-06 09:34:42 +01:00
Switch type literals to use builtin functions. (#3978)
Modifies the core package and literal handling to use factory functions for standard type literals. Updates function/builtin/import.carbon to stop depending on the prelude, since it would list all the impls in the core file. Updates alias/builtins.carbon to be failing (the type values cannot be aliased).
This commit is contained in:
+68
-24
@@ -96,16 +96,18 @@ fn D() {}
|
||||
// CHECK:STDOUT: %A: type = fn_type @A [template]
|
||||
// CHECK:STDOUT: %.1: type = tuple_type () [template]
|
||||
// CHECK:STDOUT: %struct.1: A = struct_value () [template]
|
||||
// CHECK:STDOUT: %Int32: type = fn_type @Int32 [template]
|
||||
// CHECK:STDOUT: %struct.2: Int32 = struct_value () [template]
|
||||
// CHECK:STDOUT: %B: type = fn_type @B [template]
|
||||
// CHECK:STDOUT: %struct.2: B = struct_value () [template]
|
||||
// CHECK:STDOUT: %struct.3: B = struct_value () [template]
|
||||
// CHECK:STDOUT: %.2: type = tuple_type (type) [template]
|
||||
// CHECK:STDOUT: %.3: type = tuple_type (i32) [template]
|
||||
// CHECK:STDOUT: %.4: type = struct_type {.c: i32} [template]
|
||||
// CHECK:STDOUT: %C: type = fn_type @C [template]
|
||||
// CHECK:STDOUT: %struct.3: C = struct_value () [template]
|
||||
// CHECK:STDOUT: %struct.4: C = struct_value () [template]
|
||||
// CHECK:STDOUT: %.5: i32 = int_literal 0 [template]
|
||||
// CHECK:STDOUT: %D: type = fn_type @D [template]
|
||||
// CHECK:STDOUT: %struct.4: D = struct_value () [template]
|
||||
// CHECK:STDOUT: %struct.5: D = struct_value () [template]
|
||||
// CHECK:STDOUT: }
|
||||
// CHECK:STDOUT:
|
||||
// CHECK:STDOUT: file {
|
||||
@@ -118,20 +120,36 @@ fn D() {}
|
||||
// CHECK:STDOUT: }
|
||||
// CHECK:STDOUT: %Core: <namespace> = namespace [template] {}
|
||||
// CHECK:STDOUT: %A.decl: A = fn_decl @A [template = constants.%struct.1] {}
|
||||
// CHECK:STDOUT: %B.decl: B = fn_decl @B [template = constants.%struct.2] {
|
||||
// CHECK:STDOUT: %import_ref.1: Int32 = import_ref ir3, inst+3, loaded [template = constants.%struct.2]
|
||||
// CHECK:STDOUT: %import_ref.2: Int32 = import_ref ir3, inst+3, loaded [template = constants.%struct.2]
|
||||
// CHECK:STDOUT: %B.decl: B = fn_decl @B [template = constants.%struct.3] {
|
||||
// CHECK:STDOUT: %int.make_type_32.loc5_9: init type = call constants.%struct.2() [template = i32]
|
||||
// CHECK:STDOUT: %.loc5_9.1: type = value_of_initializer %int.make_type_32.loc5_9 [template = i32]
|
||||
// CHECK:STDOUT: %.loc5_9.2: type = converted %int.make_type_32.loc5_9, %.loc5_9.1 [template = i32]
|
||||
// CHECK:STDOUT: %b.loc5_6.1: i32 = param b
|
||||
// CHECK:STDOUT: @B.%b: i32 = bind_name b, %b.loc5_6.1
|
||||
// CHECK:STDOUT: %int.make_type_32.loc5_17: init type = call constants.%struct.2() [template = i32]
|
||||
// CHECK:STDOUT: %.loc5_17.1: type = value_of_initializer %int.make_type_32.loc5_17 [template = i32]
|
||||
// CHECK:STDOUT: %.loc5_17.2: type = converted %int.make_type_32.loc5_17, %.loc5_17.1 [template = i32]
|
||||
// CHECK:STDOUT: @B.%return: ref i32 = var <return slot>
|
||||
// CHECK:STDOUT: }
|
||||
// CHECK:STDOUT: %C.decl: C = fn_decl @C [template = constants.%struct.3] {
|
||||
// CHECK:STDOUT: %.loc6_14.1: (type,) = tuple_literal (i32)
|
||||
// CHECK:STDOUT: %.loc6_14.2: type = converted %.loc6_14.1, constants.%.3 [template = constants.%.3]
|
||||
// CHECK:STDOUT: %import_ref.3: Int32 = import_ref ir3, inst+3, loaded [template = constants.%struct.2]
|
||||
// CHECK:STDOUT: %import_ref.4: Int32 = import_ref ir3, inst+3, loaded [template = constants.%struct.2]
|
||||
// CHECK:STDOUT: %C.decl: C = fn_decl @C [template = constants.%struct.4] {
|
||||
// CHECK:STDOUT: %int.make_type_32.loc6_10: init type = call constants.%struct.2() [template = i32]
|
||||
// CHECK:STDOUT: %.loc6_14.1: (type,) = tuple_literal (%int.make_type_32.loc6_10)
|
||||
// CHECK:STDOUT: %.loc6_14.2: type = value_of_initializer %int.make_type_32.loc6_10 [template = i32]
|
||||
// CHECK:STDOUT: %.loc6_14.3: type = converted %int.make_type_32.loc6_10, %.loc6_14.2 [template = i32]
|
||||
// CHECK:STDOUT: %.loc6_14.4: type = converted %.loc6_14.1, constants.%.3 [template = constants.%.3]
|
||||
// CHECK:STDOUT: %c.loc6_6.1: (i32,) = param c
|
||||
// CHECK:STDOUT: @C.%c: (i32,) = bind_name c, %c.loc6_6.1
|
||||
// CHECK:STDOUT: %int.make_type_32.loc6_25: init type = call constants.%struct.2() [template = i32]
|
||||
// CHECK:STDOUT: %.loc6_25.1: type = value_of_initializer %int.make_type_32.loc6_25 [template = i32]
|
||||
// CHECK:STDOUT: %.loc6_25.2: type = converted %int.make_type_32.loc6_25, %.loc6_25.1 [template = i32]
|
||||
// CHECK:STDOUT: %.loc6_28: type = struct_type {.c: i32} [template = constants.%.4]
|
||||
// CHECK:STDOUT: @C.%return: ref {.c: i32} = var <return slot>
|
||||
// CHECK:STDOUT: }
|
||||
// CHECK:STDOUT: %D.decl: D = fn_decl @D [template = constants.%struct.4] {}
|
||||
// CHECK:STDOUT: %D.decl: D = fn_decl @D [template = constants.%struct.5] {}
|
||||
// CHECK:STDOUT: }
|
||||
// CHECK:STDOUT:
|
||||
// CHECK:STDOUT: fn @A() {
|
||||
@@ -139,6 +157,8 @@ fn D() {}
|
||||
// CHECK:STDOUT: return
|
||||
// CHECK:STDOUT: }
|
||||
// CHECK:STDOUT:
|
||||
// CHECK:STDOUT: fn @Int32() -> type = "int.make_type_32";
|
||||
// CHECK:STDOUT:
|
||||
// CHECK:STDOUT: fn @B(%b: i32) -> i32 {
|
||||
// CHECK:STDOUT: !entry:
|
||||
// CHECK:STDOUT: %b.ref: i32 = name_ref b, %b
|
||||
@@ -183,13 +203,15 @@ fn D() {}
|
||||
// CHECK:STDOUT: %.1: type = tuple_type () [template]
|
||||
// CHECK:STDOUT: %A: type = fn_type @A [template]
|
||||
// CHECK:STDOUT: %struct.1: A = struct_value () [template]
|
||||
// CHECK:STDOUT: %Int32: type = fn_type @Int32 [template]
|
||||
// CHECK:STDOUT: %struct.2: Int32 = struct_value () [template]
|
||||
// CHECK:STDOUT: %B: type = fn_type @B [template]
|
||||
// CHECK:STDOUT: %struct.2: B = struct_value () [template]
|
||||
// CHECK:STDOUT: %struct.3: B = struct_value () [template]
|
||||
// CHECK:STDOUT: %.2: i32 = int_literal 1 [template]
|
||||
// CHECK:STDOUT: %.3: type = struct_type {.c: i32} [template]
|
||||
// CHECK:STDOUT: %.4: type = tuple_type (i32) [template]
|
||||
// CHECK:STDOUT: %C: type = fn_type @C [template]
|
||||
// CHECK:STDOUT: %struct.3: C = struct_value () [template]
|
||||
// CHECK:STDOUT: %struct.4: C = struct_value () [template]
|
||||
// CHECK:STDOUT: %tuple: (i32,) = tuple_value (%.2) [template]
|
||||
// CHECK:STDOUT: }
|
||||
// CHECK:STDOUT:
|
||||
@@ -205,23 +227,33 @@ fn D() {}
|
||||
// CHECK:STDOUT: .c = %c
|
||||
// CHECK:STDOUT: }
|
||||
// CHECK:STDOUT: %import_ref.1: A = import_ref ir1, inst+2, loaded [template = constants.%struct.1]
|
||||
// CHECK:STDOUT: %import_ref.2: B = import_ref ir1, inst+10, loaded [template = constants.%struct.2]
|
||||
// CHECK:STDOUT: %import_ref.3: C = import_ref ir1, inst+26, loaded [template = constants.%struct.3]
|
||||
// CHECK:STDOUT: %import_ref.4 = import_ref ir1, inst+38, unloaded
|
||||
// CHECK:STDOUT: %import_ref.2: B = import_ref ir1, inst+22, loaded [template = constants.%struct.3]
|
||||
// CHECK:STDOUT: %import_ref.3: C = import_ref ir1, inst+46, loaded [template = constants.%struct.4]
|
||||
// CHECK:STDOUT: %import_ref.4 = import_ref ir1, inst+58, unloaded
|
||||
// CHECK:STDOUT: %Core: <namespace> = namespace [template] {}
|
||||
// CHECK:STDOUT: %.loc6_9.1: () = tuple_literal ()
|
||||
// CHECK:STDOUT: %.loc6_9.2: type = converted %.loc6_9.1, constants.%.1 [template = constants.%.1]
|
||||
// CHECK:STDOUT: %a.var: ref () = var a
|
||||
// CHECK:STDOUT: %a: ref () = bind_name a, %a.var
|
||||
// CHECK:STDOUT: %import_ref.5: Int32 = import_ref ir4, inst+3, loaded [template = constants.%struct.2]
|
||||
// CHECK:STDOUT: %int.make_type_32.loc7: init type = call constants.%struct.2() [template = i32]
|
||||
// CHECK:STDOUT: %.loc7_8.1: type = value_of_initializer %int.make_type_32.loc7 [template = i32]
|
||||
// CHECK:STDOUT: %.loc7_8.2: type = converted %int.make_type_32.loc7, %.loc7_8.1 [template = i32]
|
||||
// CHECK:STDOUT: %b.var: ref i32 = var b
|
||||
// CHECK:STDOUT: %b: ref i32 = bind_name b, %b.var
|
||||
// CHECK:STDOUT: %.loc8: type = struct_type {.c: i32} [template = constants.%.3]
|
||||
// CHECK:STDOUT: %import_ref.6: Int32 = import_ref ir4, inst+3, loaded [template = constants.%struct.2]
|
||||
// CHECK:STDOUT: %int.make_type_32.loc8: init type = call constants.%struct.2() [template = i32]
|
||||
// CHECK:STDOUT: %.loc8_13.1: type = value_of_initializer %int.make_type_32.loc8 [template = i32]
|
||||
// CHECK:STDOUT: %.loc8_13.2: type = converted %int.make_type_32.loc8, %.loc8_13.1 [template = i32]
|
||||
// CHECK:STDOUT: %.loc8_16: type = struct_type {.c: i32} [template = constants.%.3]
|
||||
// CHECK:STDOUT: %c.var: ref {.c: i32} = var c
|
||||
// CHECK:STDOUT: %c: ref {.c: i32} = bind_name c, %c.var
|
||||
// CHECK:STDOUT: }
|
||||
// CHECK:STDOUT:
|
||||
// CHECK:STDOUT: fn @A();
|
||||
// CHECK:STDOUT:
|
||||
// CHECK:STDOUT: fn @Int32() -> type = "int.make_type_32";
|
||||
// CHECK:STDOUT:
|
||||
// CHECK:STDOUT: fn @B(%b: i32) -> i32;
|
||||
// CHECK:STDOUT:
|
||||
// CHECK:STDOUT: fn @C(%c: (i32,)) -> {.c: i32};
|
||||
@@ -231,11 +263,11 @@ fn D() {}
|
||||
// CHECK:STDOUT: %A.ref: A = name_ref A, file.%import_ref.1 [template = constants.%struct.1]
|
||||
// CHECK:STDOUT: %A.call: init () = call %A.ref()
|
||||
// CHECK:STDOUT: assign file.%a.var, %A.call
|
||||
// CHECK:STDOUT: %B.ref: B = name_ref B, file.%import_ref.2 [template = constants.%struct.2]
|
||||
// CHECK:STDOUT: %B.ref: B = name_ref B, file.%import_ref.2 [template = constants.%struct.3]
|
||||
// CHECK:STDOUT: %.loc7: i32 = int_literal 1 [template = constants.%.2]
|
||||
// CHECK:STDOUT: %B.call: init i32 = call %B.ref(%.loc7)
|
||||
// CHECK:STDOUT: assign file.%b.var, %B.call
|
||||
// CHECK:STDOUT: %C.ref: C = name_ref C, file.%import_ref.3 [template = constants.%struct.3]
|
||||
// CHECK:STDOUT: %C.ref: C = name_ref C, file.%import_ref.3 [template = constants.%struct.4]
|
||||
// CHECK:STDOUT: %.loc8_23: i32 = int_literal 1 [template = constants.%.2]
|
||||
// CHECK:STDOUT: %.loc8_25: (i32,) = tuple_literal (%.loc8_23)
|
||||
// CHECK:STDOUT: %tuple: (i32,) = tuple_value (%.loc8_23) [template = constants.%tuple]
|
||||
@@ -251,8 +283,10 @@ fn D() {}
|
||||
// CHECK:STDOUT: %A: type = fn_type @A [template]
|
||||
// CHECK:STDOUT: %.1: type = tuple_type () [template]
|
||||
// CHECK:STDOUT: %struct.1: A = struct_value () [template]
|
||||
// CHECK:STDOUT: %Int32: type = fn_type @Int32 [template]
|
||||
// CHECK:STDOUT: %struct.2: Int32 = struct_value () [template]
|
||||
// CHECK:STDOUT: %B: type = fn_type @B [template]
|
||||
// CHECK:STDOUT: %struct.2: B = struct_value () [template]
|
||||
// CHECK:STDOUT: %struct.3: B = struct_value () [template]
|
||||
// CHECK:STDOUT: }
|
||||
// CHECK:STDOUT:
|
||||
// CHECK:STDOUT: file {
|
||||
@@ -264,14 +298,22 @@ fn D() {}
|
||||
// CHECK:STDOUT: .B = %B.decl
|
||||
// CHECK:STDOUT: }
|
||||
// CHECK:STDOUT: %import_ref.1: A = import_ref ir1, inst+2, loaded [template = constants.%struct.1]
|
||||
// CHECK:STDOUT: %import_ref.2: B = import_ref ir1, inst+10, loaded [template = constants.%struct.2]
|
||||
// CHECK:STDOUT: %import_ref.3 = import_ref ir1, inst+26, unloaded
|
||||
// CHECK:STDOUT: %import_ref.4 = import_ref ir1, inst+38, unloaded
|
||||
// CHECK:STDOUT: %import_ref.2: B = import_ref ir1, inst+22, loaded [template = constants.%struct.3]
|
||||
// CHECK:STDOUT: %import_ref.3 = import_ref ir1, inst+46, unloaded
|
||||
// CHECK:STDOUT: %import_ref.4 = import_ref ir1, inst+58, unloaded
|
||||
// CHECK:STDOUT: %Core: <namespace> = namespace [template] {}
|
||||
// CHECK:STDOUT: %A.decl: A = fn_decl @A [template = constants.%struct.1] {}
|
||||
// CHECK:STDOUT: %B.decl: B = fn_decl @B [template = constants.%struct.2] {
|
||||
// CHECK:STDOUT: %import_ref.5: Int32 = import_ref ir4, inst+3, loaded [template = constants.%struct.2]
|
||||
// CHECK:STDOUT: %import_ref.6: Int32 = import_ref ir4, inst+3, loaded [template = constants.%struct.2]
|
||||
// CHECK:STDOUT: %B.decl: B = fn_decl @B [template = constants.%struct.3] {
|
||||
// CHECK:STDOUT: %int.make_type_32.loc27_9: init type = call constants.%struct.2() [template = i32]
|
||||
// CHECK:STDOUT: %.loc27_9.1: type = value_of_initializer %int.make_type_32.loc27_9 [template = i32]
|
||||
// CHECK:STDOUT: %.loc27_9.2: type = converted %int.make_type_32.loc27_9, %.loc27_9.1 [template = i32]
|
||||
// CHECK:STDOUT: %b.loc27_6.1: i32 = param b
|
||||
// CHECK:STDOUT: %b.loc27_6.2: i32 = bind_name b, %b.loc27_6.1
|
||||
// CHECK:STDOUT: %int.make_type_32.loc27_17: init type = call constants.%struct.2() [template = i32]
|
||||
// CHECK:STDOUT: %.loc27_17.1: type = value_of_initializer %int.make_type_32.loc27_17 [template = i32]
|
||||
// CHECK:STDOUT: %.loc27_17.2: type = converted %int.make_type_32.loc27_17, %.loc27_17.1 [template = i32]
|
||||
// CHECK:STDOUT: %return.var: ref i32 = var <return slot>
|
||||
// CHECK:STDOUT: }
|
||||
// CHECK:STDOUT: }
|
||||
@@ -281,6 +323,8 @@ fn D() {}
|
||||
// CHECK:STDOUT: return
|
||||
// CHECK:STDOUT: }
|
||||
// CHECK:STDOUT:
|
||||
// CHECK:STDOUT: fn @Int32() -> type = "int.make_type_32";
|
||||
// CHECK:STDOUT:
|
||||
// CHECK:STDOUT: fn @B(%b: i32) -> i32;
|
||||
// CHECK:STDOUT:
|
||||
// CHECK:STDOUT: --- redecl_then_def.carbon
|
||||
@@ -324,9 +368,9 @@ fn D() {}
|
||||
// CHECK:STDOUT: .D = %D.decl.loc13
|
||||
// CHECK:STDOUT: }
|
||||
// CHECK:STDOUT: %import_ref.1 = import_ref ir1, inst+2, unloaded
|
||||
// CHECK:STDOUT: %import_ref.2 = import_ref ir1, inst+10, unloaded
|
||||
// CHECK:STDOUT: %import_ref.3 = import_ref ir1, inst+26, unloaded
|
||||
// CHECK:STDOUT: %import_ref.4: D = import_ref ir1, inst+38, loaded [template = constants.%struct]
|
||||
// CHECK:STDOUT: %import_ref.2 = import_ref ir1, inst+22, unloaded
|
||||
// CHECK:STDOUT: %import_ref.3 = import_ref ir1, inst+46, unloaded
|
||||
// CHECK:STDOUT: %import_ref.4: D = import_ref ir1, inst+58, loaded [template = constants.%struct]
|
||||
// CHECK:STDOUT: %Core: <namespace> = namespace [template] {}
|
||||
// CHECK:STDOUT: %D.decl.loc6: D = fn_decl @D [template = constants.%struct] {}
|
||||
// CHECK:STDOUT: %D.decl.loc13: D = fn_decl @D [template = constants.%struct] {}
|
||||
|
||||
+23
-26
@@ -25,12 +25,9 @@ fn G(x: ());
|
||||
fn G() {}
|
||||
|
||||
fn H(x: ());
|
||||
// CHECK:STDERR: fail_decl_param_mismatch.carbon:[[@LINE+7]]:6: ERROR: Redeclaration differs at parameter 1.
|
||||
// CHECK:STDERR: fail_decl_param_mismatch.carbon:[[@LINE+4]]:9: ERROR: Name `Core` not found.
|
||||
// CHECK:STDERR: fn H(x: bool) {}
|
||||
// CHECK:STDERR: ^
|
||||
// CHECK:STDERR: fail_decl_param_mismatch.carbon:[[@LINE-4]]:6: Previous declaration's corresponding parameter here.
|
||||
// CHECK:STDERR: fn H(x: ());
|
||||
// CHECK:STDERR: ^
|
||||
// CHECK:STDERR: ^~~~
|
||||
// CHECK:STDERR:
|
||||
fn H(x: bool) {}
|
||||
|
||||
@@ -125,30 +122,30 @@ fn K() -> {} { return {}; }
|
||||
// CHECK:STDOUT: %x.loc27_6.1: () = param x
|
||||
// CHECK:STDOUT: @H.%x: () = bind_name x, %x.loc27_6.1
|
||||
// CHECK:STDOUT: }
|
||||
// CHECK:STDOUT: %.decl.loc35: <invalid> = fn_decl @.3 [template = constants.%struct.6] {
|
||||
// CHECK:STDOUT: %x.loc35_6.1: bool = param x
|
||||
// CHECK:STDOUT: @.3.%x: bool = bind_name x, %x.loc35_6.1
|
||||
// CHECK:STDOUT: %.decl.loc32: <invalid> = fn_decl @.3 [template = constants.%struct.6] {
|
||||
// CHECK:STDOUT: %x.loc32_6.1: <error> = param x
|
||||
// CHECK:STDOUT: @.3.%x: <error> = bind_name x, %x.loc32_6.1
|
||||
// CHECK:STDOUT: }
|
||||
// CHECK:STDOUT: %I.decl: I = fn_decl @I [template = constants.%struct.7] {}
|
||||
// CHECK:STDOUT: %.decl.loc45: <invalid> = fn_decl @.4 [template = constants.%struct.8] {
|
||||
// CHECK:STDOUT: %.loc45_12.1: () = tuple_literal ()
|
||||
// CHECK:STDOUT: %.loc45_12.2: type = converted %.loc45_12.1, constants.%.1 [template = constants.%.1]
|
||||
// CHECK:STDOUT: %.decl.loc42: <invalid> = fn_decl @.4 [template = constants.%struct.8] {
|
||||
// CHECK:STDOUT: %.loc42_12.1: () = tuple_literal ()
|
||||
// CHECK:STDOUT: %.loc42_12.2: type = converted %.loc42_12.1, constants.%.1 [template = constants.%.1]
|
||||
// CHECK:STDOUT: @.4.%return: ref () = var <return slot>
|
||||
// CHECK:STDOUT: }
|
||||
// CHECK:STDOUT: %J.decl: J = fn_decl @J [template = constants.%struct.9] {
|
||||
// CHECK:STDOUT: %.loc47_12.1: () = tuple_literal ()
|
||||
// CHECK:STDOUT: %.loc47_12.2: type = converted %.loc47_12.1, constants.%.1 [template = constants.%.1]
|
||||
// CHECK:STDOUT: %.loc44_12.1: () = tuple_literal ()
|
||||
// CHECK:STDOUT: %.loc44_12.2: type = converted %.loc44_12.1, constants.%.1 [template = constants.%.1]
|
||||
// CHECK:STDOUT: @J.%return: ref () = var <return slot>
|
||||
// CHECK:STDOUT: }
|
||||
// CHECK:STDOUT: %.decl.loc55: <invalid> = fn_decl @.5 [template = constants.%struct.10] {}
|
||||
// CHECK:STDOUT: %.decl.loc52: <invalid> = fn_decl @.5 [template = constants.%struct.10] {}
|
||||
// CHECK:STDOUT: %K.decl: K = fn_decl @K [template = constants.%struct.11] {
|
||||
// CHECK:STDOUT: %.loc57_12.1: () = tuple_literal ()
|
||||
// CHECK:STDOUT: %.loc57_12.2: type = converted %.loc57_12.1, constants.%.1 [template = constants.%.1]
|
||||
// CHECK:STDOUT: %.loc54_12.1: () = tuple_literal ()
|
||||
// CHECK:STDOUT: %.loc54_12.2: type = converted %.loc54_12.1, constants.%.1 [template = constants.%.1]
|
||||
// CHECK:STDOUT: @K.%return: ref () = var <return slot>
|
||||
// CHECK:STDOUT: }
|
||||
// CHECK:STDOUT: %.decl.loc64: <invalid> = fn_decl @.6 [template = constants.%struct.12] {
|
||||
// CHECK:STDOUT: %.loc64_12.1: {} = struct_literal ()
|
||||
// CHECK:STDOUT: %.loc64_12.2: type = converted %.loc64_12.1, constants.%.7 [template = constants.%.7]
|
||||
// CHECK:STDOUT: %.decl.loc61: <invalid> = fn_decl @.6 [template = constants.%struct.12] {
|
||||
// CHECK:STDOUT: %.loc61_12.1: {} = struct_literal ()
|
||||
// CHECK:STDOUT: %.loc61_12.2: type = converted %.loc61_12.1, constants.%.7 [template = constants.%.7]
|
||||
// CHECK:STDOUT: @.6.%return: ref {} = var <return slot>
|
||||
// CHECK:STDOUT: }
|
||||
// CHECK:STDOUT: }
|
||||
@@ -169,7 +166,7 @@ fn K() -> {} { return {}; }
|
||||
// CHECK:STDOUT:
|
||||
// CHECK:STDOUT: fn @H(%x: ());
|
||||
// CHECK:STDOUT:
|
||||
// CHECK:STDOUT: fn @.3(%x: bool) {
|
||||
// CHECK:STDOUT: fn @.3(%x: <error>) {
|
||||
// CHECK:STDOUT: !entry:
|
||||
// CHECK:STDOUT: return
|
||||
// CHECK:STDOUT: }
|
||||
@@ -178,10 +175,10 @@ fn K() -> {} { return {}; }
|
||||
// CHECK:STDOUT:
|
||||
// CHECK:STDOUT: fn @.4() -> () {
|
||||
// CHECK:STDOUT: !entry:
|
||||
// CHECK:STDOUT: %.loc45_24: () = tuple_literal ()
|
||||
// CHECK:STDOUT: %.loc42_24: () = tuple_literal ()
|
||||
// CHECK:STDOUT: %tuple: () = tuple_value () [template = constants.%tuple]
|
||||
// CHECK:STDOUT: %.loc45_25: () = converted %.loc45_24, %tuple [template = constants.%tuple]
|
||||
// CHECK:STDOUT: return %.loc45_25
|
||||
// CHECK:STDOUT: %.loc42_25: () = converted %.loc42_24, %tuple [template = constants.%tuple]
|
||||
// CHECK:STDOUT: return %.loc42_25
|
||||
// CHECK:STDOUT: }
|
||||
// CHECK:STDOUT:
|
||||
// CHECK:STDOUT: fn @J() -> ();
|
||||
@@ -195,9 +192,9 @@ fn K() -> {} { return {}; }
|
||||
// CHECK:STDOUT:
|
||||
// CHECK:STDOUT: fn @.6() -> {} {
|
||||
// CHECK:STDOUT: !entry:
|
||||
// CHECK:STDOUT: %.loc64_24: {} = struct_literal ()
|
||||
// CHECK:STDOUT: %.loc61_24: {} = struct_literal ()
|
||||
// CHECK:STDOUT: %struct: {} = struct_value () [template = constants.%struct.13]
|
||||
// CHECK:STDOUT: %.loc64_25: {} = converted %.loc64_24, %struct [template = constants.%struct.13]
|
||||
// CHECK:STDOUT: return %.loc64_25
|
||||
// CHECK:STDOUT: %.loc61_25: {} = converted %.loc61_24, %struct [template = constants.%struct.13]
|
||||
// CHECK:STDOUT: return %.loc61_25
|
||||
// CHECK:STDOUT: }
|
||||
// CHECK:STDOUT:
|
||||
|
||||
@@ -9,9 +9,11 @@ fn Foo(a: i32) {}
|
||||
// CHECK:STDOUT: --- params_one.carbon
|
||||
// CHECK:STDOUT:
|
||||
// CHECK:STDOUT: constants {
|
||||
// CHECK:STDOUT: %Foo: type = fn_type @Foo [template]
|
||||
// CHECK:STDOUT: %Int32: type = fn_type @Int32 [template]
|
||||
// CHECK:STDOUT: %.1: type = tuple_type () [template]
|
||||
// CHECK:STDOUT: %struct: Foo = struct_value () [template]
|
||||
// CHECK:STDOUT: %struct.1: Int32 = struct_value () [template]
|
||||
// CHECK:STDOUT: %Foo: type = fn_type @Foo [template]
|
||||
// CHECK:STDOUT: %struct.2: Foo = struct_value () [template]
|
||||
// CHECK:STDOUT: }
|
||||
// CHECK:STDOUT:
|
||||
// CHECK:STDOUT: file {
|
||||
@@ -20,12 +22,18 @@ fn Foo(a: i32) {}
|
||||
// CHECK:STDOUT: .Foo = %Foo.decl
|
||||
// CHECK:STDOUT: }
|
||||
// CHECK:STDOUT: %Core: <namespace> = namespace [template] {}
|
||||
// CHECK:STDOUT: %Foo.decl: Foo = fn_decl @Foo [template = constants.%struct] {
|
||||
// CHECK:STDOUT: %import_ref: Int32 = import_ref ir3, inst+3, loaded [template = constants.%struct.1]
|
||||
// CHECK:STDOUT: %Foo.decl: Foo = fn_decl @Foo [template = constants.%struct.2] {
|
||||
// CHECK:STDOUT: %int.make_type_32: init type = call constants.%struct.1() [template = i32]
|
||||
// CHECK:STDOUT: %.loc7_11.1: type = value_of_initializer %int.make_type_32 [template = i32]
|
||||
// CHECK:STDOUT: %.loc7_11.2: type = converted %int.make_type_32, %.loc7_11.1 [template = i32]
|
||||
// CHECK:STDOUT: %a.loc7_8.1: i32 = param a
|
||||
// CHECK:STDOUT: @Foo.%a: i32 = bind_name a, %a.loc7_8.1
|
||||
// CHECK:STDOUT: }
|
||||
// CHECK:STDOUT: }
|
||||
// CHECK:STDOUT:
|
||||
// CHECK:STDOUT: fn @Int32() -> type = "int.make_type_32";
|
||||
// CHECK:STDOUT:
|
||||
// CHECK:STDOUT: fn @Foo(%a: i32) {
|
||||
// CHECK:STDOUT: !entry:
|
||||
// CHECK:STDOUT: return
|
||||
|
||||
@@ -9,9 +9,11 @@ fn Foo(a: i32,) {}
|
||||
// CHECK:STDOUT: --- params_one_comma.carbon
|
||||
// CHECK:STDOUT:
|
||||
// CHECK:STDOUT: constants {
|
||||
// CHECK:STDOUT: %Foo: type = fn_type @Foo [template]
|
||||
// CHECK:STDOUT: %Int32: type = fn_type @Int32 [template]
|
||||
// CHECK:STDOUT: %.1: type = tuple_type () [template]
|
||||
// CHECK:STDOUT: %struct: Foo = struct_value () [template]
|
||||
// CHECK:STDOUT: %struct.1: Int32 = struct_value () [template]
|
||||
// CHECK:STDOUT: %Foo: type = fn_type @Foo [template]
|
||||
// CHECK:STDOUT: %struct.2: Foo = struct_value () [template]
|
||||
// CHECK:STDOUT: }
|
||||
// CHECK:STDOUT:
|
||||
// CHECK:STDOUT: file {
|
||||
@@ -20,12 +22,18 @@ fn Foo(a: i32,) {}
|
||||
// CHECK:STDOUT: .Foo = %Foo.decl
|
||||
// CHECK:STDOUT: }
|
||||
// CHECK:STDOUT: %Core: <namespace> = namespace [template] {}
|
||||
// CHECK:STDOUT: %Foo.decl: Foo = fn_decl @Foo [template = constants.%struct] {
|
||||
// CHECK:STDOUT: %import_ref: Int32 = import_ref ir3, inst+3, loaded [template = constants.%struct.1]
|
||||
// CHECK:STDOUT: %Foo.decl: Foo = fn_decl @Foo [template = constants.%struct.2] {
|
||||
// CHECK:STDOUT: %int.make_type_32: init type = call constants.%struct.1() [template = i32]
|
||||
// CHECK:STDOUT: %.loc7_11.1: type = value_of_initializer %int.make_type_32 [template = i32]
|
||||
// CHECK:STDOUT: %.loc7_11.2: type = converted %int.make_type_32, %.loc7_11.1 [template = i32]
|
||||
// CHECK:STDOUT: %a.loc7_8.1: i32 = param a
|
||||
// CHECK:STDOUT: @Foo.%a: i32 = bind_name a, %a.loc7_8.1
|
||||
// CHECK:STDOUT: }
|
||||
// CHECK:STDOUT: }
|
||||
// CHECK:STDOUT:
|
||||
// CHECK:STDOUT: fn @Int32() -> type = "int.make_type_32";
|
||||
// CHECK:STDOUT:
|
||||
// CHECK:STDOUT: fn @Foo(%a: i32) {
|
||||
// CHECK:STDOUT: !entry:
|
||||
// CHECK:STDOUT: return
|
||||
|
||||
@@ -9,9 +9,11 @@ fn Foo(a: i32, b: i32) {}
|
||||
// CHECK:STDOUT: --- params_two.carbon
|
||||
// CHECK:STDOUT:
|
||||
// CHECK:STDOUT: constants {
|
||||
// CHECK:STDOUT: %Foo: type = fn_type @Foo [template]
|
||||
// CHECK:STDOUT: %Int32: type = fn_type @Int32 [template]
|
||||
// CHECK:STDOUT: %.1: type = tuple_type () [template]
|
||||
// CHECK:STDOUT: %struct: Foo = struct_value () [template]
|
||||
// CHECK:STDOUT: %struct.1: Int32 = struct_value () [template]
|
||||
// CHECK:STDOUT: %Foo: type = fn_type @Foo [template]
|
||||
// CHECK:STDOUT: %struct.2: Foo = struct_value () [template]
|
||||
// CHECK:STDOUT: }
|
||||
// CHECK:STDOUT:
|
||||
// CHECK:STDOUT: file {
|
||||
@@ -20,14 +22,24 @@ fn Foo(a: i32, b: i32) {}
|
||||
// CHECK:STDOUT: .Foo = %Foo.decl
|
||||
// CHECK:STDOUT: }
|
||||
// CHECK:STDOUT: %Core: <namespace> = namespace [template] {}
|
||||
// CHECK:STDOUT: %Foo.decl: Foo = fn_decl @Foo [template = constants.%struct] {
|
||||
// CHECK:STDOUT: %import_ref.1: Int32 = import_ref ir3, inst+3, loaded [template = constants.%struct.1]
|
||||
// CHECK:STDOUT: %import_ref.2: Int32 = import_ref ir3, inst+3, loaded [template = constants.%struct.1]
|
||||
// CHECK:STDOUT: %Foo.decl: Foo = fn_decl @Foo [template = constants.%struct.2] {
|
||||
// CHECK:STDOUT: %int.make_type_32.loc7_11: init type = call constants.%struct.1() [template = i32]
|
||||
// CHECK:STDOUT: %.loc7_11.1: type = value_of_initializer %int.make_type_32.loc7_11 [template = i32]
|
||||
// CHECK:STDOUT: %.loc7_11.2: type = converted %int.make_type_32.loc7_11, %.loc7_11.1 [template = i32]
|
||||
// CHECK:STDOUT: %a.loc7_8.1: i32 = param a
|
||||
// CHECK:STDOUT: @Foo.%a: i32 = bind_name a, %a.loc7_8.1
|
||||
// CHECK:STDOUT: %int.make_type_32.loc7_19: init type = call constants.%struct.1() [template = i32]
|
||||
// CHECK:STDOUT: %.loc7_19.1: type = value_of_initializer %int.make_type_32.loc7_19 [template = i32]
|
||||
// CHECK:STDOUT: %.loc7_19.2: type = converted %int.make_type_32.loc7_19, %.loc7_19.1 [template = i32]
|
||||
// CHECK:STDOUT: %b.loc7_16.1: i32 = param b
|
||||
// CHECK:STDOUT: @Foo.%b: i32 = bind_name b, %b.loc7_16.1
|
||||
// CHECK:STDOUT: }
|
||||
// CHECK:STDOUT: }
|
||||
// CHECK:STDOUT:
|
||||
// CHECK:STDOUT: fn @Int32() -> type = "int.make_type_32";
|
||||
// CHECK:STDOUT:
|
||||
// CHECK:STDOUT: fn @Foo(%a: i32, %b: i32) {
|
||||
// CHECK:STDOUT: !entry:
|
||||
// CHECK:STDOUT: return
|
||||
|
||||
@@ -9,9 +9,11 @@ fn Foo(a: i32, b: i32,) {}
|
||||
// CHECK:STDOUT: --- params_two_comma.carbon
|
||||
// CHECK:STDOUT:
|
||||
// CHECK:STDOUT: constants {
|
||||
// CHECK:STDOUT: %Foo: type = fn_type @Foo [template]
|
||||
// CHECK:STDOUT: %Int32: type = fn_type @Int32 [template]
|
||||
// CHECK:STDOUT: %.1: type = tuple_type () [template]
|
||||
// CHECK:STDOUT: %struct: Foo = struct_value () [template]
|
||||
// CHECK:STDOUT: %struct.1: Int32 = struct_value () [template]
|
||||
// CHECK:STDOUT: %Foo: type = fn_type @Foo [template]
|
||||
// CHECK:STDOUT: %struct.2: Foo = struct_value () [template]
|
||||
// CHECK:STDOUT: }
|
||||
// CHECK:STDOUT:
|
||||
// CHECK:STDOUT: file {
|
||||
@@ -20,14 +22,24 @@ fn Foo(a: i32, b: i32,) {}
|
||||
// CHECK:STDOUT: .Foo = %Foo.decl
|
||||
// CHECK:STDOUT: }
|
||||
// CHECK:STDOUT: %Core: <namespace> = namespace [template] {}
|
||||
// CHECK:STDOUT: %Foo.decl: Foo = fn_decl @Foo [template = constants.%struct] {
|
||||
// CHECK:STDOUT: %import_ref.1: Int32 = import_ref ir3, inst+3, loaded [template = constants.%struct.1]
|
||||
// CHECK:STDOUT: %import_ref.2: Int32 = import_ref ir3, inst+3, loaded [template = constants.%struct.1]
|
||||
// CHECK:STDOUT: %Foo.decl: Foo = fn_decl @Foo [template = constants.%struct.2] {
|
||||
// CHECK:STDOUT: %int.make_type_32.loc7_11: init type = call constants.%struct.1() [template = i32]
|
||||
// CHECK:STDOUT: %.loc7_11.1: type = value_of_initializer %int.make_type_32.loc7_11 [template = i32]
|
||||
// CHECK:STDOUT: %.loc7_11.2: type = converted %int.make_type_32.loc7_11, %.loc7_11.1 [template = i32]
|
||||
// CHECK:STDOUT: %a.loc7_8.1: i32 = param a
|
||||
// CHECK:STDOUT: @Foo.%a: i32 = bind_name a, %a.loc7_8.1
|
||||
// CHECK:STDOUT: %int.make_type_32.loc7_19: init type = call constants.%struct.1() [template = i32]
|
||||
// CHECK:STDOUT: %.loc7_19.1: type = value_of_initializer %int.make_type_32.loc7_19 [template = i32]
|
||||
// CHECK:STDOUT: %.loc7_19.2: type = converted %int.make_type_32.loc7_19, %.loc7_19.1 [template = i32]
|
||||
// CHECK:STDOUT: %b.loc7_16.1: i32 = param b
|
||||
// CHECK:STDOUT: @Foo.%b: i32 = bind_name b, %b.loc7_16.1
|
||||
// CHECK:STDOUT: }
|
||||
// CHECK:STDOUT: }
|
||||
// CHECK:STDOUT:
|
||||
// CHECK:STDOUT: fn @Int32() -> type = "int.make_type_32";
|
||||
// CHECK:STDOUT:
|
||||
// CHECK:STDOUT: fn @Foo(%a: i32, %b: i32) {
|
||||
// CHECK:STDOUT: !entry:
|
||||
// CHECK:STDOUT: return
|
||||
|
||||
Reference in New Issue
Block a user