Adapt EVM codegen to new namespace.

This commit is contained in:
chriseth
2017-05-26 15:08:27 +02:00
parent 71b923cc36
commit 261731f7ee
17 changed files with 364 additions and 293 deletions
+9 -9
View File
@@ -35,7 +35,7 @@
#include <libsolidity/interface/StandardCompiler.h>
#include <libsolidity/interface/SourceReferenceFormatter.h>
#include <libsolidity/interface/GasEstimator.h>
#include <libsolidity/interface/MultiBackendAssemblyStack.h>
#include <libsolidity/interface/AssemblyStack.h>
#include <libsolidity/formal/Why3Translator.h>
#include <libevmasm/Instruction.h>
@@ -717,9 +717,9 @@ bool CommandLineInterface::processInput()
{
// switch to assembly mode
m_onlyAssemble = true;
using Input = MultiBackendAssemblyStack::Input;
using Machine = MultiBackendAssemblyStack::Machine;
Input input = m_args.count(g_argJulia) ? Input::JULIA : Input::Assembly;
using Input = AssemblyStack::Language;
using Machine = AssemblyStack::Machine;
Input inputLanguage = m_args.count(g_argJulia) ? Input::JULIA : Input::Assembly;
Machine targetMachine = Machine::EVM;
if (m_args.count(g_argMachine))
{
@@ -736,7 +736,7 @@ bool CommandLineInterface::processInput()
return false;
}
}
return assemble(input, targetMachine);
return assemble(inputLanguage, targetMachine);
}
if (m_args.count(g_argLink))
{
@@ -1023,15 +1023,15 @@ void CommandLineInterface::writeLinkedFiles()
}
bool CommandLineInterface::assemble(
MultiBackendAssemblyStack::Input _input,
MultiBackendAssemblyStack::Machine _targetMachine
AssemblyStack::Language _language,
AssemblyStack::Machine _targetMachine
)
{
bool successful = true;
map<string, MultiBackendAssemblyStack> assemblyStacks;
map<string, AssemblyStack> assemblyStacks;
for (auto const& src: m_sourceCodes)
{
auto& stack = assemblyStacks[src.first] = MultiBackendAssemblyStack(_input, _targetMachine);
auto& stack = assemblyStacks[src.first] = AssemblyStack(_language);
try
{
if (!stack.parseAndAnalyze(src.first, src.second))