diff options
Diffstat (limited to 'solc/CommandLineInterface.cpp')
-rw-r--r-- | solc/CommandLineInterface.cpp | 31 |
1 files changed, 16 insertions, 15 deletions
diff --git a/solc/CommandLineInterface.cpp b/solc/CommandLineInterface.cpp index 04d6d1a8..8ccb04ee 100644 --- a/solc/CommandLineInterface.cpp +++ b/solc/CommandLineInterface.cpp @@ -748,6 +748,19 @@ bool CommandLineInterface::processInput() if (!parseLibraryOption(library)) return false; + EVMVersion evmVersion; + if (m_args.count(g_strEVMVersion)) + { + string versionOptionStr = m_args[g_strEVMVersion].as<string>(); + boost::optional<EVMVersion> versionOption = EVMVersion::fromString(versionOptionStr); + if (!versionOption) + { + cerr << "Invalid option for --evm-version: " << versionOptionStr << endl; + return false; + } + evmVersion = *versionOption; + } + if (m_args.count(g_argAssemble) || m_args.count(g_argStrictAssembly) || m_args.count(g_argJulia)) { // switch to assembly mode @@ -771,7 +784,7 @@ bool CommandLineInterface::processInput() return false; } } - return assemble(inputLanguage, targetMachine); + return assemble(evmVersion, inputLanguage, targetMachine); } if (m_args.count(g_argLink)) { @@ -782,19 +795,6 @@ bool CommandLineInterface::processInput() m_compiler.reset(new CompilerStack(fileReader)); - EVMVersion evmVersion; - if (m_args.count(g_strEVMVersion)) - { - string versionOptionStr = m_args[g_strEVMVersion].as<string>(); - boost::optional<EVMVersion> versionOption = EVMVersion::fromString(versionOptionStr); - if (!versionOption) - { - cerr << "Invalid option for --evm-version: " << versionOptionStr << endl; - return false; - } - evmVersion = *versionOption; - } - auto scannerFromSourceName = [&](string const& _sourceName) -> solidity::Scanner const& { return m_compiler->scanner(_sourceName); }; SourceReferenceFormatter formatter(cerr, scannerFromSourceName); @@ -1081,6 +1081,7 @@ void CommandLineInterface::writeLinkedFiles() } bool CommandLineInterface::assemble( + EVMVersion _evmVersion, AssemblyStack::Language _language, AssemblyStack::Machine _targetMachine ) @@ -1089,7 +1090,7 @@ bool CommandLineInterface::assemble( map<string, AssemblyStack> assemblyStacks; for (auto const& src: m_sourceCodes) { - auto& stack = assemblyStacks[src.first] = AssemblyStack(_language); + auto& stack = assemblyStacks[src.first] = AssemblyStack(_evmVersion, _language); try { if (!stack.parseAndAnalyze(src.first, src.second)) |