Merge remote-tracking branch 'origin/develop' into develop_060

This commit is contained in:
chriseth
2019-10-28 15:21:49 +01:00
67 changed files with 182 additions and 165 deletions
+2 -4
View File
@@ -704,9 +704,7 @@ void CodeTransform::visitExpression(Expression const& _expression)
void CodeTransform::visitStatements(vector<Statement> const& _statements)
{
// Workaround boost bug:
// https://www.boost.org/doc/libs/1_63_0/libs/optional/doc/html/boost_optional/tutorial/gotchas/false_positive_with__wmaybe_uninitialized.html
boost::optional<AbstractAssembly::LabelID> jumpTarget = boost::make_optional(false, AbstractAssembly::LabelID());
std::optional<AbstractAssembly::LabelID> jumpTarget = std::nullopt;
for (auto const& statement: _statements)
{
@@ -721,7 +719,7 @@ void CodeTransform::visitStatements(vector<Statement> const& _statements)
else if (!functionDefinition && jumpTarget)
{
m_assembly.appendLabel(*jumpTarget);
jumpTarget = boost::none;
jumpTarget = std::nullopt;
}
boost::apply_visitor(*this, statement);
+1 -1
View File
@@ -28,8 +28,8 @@
#include <libyul/AsmScope.h>
#include <boost/variant.hpp>
#include <boost/optional.hpp>
#include <optional>
#include <stack>
namespace langutil
+1 -1
View File
@@ -47,7 +47,7 @@ struct BuiltinContext
struct BuiltinFunctionForEVM: BuiltinFunction
{
boost::optional<dev::eth::Instruction> instruction;
std::optional<dev::eth::Instruction> instruction;
/// Function to generate code for the given function call and append it to the abstract
/// assembly. The fourth parameter is called to visit (and generate code for) the arguments
/// from right to left.
+9 -9
View File
@@ -82,7 +82,7 @@ void WordSizeTransform::operator()(Block& _block)
{
iterateReplacing(
_block.statements,
[&](Statement& _s) -> boost::optional<vector<Statement>>
[&](Statement& _s) -> std::optional<vector<Statement>>
{
if (_s.type() == typeid(VariableDeclaration))
{
@@ -95,7 +95,7 @@ void WordSizeTransform::operator()(Block& _block)
{
if (varDecl.value) visit(*varDecl.value);
rewriteVarDeclList(varDecl.variables);
return boost::none;
return std::nullopt;
}
else if (
varDecl.value->type() == typeid(Identifier) ||
@@ -114,7 +114,7 @@ void WordSizeTransform::operator()(Block& _block)
std::move(newRhs[i])
}
);
return ret;
return {std::move(ret)};
}
else
yulAssert(false, "");
@@ -130,7 +130,7 @@ void WordSizeTransform::operator()(Block& _block)
{
if (assignment.value) visit(*assignment.value);
rewriteIdentifierList(assignment.variableNames);
return boost::none;
return std::nullopt;
}
else if (
assignment.value->type() == typeid(Identifier) ||
@@ -149,7 +149,7 @@ void WordSizeTransform::operator()(Block& _block)
std::move(newRhs[i])
}
);
return ret;
return {std::move(ret)};
}
else
yulAssert(false, "");
@@ -158,7 +158,7 @@ void WordSizeTransform::operator()(Block& _block)
return handleSwitch(boost::get<Switch>(_s));
else
visit(_s);
return boost::none;
return std::nullopt;
}
);
}
@@ -174,7 +174,7 @@ void WordSizeTransform::rewriteVarDeclList(TypedNameList& _nameList)
{
iterateReplacing(
_nameList,
[&](TypedName const& _n) -> boost::optional<TypedNameList>
[&](TypedName const& _n) -> std::optional<TypedNameList>
{
TypedNameList ret;
for (auto newName: generateU64IdentifierNames(_n.name))
@@ -188,7 +188,7 @@ void WordSizeTransform::rewriteIdentifierList(vector<Identifier>& _ids)
{
iterateReplacing(
_ids,
[&](Identifier const& _id) -> boost::optional<vector<Identifier>>
[&](Identifier const& _id) -> std::optional<vector<Identifier>>
{
vector<Identifier> ret;
for (auto newId: m_variableMapping.at(_id.name))
@@ -202,7 +202,7 @@ void WordSizeTransform::rewriteFunctionCallArguments(vector<Expression>& _args)
{
iterateReplacing(
_args,
[&](Expression& _e) -> boost::optional<vector<Expression>>
[&](Expression& _e) -> std::optional<vector<Expression>>
{
return expandValueToVector(_e);
}