Track the list of blocks that form the body of a function. (#2941)

Use that list for lowering in lexical order, instead of rediscovering
the list based on which blocks are referenced as branch targets.
This commit is contained in:
Richard Smith authored and GitHub committed 2023-06-23 08:36:13 -07:00
1 parent 5a90f660b9
commit b908c6e274
61 files changed
+145 -176

No files matched your search

@@ -49,7 +49,7 @@ auto SemanticsHandleFunctionDefinitionStart(SemanticsContext& context,
{.name_id = name_id,
.param_refs_id = param_refs_id,
.return_type_id = return_type_id,
.body_id = context.node_block_stack().PeekForAdd()});
.body_block_ids = {context.node_block_stack().PeekForAdd()}});
auto decl_id = context.AddNodeToBlock(
outer_block,
SemanticsNode::FunctionDeclaration::Make(fn_node, function_id));