mirror of
https://github.com/ethereum/solidity
synced 2023-10-03 13:03:40 +00:00
Merge remote-tracking branch 'origin/develop' into develop_060
This commit is contained in:
@@ -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);
|
||||
|
||||
@@ -28,8 +28,8 @@
|
||||
#include <libyul/AsmScope.h>
|
||||
|
||||
#include <boost/variant.hpp>
|
||||
#include <boost/optional.hpp>
|
||||
|
||||
#include <optional>
|
||||
#include <stack>
|
||||
|
||||
namespace langutil
|
||||
|
||||
@@ -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.
|
||||
|
||||
@@ -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);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user