Put the IR for the return type in the same block as the IR for the parameters. (#3145)

Previously, IR generated for the computation of the return type ended up
in the package's node block. Put it with the IR for the parameters for
consistency and cleanliness.
This commit is contained in:
Richard Smith
2023-08-23 23:38:17 +00:00
committed by GitHub
parent 67da700dd5
commit 0ff5e42b12
15 changed files with 82 additions and 99 deletions
@@ -12,8 +12,8 @@ fn Run() {
// CHECK:STDOUT: cross_reference_irs_size: 1
// CHECK:STDOUT: functions: [
// CHECK:STDOUT: {name: str0, param_refs: block0, return_type: type2, body: [block3]},
// CHECK:STDOUT: {name: str1, param_refs: block0, body: [block5]},
// CHECK:STDOUT: {name: str0, param_refs: block0, return_type: type2, body: [block4]},
// CHECK:STDOUT: {name: str1, param_refs: block0, body: [block6]},
// CHECK:STDOUT: ]
// CHECK:STDOUT: integer_literals: [
// CHECK:STDOUT: 0,
@@ -48,7 +48,7 @@ fn Run() {
// CHECK:STDOUT: {kind: FunctionDeclaration, arg0: function0},
// CHECK:STDOUT: {kind: IntegerLiteral, arg0: int0, type: type1},
// CHECK:STDOUT: {kind: StubReference, arg0: node+5, type: type1},
// CHECK:STDOUT: {kind: TupleValue, arg0: block4, type: type2},
// CHECK:STDOUT: {kind: TupleValue, arg0: block5, type: type2},
// CHECK:STDOUT: {kind: ReturnExpression, arg0: node+7},
// CHECK:STDOUT: {kind: FunctionDeclaration, arg0: function1},
// CHECK:STDOUT: {kind: IntegerLiteral, arg0: int1, type: type1},
@@ -67,13 +67,15 @@ fn Run() {
// CHECK:STDOUT: node+1,
// CHECK:STDOUT: node+2,
// CHECK:STDOUT: node+3,
// CHECK:STDOUT: node+4,
// CHECK:STDOUT: node+9,
// CHECK:STDOUT: ],
// CHECK:STDOUT: [
// CHECK:STDOUT: node+0,
// CHECK:STDOUT: ],
// CHECK:STDOUT: [
// CHECK:STDOUT: node+4,
// CHECK:STDOUT: node+9,
// CHECK:STDOUT: ],
// CHECK:STDOUT: [
// CHECK:STDOUT: node+5,
// CHECK:STDOUT: node+6,
// CHECK:STDOUT: node+7,
@@ -94,11 +96,7 @@ fn Run() {
// CHECK:STDOUT: ]
// CHECK:STDOUT:
// CHECK:STDOUT: package {
// CHECK:STDOUT: %.loc7_12: type = stub_reference i32
// CHECK:STDOUT: %.loc7_16.1: type = tuple_type (type)
// CHECK:STDOUT: %.loc7_16.2: (type,) = tuple_value (%.loc7_12)
// CHECK:STDOUT: %.loc7_16.3: type = tuple_type (i32)
// CHECK:STDOUT: %.loc7_1 = fn_decl @F
// CHECK:STDOUT: %.loc7 = fn_decl @F
// CHECK:STDOUT: %.loc9 = fn_decl @Run
// CHECK:STDOUT: }
// CHECK:STDOUT: