aboutsummaryrefslogtreecommitdiffstats
path: root/libsolidity/interface/AssemblyStack.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'libsolidity/interface/AssemblyStack.cpp')
-rw-r--r--libsolidity/interface/AssemblyStack.cpp15
1 files changed, 11 insertions, 4 deletions
diff --git a/libsolidity/interface/AssemblyStack.cpp b/libsolidity/interface/AssemblyStack.cpp
index 347de350..31d9e494 100644
--- a/libsolidity/interface/AssemblyStack.cpp
+++ b/libsolidity/interface/AssemblyStack.cpp
@@ -30,6 +30,9 @@
#include <libevmasm/Assembly.h>
+#include <libjulia/backends/evm/EVMCodeTransform.h>
+#include <libjulia/backends/evm/EVMAssembly.h>
+
using namespace std;
using namespace dev;
using namespace dev::solidity;
@@ -73,7 +76,7 @@ bool AssemblyStack::analyzeParsed()
return m_analysisSuccessful;
}
-eth::LinkerObject AssemblyStack::assemble(Machine _machine)
+eth::LinkerObject AssemblyStack::assemble(Machine _machine) const
{
solAssert(m_analysisSuccessful, "");
solAssert(m_parserResult, "");
@@ -83,11 +86,15 @@ eth::LinkerObject AssemblyStack::assemble(Machine _machine)
{
case Machine::EVM:
{
- auto assembly = assembly::CodeGenerator(m_errorReporter).assemble(*m_parserResult, *m_analysisInfo);
+ auto assembly = assembly::CodeGenerator::assemble(*m_parserResult, *m_analysisInfo);
return assembly.assemble();
}
case Machine::EVM15:
- solUnimplemented("EVM 1.5 backend is not yet implemented.");
+ {
+ julia::EVMAssembly assembly(true);
+ julia::CodeTransform(assembly, *m_analysisInfo, true).run(*m_parserResult);
+ return assembly.finalize();
+ }
case Machine::eWasm:
solUnimplemented("eWasm backend is not yet implemented.");
}
@@ -95,7 +102,7 @@ eth::LinkerObject AssemblyStack::assemble(Machine _machine)
return eth::LinkerObject();
}
-string AssemblyStack::print()
+string AssemblyStack::print() const
{
solAssert(m_parserResult, "");
return assembly::AsmPrinter(m_language == Language::JULIA)(*m_parserResult);