MCPcopy Create free account
hub / github.com/argotorg/solidity / assembleFromEVMAssemblyJSON

Method assembleFromEVMAssemblyJSON

solc/CommandLineInterface.cpp:895–926  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

893}
894
895void 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
928void CommandLineInterface::compile()
929{

Callers

nothing calls this directly

Calls 9

optimiserSettingsMethod · 0.80
whatMethod · 0.80
sizeMethod · 0.45
beginMethod · 0.45
parseAndAnalyzeMethod · 0.45
selectDebugInfoMethod · 0.45
valueMethod · 0.45
assembleMethod · 0.45
getMethod · 0.45

Tested by

no test coverage detected