mirror of
https://github.com/ethereum/solidity
synced 2023-10-03 13:03:40 +00:00
Fix develop 060 merge
This commit is contained in:
@@ -83,7 +83,7 @@ Json::Value AsmJsonConverter::operator()(Assignment const& _node) const
|
||||
Json::Value ret = createAstNode(_node.location, "YulAssignment");
|
||||
for (auto const& var: _node.variableNames)
|
||||
ret["variableNames"].append((*this)(var));
|
||||
ret["value"] = _node.value ? boost::apply_visitor(*this, *_node.value) : Json::nullValue;
|
||||
ret["value"] = _node.value ? std::visit(*this, *_node.value) : Json::nullValue;
|
||||
return ret;
|
||||
}
|
||||
|
||||
@@ -98,7 +98,7 @@ Json::Value AsmJsonConverter::operator()(FunctionCall const& _node) const
|
||||
Json::Value AsmJsonConverter::operator()(ExpressionStatement const& _node) const
|
||||
{
|
||||
Json::Value ret = createAstNode(_node.location, "YulExpressionStatement");
|
||||
ret["expression"] = boost::apply_visitor(*this, _node.expression);
|
||||
ret["expression"] = std::visit(*this, _node.expression);
|
||||
return ret;
|
||||
}
|
||||
|
||||
@@ -108,7 +108,7 @@ Json::Value AsmJsonConverter::operator()(VariableDeclaration const& _node) const
|
||||
for (auto const& var: _node.variables)
|
||||
ret["variables"].append((*this)(var));
|
||||
|
||||
ret["value"] = _node.value ? boost::apply_visitor(*this, *_node.value) : Json::nullValue;
|
||||
ret["value"] = _node.value ? std::visit(*this, *_node.value) : Json::nullValue;
|
||||
|
||||
return ret;
|
||||
}
|
||||
@@ -130,7 +130,7 @@ Json::Value AsmJsonConverter::operator()(If const& _node) const
|
||||
{
|
||||
solAssert(_node.condition, "Invalid if condition.");
|
||||
Json::Value ret = createAstNode(_node.location, "YulIf");
|
||||
ret["condition"] = boost::apply_visitor(*this, *_node.condition);
|
||||
ret["condition"] = std::visit(*this, *_node.condition);
|
||||
ret["body"] = (*this)(_node.body);
|
||||
return ret;
|
||||
}
|
||||
@@ -139,7 +139,7 @@ Json::Value AsmJsonConverter::operator()(Switch const& _node) const
|
||||
{
|
||||
solAssert(_node.expression, "Invalid expression pointer.");
|
||||
Json::Value ret = createAstNode(_node.location, "YulSwitch");
|
||||
ret["expression"] = boost::apply_visitor(*this, *_node.expression);
|
||||
ret["expression"] = std::visit(*this, *_node.expression);
|
||||
for (auto const& var: _node.cases)
|
||||
ret["cases"].append((*this)(var));
|
||||
return ret;
|
||||
@@ -158,7 +158,7 @@ Json::Value AsmJsonConverter::operator()(ForLoop const& _node) const
|
||||
solAssert(_node.condition, "Invalid for loop condition.");
|
||||
Json::Value ret = createAstNode(_node.location, "YulForLoop");
|
||||
ret["pre"] = (*this)(_node.pre);
|
||||
ret["condition"] = boost::apply_visitor(*this, *_node.condition);
|
||||
ret["condition"] = std::visit(*this, *_node.condition);
|
||||
ret["post"] = (*this)(_node.post);
|
||||
ret["body"] = (*this)(_node.body);
|
||||
return ret;
|
||||
@@ -195,7 +195,7 @@ Json::Value AsmJsonConverter::vectorOfVariantsToJson(vector<T> const& _vec) cons
|
||||
{
|
||||
Json::Value ret{Json::arrayValue};
|
||||
for (auto const& var: _vec)
|
||||
ret.append(boost::apply_visitor(*this, var));
|
||||
ret.append(std::visit(*this, var));
|
||||
|
||||
return ret;
|
||||
}
|
||||
|
||||
@@ -466,11 +466,11 @@ Expression Parser::parseCall(Parser::ElementaryOperation&& _initialOp)
|
||||
FunctionCall ret;
|
||||
if (holds_alternative<Identifier>(_initialOp))
|
||||
{
|
||||
ret.functionName = std::move(boost::get<Identifier>(_initialOp));
|
||||
ret.functionName = std::move(std::get<Identifier>(_initialOp));
|
||||
ret.location = ret.functionName.location;
|
||||
}
|
||||
else if (holds_alternative<FunctionCall>(_initialOp))
|
||||
ret = std::move(boost::get<FunctionCall>(_initialOp));
|
||||
ret = std::move(std::get<FunctionCall>(_initialOp));
|
||||
else
|
||||
fatalParserError(
|
||||
m_dialect.flavour == AsmFlavour::Yul ?
|
||||
|
||||
@@ -139,7 +139,7 @@ void ControlFlowSimplifier::operator()(Block& _block)
|
||||
void ControlFlowSimplifier::operator()(FunctionDefinition& _funDef)
|
||||
{
|
||||
ASTModifier::operator()(_funDef);
|
||||
if (!_funDef.body.statements.empty() && _funDef.body.statements.back().type() == typeid(Leave))
|
||||
if (!_funDef.body.statements.empty() && holds_alternative<Leave>(_funDef.body.statements.back()))
|
||||
_funDef.body.statements.pop_back();
|
||||
}
|
||||
|
||||
|
||||
@@ -158,7 +158,7 @@ TerminationFinder::ControlFlow TerminationFinder::controlFlowKind(Statement cons
|
||||
return ControlFlow::Break;
|
||||
else if (holds_alternative<Continue>(_statement))
|
||||
return ControlFlow::Continue;
|
||||
else if (_statement.type() == typeid(Leave))
|
||||
else if (holds_alternative<Leave>(_statement))
|
||||
return ControlFlow::Leave;
|
||||
else
|
||||
return ControlFlow::FlowOut;
|
||||
|
||||
Reference in New Issue
Block a user