mirror of
https://github.com/carbon-language/carbon-lang.git
synced 2026-10-05 22:02:55 +01:00
Replace form insts with actions (#7100)
See [here](https://docs.google.com/document/d/1rWcueFwIfZox6GKVGxiUG4cBzjrZ6djXiIDGyJDtrE4/edit?tab=t.0) for the design doc. This also removes the default value of the `result_type_inst_id` parameter of `HandleAction`, moves it before the action in the parameter list, and documents it. This solves two problems: - The default made it easy to forget, leading to unnecessary `TypeOfInst` instructions. - When it was present, putting it after the fairly "bulky" action argument tended to make the callsite harder to read.
This commit is contained in:
+106
-37
@@ -123,15 +123,7 @@ fn G() {
|
||||
library "[[@TEST_NAME]]";
|
||||
|
||||
fn F() {
|
||||
// CHECK:STDERR: fail_todo_local_init_form_binding.carbon:[[@LINE+12]]:7: error: semantics TODO: `Support local initializing forms` [SemanticsTodo]
|
||||
// CHECK:STDERR: let x:? form(var i32) = 0;
|
||||
// CHECK:STDERR: ^~~~~~~~~~~~~~~~~
|
||||
// CHECK:STDERR:
|
||||
// CHECK:STDERR: fail_todo_local_init_form_binding.carbon:[[@LINE+8]]:27: error: cannot bind durable reference to non-reference value of type `i32` [ConversionFailureNonRefToRef]
|
||||
// CHECK:STDERR: let x:? form(var i32) = 0;
|
||||
// CHECK:STDERR: ^
|
||||
// CHECK:STDERR:
|
||||
// CHECK:STDERR: fail_todo_local_init_form_binding.carbon:[[@LINE+4]]:7: warning: binding `x` unused [UnusedBinding]
|
||||
// CHECK:STDERR: fail_todo_local_init_form_binding.carbon:[[@LINE+4]]:7: error: semantics TODO: `support local form bindings` [SemanticsTodo]
|
||||
// CHECK:STDERR: let x:? form(var i32) = 0;
|
||||
// CHECK:STDERR: ^~~~~~~~~~~~~~~~~
|
||||
// CHECK:STDERR:
|
||||
@@ -214,13 +206,12 @@ fn F() ->? i32;
|
||||
// CHECK:STDERR:
|
||||
fn F() ->? ref i32;
|
||||
|
||||
// --- fail_todo_form_generic_return.carbon
|
||||
// --- form_generic_return.carbon
|
||||
library "[[@TEST_NAME]]";
|
||||
|
||||
// CHECK:STDERR: fail_todo_form_generic_return.carbon:[[@LINE+4]]:26: error: semantics TODO: `Support symbolic return forms` [SemanticsTodo]
|
||||
// CHECK:STDERR: fn F(Form:! Core.Form()) ->? Form;
|
||||
// CHECK:STDERR: ^~~~~~~~
|
||||
// CHECK:STDERR:
|
||||
//@dump-sem-ir-begin
|
||||
fn F(Form:! Core.Form()) ->? Form;
|
||||
//@dump-sem-ir-end
|
||||
|
||||
// CHECK:STDOUT: --- ref_form_param.carbon
|
||||
// CHECK:STDOUT:
|
||||
@@ -236,15 +227,15 @@ fn F(Form:! Core.Form()) ->? Form;
|
||||
// CHECK:STDOUT:
|
||||
// CHECK:STDOUT: file {
|
||||
// CHECK:STDOUT: %F.decl: %F.type = fn_decl @F [concrete = constants.%F] {
|
||||
// CHECK:STDOUT: %.loc4_7: %pattern_type.7ce = form_param_pattern [concrete]
|
||||
// CHECK:STDOUT: %x.patt: %pattern_type.7ce = at_binding_pattern x, %.loc4_7 [concrete]
|
||||
// CHECK:STDOUT: %x.param_patt: %pattern_type.7ce = ref_param_pattern [concrete]
|
||||
// CHECK:STDOUT: %x.patt: %pattern_type.7ce = at_binding_pattern x, %x.param_patt [concrete]
|
||||
// CHECK:STDOUT: } {
|
||||
// CHECK:STDOUT: %x.param: ref %i32 = ref_param call_param0
|
||||
// CHECK:STDOUT: %.loc4_15.1: Core.Form = splice_block %.loc4_15.2 [concrete = constants.%.1da] {
|
||||
// CHECK:STDOUT: %i32: type = type_literal constants.%i32 [concrete = constants.%i32]
|
||||
// CHECK:STDOUT: %.loc4_15.2: Core.Form = ref_form %i32 [concrete = constants.%.1da]
|
||||
// CHECK:STDOUT: }
|
||||
// CHECK:STDOUT: %x: ref %i32 = form_binding x, %x.param
|
||||
// CHECK:STDOUT: %x: ref %i32 = ref_binding x, %x.param
|
||||
// CHECK:STDOUT: }
|
||||
// CHECK:STDOUT: }
|
||||
// CHECK:STDOUT:
|
||||
@@ -297,15 +288,16 @@ fn F(Form:! Core.Form()) ->? Form;
|
||||
// CHECK:STDOUT:
|
||||
// CHECK:STDOUT: file {
|
||||
// CHECK:STDOUT: %F.decl: %F.type = fn_decl @F [concrete = constants.%F] {
|
||||
// CHECK:STDOUT: %.loc4_7: %pattern_type.7ce = form_param_pattern [concrete]
|
||||
// CHECK:STDOUT: %x.patt: %pattern_type.7ce = at_binding_pattern x, %.loc4_7 [concrete]
|
||||
// CHECK:STDOUT: %x.param_patt: %pattern_type.7ce = ref_param_pattern [concrete]
|
||||
// CHECK:STDOUT: %x.var_patt: %pattern_type.7ce = var_pattern %x.param_patt [concrete]
|
||||
// CHECK:STDOUT: %x.patt: %pattern_type.7ce = at_binding_pattern x, %x.var_patt [concrete]
|
||||
// CHECK:STDOUT: } {
|
||||
// CHECK:STDOUT: %x.param: ref %i32 = ref_param call_param0
|
||||
// CHECK:STDOUT: %.loc4_15.1: Core.Form = splice_block %.loc4_15.2 [concrete = constants.%.ff5] {
|
||||
// CHECK:STDOUT: %i32: type = type_literal constants.%i32 [concrete = constants.%i32]
|
||||
// CHECK:STDOUT: %.loc4_15.2: Core.Form = init_form %i32 [concrete = constants.%.ff5]
|
||||
// CHECK:STDOUT: }
|
||||
// CHECK:STDOUT: %x: ref %i32 = form_binding x, %x.param
|
||||
// CHECK:STDOUT: %x: ref %i32 = ref_binding x, %x.param
|
||||
// CHECK:STDOUT: }
|
||||
// CHECK:STDOUT: }
|
||||
// CHECK:STDOUT:
|
||||
@@ -321,7 +313,7 @@ fn F(Form:! Core.Form()) ->? Form;
|
||||
// CHECK:STDOUT: %bound_method.loc4_7.2: <bound method> = bound_method %int_0, %specific_fn [concrete = constants.%bound_method]
|
||||
// CHECK:STDOUT: %Core.IntLiteral.as.ImplicitAs.impl.Convert.call: init %i32 = call %bound_method.loc4_7.2(%int_0) [concrete = constants.%int_0.6a9]
|
||||
// CHECK:STDOUT: %.loc4: init %i32 = converted %int_0, %Core.IntLiteral.as.ImplicitAs.impl.Convert.call [concrete = constants.%int_0.6a9]
|
||||
// CHECK:STDOUT: %x.var: ref %i32 = var @F.%.loc4_7
|
||||
// CHECK:STDOUT: %x.var: ref %i32 = var @F.%x.var_patt
|
||||
// CHECK:STDOUT: assign %x.var, %.loc4
|
||||
// CHECK:STDOUT: %F.call: init %empty_tuple.type = call %F.ref(%x.var)
|
||||
// CHECK:STDOUT: %Destroy.Op.bound: <bound method> = bound_method %x.var, constants.%Destroy.Op.651ba6.2
|
||||
@@ -370,15 +362,15 @@ fn F(Form:! Core.Form()) ->? Form;
|
||||
// CHECK:STDOUT:
|
||||
// CHECK:STDOUT: file {
|
||||
// CHECK:STDOUT: %F.decl: %F.type = fn_decl @F [concrete = constants.%F] {
|
||||
// CHECK:STDOUT: %.loc4_7: %pattern_type.7ce = form_param_pattern [concrete]
|
||||
// CHECK:STDOUT: %x.patt: %pattern_type.7ce = at_binding_pattern x, %.loc4_7 [concrete]
|
||||
// CHECK:STDOUT: %x.param_patt: %pattern_type.7ce = value_param_pattern [concrete]
|
||||
// CHECK:STDOUT: %x.patt: %pattern_type.7ce = at_binding_pattern x, %x.param_patt [concrete]
|
||||
// CHECK:STDOUT: } {
|
||||
// CHECK:STDOUT: %x.param: %i32 = value_param call_param0
|
||||
// CHECK:STDOUT: %.loc4_15.1: Core.Form = splice_block %.loc4_15.2 [concrete = constants.%.754] {
|
||||
// CHECK:STDOUT: %i32: type = type_literal constants.%i32 [concrete = constants.%i32]
|
||||
// CHECK:STDOUT: %.loc4_15.2: Core.Form = value_form %i32 [concrete = constants.%.754]
|
||||
// CHECK:STDOUT: }
|
||||
// CHECK:STDOUT: %x: %i32 = form_binding x, %x.param
|
||||
// CHECK:STDOUT: %x: %i32 = value_binding x, %x.param
|
||||
// CHECK:STDOUT: }
|
||||
// CHECK:STDOUT: }
|
||||
// CHECK:STDOUT:
|
||||
@@ -412,8 +404,8 @@ fn F(Form:! Core.Form()) ->? Form;
|
||||
// CHECK:STDOUT:
|
||||
// CHECK:STDOUT: file {
|
||||
// CHECK:STDOUT: %F.decl: %F.type = fn_decl @F [concrete = constants.%F] {
|
||||
// CHECK:STDOUT: %.loc4_7: %pattern_type = form_param_pattern [concrete]
|
||||
// CHECK:STDOUT: %x.patt: %pattern_type = at_binding_pattern x, %.loc4_7 [concrete]
|
||||
// CHECK:STDOUT: %x.param_patt: %pattern_type = ref_param_pattern [concrete]
|
||||
// CHECK:STDOUT: %x.patt: %pattern_type = at_binding_pattern x, %x.param_patt [concrete]
|
||||
// CHECK:STDOUT: } {
|
||||
// CHECK:STDOUT: %x.param: ref %empty_tuple.type = ref_param call_param0
|
||||
// CHECK:STDOUT: %.loc4_15.1: Core.Form = splice_block %.loc4_15.2 [concrete = constants.%.9f9] {
|
||||
@@ -421,7 +413,7 @@ fn F(Form:! Core.Form()) ->? Form;
|
||||
// CHECK:STDOUT: %.loc4_20.2: type = converted %.loc4_20.1, constants.%empty_tuple.type [concrete = constants.%empty_tuple.type]
|
||||
// CHECK:STDOUT: %.loc4_15.2: Core.Form = ref_form %.loc4_20.2 [concrete = constants.%.9f9]
|
||||
// CHECK:STDOUT: }
|
||||
// CHECK:STDOUT: %x: ref %empty_tuple.type = form_binding x, %x.param
|
||||
// CHECK:STDOUT: %x: ref %empty_tuple.type = ref_binding x, %x.param
|
||||
// CHECK:STDOUT: }
|
||||
// CHECK:STDOUT: }
|
||||
// CHECK:STDOUT:
|
||||
@@ -440,13 +432,13 @@ fn F(Form:! Core.Form()) ->? Form;
|
||||
// CHECK:STDOUT:
|
||||
// CHECK:STDOUT: file {
|
||||
// CHECK:STDOUT: %F.decl: %F.type = fn_decl @F [concrete = constants.%F] {
|
||||
// CHECK:STDOUT: %.loc4_8.1: %pattern_type.7ce = ref_return_pattern [concrete]
|
||||
// CHECK:STDOUT: %return.patt: %pattern_type.7ce = return_slot_pattern %.loc4_8.1, constants.%i32 [concrete]
|
||||
// CHECK:STDOUT: %.loc4_17.1: %pattern_type.7ce = ref_return_pattern [concrete]
|
||||
// CHECK:STDOUT: %return.patt: %pattern_type.7ce = return_slot_pattern %.loc4_17.1, constants.%i32 [concrete]
|
||||
// CHECK:STDOUT: } {
|
||||
// CHECK:STDOUT: %i32: type = type_literal constants.%i32 [concrete = constants.%i32]
|
||||
// CHECK:STDOUT: %.loc4_17: Core.Form = ref_form %i32 [concrete = constants.%.1da]
|
||||
// CHECK:STDOUT: %.loc4_8.2: ref %i32 = ref_return
|
||||
// CHECK:STDOUT: %return: ref %i32 = return_slot %.loc4_8.2
|
||||
// CHECK:STDOUT: %.loc4_17.2: Core.Form = ref_form %i32 [concrete = constants.%.1da]
|
||||
// CHECK:STDOUT: %.loc4_17.3: ref %i32 = ref_return
|
||||
// CHECK:STDOUT: %return: ref %i32 = return_slot %.loc4_17.3
|
||||
// CHECK:STDOUT: }
|
||||
// CHECK:STDOUT: }
|
||||
// CHECK:STDOUT:
|
||||
@@ -530,13 +522,13 @@ fn F(Form:! Core.Form()) ->? Form;
|
||||
// CHECK:STDOUT:
|
||||
// CHECK:STDOUT: file {
|
||||
// CHECK:STDOUT: %F.decl: %F.type = fn_decl @F [concrete = constants.%F] {
|
||||
// CHECK:STDOUT: %.loc4_8.1: %pattern_type.7ce = value_return_pattern [concrete]
|
||||
// CHECK:STDOUT: %return.patt: %pattern_type.7ce = return_slot_pattern %.loc4_8.1, constants.%i32 [concrete]
|
||||
// CHECK:STDOUT: %.loc4_17.1: %pattern_type.7ce = value_return_pattern [concrete]
|
||||
// CHECK:STDOUT: %return.patt: %pattern_type.7ce = return_slot_pattern %.loc4_17.1, constants.%i32 [concrete]
|
||||
// CHECK:STDOUT: } {
|
||||
// CHECK:STDOUT: %i32: type = type_literal constants.%i32 [concrete = constants.%i32]
|
||||
// CHECK:STDOUT: %.loc4_17: Core.Form = value_form %i32 [concrete = constants.%.754]
|
||||
// CHECK:STDOUT: %.loc4_8.2: %i32 = value_return
|
||||
// CHECK:STDOUT: %return: %i32 = return_slot %.loc4_8.2
|
||||
// CHECK:STDOUT: %.loc4_17.2: Core.Form = value_form %i32 [concrete = constants.%.754]
|
||||
// CHECK:STDOUT: %.loc4_17.3: %i32 = value_return
|
||||
// CHECK:STDOUT: %return: %i32 = return_slot %.loc4_17.3
|
||||
// CHECK:STDOUT: }
|
||||
// CHECK:STDOUT: }
|
||||
// CHECK:STDOUT:
|
||||
@@ -554,3 +546,80 @@ fn F(Form:! Core.Form()) ->? Form;
|
||||
// CHECK:STDOUT: <elided>
|
||||
// CHECK:STDOUT: }
|
||||
// CHECK:STDOUT:
|
||||
// CHECK:STDOUT: --- form_generic_return.carbon
|
||||
// CHECK:STDOUT:
|
||||
// CHECK:STDOUT: constants {
|
||||
// CHECK:STDOUT: %Form.type: type = fn_type @Form [concrete]
|
||||
// CHECK:STDOUT: %Form.ea2: %Form.type = struct_value () [concrete]
|
||||
// CHECK:STDOUT: %pattern_type.13f: type = pattern_type Core.Form [concrete]
|
||||
// CHECK:STDOUT: %Form.ac3: Core.Form = symbolic_binding Form, 0 [symbolic]
|
||||
// CHECK:STDOUT: %.344: Core.Form = splice_inst @F.%.loc4_30.1 [template]
|
||||
// CHECK:STDOUT: %.82f: type = type_component_of %.344 [template]
|
||||
// CHECK:STDOUT: %pattern_type.ec7: type = pattern_type %.82f [template]
|
||||
// CHECK:STDOUT: %.f74: %.82f = splice_inst @F.%.loc4_26.2 [template]
|
||||
// CHECK:STDOUT: %.33d: <instruction> = refine_form_action %Form.ac3 [template]
|
||||
// CHECK:STDOUT: %.80a: Core.Form = splice_inst %.33d [template]
|
||||
// CHECK:STDOUT: %.af3: <instruction> = out_form_param_pattern_action %.80a [template]
|
||||
// CHECK:STDOUT: %.465: type = type_component_of %.80a [template]
|
||||
// CHECK:STDOUT: %.e7f: %.465 = splice_inst %.af3 [template]
|
||||
// CHECK:STDOUT: %pattern_type.a51: type = pattern_type %.465 [template]
|
||||
// CHECK:STDOUT: %.cab: <instruction> = callee_pattern_match_action %.e7f, call_param0 [template]
|
||||
// CHECK:STDOUT: %F.type: type = fn_type @F [concrete]
|
||||
// CHECK:STDOUT: %F: %F.type = struct_value () [concrete]
|
||||
// CHECK:STDOUT: }
|
||||
// CHECK:STDOUT:
|
||||
// CHECK:STDOUT: imports {
|
||||
// CHECK:STDOUT: %Core: <namespace> = namespace file.%Core.import, [concrete] {
|
||||
// CHECK:STDOUT: .Form = %Core.Form
|
||||
// CHECK:STDOUT: import Core//prelude
|
||||
// CHECK:STDOUT: import Core//prelude/...
|
||||
// CHECK:STDOUT: }
|
||||
// CHECK:STDOUT: %Core.Form: %Form.type = import_ref Core//prelude/parts/form, Form, loaded [concrete = constants.%Form.ea2]
|
||||
// CHECK:STDOUT: }
|
||||
// CHECK:STDOUT:
|
||||
// CHECK:STDOUT: file {
|
||||
// CHECK:STDOUT: %F.decl: %F.type = fn_decl @F [concrete = constants.%F] {
|
||||
// CHECK:STDOUT: %Form.patt: %pattern_type.13f = symbolic_binding_pattern Form, 0 [concrete]
|
||||
// CHECK:STDOUT: %return.patt: @F.%pattern_type (%pattern_type.ec7) = return_slot_pattern %.loc4_26.6, constants.%.82f [concrete]
|
||||
// CHECK:STDOUT: } {
|
||||
// CHECK:STDOUT: %Form.ref.loc4_30: Core.Form = name_ref Form, %Form.loc4_10.2 [symbolic = %Form.loc4_10.1 (constants.%Form.ac3)]
|
||||
// CHECK:STDOUT: %.loc4_30.3: Core.Form = splice_inst %.loc4_30.1 [template = %.loc4_30.2 (constants.%.344)]
|
||||
// CHECK:STDOUT: %.loc4_26.6: @F.%.loc4_26.3 (%.82f) = splice_inst %.loc4_26.2 [template = %.loc4_26.4 (constants.%.f74)]
|
||||
// CHECK:STDOUT: %.loc4_23.1: type = splice_block %.loc4_23.3 [concrete = Core.Form] {
|
||||
// CHECK:STDOUT: <elided>
|
||||
// CHECK:STDOUT: %Core.ref: <namespace> = name_ref Core, imports.%Core [concrete = imports.%Core]
|
||||
// CHECK:STDOUT: %Form.ref.loc4_17: %Form.type = name_ref Form, imports.%Core.Form [concrete = constants.%Form.ea2]
|
||||
// CHECK:STDOUT: %Form.call: init type = call %Form.ref.loc4_17() [concrete = Core.Form]
|
||||
// CHECK:STDOUT: %.loc4_23.2: type = value_of_initializer %Form.call [concrete = Core.Form]
|
||||
// CHECK:STDOUT: %.loc4_23.3: type = converted %Form.call, %.loc4_23.2 [concrete = Core.Form]
|
||||
// CHECK:STDOUT: }
|
||||
// CHECK:STDOUT: %Form.loc4_10.2: Core.Form = symbolic_binding Form, 0 [symbolic = %Form.loc4_10.1 (constants.%Form.ac3)]
|
||||
// CHECK:STDOUT: %.loc4_26.1: @F.%.loc4_26.3 (%.82f) = splice_inst %.loc4_26.5
|
||||
// CHECK:STDOUT: %return: @F.%.loc4_26.3 (%.82f) = return_slot %.loc4_26.1
|
||||
// CHECK:STDOUT: }
|
||||
// CHECK:STDOUT: }
|
||||
// CHECK:STDOUT:
|
||||
// CHECK:STDOUT: generic fn @F(%Form.loc4_10.2: Core.Form) {
|
||||
// CHECK:STDOUT: %Form.loc4_10.1: Core.Form = symbolic_binding Form, 0 [symbolic = %Form.loc4_10.1 (constants.%Form.ac3)]
|
||||
// CHECK:STDOUT: %.loc4_30.1: <instruction> = refine_form_action %Form.ref.loc4_30 [template]
|
||||
// CHECK:STDOUT: %.loc4_30.2: Core.Form = splice_inst %.loc4_30.1 [template = %.loc4_30.2 (constants.%.344)]
|
||||
// CHECK:STDOUT: %.loc4_26.2: <instruction> = out_form_param_pattern_action %.loc4_30.3 [template]
|
||||
// CHECK:STDOUT: %.loc4_26.3: type = type_component_of %.loc4_30.2 [template = %.loc4_26.3 (constants.%.82f)]
|
||||
// CHECK:STDOUT: %.loc4_26.4: @F.%.loc4_26.3 (%.82f) = splice_inst %.loc4_26.2 [template = %.loc4_26.4 (constants.%.f74)]
|
||||
// CHECK:STDOUT: %pattern_type: type = pattern_type %.loc4_26.3 [template = %pattern_type (constants.%pattern_type.ec7)]
|
||||
// CHECK:STDOUT: %.loc4_26.5: <instruction> = callee_pattern_match_action %.loc4_26.6, call_param0 [template]
|
||||
// CHECK:STDOUT:
|
||||
// CHECK:STDOUT: fn() -> out %.loc4_26.1:? @F.%.loc4_30.1 (@F.%.loc4_30.1);
|
||||
// CHECK:STDOUT: }
|
||||
// CHECK:STDOUT:
|
||||
// CHECK:STDOUT: specific @F(constants.%Form.ac3) {
|
||||
// CHECK:STDOUT: %Form.loc4_10.1 => constants.%Form.ac3
|
||||
// CHECK:STDOUT: %.loc4_30.1 => constants.%.33d
|
||||
// CHECK:STDOUT: %.loc4_30.2 => constants.%.80a
|
||||
// CHECK:STDOUT: %.loc4_26.2 => constants.%.af3
|
||||
// CHECK:STDOUT: %.loc4_26.3 => constants.%.465
|
||||
// CHECK:STDOUT: %.loc4_26.4 => constants.%.e7f
|
||||
// CHECK:STDOUT: %pattern_type => constants.%pattern_type.a51
|
||||
// CHECK:STDOUT: %.loc4_26.5 => constants.%.cab
|
||||
// CHECK:STDOUT: }
|
||||
// CHECK:STDOUT:
|
||||
|
||||
+8
-8
@@ -31,9 +31,9 @@ fn Call() {
|
||||
// CHECK:STDERR: fail_incomplete_return.carbon:[[@LINE-12]]:1: note: class was forward declared here [ClassForwardDeclaredHere]
|
||||
// CHECK:STDERR: class C;
|
||||
// CHECK:STDERR: ^~~~~~~~
|
||||
// CHECK:STDERR: fail_incomplete_return.carbon:[[@LINE-11]]:21: note: return type declared here [IncompleteReturnTypeHere]
|
||||
// CHECK:STDERR: fail_incomplete_return.carbon:[[@LINE-11]]:18: note: return type declared here [IncompleteReturnTypeHere]
|
||||
// CHECK:STDERR: fn ReturnCUsed() -> C;
|
||||
// CHECK:STDERR: ^
|
||||
// CHECK:STDERR: ^~~~
|
||||
// CHECK:STDERR:
|
||||
ReturnCUsed();
|
||||
// CHECK:STDERR: fail_incomplete_return.carbon:[[@LINE+10]]:3: error: function returns incomplete type `D` [IncompleteTypeInFunctionReturnType]
|
||||
@@ -42,9 +42,9 @@ fn Call() {
|
||||
// CHECK:STDERR: fail_incomplete_return.carbon:[[@LINE-22]]:1: note: class was forward declared here [ClassForwardDeclaredHere]
|
||||
// CHECK:STDERR: class D;
|
||||
// CHECK:STDERR: ^~~~~~~~
|
||||
// CHECK:STDERR: fail_incomplete_return.carbon:[[@LINE-20]]:21: note: return type declared here [IncompleteReturnTypeHere]
|
||||
// CHECK:STDERR: fail_incomplete_return.carbon:[[@LINE-20]]:18: note: return type declared here [IncompleteReturnTypeHere]
|
||||
// CHECK:STDERR: fn ReturnDUsed() -> D;
|
||||
// CHECK:STDERR: ^
|
||||
// CHECK:STDERR: ^~~~
|
||||
// CHECK:STDERR:
|
||||
ReturnDUsed();
|
||||
}
|
||||
@@ -66,9 +66,9 @@ fn CallFAndGIncomplete() {
|
||||
// CHECK:STDERR: class C;
|
||||
// CHECK:STDERR: ^~~~~~~~
|
||||
// CHECK:STDERR: fail_use_imported.carbon:[[@LINE-10]]:1: in import [InImport]
|
||||
// CHECK:STDERR: fail_incomplete_return.carbon:7:23: note: return type declared here [IncompleteReturnTypeHere]
|
||||
// CHECK:STDERR: fail_incomplete_return.carbon:7:20: note: return type declared here [IncompleteReturnTypeHere]
|
||||
// CHECK:STDERR: fn ReturnCUnused() -> C;
|
||||
// CHECK:STDERR: ^
|
||||
// CHECK:STDERR: ^~~~
|
||||
// CHECK:STDERR:
|
||||
ReturnCUnused();
|
||||
// CHECK:STDERR: fail_use_imported.carbon:[[@LINE+12]]:3: error: function returns incomplete type `C` [IncompleteTypeInFunctionReturnType]
|
||||
@@ -79,9 +79,9 @@ fn CallFAndGIncomplete() {
|
||||
// CHECK:STDERR: class C;
|
||||
// CHECK:STDERR: ^~~~~~~~
|
||||
// CHECK:STDERR: fail_use_imported.carbon:[[@LINE-23]]:1: in import [InImport]
|
||||
// CHECK:STDERR: fail_incomplete_return.carbon:8:21: note: return type declared here [IncompleteReturnTypeHere]
|
||||
// CHECK:STDERR: fail_incomplete_return.carbon:8:18: note: return type declared here [IncompleteReturnTypeHere]
|
||||
// CHECK:STDERR: fn ReturnCUsed() -> C;
|
||||
// CHECK:STDERR: ^
|
||||
// CHECK:STDERR: ^~~~
|
||||
// CHECK:STDERR:
|
||||
ReturnCUsed();
|
||||
ReturnDUnused();
|
||||
|
||||
@@ -53,14 +53,14 @@ fn G() {
|
||||
// CHECK:STDOUT: }
|
||||
// CHECK:STDOUT: %Core.import = import Core
|
||||
// CHECK:STDOUT: %F.decl: %F.type = fn_decl @F [concrete = constants.%F] {
|
||||
// CHECK:STDOUT: %.loc4_8.1: %pattern_type.7ce = ref_return_pattern [concrete]
|
||||
// CHECK:STDOUT: %return.patt: %pattern_type.7ce = return_slot_pattern %.loc4_8.1, %i32 [concrete]
|
||||
// CHECK:STDOUT: %.loc4_11.1: %pattern_type.7ce = ref_return_pattern [concrete]
|
||||
// CHECK:STDOUT: %return.patt: %pattern_type.7ce = return_slot_pattern %.loc4_11.1, %i32 [concrete]
|
||||
// CHECK:STDOUT: } {
|
||||
// CHECK:STDOUT: %i32: type = type_literal constants.%i32 [concrete = constants.%i32]
|
||||
// CHECK:STDOUT: %.loc4_11.1: type = ref_tag %i32
|
||||
// CHECK:STDOUT: %.loc4_11.2: Core.Form = ref_form %i32 [concrete = constants.%.1da]
|
||||
// CHECK:STDOUT: %.loc4_8.2: ref %i32 = ref_return
|
||||
// CHECK:STDOUT: %return: ref %i32 = return_slot %.loc4_8.2
|
||||
// CHECK:STDOUT: %.loc4_11.2: type = ref_tag %i32
|
||||
// CHECK:STDOUT: %.loc4_11.3: Core.Form = ref_form %i32 [concrete = constants.%.1da]
|
||||
// CHECK:STDOUT: %.loc4_11.4: ref %i32 = ref_return
|
||||
// CHECK:STDOUT: %return: ref %i32 = return_slot %.loc4_11.4
|
||||
// CHECK:STDOUT: }
|
||||
// CHECK:STDOUT: %G.decl: %G.type = fn_decl @G [concrete = constants.%G] {} {}
|
||||
// CHECK:STDOUT: }
|
||||
|
||||
+6
-6
@@ -636,7 +636,7 @@ fn F() {
|
||||
// CHECK:STDOUT:
|
||||
// CHECK:STDOUT: !definition:
|
||||
// CHECK:STDOUT: %require_complete.loc6_38: <witness> = require_complete_type %T.loc6_28.1 [symbolic = %require_complete.loc6_38 (constants.%require_complete.944)]
|
||||
// CHECK:STDOUT: %require_complete.loc6_47: <witness> = require_complete_type %ptr.loc6_47.1 [symbolic = %require_complete.loc6_47 (constants.%require_complete.ef1)]
|
||||
// CHECK:STDOUT: %require_complete.loc6_43: <witness> = require_complete_type %ptr.loc6_47.1 [symbolic = %require_complete.loc6_43 (constants.%require_complete.ef1)]
|
||||
// CHECK:STDOUT: %ExplicitAndAlsoDeduced.specific_fn.loc7_10.2: <specific function> = specific_function constants.%ExplicitAndAlsoDeduced, @ExplicitAndAlsoDeduced(%T.loc6_28.1) [symbolic = %ExplicitAndAlsoDeduced.specific_fn.loc7_10.2 (constants.%ExplicitAndAlsoDeduced.specific_fn.7e7)]
|
||||
// CHECK:STDOUT:
|
||||
// CHECK:STDOUT: fn(%x.param: @ExplicitAndAlsoDeduced.%T.loc6_28.1 (%T)) -> out %return.param: @ExplicitAndAlsoDeduced.%ptr.loc6_47.1 (%ptr.e8f) {
|
||||
@@ -682,7 +682,7 @@ fn F() {
|
||||
// CHECK:STDOUT:
|
||||
// CHECK:STDOUT: !definition:
|
||||
// CHECK:STDOUT: %require_complete.loc6_38 => constants.%require_complete.944
|
||||
// CHECK:STDOUT: %require_complete.loc6_47 => constants.%require_complete.ef1
|
||||
// CHECK:STDOUT: %require_complete.loc6_43 => constants.%require_complete.ef1
|
||||
// CHECK:STDOUT: %ExplicitAndAlsoDeduced.specific_fn.loc7_10.2 => constants.%ExplicitAndAlsoDeduced.specific_fn.7e7
|
||||
// CHECK:STDOUT: }
|
||||
// CHECK:STDOUT:
|
||||
@@ -695,7 +695,7 @@ fn F() {
|
||||
// CHECK:STDOUT:
|
||||
// CHECK:STDOUT: !definition:
|
||||
// CHECK:STDOUT: %require_complete.loc6_38 => constants.%complete_type.357
|
||||
// CHECK:STDOUT: %require_complete.loc6_47 => constants.%complete_type.8a0
|
||||
// CHECK:STDOUT: %require_complete.loc6_43 => constants.%complete_type.8a0
|
||||
// CHECK:STDOUT: %ExplicitAndAlsoDeduced.specific_fn.loc7_10.2 => constants.%ExplicitAndAlsoDeduced.specific_fn.1f3
|
||||
// CHECK:STDOUT: }
|
||||
// CHECK:STDOUT:
|
||||
@@ -794,7 +794,7 @@ fn F() {
|
||||
// CHECK:STDOUT:
|
||||
// CHECK:STDOUT: !definition:
|
||||
// CHECK:STDOUT: %require_complete.loc4_36: <witness> = require_complete_type %T.loc4_26.1 [symbolic = %require_complete.loc4_36 (constants.%require_complete.944)]
|
||||
// CHECK:STDOUT: %require_complete.loc4_45: <witness> = require_complete_type %ptr.loc4_45.1 [symbolic = %require_complete.loc4_45 (constants.%require_complete.ef1)]
|
||||
// CHECK:STDOUT: %require_complete.loc4_41: <witness> = require_complete_type %ptr.loc4_45.1 [symbolic = %require_complete.loc4_41 (constants.%require_complete.ef1)]
|
||||
// CHECK:STDOUT: %ImplicitGenericParam.specific_fn.loc4_56.2: <specific function> = specific_function constants.%ImplicitGenericParam, @ImplicitGenericParam(%T.loc4_26.1) [symbolic = %ImplicitGenericParam.specific_fn.loc4_56.2 (constants.%ImplicitGenericParam.specific_fn.7cc)]
|
||||
// CHECK:STDOUT:
|
||||
// CHECK:STDOUT: fn(%x.param: @ImplicitGenericParam.%T.loc4_26.1 (%T)) -> out %return.param: @ImplicitGenericParam.%ptr.loc4_45.1 (%ptr.e8f) {
|
||||
@@ -825,7 +825,7 @@ fn F() {
|
||||
// CHECK:STDOUT:
|
||||
// CHECK:STDOUT: !definition:
|
||||
// CHECK:STDOUT: %require_complete.loc4_36 => constants.%require_complete.944
|
||||
// CHECK:STDOUT: %require_complete.loc4_45 => constants.%require_complete.ef1
|
||||
// CHECK:STDOUT: %require_complete.loc4_41 => constants.%require_complete.ef1
|
||||
// CHECK:STDOUT: %ImplicitGenericParam.specific_fn.loc4_56.2 => constants.%ImplicitGenericParam.specific_fn.7cc
|
||||
// CHECK:STDOUT: }
|
||||
// CHECK:STDOUT:
|
||||
@@ -838,7 +838,7 @@ fn F() {
|
||||
// CHECK:STDOUT:
|
||||
// CHECK:STDOUT: !definition:
|
||||
// CHECK:STDOUT: %require_complete.loc4_36 => constants.%complete_type.f8a
|
||||
// CHECK:STDOUT: %require_complete.loc4_45 => constants.%complete_type.3d0
|
||||
// CHECK:STDOUT: %require_complete.loc4_41 => constants.%complete_type.3d0
|
||||
// CHECK:STDOUT: %ImplicitGenericParam.specific_fn.loc4_56.2 => constants.%ImplicitGenericParam.specific_fn.be5
|
||||
// CHECK:STDOUT: }
|
||||
// CHECK:STDOUT:
|
||||
|
||||
@@ -43,12 +43,12 @@ fn CallNegative() {
|
||||
// CHECK:STDOUT: constants {
|
||||
// CHECK:STDOUT: %type: type = facet_type <type> [concrete]
|
||||
// CHECK:STDOUT: %.Self: %type = symbolic_binding .Self [symbolic_self]
|
||||
// CHECK:STDOUT: %empty_tuple.type: type = tuple_type () [concrete]
|
||||
// CHECK:STDOUT: %IntLiteral.type: type = fn_type @IntLiteral [concrete]
|
||||
// CHECK:STDOUT: %IntLiteral: %IntLiteral.type = struct_value () [concrete]
|
||||
// CHECK:STDOUT: %pattern_type.dc0: type = pattern_type Core.IntLiteral [concrete]
|
||||
// CHECK:STDOUT: %N: Core.IntLiteral = symbolic_binding N, 0 [symbolic]
|
||||
// CHECK:STDOUT: %ErrorIfNIsZero.type: type = fn_type @ErrorIfNIsZero [concrete]
|
||||
// CHECK:STDOUT: %empty_tuple.type: type = tuple_type () [concrete]
|
||||
// CHECK:STDOUT: %ErrorIfNIsZero: %ErrorIfNIsZero.type = struct_value () [concrete]
|
||||
// CHECK:STDOUT: %Int.type: type = generic_class_type @Int [concrete]
|
||||
// CHECK:STDOUT: %Int.generic: %Int.type = struct_value () [concrete]
|
||||
|
||||
Reference in New Issue
Block a user