aboutsummaryrefslogtreecommitdiffstats
path: root/libyul/backends/evm/EVMObjectCompiler.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'libyul/backends/evm/EVMObjectCompiler.cpp')
-rw-r--r--libyul/backends/evm/EVMObjectCompiler.cpp12
1 files changed, 10 insertions, 2 deletions
diff --git a/libyul/backends/evm/EVMObjectCompiler.cpp b/libyul/backends/evm/EVMObjectCompiler.cpp
index ec849faa..3f7634b2 100644
--- a/libyul/backends/evm/EVMObjectCompiler.cpp
+++ b/libyul/backends/evm/EVMObjectCompiler.cpp
@@ -21,13 +21,15 @@
#include <libyul/backends/evm/EVMObjectCompiler.h>
#include <libyul/backends/evm/EVMCodeTransform.h>
+#include <libyul/backends/evm/EVMDialect.h>
+
#include <libyul/Object.h>
#include <libyul/Exceptions.h>
using namespace yul;
using namespace std;
-void EVMObjectCompiler::compile(Object& _object, AbstractAssembly& _assembly, Dialect const& _dialect, bool _evm15, bool _optimize)
+void EVMObjectCompiler::compile(Object& _object, AbstractAssembly& _assembly, EVMDialect& _dialect, bool _evm15, bool _optimize)
{
EVMObjectCompiler compiler(_assembly, _dialect, _evm15);
compiler.run(_object, _optimize);
@@ -50,7 +52,13 @@ void EVMObjectCompiler::run(Object& _object, bool _optimize)
subIDs[data.name] = m_assembly.appendData(data.data);
}
+ if (m_dialect.providesObjectAccess())
+ {
+ m_dialect.setSubIDs(std::move(subIDs));
+ m_dialect.setCurrentObject(&_object);
+ }
+
yulAssert(_object.analysisInfo, "No analysis info.");
yulAssert(_object.code, "No code.");
- CodeTransform{m_assembly, *_object.analysisInfo, *_object.code, _optimize, m_yul, m_evm15, _optimize}(*_object.code);
+ CodeTransform{m_assembly, *_object.analysisInfo, *_object.code, m_dialect, _optimize, m_evm15}(*_object.code);
}