aboutsummaryrefslogtreecommitdiffstats
path: root/liblll
diff options
context:
space:
mode:
authorchriseth <chris@ethereum.org>2018-12-20 01:06:13 +0800
committerGitHub <noreply@github.com>2018-12-20 01:06:13 +0800
commit1df8f40cd2fd7b47698d847907b8ca7b47eb488d (patch)
tree5ed5816fe2d1a8a207e750d39884aca7957c8289 /liblll
parentc8a2cb62832afb2dc09ccee6fd42c1516dfdb981 (diff)
parentddf54b21d1d002903624f61173ab4af197f50053 (diff)
downloaddexon-solidity-1df8f40cd2fd7b47698d847907b8ca7b47eb488d.tar
dexon-solidity-1df8f40cd2fd7b47698d847907b8ca7b47eb488d.tar.gz
dexon-solidity-1df8f40cd2fd7b47698d847907b8ca7b47eb488d.tar.bz2
dexon-solidity-1df8f40cd2fd7b47698d847907b8ca7b47eb488d.tar.lz
dexon-solidity-1df8f40cd2fd7b47698d847907b8ca7b47eb488d.tar.xz
dexon-solidity-1df8f40cd2fd7b47698d847907b8ca7b47eb488d.tar.zst
dexon-solidity-1df8f40cd2fd7b47698d847907b8ca7b47eb488d.zip
Merge pull request #5697 from ethereum/develop
Merge develop into release for 0.5.2
Diffstat (limited to 'liblll')
-rw-r--r--liblll/CMakeLists.txt5
-rw-r--r--liblll/CodeFragment.cpp6
-rw-r--r--liblll/CodeFragment.h2
-rw-r--r--liblll/Compiler.cpp20
4 files changed, 19 insertions, 14 deletions
diff --git a/liblll/CMakeLists.txt b/liblll/CMakeLists.txt
index 9566c62f..c529461b 100644
--- a/liblll/CMakeLists.txt
+++ b/liblll/CMakeLists.txt
@@ -1,8 +1,13 @@
set(sources
CodeFragment.cpp
+ CodeFragment.h
Compiler.cpp
+ Compiler.h
CompilerState.cpp
+ CompilerState.h
+ Exceptions.h
Parser.cpp
+ Parser.h
)
add_library(lll ${sources})
diff --git a/liblll/CodeFragment.cpp b/liblll/CodeFragment.cpp
index b32f14e9..63d8da3d 100644
--- a/liblll/CodeFragment.cpp
+++ b/liblll/CodeFragment.cpp
@@ -353,7 +353,7 @@ void CodeFragment::constructOperation(sp::utree const& _t, CompilerState& _s)
if (j.tag() || j.which() != sp::utree_type::symbol_type)
error<InvalidMacroArgs>();
auto sr = j.get<sp::basic_string<boost::iterator_range<char const*>, sp::utree_type::symbol_type>>();
- args.push_back(string(sr.begin(), sr.end()));
+ args.emplace_back(sr.begin(), sr.end());
}
else if (ii == 3)
{
@@ -464,9 +464,9 @@ void CodeFragment::constructOperation(sp::utree const& _t, CompilerState& _s)
if (c++)
{
if (us == "LLL" && c == 1)
- code.push_back(CodeFragment(i, ns, m_readFile));
+ code.emplace_back(i, ns, m_readFile);
else
- code.push_back(CodeFragment(i, _s, m_readFile));
+ code.emplace_back(i, _s, m_readFile);
}
auto requireSize = [&](unsigned s) { if (code.size() != s) error<IncorrectParameterCount>(us); };
auto requireMinSize = [&](unsigned s) { if (code.size() < s) error<IncorrectParameterCount>(us); };
diff --git a/liblll/CodeFragment.h b/liblll/CodeFragment.h
index e6e4d3b6..5c2f49a6 100644
--- a/liblll/CodeFragment.h
+++ b/liblll/CodeFragment.h
@@ -41,7 +41,7 @@ class CodeFragment
public:
using ReadCallback = std::function<std::string(std::string const&)>;
- CodeFragment() {}
+ CodeFragment() = default;
CodeFragment(sp::utree const& _t, CompilerState& _s, ReadCallback const& _readFile, bool _allowASM = false);
static CodeFragment compile(std::string const& _src, CompilerState& _s, ReadCallback const& _readFile);
diff --git a/liblll/Compiler.cpp b/liblll/Compiler.cpp
index f944adbd..6296cbcf 100644
--- a/liblll/Compiler.cpp
+++ b/liblll/Compiler.cpp
@@ -46,22 +46,22 @@ bytes dev::lll::compileLLL(string const& _src, dev::solidity::EVMVersion _evmVer
{
if (_errors)
{
- _errors->push_back("Parse error.");
- _errors->push_back(boost::diagnostic_information(_e));
+ _errors->emplace_back("Parse error.");
+ _errors->emplace_back(boost::diagnostic_information(_e));
}
}
catch (std::exception const& _e)
{
if (_errors)
{
- _errors->push_back("Parse exception.");
- _errors->push_back(boost::diagnostic_information(_e));
+ _errors->emplace_back("Parse exception.");
+ _errors->emplace_back(boost::diagnostic_information(_e));
}
}
catch (...)
{
if (_errors)
- _errors->push_back("Internal compiler exception.");
+ _errors->emplace_back("Internal compiler exception.");
}
return bytes();
}
@@ -84,22 +84,22 @@ std::string dev::lll::compileLLLToAsm(std::string const& _src, EVMVersion _evmVe
{
if (_errors)
{
- _errors->push_back("Parse error.");
- _errors->push_back(boost::diagnostic_information(_e));
+ _errors->emplace_back("Parse error.");
+ _errors->emplace_back(boost::diagnostic_information(_e));
}
}
catch (std::exception const& _e)
{
if (_errors)
{
- _errors->push_back("Parse exception.");
- _errors->push_back(boost::diagnostic_information(_e));
+ _errors->emplace_back("Parse exception.");
+ _errors->emplace_back(boost::diagnostic_information(_e));
}
}
catch (...)
{
if (_errors)
- _errors->push_back("Internal compiler exception.");
+ _errors->emplace_back("Internal compiler exception.");
}
return string();
}