mirror of
https://github.com/carbon-language/carbon-lang.git
synced 2026-10-06 07:34:45 +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:
@@ -426,6 +426,7 @@ class NodeStack {
|
||||
case Parse::NodeKind::IfExprIf:
|
||||
case Parse::NodeKind::ImplicitParamList:
|
||||
case Parse::NodeKind::WhileConditionStart:
|
||||
case Parse::NodeKind::ReturnType:
|
||||
return Id::KindFor<SemIR::InstBlockId>();
|
||||
case Parse::NodeKind::FunctionDefinitionStart:
|
||||
case Parse::NodeKind::BuiltinFunctionDefinitionStart:
|
||||
@@ -446,8 +447,6 @@ class NodeStack {
|
||||
case Parse::NodeKind::DefaultLibrary:
|
||||
case Parse::NodeKind::LibraryName:
|
||||
return Id::KindFor<SemIR::LibraryNameId>();
|
||||
case Parse::NodeKind::ReturnType:
|
||||
return Id::KindFor<SemIR::InstId>();
|
||||
case Parse::NodeKind::AssociatedConstantInitializer:
|
||||
case Parse::NodeKind::AssociatedConstantIntroducer:
|
||||
case Parse::NodeKind::BuiltinName:
|
||||
|
||||
Reference in New Issue
Block a user