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
+7 -6
View File
@@ -32,6 +32,7 @@
#include <boost/range/adaptor/reversed.hpp>
#include <boost/range/algorithm_ext/erase.hpp>
#include <variant>
using namespace std;
using namespace dev;
@@ -364,19 +365,19 @@ std::optional<pair<YulString, YulString>> DataFlowAnalyzer::isSimpleStore(
_store == dev::eth::Instruction::SSTORE,
""
);
if (_statement.expression.type() == typeid(FunctionCall))
if (holds_alternative<FunctionCall>(_statement.expression))
{
FunctionCall const& funCall = boost::get<FunctionCall>(_statement.expression);
FunctionCall const& funCall = std::get<FunctionCall>(_statement.expression);
if (EVMDialect const* dialect = dynamic_cast<EVMDialect const*>(&m_dialect))
if (auto const* builtin = dialect->builtin(funCall.functionName.name))
if (builtin->instruction == _store)
if (
funCall.arguments.at(0).type() == typeid(Identifier) &&
funCall.arguments.at(1).type() == typeid(Identifier)
holds_alternative<Identifier>(funCall.arguments.at(0)) &&
holds_alternative<Identifier>(funCall.arguments.at(1))
)
{
YulString key = boost::get<Identifier>(funCall.arguments.at(0)).name;
YulString value = boost::get<Identifier>(funCall.arguments.at(1)).name;
YulString key = std::get<Identifier>(funCall.arguments.at(0)).name;
YulString value = std::get<Identifier>(funCall.arguments.at(1)).name;
return make_pair(key, value);
}
}