| 893 | } |
| 894 | |
| 895 | void CommandLineInterface::assembleFromEVMAssemblyJSON() |
| 896 | { |
| 897 | solAssert(m_options.input.mode == InputMode::EVMAssemblerJSON); |
| 898 | solAssert(!m_assemblyStack); |
| 899 | solAssert(!m_evmAssemblyStack && !m_compiler); |
| 900 | |
| 901 | solAssert(m_fileReader.sourceUnits().size() == 1); |
| 902 | auto&& [sourceUnitName, source] = *m_fileReader.sourceUnits().begin(); |
| 903 | |
| 904 | auto evmAssemblyStack = std::make_unique<evmasm::EVMAssemblyStack>( |
| 905 | m_options.output.evmVersion, |
| 906 | m_options.output.eofVersion, |
| 907 | evmasm::Assembly::OptimiserSettings::translateSettings( |
| 908 | m_options.optimiserSettings() |
| 909 | ) |
| 910 | ); |
| 911 | try |
| 912 | { |
| 913 | evmAssemblyStack->parseAndAnalyze(sourceUnitName, source); |
| 914 | } |
| 915 | catch (evmasm::AssemblyImportException const& _exception) |
| 916 | { |
| 917 | solThrow(CommandLineExecutionError, "Assembly Import Error: "s + _exception.what()); |
| 918 | } |
| 919 | |
| 920 | if (m_options.output.debugInfoSelection.has_value()) |
| 921 | evmAssemblyStack->selectDebugInfo(m_options.output.debugInfoSelection.value()); |
| 922 | evmAssemblyStack->assemble(); |
| 923 | |
| 924 | m_evmAssemblyStack = std::move(evmAssemblyStack); |
| 925 | m_assemblyStack = m_evmAssemblyStack.get(); |
| 926 | } |
| 927 | |
| 928 | void CommandLineInterface::compile() |
| 929 | { |
nothing calls this directly
no test coverage detected