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
2023-06-23 08:36:13 -07:00
committed by GitHub
parent 5a90f660b9
commit b908c6e274
61 changed files with 145 additions and 176 deletions
@@ -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));