Replace boost::variant by std::variant in libyul

This commit is contained in:
Leonardo Alt
2019-11-19 17:23:18 +01:00
parent 6d85b63f87
commit be849b3c47
75 changed files with 371 additions and 372 deletions
+6 -6
View File
@@ -48,16 +48,16 @@ void LoadResolver::visit(Expression& _e)
if (!dynamic_cast<EVMDialect const*>(&m_dialect))
return;
if (_e.type() == typeid(FunctionCall))
if (holds_alternative<FunctionCall>(_e))
{
FunctionCall const& funCall = boost::get<FunctionCall>(_e);
FunctionCall const& funCall = std::get<FunctionCall>(_e);
if (auto const* builtin = dynamic_cast<EVMDialect const&>(m_dialect).builtin(funCall.functionName.name))
if (builtin->instruction)
tryResolve(_e, *builtin->instruction, funCall.arguments);
}
else if (_e.type() == typeid(FunctionalInstruction))
else if (holds_alternative<FunctionalInstruction>(_e))
{
FunctionalInstruction const& instruction = boost::get<FunctionalInstruction>(_e);
FunctionalInstruction const& instruction = std::get<FunctionalInstruction>(_e);
tryResolve(_e, instruction.instruction, instruction.arguments);
}
}
@@ -68,10 +68,10 @@ void LoadResolver::tryResolve(
vector<Expression> const& _arguments
)
{
if (_arguments.empty() || _arguments.at(0).type() != typeid(Identifier))
if (_arguments.empty() || !holds_alternative<Identifier>(_arguments.at(0)))
return;
YulString key = boost::get<Identifier>(_arguments.at(0)).name;
YulString key = std::get<Identifier>(_arguments.at(0)).name;
if (
_instruction == dev::eth::Instruction::SLOAD &&
m_storage.values.count(key)