mirror of
https://github.com/carbon-language/carbon-lang.git
synced 2026-10-06 08:44:41 +01:00
Initial support for return forms (#6556)
The main changes here are: - Introducing `InitForm` and `RefForm` to represent initializing and reference forms (the two return forms currently supported by the parser). - Introducing the `FormType` singleton inst to represent their type (i.e. `Core.Form`). - Emitting an inst representing a function's declared return form as part of handling the function signature. The return form inst is currently ignored. Subsequent PRs will expose it in `SemIR::Function` and use it to determine the form of call expressions.
This commit is contained in:
@@ -26,6 +26,7 @@ fn Main() {
|
||||
// CHECK:STDOUT: %empty_struct_type: type = struct_type {} [concrete]
|
||||
// CHECK:STDOUT: %empty_struct: %empty_struct_type = struct_value () [concrete]
|
||||
// CHECK:STDOUT: %pattern_type: type = pattern_type %empty_struct_type [concrete]
|
||||
// CHECK:STDOUT: %.631: form = init_form %empty_struct_type, call_param1 [concrete]
|
||||
// CHECK:STDOUT: %Echo.type: type = fn_type @Echo [concrete]
|
||||
// CHECK:STDOUT: %Echo: %Echo.type = struct_value () [concrete]
|
||||
// CHECK:STDOUT: %Main.type: type = fn_type @Main [concrete]
|
||||
@@ -45,6 +46,7 @@ fn Main() {
|
||||
// CHECK:STDOUT: } {
|
||||
// CHECK:STDOUT: %.loc15_20.1: %empty_struct_type = struct_literal () [concrete = constants.%empty_struct]
|
||||
// CHECK:STDOUT: %.loc15_20.2: type = converted %.loc15_20.1, constants.%empty_struct_type [concrete = constants.%empty_struct_type]
|
||||
// CHECK:STDOUT: %.loc15_20.3: form = init_form %.loc15_20.2, call_param1 [concrete = constants.%.631]
|
||||
// CHECK:STDOUT: %a.param: %empty_struct_type = value_param call_param0
|
||||
// CHECK:STDOUT: %.loc15_13.1: type = splice_block %.loc15_13.3 [concrete = constants.%empty_struct_type] {
|
||||
// CHECK:STDOUT: %.loc15_13.2: %empty_struct_type = struct_literal () [concrete = constants.%empty_struct]
|
||||
|
||||
Reference in New Issue
Block a user