lll: Adapted to namespace changes.

This commit is contained in:
Christian Parpart 2020-01-06 11:23:58 +01:00 committed by Daniel Kirchner
parent ed45b000d1
commit 8ac6258d31
15 changed files with 40 additions and 72 deletions

View File

@ -40,9 +40,10 @@
using namespace std; using namespace std;
using namespace dev; using namespace solidity;
using namespace dev::eth; using namespace solidity::util;
using namespace dev::lll; using namespace solidity::evmasm;
using namespace solidity::lll;
void CodeFragment::finalise(CompilerState const& _cs) void CodeFragment::finalise(CompilerState const& _cs)
{ {

View File

@ -29,9 +29,7 @@
namespace boost { namespace spirit { class utree; } } namespace boost { namespace spirit { class utree; } }
namespace sp = boost::spirit; namespace sp = boost::spirit;
namespace dev namespace solidity::lll
{
namespace lll
{ {
struct CompilerState; struct CompilerState;
@ -55,7 +53,7 @@ private:
template <class T> static void error() { BOOST_THROW_EXCEPTION(T() ); } template <class T> static void error() { BOOST_THROW_EXCEPTION(T() ); }
template <class T> static void error(std::string const& reason) { template <class T> static void error(std::string const& reason) {
auto err = T(); auto err = T();
err << errinfo_comment(reason); err << util::errinfo_comment(reason);
BOOST_THROW_EXCEPTION(err); BOOST_THROW_EXCEPTION(err);
} }
void constructOperation(sp::utree const& _t, CompilerState& _s); void constructOperation(sp::utree const& _t, CompilerState& _s);
@ -68,4 +66,3 @@ private:
static CodeFragment const NullCodeFragment; static CodeFragment const NullCodeFragment;
} }
}

View File

@ -25,10 +25,11 @@
#include <liblll/CodeFragment.h> #include <liblll/CodeFragment.h>
using namespace std; using namespace std;
using namespace dev; using namespace solidity;
using namespace dev::lll; using namespace solidity::util;
using namespace solidity::lll;
bytes dev::lll::compileLLL(string _src, langutil::EVMVersion _evmVersion, bool _opt, std::vector<std::string>* _errors, ReadCallback const& _readFile) bytes solidity::lll::compileLLL(string _src, langutil::EVMVersion _evmVersion, bool _opt, std::vector<std::string>* _errors, ReadCallback const& _readFile)
{ {
try try
{ {
@ -66,7 +67,7 @@ bytes dev::lll::compileLLL(string _src, langutil::EVMVersion _evmVersion, bool _
return bytes(); return bytes();
} }
std::string dev::lll::compileLLLToAsm(std::string _src, langutil::EVMVersion _evmVersion, bool _opt, std::vector<std::string>* _errors, ReadCallback const& _readFile) std::string solidity::lll::compileLLLToAsm(std::string _src, langutil::EVMVersion _evmVersion, bool _opt, std::vector<std::string>* _errors, ReadCallback const& _readFile)
{ {
try try
{ {
@ -104,7 +105,7 @@ std::string dev::lll::compileLLLToAsm(std::string _src, langutil::EVMVersion _ev
return string(); return string();
} }
string dev::lll::parseLLL(string _src) string solidity::lll::parseLLL(string _src)
{ {
sp::utree o; sp::utree o;

View File

@ -28,9 +28,7 @@
#include <string> #include <string>
#include <vector> #include <vector>
namespace dev namespace solidity::lll
{
namespace lll
{ {
using ReadCallback = std::function<std::string(std::string const&)>; using ReadCallback = std::function<std::string(std::string const&)>;
@ -40,4 +38,3 @@ std::string compileLLLToAsm(std::string _src, langutil::EVMVersion _evmVersion,
bytes compileLLL(std::string _src, langutil::EVMVersion _evmVersion, bool _opt = true, std::vector<std::string>* _errors = nullptr, ReadCallback const& _readFile = ReadCallback()); bytes compileLLL(std::string _src, langutil::EVMVersion _evmVersion, bool _opt = true, std::vector<std::string>* _errors = nullptr, ReadCallback const& _readFile = ReadCallback());
} }
}

View File

@ -23,8 +23,8 @@
#include <liblll/CodeFragment.h> #include <liblll/CodeFragment.h>
using namespace std; using namespace std;
using namespace dev; using namespace solidity;
using namespace dev::lll; using namespace solidity::lll;
CompilerState::CompilerState() CompilerState::CompilerState()
{ {

View File

@ -24,9 +24,7 @@
#include <liblll/CodeFragment.h> #include <liblll/CodeFragment.h>
#include <boost/spirit/include/support_utree.hpp> #include <boost/spirit/include/support_utree.hpp>
namespace dev namespace solidity::lll
{
namespace lll
{ {
struct Macro struct Macro
@ -54,4 +52,3 @@ struct CompilerState
}; };
} }
}

View File

@ -23,13 +23,11 @@
#include <libdevcore/Exceptions.h> #include <libdevcore/Exceptions.h>
namespace dev namespace solidity::lll
{
namespace lll
{ {
/// Compile a Low-level Lisp-like Language program into EVM-code. /// Compile a Low-level Lisp-like Language program into EVM-code.
class CompilerException: public dev::Exception {}; class CompilerException: public util::Exception {};
class InvalidOperation: public CompilerException {}; class InvalidOperation: public CompilerException {};
class IntegerOutOfRange: public CompilerException {}; class IntegerOutOfRange: public CompilerException {};
class EmptyList: public CompilerException {}; class EmptyList: public CompilerException {};
@ -42,4 +40,3 @@ class BareSymbol: public CompilerException {};
class ParserException: public CompilerException {}; class ParserException: public CompilerException {};
} }
}

View File

@ -32,13 +32,14 @@
#include <boost/spirit/include/support_utree.hpp> #include <boost/spirit/include/support_utree.hpp>
using namespace std; using namespace std;
using namespace dev; using namespace solidity;
using namespace dev::lll; using namespace solidity::util;
using namespace solidity::lll;
namespace qi = boost::spirit::qi; namespace qi = boost::spirit::qi;
namespace px = boost::phoenix; namespace px = boost::phoenix;
namespace sp = boost::spirit; namespace sp = boost::spirit;
void dev::lll::killBigints(sp::utree const& _this) void solidity::lll::killBigints(sp::utree const& _this)
{ {
switch (_this.which()) switch (_this.which())
{ {
@ -48,7 +49,7 @@ void dev::lll::killBigints(sp::utree const& _this)
} }
} }
void dev::lll::debugOutAST(ostream& _out, sp::utree const& _this) void solidity::lll::debugOutAST(ostream& _out, sp::utree const& _this)
{ {
switch (_this.which()) switch (_this.which())
{ {
@ -74,7 +75,7 @@ void dev::lll::debugOutAST(ostream& _out, sp::utree const& _this)
} }
} }
namespace dev { namespace solidity {
namespace lll { namespace lll {
namespace parseTreeLLL_ { namespace parseTreeLLL_ {
@ -89,11 +90,11 @@ struct tagNode
}}} }}}
void dev::lll::parseTreeLLL(string const& _s, sp::utree& o_out) void solidity::lll::parseTreeLLL(string const& _s, sp::utree& o_out)
{ {
using qi::standard::space; using qi::standard::space;
using qi::standard::space_type; using qi::standard::space_type;
using dev::lll::parseTreeLLL_::tagNode; using solidity::lll::parseTreeLLL_::tagNode;
using symbol_type = sp::basic_string<std::string, sp::utree_type::symbol_type>; using symbol_type = sp::basic_string<std::string, sp::utree_type::symbol_type>;
using it = string::const_iterator; using it = string::const_iterator;

View File

@ -29,9 +29,7 @@
namespace boost { namespace spirit { class utree; } } namespace boost { namespace spirit { class utree; } }
namespace sp = boost::spirit; namespace sp = boost::spirit;
namespace dev namespace solidity::lll
{
namespace lll
{ {
void killBigints(sp::utree const& _this); void killBigints(sp::utree const& _this);
@ -39,4 +37,3 @@ void parseTreeLLL(std::string const& _s, sp::utree& o_out);
void debugOutAST(std::ostream& _out, sp::utree const& _this); void debugOutAST(std::ostream& _out, sp::utree const& _this);
} }
}

View File

@ -30,8 +30,9 @@
#include <solidity/BuildInfo.h> #include <solidity/BuildInfo.h>
using namespace std; using namespace std;
using namespace dev; using namespace solidity;
using namespace dev::lll; using namespace solidity::util;
using namespace solidity::lll;
static string const VersionString = static string const VersionString =
string(ETH_PROJECT_VERSION) + string(ETH_PROJECT_VERSION) +

View File

@ -29,13 +29,10 @@
#include <memory> #include <memory>
using namespace std; using namespace std;
using namespace solidity::util;
using namespace solidity::test; using namespace solidity::test;
namespace dev namespace solidity::lll::test
{
namespace lll
{
namespace test
{ {
BOOST_FIXTURE_TEST_SUITE(LLLEndToEndTest, LLLExecutionFramework) BOOST_FIXTURE_TEST_SUITE(LLLEndToEndTest, LLLExecutionFramework)
@ -1026,6 +1023,4 @@ BOOST_AUTO_TEST_CASE(string_literal)
BOOST_AUTO_TEST_SUITE_END() BOOST_AUTO_TEST_SUITE_END()
}
}
} // end namespaces } // end namespaces

View File

@ -25,7 +25,7 @@
#include <test/liblll/ExecutionFramework.h> #include <test/liblll/ExecutionFramework.h>
using namespace solidity::test; using namespace solidity::test;
using namespace dev::lll::test; using namespace solidity::lll::test;
LLLExecutionFramework::LLLExecutionFramework() : LLLExecutionFramework::LLLExecutionFramework() :
ExecutionFramework() ExecutionFramework()

View File

@ -28,14 +28,11 @@
#define ACCOUNT(n) h256(account(n), h256::AlignRight) #define ACCOUNT(n) h256(account(n), h256::AlignRight)
using namespace std; using namespace std;
using namespace dev::lll; using namespace solidity::lll;
using namespace solidity::util;
using namespace solidity::test; using namespace solidity::test;
namespace dev namespace solidity::lll::test
{
namespace lll
{
namespace test
{ {
namespace namespace
@ -503,6 +500,4 @@ BOOST_AUTO_TEST_CASE(fallback)
BOOST_AUTO_TEST_SUITE_END() BOOST_AUTO_TEST_SUITE_END()
}
}
} // end namespaces } // end namespaces

View File

@ -33,14 +33,11 @@
#define SUCCESS encodeArgs(1) #define SUCCESS encodeArgs(1)
using namespace std; using namespace std;
using namespace dev::lll; using namespace solidity::lll;
using namespace solidity::util;
using namespace solidity::test; using namespace solidity::test;
namespace dev namespace solidity::lll::test
{
namespace lll
{
namespace test
{ {
namespace namespace
@ -652,6 +649,4 @@ BOOST_AUTO_TEST_CASE(bad_data)
BOOST_AUTO_TEST_SUITE_END() BOOST_AUTO_TEST_SUITE_END()
}
}
} // end namespaces } // end namespaces

View File

@ -27,11 +27,7 @@
using namespace std; using namespace std;
namespace dev namespace solidity::lll::test
{
namespace lll
{
namespace test
{ {
namespace namespace
@ -182,6 +178,4 @@ BOOST_AUTO_TEST_CASE(macro_with_zero_args)
BOOST_AUTO_TEST_SUITE_END() BOOST_AUTO_TEST_SUITE_END()
}
}
} // end namespaces } // end namespaces