aboutsummaryrefslogtreecommitdiffstats
path: root/liblll
diff options
context:
space:
mode:
Diffstat (limited to 'liblll')
-rw-r--r--liblll/Compiler.cpp17
-rw-r--r--liblll/Compiler.h9
2 files changed, 14 insertions, 12 deletions
diff --git a/liblll/Compiler.cpp b/liblll/Compiler.cpp
index 1638f69e..f2c1b0be 100644
--- a/liblll/Compiler.cpp
+++ b/liblll/Compiler.cpp
@@ -19,17 +19,16 @@
* @date 2014
*/
-#include "Compiler.h"
-#include "Parser.h"
-#include "CompilerState.h"
-#include "CodeFragment.h"
+#include <liblll/Compiler.h>
+#include <liblll/Parser.h>
+#include <liblll/CompilerState.h>
+#include <liblll/CodeFragment.h>
using namespace std;
using namespace dev;
using namespace dev::eth;
-
-bytes dev::eth::compileLLL(string const& _src, bool _opt, vector<string>* _errors, ReadCallback const& _readFile)
+bytes dev::eth::compileLLL(string const& _src, dev::solidity::EVMVersion _evmVersion, bool _opt, std::vector<std::string>* _errors, dev::eth::ReadCallback const& _readFile)
{
try
{
@@ -37,7 +36,7 @@ bytes dev::eth::compileLLL(string const& _src, bool _opt, vector<string>* _error
cs.populateStandard();
auto assembly = CodeFragment::compile(_src, cs, _readFile).assembly(cs);
if (_opt)
- assembly = assembly.optimise(true);
+ assembly = assembly.optimise(true, _evmVersion);
bytes ret = assembly.assemble().bytecode;
for (auto i: cs.treesToKill)
killBigints(i);
@@ -67,7 +66,7 @@ bytes dev::eth::compileLLL(string const& _src, bool _opt, vector<string>* _error
return bytes();
}
-std::string dev::eth::compileLLLToAsm(std::string const& _src, bool _opt, std::vector<std::string>* _errors, ReadCallback const& _readFile)
+std::string dev::eth::compileLLLToAsm(std::string const& _src, EVMVersion _evmVersion, bool _opt, std::vector<std::string>* _errors, ReadCallback const& _readFile)
{
try
{
@@ -75,7 +74,7 @@ std::string dev::eth::compileLLLToAsm(std::string const& _src, bool _opt, std::v
cs.populateStandard();
auto assembly = CodeFragment::compile(_src, cs, _readFile).assembly(cs);
if (_opt)
- assembly = assembly.optimise(true);
+ assembly = assembly.optimise(true, _evmVersion);
string ret = assembly.assemblyString();
for (auto i: cs.treesToKill)
killBigints(i);
diff --git a/liblll/Compiler.h b/liblll/Compiler.h
index c3395b66..06440c17 100644
--- a/liblll/Compiler.h
+++ b/liblll/Compiler.h
@@ -21,9 +21,12 @@
#pragma once
+#include <libdevcore/Common.h>
+
+#include <libsolidity/interface/EVMVersion.h>
+
#include <string>
#include <vector>
-#include <libdevcore/Common.h>
namespace dev
{
@@ -33,8 +36,8 @@ namespace eth
using ReadCallback = std::function<std::string(std::string const&)>;
std::string parseLLL(std::string const& _src);
-std::string compileLLLToAsm(std::string const& _src, bool _opt = true, std::vector<std::string>* _errors = nullptr, ReadCallback const& _readFile = ReadCallback());
-bytes compileLLL(std::string const& _src, bool _opt = true, std::vector<std::string>* _errors = nullptr, ReadCallback const& _readFile = ReadCallback());
+std::string compileLLLToAsm(std::string const& _src, solidity::EVMVersion _evmVersion, bool _opt = true, std::vector<std::string>* _errors = nullptr, ReadCallback const& _readFile = ReadCallback());
+bytes compileLLL(std::string const& _src, solidity::EVMVersion _evmVersion, bool _opt = true, std::vector<std::string>* _errors = nullptr, ReadCallback const& _readFile = ReadCallback());
}
}