aboutsummaryrefslogtreecommitdiffstats
path: root/Compiler.cpp
diff options
context:
space:
mode:
authorGav Wood <i@gavwood.com>2014-05-28 00:51:10 +0800
committerGav Wood <i@gavwood.com>2014-05-28 00:51:10 +0800
commit1fdb7a1536209409010c6b6a69aedfce03c8372d (patch)
treee7911c2048e7e8db2479564c3b2f4ae3c96b18d8 /Compiler.cpp
parent7476c6884ee22194b7d363c5e5401773d04bf47d (diff)
downloaddexon-solidity-1fdb7a1536209409010c6b6a69aedfce03c8372d.tar
dexon-solidity-1fdb7a1536209409010c6b6a69aedfce03c8372d.tar.gz
dexon-solidity-1fdb7a1536209409010c6b6a69aedfce03c8372d.tar.bz2
dexon-solidity-1fdb7a1536209409010c6b6a69aedfce03c8372d.tar.lz
dexon-solidity-1fdb7a1536209409010c6b6a69aedfce03c8372d.tar.xz
dexon-solidity-1fdb7a1536209409010c6b6a69aedfce03c8372d.tar.zst
dexon-solidity-1fdb7a1536209409010c6b6a69aedfce03c8372d.zip
Pinhole optimise working fairly well...
Diffstat (limited to 'Compiler.cpp')
-rw-r--r--Compiler.cpp14
1 files changed, 10 insertions, 4 deletions
diff --git a/Compiler.cpp b/Compiler.cpp
index 777bb72d..cd326341 100644
--- a/Compiler.cpp
+++ b/Compiler.cpp
@@ -27,12 +27,15 @@
using namespace std;
using namespace eth;
-bytes eth::compileLLL(string const& _src, vector<string>* _errors)
+bytes eth::compileLLL(string const& _src, bool _opt, vector<string>* _errors)
{
try
{
CompilerState cs;
- bytes ret = CodeFragment::compile(_src, cs).code();
+ auto f = CodeFragment::compile(_src, cs);
+ if (_opt)
+ f.optimise();
+ bytes ret = f.code();
for (auto i: cs.treesToKill)
killBigints(i);
return ret;
@@ -50,12 +53,15 @@ bytes eth::compileLLL(string const& _src, vector<string>* _errors)
return bytes();
}
-std::string eth::compileLLLToAsm(std::string const& _src, std::vector<std::string>* _errors)
+std::string eth::compileLLLToAsm(std::string const& _src, bool _opt, std::vector<std::string>* _errors)
{
try
{
CompilerState cs;
- string ret = CodeFragment::compile(_src, cs).assembly();
+ auto f = CodeFragment::compile(_src, cs);
+ if (_opt)
+ f.optimise();
+ string ret = f.assembly();
for (auto i: cs.treesToKill)
killBigints(i);
return ret;