mirror of
https://github.com/ethereum/solidity
synced 2023-10-03 13:03:40 +00:00
libyul: changing some AST members from shared_ptr<> to unique_ptr<>
* Some spaces look a little more verbose now, but that shouln't be a problem as it also should raise readability, too. * This makes some use of return-value-optimizations also.
This commit is contained in:
@@ -181,9 +181,9 @@ vector<Statement> InlineModifier::performInline(Statement& _statement, FunctionC
|
||||
variableReplacements[_existingVariable.name] = newName;
|
||||
VariableDeclaration varDecl{_funCall.location, {{_funCall.location, newName, _existingVariable.type}}, {}};
|
||||
if (_value)
|
||||
varDecl.value = make_shared<Expression>(std::move(*_value));
|
||||
varDecl.value = make_unique<Expression>(std::move(*_value));
|
||||
else
|
||||
varDecl.value = make_shared<Expression>(zero);
|
||||
varDecl.value = make_unique<Expression>(zero);
|
||||
newStatements.emplace_back(std::move(varDecl));
|
||||
};
|
||||
|
||||
@@ -202,7 +202,7 @@ vector<Statement> InlineModifier::performInline(Statement& _statement, FunctionC
|
||||
newStatements.emplace_back(Assignment{
|
||||
_assignment.location,
|
||||
{_assignment.variableNames[i]},
|
||||
make_shared<Expression>(Identifier{
|
||||
make_unique<Expression>(Identifier{
|
||||
_assignment.location,
|
||||
variableReplacements.at(function->returnVariables[i].name)
|
||||
})
|
||||
@@ -214,7 +214,7 @@ vector<Statement> InlineModifier::performInline(Statement& _statement, FunctionC
|
||||
newStatements.emplace_back(VariableDeclaration{
|
||||
_varDecl.location,
|
||||
{std::move(_varDecl.variables[i])},
|
||||
make_shared<Expression>(Identifier{
|
||||
make_unique<Expression>(Identifier{
|
||||
_varDecl.location,
|
||||
variableReplacements.at(function->returnVariables[i].name)
|
||||
})
|
||||
@@ -232,10 +232,10 @@ Statement BodyCopier::operator()(VariableDeclaration const& _varDecl)
|
||||
return ASTCopier::operator()(_varDecl);
|
||||
}
|
||||
|
||||
Statement BodyCopier::operator()(FunctionDefinition const& _funDef)
|
||||
Statement BodyCopier::operator()(FunctionDefinition const&)
|
||||
{
|
||||
assertThrow(false, OptimizerException, "Function hoisting has to be done before function inlining.");
|
||||
return _funDef;
|
||||
return {};
|
||||
}
|
||||
|
||||
YulString BodyCopier::translateIdentifier(YulString _name)
|
||||
|
||||
Reference in New Issue
Block a user