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:
Christian Parpart
2019-01-16 14:58:59 +01:00
parent 778b14de26
commit 065c3c87af
11 changed files with 68 additions and 50 deletions
+2 -2
View File
@@ -39,7 +39,7 @@ void VarDeclInitializer::operator()(Block& _block)
return {};
else if (_varDecl.variables.size() == 1)
{
_varDecl.value = make_shared<Expression>(zero);
_varDecl.value = make_unique<Expression>(zero);
return {};
}
else
@@ -47,7 +47,7 @@ void VarDeclInitializer::operator()(Block& _block)
OptionalStatements ret{vector<Statement>{}};
langutil::SourceLocation loc{std::move(_varDecl.location)};
for (auto& var: _varDecl.variables)
ret->push_back(VariableDeclaration{loc, {std::move(var)}, make_shared<Expression>(zero)});
ret->push_back(VariableDeclaration{loc, {std::move(var)}, make_unique<Expression>(zero)});
return ret;
}
}