aboutsummaryrefslogtreecommitdiffstats
path: root/libyul/backends/evm/EVMObjectCompiler.cpp
diff options
context:
space:
mode:
authorliangdzou <liang.d.zou@gmail.com>2018-09-25 10:47:25 +0800
committerchriseth <chris@ethereum.org>2018-12-10 21:28:56 +0800
commit362648a45042d74da4e631520c0be581902c871b (patch)
treea7f9d5df94b4d9ac8cbbc89e99c6d74d8d080732 /libyul/backends/evm/EVMObjectCompiler.cpp
parent6240d9e72a6f1696d7c37facf805af6ce2352ab2 (diff)
downloaddexon-solidity-362648a45042d74da4e631520c0be581902c871b.tar
dexon-solidity-362648a45042d74da4e631520c0be581902c871b.tar.gz
dexon-solidity-362648a45042d74da4e631520c0be581902c871b.tar.bz2
dexon-solidity-362648a45042d74da4e631520c0be581902c871b.tar.lz
dexon-solidity-362648a45042d74da4e631520c0be581902c871b.tar.xz
dexon-solidity-362648a45042d74da4e631520c0be581902c871b.tar.zst
dexon-solidity-362648a45042d74da4e631520c0be581902c871b.zip
Reuse stack slots in Yul to EVM code generation.
Diffstat (limited to 'libyul/backends/evm/EVMObjectCompiler.cpp')
-rw-r--r--libyul/backends/evm/EVMObjectCompiler.cpp11
1 files changed, 6 insertions, 5 deletions
diff --git a/libyul/backends/evm/EVMObjectCompiler.cpp b/libyul/backends/evm/EVMObjectCompiler.cpp
index e7e8ad99..13d4b756 100644
--- a/libyul/backends/evm/EVMObjectCompiler.cpp
+++ b/libyul/backends/evm/EVMObjectCompiler.cpp
@@ -27,13 +27,13 @@
using namespace yul;
using namespace std;
-void EVMObjectCompiler::compile(Object& _object, AbstractAssembly& _assembly, bool _yul, bool _evm15)
+void EVMObjectCompiler::compile(Object& _object, AbstractAssembly& _assembly, bool _yul, bool _evm15, bool _optimize)
{
EVMObjectCompiler compiler(_assembly, _yul, _evm15);
- compiler.run(_object);
+ compiler.run(_object, _optimize);
}
-void EVMObjectCompiler::run(Object& _object)
+void EVMObjectCompiler::run(Object& _object, bool _optimize)
{
map<YulString, AbstractAssembly::SubID> subIDs;
@@ -42,7 +42,7 @@ void EVMObjectCompiler::run(Object& _object)
{
auto subAssemblyAndID = m_assembly.createSubAssembly();
subIDs[subObject->name] = subAssemblyAndID.second;
- compile(*subObject, *subAssemblyAndID.first, m_yul, m_evm15);
+ compile(*subObject, *subAssemblyAndID.first, m_yul, m_evm15, _optimize);
}
else
{
@@ -51,5 +51,6 @@ void EVMObjectCompiler::run(Object& _object)
}
yulAssert(_object.analysisInfo, "No analysis info.");
- CodeTransform{m_assembly, *_object.analysisInfo, m_yul, m_evm15}(*_object.code);
+ yulAssert(_object.code, "No code.");
+ CodeTransform{m_assembly, *_object.analysisInfo, *_object.code, _optimize, m_yul, m_evm15}(*_object.code);
}