Skip to content

Commit 99aa18c

Browse files
committed
Refactor: Only return output.
1 parent 735550b commit 99aa18c

File tree

2 files changed

+12
-12
lines changed

2 files changed

+12
-12
lines changed

libyul/backends/evm/ControlFlowGraphBuilder.cpp

Lines changed: 11 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -176,9 +176,9 @@ StackSlot ControlFlowGraphBuilder::operator()(Expression const& _expression)
176176

177177
StackSlot ControlFlowGraphBuilder::operator()(FunctionCall const& _call)
178178
{
179-
CFG::Operation const& operation = visitFunctionCall(_call);
180-
yulAssert(operation.output.size() == 1, "");
181-
return operation.output.front();
179+
Stack const& output = visitFunctionCall(_call);
180+
yulAssert(output.size() == 1, "");
181+
return output.front();
182182
}
183183

184184
void ControlFlowGraphBuilder::operator()(VariableDeclaration const& _varDecl)
@@ -219,8 +219,8 @@ void ControlFlowGraphBuilder::operator()(ExpressionStatement const& _exprStmt)
219219
yulAssert(m_currentBlock, "");
220220
std::visit(util::GenericVisitor{
221221
[&](FunctionCall const& _call) {
222-
CFG::Operation const& operation = visitFunctionCall(_call);
223-
yulAssert(operation.output.empty(), "");
222+
Stack const& output = visitFunctionCall(_call);
223+
yulAssert(output.empty(), "");
224224
},
225225
[&](auto const&) { yulAssert(false, ""); }
226226
}, _exprStmt.expression);
@@ -418,7 +418,7 @@ void ControlFlowGraphBuilder::operator()(FunctionDefinition const& _function)
418418
}
419419

420420

421-
CFG::Operation const& ControlFlowGraphBuilder::visitFunctionCall(FunctionCall const& _call)
421+
Stack const& ControlFlowGraphBuilder::visitFunctionCall(FunctionCall const& _call)
422422
{
423423
yulAssert(m_scope, "");
424424
yulAssert(m_currentBlock, "");
@@ -439,7 +439,7 @@ CFG::Operation const& ControlFlowGraphBuilder::visitFunctionCall(FunctionCall co
439439
}) | ranges::to<Stack>,
440440
// operation
441441
move(builtinCall)
442-
});
442+
}).output;
443443
}
444444
else
445445
{
@@ -456,17 +456,17 @@ CFG::Operation const& ControlFlowGraphBuilder::visitFunctionCall(FunctionCall co
456456
}) | ranges::to<Stack>,
457457
// operation
458458
CFG::FunctionCall{_call.debugData, function, _call}
459-
});
459+
}).output;
460460
}
461461
}
462462

463463
Stack ControlFlowGraphBuilder::visitAssignmentRightHandSide(Expression const& _expression, size_t _expectedSlotCount)
464464
{
465465
return std::visit(util::GenericVisitor{
466466
[&](FunctionCall const& _call) -> Stack {
467-
CFG::Operation const& operation = visitFunctionCall(_call);
468-
yulAssert(_expectedSlotCount == operation.output.size(), "");
469-
return operation.output;
467+
Stack const& output = visitFunctionCall(_call);
468+
yulAssert(_expectedSlotCount == output.size(), "");
469+
return output;
470470
},
471471
[&](auto const& _identifierOrLiteral) -> Stack {
472472
yulAssert(_expectedSlotCount == 1, "");

libyul/backends/evm/ControlFlowGraphBuilder.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -57,7 +57,7 @@ class ControlFlowGraphBuilder
5757
AsmAnalysisInfo const& _analysisInfo,
5858
Dialect const& _dialect
5959
);
60-
CFG::Operation const& visitFunctionCall(FunctionCall const&);
60+
Stack const& visitFunctionCall(FunctionCall const&);
6161
Stack visitAssignmentRightHandSide(Expression const& _expression, size_t _expectedSlotCount);
6262

6363
Scope::Function const& lookupFunction(YulString _name) const;

0 commit comments

Comments
 (0)