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:
Geoff Romer
2026-01-07 00:54:18 +00:00
committed by GitHub
parent 444c18dfa3
commit 505b1c86b9
225 changed files with 4164 additions and 2583 deletions
+1 -1
View File
@@ -73,7 +73,7 @@ auto Context::VerifyOnFinish() const -> void {
vtable_stack_.VerifyOnFinish();
region_stack_.VerifyOnFinish();
CARBON_CHECK(impl_lookup_stack_.empty());
CARBON_CHECK(return_type_inst_id_ == std::nullopt);
CARBON_CHECK(return_form_expr_ == std::nullopt);
#ifndef NDEBUG
if (auto verify = sem_ir_->Verify(); !verify.ok()) {