Model type expressions as regions (#4698)

This is a precondition for enabling the new pattern-matching subsystem
to support binding patterns that have `if` expressions in the type
position.

---------

Co-authored-by: Richard Smith <richard@metafoo.co.uk>
This commit is contained in:
Geoff Romer
2024-12-19 21:41:06 +00:00
committed by GitHub
co-authored by Richard Smith
parent 95c9634c60
commit a112cbde5c
504 changed files with 5699 additions and 8719 deletions
+3 -3
View File
@@ -21,7 +21,7 @@ auto HandleParseNode(Context& context, Parse::WhileConditionStartId node_id)
// Start emitting the loop header block.
context.inst_block_stack().Push(loop_header_id);
context.AddCurrentCodeBlockToFunction();
context.AddToRegion(loop_header_id, node_id);
context.node_stack().Push(node_id, loop_header_id);
return true;
@@ -42,7 +42,7 @@ auto HandleParseNode(Context& context, Parse::WhileConditionId node_id)
// Start emitting the loop body.
context.inst_block_stack().Push(loop_body_id);
context.AddCurrentCodeBlockToFunction();
context.AddToRegion(loop_body_id, node_id);
context.break_continue_stack().push_back(
{.break_target = loop_exit_id, .continue_target = loop_header_id});
@@ -64,7 +64,7 @@ auto HandleParseNode(Context& context, Parse::WhileStatementId node_id)
// Start emitting the loop exit block.
context.inst_block_stack().Push(loop_exit_id);
context.AddCurrentCodeBlockToFunction();
context.AddToRegion(loop_exit_id, node_id);
return true;
}