mirror of
https://github.com/carbon-language/carbon-lang.git
synced 2026-10-05 22:02:55 +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:
@@ -184,6 +184,7 @@ auto SemanticsHandleInfixOperator(SemanticsContext& context,
|
||||
context.AddNodeToBlock(rhs_block_id,
|
||||
SemanticsNode::BranchWithArg::Make(
|
||||
parse_node, resume_block_id, rhs_id));
|
||||
context.AddCurrentCodeBlockToFunction();
|
||||
|
||||
// Collect the result from either the first or second operand.
|
||||
context.AddNodeAndPush(
|
||||
@@ -539,6 +540,7 @@ auto SemanticsHandleShortCircuitOperand(SemanticsContext& context,
|
||||
context.AddNodeToBlock(
|
||||
lhs_block_id, SemanticsNode::BranchWithArg::Make(
|
||||
parse_node, end_block_id, short_circuit_result_id));
|
||||
context.AddCurrentCodeBlockToFunction();
|
||||
|
||||
// Put the condition back on the stack for SemanticsHandleInfixOperator.
|
||||
context.node_stack().Push(parse_node, cond_value_id);
|
||||
|
||||
Reference in New Issue
Block a user