mirror of
https://github.com/carbon-language/carbon-lang.git
synced 2026-10-05 22:02:55 +01:00
Initial support for binding patterns in SemIR (#4221)
Introduces the `BindingPattern` and `SymbolicBindingPattern` insts, and a separate stack of pattern blocks that they are emitted into. The intent is to generate the corresponding pattern-matching insts (like `BindName`) from them in a separate pass, but that is deferred to future PRs. See [here](https://docs.google.com/document/d/1U_vQH17V893J9aF1LJXUnFYBNSs2MjKl4bJPaWCB2zo/edit?usp=sharing&resourcekey=0-w0xGYZ0An31Kpz-wvzSXwQ) for the design this is based on, but note that during review we have chosen to deviate from that design by putting the patterns in separate blocks, and omitting the "forward references" from a `BindingPattern` to its corresponding `BindName`. This in turn necessitates having separate inst kinds for symbolic and non-symbolic binding patterns. --------- Co-authored-by: Jon Ross-Perkins <jperkins@google.com>
This commit is contained in:
co-authored by
Jon Ross-Perkins
parent
87678cc374
commit
dc32aa2690
+3
-3
@@ -57,7 +57,7 @@ fn G() {
|
||||
// CHECK:STDOUT: .G = %G.decl
|
||||
// CHECK:STDOUT: }
|
||||
// CHECK:STDOUT: %Core.import = import Core
|
||||
// CHECK:STDOUT: %F.decl: %F.type = fn_decl @F [template = constants.%F] {
|
||||
// CHECK:STDOUT: %F.decl: %F.type = fn_decl @F [template = constants.%F] {} {
|
||||
// CHECK:STDOUT: %int.make_type_32.loc11_12: init type = call constants.%Int32() [template = i32]
|
||||
// CHECK:STDOUT: %int.make_type_32.loc11_17: init type = call constants.%Int32() [template = i32]
|
||||
// CHECK:STDOUT: %int.make_type_32.loc11_22: init type = call constants.%Int32() [template = i32]
|
||||
@@ -69,9 +69,9 @@ fn G() {
|
||||
// CHECK:STDOUT: %.loc11_25.6: type = value_of_initializer %int.make_type_32.loc11_22 [template = i32]
|
||||
// CHECK:STDOUT: %.loc11_25.7: type = converted %int.make_type_32.loc11_22, %.loc11_25.6 [template = i32]
|
||||
// CHECK:STDOUT: %.loc11_25.8: type = converted %.loc11_25.1, constants.%.3 [template = constants.%.3]
|
||||
// CHECK:STDOUT: @F.%return: ref %.3 = var <return slot>
|
||||
// CHECK:STDOUT: %return: ref %.3 = var <return slot>
|
||||
// CHECK:STDOUT: }
|
||||
// CHECK:STDOUT: %G.decl: %G.type = fn_decl @G [template = constants.%G] {}
|
||||
// CHECK:STDOUT: %G.decl: %G.type = fn_decl @G [template = constants.%G] {} {}
|
||||
// CHECK:STDOUT: }
|
||||
// CHECK:STDOUT:
|
||||
// CHECK:STDOUT: fn @Int32() -> type = "int.make_type_32";
|
||||
|
||||
+1
-1
@@ -56,7 +56,7 @@ fn G() {
|
||||
// CHECK:STDOUT: .G = %G.decl
|
||||
// CHECK:STDOUT: }
|
||||
// CHECK:STDOUT: %Core.import = import Core
|
||||
// CHECK:STDOUT: %G.decl: %G.type = fn_decl @G [template = constants.%G] {}
|
||||
// CHECK:STDOUT: %G.decl: %G.type = fn_decl @G [template = constants.%G] {} {}
|
||||
// CHECK:STDOUT: }
|
||||
// CHECK:STDOUT:
|
||||
// CHECK:STDOUT: fn @G() {
|
||||
|
||||
@@ -55,15 +55,15 @@ fn Run() {
|
||||
// CHECK:STDOUT: .Run = %Run.decl
|
||||
// CHECK:STDOUT: }
|
||||
// CHECK:STDOUT: %Core.import = import Core
|
||||
// CHECK:STDOUT: %F.decl: %F.type = fn_decl @F [template = constants.%F] {
|
||||
// CHECK:STDOUT: %F.decl: %F.type = fn_decl @F [template = constants.%F] {} {
|
||||
// CHECK:STDOUT: %int.make_type_32: init type = call constants.%Int32() [template = i32]
|
||||
// CHECK:STDOUT: %.loc11_16.1: %.2 = tuple_literal (%int.make_type_32)
|
||||
// CHECK:STDOUT: %.loc11_16.2: type = value_of_initializer %int.make_type_32 [template = i32]
|
||||
// CHECK:STDOUT: %.loc11_16.3: type = converted %int.make_type_32, %.loc11_16.2 [template = i32]
|
||||
// CHECK:STDOUT: %.loc11_16.4: type = converted %.loc11_16.1, constants.%.3 [template = constants.%.3]
|
||||
// CHECK:STDOUT: @F.%return: ref %.3 = var <return slot>
|
||||
// CHECK:STDOUT: %return: ref %.3 = var <return slot>
|
||||
// CHECK:STDOUT: }
|
||||
// CHECK:STDOUT: %Run.decl: %Run.type = fn_decl @Run [template = constants.%Run] {}
|
||||
// CHECK:STDOUT: %Run.decl: %Run.type = fn_decl @Run [template = constants.%Run] {} {}
|
||||
// CHECK:STDOUT: }
|
||||
// CHECK:STDOUT:
|
||||
// CHECK:STDOUT: fn @Int32() -> type = "int.make_type_32";
|
||||
|
||||
+1
-1
@@ -58,7 +58,7 @@ var c: [(); 5] = ((), (), (), (), (),);
|
||||
// CHECK:STDOUT: import Core//prelude/types/bool
|
||||
// CHECK:STDOUT: }
|
||||
// CHECK:STDOUT: %import_ref.1: %Int32.type = import_ref Core//prelude/types, inst+4, loaded [template = constants.%Int32]
|
||||
// CHECK:STDOUT: %import_ref.2: %Float.type = import_ref Core//prelude/types, inst+32, loaded [template = constants.%Float]
|
||||
// CHECK:STDOUT: %import_ref.2: %Float.type = import_ref Core//prelude/types, inst+35, loaded [template = constants.%Float]
|
||||
// CHECK:STDOUT: }
|
||||
// CHECK:STDOUT:
|
||||
// CHECK:STDOUT: file {
|
||||
|
||||
+11
-8
@@ -50,25 +50,28 @@ let b: [i32; 3]* = &a;
|
||||
// CHECK:STDOUT: package: <namespace> = namespace [template] {
|
||||
// CHECK:STDOUT: .Core = imports.%Core
|
||||
// CHECK:STDOUT: .Add = %Add.decl
|
||||
// CHECK:STDOUT: .a = %a.loc13
|
||||
// CHECK:STDOUT: .a = %a
|
||||
// CHECK:STDOUT: .b = @__global_init.%b
|
||||
// CHECK:STDOUT: }
|
||||
// CHECK:STDOUT: %Core.import = import Core
|
||||
// CHECK:STDOUT: %Add.decl: %Add.type = fn_decl @Add [template = constants.%Add] {
|
||||
// CHECK:STDOUT: %a.patt: i32 = binding_pattern a
|
||||
// CHECK:STDOUT: %b.patt: i32 = binding_pattern b
|
||||
// CHECK:STDOUT: } {
|
||||
// CHECK:STDOUT: %int.make_type_32.loc11_11: init type = call constants.%Int32() [template = i32]
|
||||
// CHECK:STDOUT: %.loc11_11.1: type = value_of_initializer %int.make_type_32.loc11_11 [template = i32]
|
||||
// CHECK:STDOUT: %.loc11_11.2: type = converted %int.make_type_32.loc11_11, %.loc11_11.1 [template = i32]
|
||||
// CHECK:STDOUT: %a.loc11_8.1: i32 = param a, runtime_param0
|
||||
// CHECK:STDOUT: @Add.%a: i32 = bind_name a, %a.loc11_8.1
|
||||
// CHECK:STDOUT: %a.param: i32 = param a, runtime_param0
|
||||
// CHECK:STDOUT: %a: i32 = bind_name a, %a.param
|
||||
// CHECK:STDOUT: %int.make_type_32.loc11_19: init type = call constants.%Int32() [template = i32]
|
||||
// CHECK:STDOUT: %.loc11_19.1: type = value_of_initializer %int.make_type_32.loc11_19 [template = i32]
|
||||
// CHECK:STDOUT: %.loc11_19.2: type = converted %int.make_type_32.loc11_19, %.loc11_19.1 [template = i32]
|
||||
// CHECK:STDOUT: %b.loc11_16.1: i32 = param b, runtime_param1
|
||||
// CHECK:STDOUT: @Add.%b: i32 = bind_name b, %b.loc11_16.1
|
||||
// CHECK:STDOUT: %b.param: i32 = param b, runtime_param1
|
||||
// CHECK:STDOUT: %b: i32 = bind_name b, %b.param
|
||||
// CHECK:STDOUT: %int.make_type_32.loc11_27: init type = call constants.%Int32() [template = i32]
|
||||
// CHECK:STDOUT: %.loc11_27.1: type = value_of_initializer %int.make_type_32.loc11_27 [template = i32]
|
||||
// CHECK:STDOUT: %.loc11_27.2: type = converted %int.make_type_32.loc11_27, %.loc11_27.1 [template = i32]
|
||||
// CHECK:STDOUT: @Add.%return: ref i32 = var <return slot>
|
||||
// CHECK:STDOUT: %return: ref i32 = var <return slot>
|
||||
// CHECK:STDOUT: }
|
||||
// CHECK:STDOUT: %int.make_type_32.loc13: init type = call constants.%Int32() [template = i32]
|
||||
// CHECK:STDOUT: %Add.ref: %Add.type = name_ref Add, %Add.decl [template = constants.%Add]
|
||||
@@ -79,7 +82,7 @@ let b: [i32; 3]* = &a;
|
||||
// CHECK:STDOUT: %.loc13_9.2: type = converted %int.make_type_32.loc13, %.loc13_9.1 [template = i32]
|
||||
// CHECK:STDOUT: %.loc13_23: type = array_type %int.sadd, i32 [template = constants.%.5]
|
||||
// CHECK:STDOUT: %a.var: ref %.5 = var a
|
||||
// CHECK:STDOUT: %a.loc13: ref %.5 = bind_name a, %a.var
|
||||
// CHECK:STDOUT: %a: ref %.5 = bind_name a, %a.var
|
||||
// CHECK:STDOUT: %int.make_type_32.loc14: init type = call constants.%Int32() [template = i32]
|
||||
// CHECK:STDOUT: %.loc14_14: i32 = int_literal 3 [template = constants.%.4]
|
||||
// CHECK:STDOUT: %.loc14_9.1: type = value_of_initializer %int.make_type_32.loc14 [template = i32]
|
||||
@@ -110,7 +113,7 @@ let b: [i32; 3]* = &a;
|
||||
// CHECK:STDOUT: %.loc13_35.11: init %.5 = array_init (%.loc13_35.4, %.loc13_35.7, %.loc13_35.10) to file.%a.var [template = constants.%array]
|
||||
// CHECK:STDOUT: %.loc13_36: init %.5 = converted %.loc13_35.1, %.loc13_35.11 [template = constants.%array]
|
||||
// CHECK:STDOUT: assign file.%a.var, %.loc13_36
|
||||
// CHECK:STDOUT: %a.ref: ref %.5 = name_ref a, file.%a.loc13
|
||||
// CHECK:STDOUT: %a.ref: ref %.5 = name_ref a, file.%a
|
||||
// CHECK:STDOUT: %.loc14: %.6 = addr_of %a.ref
|
||||
// CHECK:STDOUT: %b: %.6 = bind_name b, %.loc14
|
||||
// CHECK:STDOUT: return
|
||||
|
||||
@@ -50,22 +50,24 @@ var a: [i32; Negate(1)];
|
||||
// CHECK:STDOUT: }
|
||||
// CHECK:STDOUT: %Core.import = import Core
|
||||
// CHECK:STDOUT: %Negate.decl: %Negate.type = fn_decl @Negate [template = constants.%Negate] {
|
||||
// CHECK:STDOUT: %n.patt: i32 = binding_pattern n
|
||||
// CHECK:STDOUT: } {
|
||||
// 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]
|
||||
// CHECK:STDOUT: %.loc11_14.2: type = converted %int.make_type_32.loc11_14, %.loc11_14.1 [template = i32]
|
||||
// CHECK:STDOUT: %n.loc11_11.1: i32 = param n, runtime_param0
|
||||
// CHECK:STDOUT: @Negate.%n: i32 = bind_name n, %n.loc11_11.1
|
||||
// CHECK:STDOUT: %n.param: i32 = param n, runtime_param0
|
||||
// CHECK:STDOUT: %n: i32 = bind_name n, %n.param
|
||||
// CHECK:STDOUT: %int.make_type_32.loc11_22: init type = call constants.%Int32() [template = i32]
|
||||
// CHECK:STDOUT: %.loc11_22.1: type = value_of_initializer %int.make_type_32.loc11_22 [template = i32]
|
||||
// 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: %return: ref i32 = var <return slot>
|
||||
// CHECK:STDOUT: }
|
||||
// CHECK:STDOUT: %int.make_type_32.loc16: init type = call constants.%Int32() [template = i32]
|
||||
// CHECK:STDOUT: %int.make_type_32: 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]
|
||||
// CHECK:STDOUT: %int.snegate: init i32 = call %Negate.ref(%.loc16_21) [template = constants.%.3]
|
||||
// CHECK:STDOUT: %.loc16_9.1: type = value_of_initializer %int.make_type_32.loc16 [template = i32]
|
||||
// CHECK:STDOUT: %.loc16_9.2: type = converted %int.make_type_32.loc16, %.loc16_9.1 [template = i32]
|
||||
// CHECK:STDOUT: %.loc16_9.1: type = value_of_initializer %int.make_type_32 [template = i32]
|
||||
// CHECK:STDOUT: %.loc16_9.2: type = converted %int.make_type_32, %.loc16_9.1 [template = i32]
|
||||
// CHECK:STDOUT: %.loc16_23: type = array_type %int.snegate, i32 [template = <error>]
|
||||
// CHECK:STDOUT: %a.var: ref <error> = var a
|
||||
// CHECK:STDOUT: %a: ref <error> = bind_name a, %a.var
|
||||
|
||||
@@ -68,12 +68,12 @@ var b: [1; 39999999999999999993];
|
||||
// CHECK:STDOUT: import Core//prelude/types/bool
|
||||
// CHECK:STDOUT: }
|
||||
// CHECK:STDOUT: %import_ref.1: %Int32.type = import_ref Core//prelude/types, inst+4, loaded [template = constants.%Int32]
|
||||
// CHECK:STDOUT: %import_ref.2: %ImplicitAs.type = import_ref Core//prelude/operators/as, inst+37, loaded [template = constants.%ImplicitAs]
|
||||
// CHECK:STDOUT: %import_ref.3 = import_ref Core//prelude/operators/as, inst+42, unloaded
|
||||
// CHECK:STDOUT: %import_ref.4: @ImplicitAs.%.2 (%.4) = import_ref Core//prelude/operators/as, inst+59, loaded [symbolic = @ImplicitAs.%.3 (constants.%.9)]
|
||||
// CHECK:STDOUT: %import_ref.5 = import_ref Core//prelude/operators/as, inst+52, unloaded
|
||||
// CHECK:STDOUT: %import_ref.6 = import_ref Core//prelude/operators/as, inst+52, unloaded
|
||||
// CHECK:STDOUT: %import_ref.7 = import_ref Core//prelude/operators/as, inst+52, unloaded
|
||||
// CHECK:STDOUT: %import_ref.2: %ImplicitAs.type = import_ref Core//prelude/operators/as, inst+40, loaded [template = constants.%ImplicitAs]
|
||||
// CHECK:STDOUT: %import_ref.3 = import_ref Core//prelude/operators/as, inst+45, unloaded
|
||||
// CHECK:STDOUT: %import_ref.4: @ImplicitAs.%.2 (%.4) = import_ref Core//prelude/operators/as, inst+63, loaded [symbolic = @ImplicitAs.%.3 (constants.%.9)]
|
||||
// CHECK:STDOUT: %import_ref.5 = import_ref Core//prelude/operators/as, inst+56, unloaded
|
||||
// CHECK:STDOUT: %import_ref.6 = import_ref Core//prelude/operators/as, inst+56, unloaded
|
||||
// CHECK:STDOUT: %import_ref.7 = import_ref Core//prelude/operators/as, inst+56, unloaded
|
||||
// CHECK:STDOUT: }
|
||||
// CHECK:STDOUT:
|
||||
// CHECK:STDOUT: file {
|
||||
|
||||
@@ -51,7 +51,7 @@ var p: Incomplete* = &a[0];
|
||||
// CHECK:STDOUT: .p = %p
|
||||
// CHECK:STDOUT: }
|
||||
// CHECK:STDOUT: %Core.import = import Core
|
||||
// CHECK:STDOUT: %Incomplete.decl: type = class_decl @Incomplete [template = constants.%Incomplete] {}
|
||||
// CHECK:STDOUT: %Incomplete.decl: type = class_decl @Incomplete [template = constants.%Incomplete] {} {}
|
||||
// CHECK:STDOUT: %Incomplete.ref.loc19: type = name_ref Incomplete, %Incomplete.decl [template = constants.%Incomplete]
|
||||
// CHECK:STDOUT: %.loc19_21: i32 = int_literal 1 [template = constants.%.1]
|
||||
// CHECK:STDOUT: %.loc19_22: type = array_type %.loc19_21, %Incomplete [template = constants.%.2]
|
||||
|
||||
+6
-6
@@ -51,12 +51,12 @@ var a: [1; 1];
|
||||
// CHECK:STDOUT: import Core//prelude/operators/comparison
|
||||
// CHECK:STDOUT: import Core//prelude/types/bool
|
||||
// CHECK:STDOUT: }
|
||||
// CHECK:STDOUT: %import_ref.1: %ImplicitAs.type = import_ref Core//prelude/operators/as, inst+37, loaded [template = constants.%ImplicitAs]
|
||||
// CHECK:STDOUT: %import_ref.2 = import_ref Core//prelude/operators/as, inst+42, unloaded
|
||||
// CHECK:STDOUT: %import_ref.3: @ImplicitAs.%.2 (%.4) = import_ref Core//prelude/operators/as, inst+59, loaded [symbolic = @ImplicitAs.%.3 (constants.%.9)]
|
||||
// CHECK:STDOUT: %import_ref.4 = import_ref Core//prelude/operators/as, inst+52, unloaded
|
||||
// CHECK:STDOUT: %import_ref.5 = import_ref Core//prelude/operators/as, inst+52, unloaded
|
||||
// CHECK:STDOUT: %import_ref.6 = import_ref Core//prelude/operators/as, inst+52, unloaded
|
||||
// CHECK:STDOUT: %import_ref.1: %ImplicitAs.type = import_ref Core//prelude/operators/as, inst+40, loaded [template = constants.%ImplicitAs]
|
||||
// CHECK:STDOUT: %import_ref.2 = import_ref Core//prelude/operators/as, inst+45, unloaded
|
||||
// CHECK:STDOUT: %import_ref.3: @ImplicitAs.%.2 (%.4) = import_ref Core//prelude/operators/as, inst+63, loaded [symbolic = @ImplicitAs.%.3 (constants.%.9)]
|
||||
// CHECK:STDOUT: %import_ref.4 = import_ref Core//prelude/operators/as, inst+56, unloaded
|
||||
// CHECK:STDOUT: %import_ref.5 = import_ref Core//prelude/operators/as, inst+56, unloaded
|
||||
// CHECK:STDOUT: %import_ref.6 = import_ref Core//prelude/operators/as, inst+56, unloaded
|
||||
// CHECK:STDOUT: }
|
||||
// CHECK:STDOUT:
|
||||
// CHECK:STDOUT: file {
|
||||
|
||||
@@ -93,12 +93,12 @@ var d: [i32; 3] = t2;
|
||||
// CHECK:STDOUT: import Core//prelude/types/bool
|
||||
// CHECK:STDOUT: }
|
||||
// CHECK:STDOUT: %import_ref.1: %Int32.type = import_ref Core//prelude/types, inst+4, loaded [template = constants.%Int32]
|
||||
// CHECK:STDOUT: %import_ref.2: %ImplicitAs.type = import_ref Core//prelude/operators/as, inst+37, loaded [template = constants.%ImplicitAs]
|
||||
// CHECK:STDOUT: %import_ref.3 = import_ref Core//prelude/operators/as, inst+42, unloaded
|
||||
// CHECK:STDOUT: %import_ref.4: @ImplicitAs.%.2 (%.12) = import_ref Core//prelude/operators/as, inst+59, loaded [symbolic = @ImplicitAs.%.3 (constants.%.17)]
|
||||
// CHECK:STDOUT: %import_ref.5 = import_ref Core//prelude/operators/as, inst+52, unloaded
|
||||
// CHECK:STDOUT: %import_ref.6 = import_ref Core//prelude/operators/as, inst+52, unloaded
|
||||
// CHECK:STDOUT: %import_ref.7 = import_ref Core//prelude/operators/as, inst+52, unloaded
|
||||
// CHECK:STDOUT: %import_ref.2: %ImplicitAs.type = import_ref Core//prelude/operators/as, inst+40, loaded [template = constants.%ImplicitAs]
|
||||
// CHECK:STDOUT: %import_ref.3 = import_ref Core//prelude/operators/as, inst+45, unloaded
|
||||
// CHECK:STDOUT: %import_ref.4: @ImplicitAs.%.2 (%.12) = import_ref Core//prelude/operators/as, inst+63, loaded [symbolic = @ImplicitAs.%.3 (constants.%.17)]
|
||||
// CHECK:STDOUT: %import_ref.5 = import_ref Core//prelude/operators/as, inst+56, unloaded
|
||||
// CHECK:STDOUT: %import_ref.6 = import_ref Core//prelude/operators/as, inst+56, unloaded
|
||||
// CHECK:STDOUT: %import_ref.7 = import_ref Core//prelude/operators/as, inst+56, unloaded
|
||||
// CHECK:STDOUT: }
|
||||
// CHECK:STDOUT:
|
||||
// CHECK:STDOUT: file {
|
||||
|
||||
+13
-10
@@ -59,28 +59,31 @@ fn G() -> i32 {
|
||||
// CHECK:STDOUT: }
|
||||
// CHECK:STDOUT: %Core.import = import Core
|
||||
// CHECK:STDOUT: %F.decl: %F.type = fn_decl @F [template = constants.%F] {
|
||||
// CHECK:STDOUT: %arr.patt: %.3 = binding_pattern arr
|
||||
// CHECK:STDOUT: %i.patt: i32 = binding_pattern i
|
||||
// CHECK:STDOUT: } {
|
||||
// CHECK:STDOUT: %int.make_type_32.loc11_12: init type = call constants.%Int32() [template = i32]
|
||||
// CHECK:STDOUT: %.loc11_17: i32 = int_literal 3 [template = constants.%.2]
|
||||
// CHECK:STDOUT: %.loc11_12.1: type = value_of_initializer %int.make_type_32.loc11_12 [template = i32]
|
||||
// CHECK:STDOUT: %.loc11_12.2: type = converted %int.make_type_32.loc11_12, %.loc11_12.1 [template = i32]
|
||||
// CHECK:STDOUT: %.loc11_18: type = array_type %.loc11_17, i32 [template = constants.%.3]
|
||||
// CHECK:STDOUT: %arr.loc11_6.1: %.3 = param arr, runtime_param0
|
||||
// CHECK:STDOUT: @F.%arr: %.3 = bind_name arr, %arr.loc11_6.1
|
||||
// CHECK:STDOUT: %arr.param: %.3 = param arr, runtime_param0
|
||||
// CHECK:STDOUT: %arr: %.3 = bind_name arr, %arr.param
|
||||
// CHECK:STDOUT: %int.make_type_32.loc11_24: init type = call constants.%Int32() [template = i32]
|
||||
// CHECK:STDOUT: %.loc11_24.1: type = value_of_initializer %int.make_type_32.loc11_24 [template = i32]
|
||||
// CHECK:STDOUT: %.loc11_24.2: type = converted %int.make_type_32.loc11_24, %.loc11_24.1 [template = i32]
|
||||
// CHECK:STDOUT: %i.loc11_21.1: i32 = param i, runtime_param1
|
||||
// CHECK:STDOUT: @F.%i: i32 = bind_name i, %i.loc11_21.1
|
||||
// CHECK:STDOUT: %i.param: i32 = param i, runtime_param1
|
||||
// CHECK:STDOUT: %i: i32 = bind_name i, %i.param
|
||||
// CHECK:STDOUT: %int.make_type_32.loc11_32: init type = call constants.%Int32() [template = i32]
|
||||
// CHECK:STDOUT: %.loc11_32.1: type = value_of_initializer %int.make_type_32.loc11_32 [template = i32]
|
||||
// CHECK:STDOUT: %.loc11_32.2: type = converted %int.make_type_32.loc11_32, %.loc11_32.1 [template = i32]
|
||||
// CHECK:STDOUT: @F.%return: ref i32 = var <return slot>
|
||||
// CHECK:STDOUT: %return: ref i32 = var <return slot>
|
||||
// CHECK:STDOUT: }
|
||||
// CHECK:STDOUT: %G.decl: %G.type = fn_decl @G [template = constants.%G] {
|
||||
// CHECK:STDOUT: %int.make_type_32.loc15: init type = call constants.%Int32() [template = i32]
|
||||
// CHECK:STDOUT: %.loc15_11.1: type = value_of_initializer %int.make_type_32.loc15 [template = i32]
|
||||
// CHECK:STDOUT: %.loc15_11.2: type = converted %int.make_type_32.loc15, %.loc15_11.1 [template = i32]
|
||||
// CHECK:STDOUT: @G.%return: ref i32 = var <return slot>
|
||||
// CHECK:STDOUT: %G.decl: %G.type = fn_decl @G [template = constants.%G] {} {
|
||||
// CHECK:STDOUT: %int.make_type_32: init type = call constants.%Int32() [template = i32]
|
||||
// CHECK:STDOUT: %.loc15_11.1: type = value_of_initializer %int.make_type_32 [template = i32]
|
||||
// CHECK:STDOUT: %.loc15_11.2: type = converted %int.make_type_32, %.loc15_11.1 [template = i32]
|
||||
// CHECK:STDOUT: %return: ref i32 = var <return slot>
|
||||
// CHECK:STDOUT: }
|
||||
// CHECK:STDOUT: }
|
||||
// CHECK:STDOUT:
|
||||
|
||||
+4
-2
@@ -46,8 +46,10 @@ fn G(T:! type) {
|
||||
// CHECK:STDOUT: }
|
||||
// CHECK:STDOUT: %Core.import = import Core
|
||||
// CHECK:STDOUT: %G.decl: %G.type = fn_decl @G [template = constants.%G] {
|
||||
// CHECK:STDOUT: %T.loc11_6.1: type = param T, runtime_param<invalid>
|
||||
// CHECK:STDOUT: @G.%T.loc11: type = bind_symbolic_name T 0, %T.loc11_6.1 [symbolic = @G.%T.1 (constants.%T)]
|
||||
// CHECK:STDOUT: %T.patt: type = symbolic_binding_pattern T 0
|
||||
// CHECK:STDOUT: } {
|
||||
// CHECK:STDOUT: %T.param: type = param T, runtime_param<invalid>
|
||||
// CHECK:STDOUT: %T.loc11: type = bind_symbolic_name T 0, %T.param [symbolic = %T.1 (constants.%T)]
|
||||
// CHECK:STDOUT: }
|
||||
// CHECK:STDOUT: }
|
||||
// CHECK:STDOUT:
|
||||
|
||||
Reference in New Issue
Block a user