mirror of
https://github.com/carbon-language/carbon-lang.git
synced 2026-10-04 07:51:05 +01:00
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:
@@ -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));
|
||||
|
||||
Reference in New Issue
Block a user