mirror of
https://github.com/ethereum/solidity
synced 2023-10-03 13:03:40 +00:00
Replace boost::variant by std::variant in libyul
This commit is contained in:
@@ -37,6 +37,8 @@
|
||||
|
||||
#include <boost/test/unit_test.hpp>
|
||||
|
||||
#include <variant>
|
||||
|
||||
using namespace std;
|
||||
using namespace langutil;
|
||||
using namespace yul;
|
||||
@@ -75,7 +77,7 @@ pair<shared_ptr<Block>, shared_ptr<yul::AsmAnalysisInfo>> yul::test::parse(strin
|
||||
yul::Block yul::test::disambiguate(string const& _source, bool _yul)
|
||||
{
|
||||
auto result = parse(_source, _yul);
|
||||
return boost::get<Block>(Disambiguator(defaultDialect(_yul), *result.second, {})(*result.first));
|
||||
return std::get<Block>(Disambiguator(defaultDialect(_yul), *result.second, {})(*result.first));
|
||||
}
|
||||
|
||||
string yul::test::format(string const& _source, bool _yul)
|
||||
|
||||
@@ -74,6 +74,7 @@
|
||||
#include <boost/algorithm/string.hpp>
|
||||
|
||||
#include <fstream>
|
||||
#include <variant>
|
||||
|
||||
using namespace dev;
|
||||
using namespace langutil;
|
||||
@@ -415,7 +416,7 @@ bool YulOptimizerTest::parse(ostream& _stream, string const& _linePrefix, bool c
|
||||
|
||||
void YulOptimizerTest::disambiguate()
|
||||
{
|
||||
*m_ast = boost::get<Block>(Disambiguator(*m_dialect, *m_analysisInfo)(*m_ast));
|
||||
*m_ast = std::get<Block>(Disambiguator(*m_dialect, *m_analysisInfo)(*m_ast));
|
||||
m_analysisInfo.reset();
|
||||
updateContext();
|
||||
}
|
||||
|
||||
@@ -35,6 +35,7 @@
|
||||
#include <boost/algorithm/cxx11/all_of.hpp>
|
||||
|
||||
#include <ostream>
|
||||
#include <variant>
|
||||
|
||||
using namespace std;
|
||||
using namespace dev;
|
||||
@@ -161,9 +162,9 @@ void Interpreter::operator()(Block const& _block)
|
||||
openScope();
|
||||
// Register functions.
|
||||
for (auto const& statement: _block.statements)
|
||||
if (statement.type() == typeid(FunctionDefinition))
|
||||
if (holds_alternative<FunctionDefinition>(statement))
|
||||
{
|
||||
FunctionDefinition const& funDef = boost::get<FunctionDefinition>(statement);
|
||||
FunctionDefinition const& funDef = std::get<FunctionDefinition>(statement);
|
||||
solAssert(!m_scopes.back().count(funDef.name), "");
|
||||
m_scopes.back().emplace(funDef.name, &funDef);
|
||||
}
|
||||
|
||||
@@ -72,6 +72,7 @@
|
||||
#include <string>
|
||||
#include <sstream>
|
||||
#include <iostream>
|
||||
#include <variant>
|
||||
|
||||
using namespace std;
|
||||
using namespace dev;
|
||||
@@ -131,7 +132,7 @@ public:
|
||||
set<YulString> reservedIdentifiers;
|
||||
if (!disambiguated)
|
||||
{
|
||||
*m_ast = boost::get<yul::Block>(Disambiguator(m_dialect, *m_analysisInfo)(*m_ast));
|
||||
*m_ast = std::get<yul::Block>(Disambiguator(m_dialect, *m_analysisInfo)(*m_ast));
|
||||
m_analysisInfo.reset();
|
||||
m_nameDispenser = make_shared<NameDispenser>(m_dialect, *m_ast, reservedIdentifiers);
|
||||
disambiguated = true;
|
||||
|
||||
Reference in New Issue
Block a user