mirror of
https://github.com/ethereum/solidity
synced 2023-10-03 13:03:40 +00:00
tmp
This commit is contained in:
@@ -134,6 +134,21 @@ bool IRGeneratorForStatements::visit(Identifier const& _identifier)
|
||||
return false;
|
||||
}
|
||||
|
||||
void IRGeneratorForStatements::endVisit(Return const& _return)
|
||||
{
|
||||
if (Expression const* value = _return.expression())
|
||||
{
|
||||
solAssert(_return.annotation().functionReturnParameters, "Invalid return parameters pointer.");
|
||||
vector<ASTPointer<VariableDeclaration>> const& returnParameters =
|
||||
_return.annotation().functionReturnParameters->parameters();
|
||||
solAssert(returnParameters.size() == 1, "Returning tuples not yet supported.");
|
||||
m_code << IRNames::localVariable(*returnParameters.front()) << " := " << IRNames::localVariable(*value) << "\n";
|
||||
}
|
||||
|
||||
_return.annotation().functionReturnParameters;
|
||||
m_code << "leave\n";
|
||||
}
|
||||
|
||||
bool IRGeneratorForStatements::visit(FunctionCall const& _functionCall)
|
||||
{
|
||||
for(auto arg: _functionCall.arguments())
|
||||
|
||||
@@ -41,6 +41,8 @@ private:
|
||||
bool visit(FunctionCall const&) override;
|
||||
bool visit(InlineAssembly const& _inlineAssembly) override;
|
||||
bool visit(VariableDeclarationStatement const& _variableDeclarationStatement) override;
|
||||
bool visit(Return const&) override { return true; }
|
||||
void endVisit(Return const& _return) override;
|
||||
/// Default visit will reject all AST nodes that are not explicitly supported.
|
||||
bool visitNode(ASTNode const& _node) override;
|
||||
IRGenerationContext& m_context;
|
||||
|
||||
Reference in New Issue
Block a user