[solc] Enable handling for InputMode::CompilerWithEvmAssemblyJsonImport.

This commit is contained in:
Alexander Arlt 2021-11-08 19:59:57 -05:00
parent 9a3e248d51
commit 34492b3fe3

View File

@ -185,7 +185,11 @@ void CommandLineInterface::handleBinary(string const& _contract)
void CommandLineInterface::handleOpcode(string const& _contract)
{
solAssert(m_options.input.mode == InputMode::Compiler || m_options.input.mode == InputMode::CompilerWithASTImport, "");
solAssert(
m_options.input.mode == InputMode::Compiler ||
m_options.input.mode == InputMode::CompilerWithASTImport ||
m_options.input.mode == InputMode::CompilerWithEvmAssemblyJsonImport , ""
);
if (!m_options.output.dir.empty())
createFile(m_compiler->filesystemFriendlyName(_contract) + ".opcode", evmasm::disassemble(m_compiler->object(_contract).bytecode));
@ -199,7 +203,11 @@ void CommandLineInterface::handleOpcode(string const& _contract)
void CommandLineInterface::handleIR(string const& _contractName)
{
solAssert(m_options.input.mode == InputMode::Compiler || m_options.input.mode == InputMode::CompilerWithASTImport, "");
solAssert(
m_options.input.mode == InputMode::Compiler ||
m_options.input.mode == InputMode::CompilerWithASTImport ||
m_options.input.mode == InputMode::CompilerWithEvmAssemblyJsonImport , ""
);
if (!m_options.compiler.outputs.ir)
return;
@ -215,7 +223,11 @@ void CommandLineInterface::handleIR(string const& _contractName)
void CommandLineInterface::handleIROptimized(string const& _contractName)
{
solAssert(m_options.input.mode == InputMode::Compiler || m_options.input.mode == InputMode::CompilerWithASTImport, "");
solAssert(
m_options.input.mode == InputMode::Compiler ||
m_options.input.mode == InputMode::CompilerWithASTImport ||
m_options.input.mode == InputMode::CompilerWithEvmAssemblyJsonImport , ""
);
if (!m_options.compiler.outputs.irOptimized)
return;
@ -231,7 +243,11 @@ void CommandLineInterface::handleIROptimized(string const& _contractName)
void CommandLineInterface::handleEwasm(string const& _contractName)
{
solAssert(m_options.input.mode == InputMode::Compiler || m_options.input.mode == InputMode::CompilerWithASTImport, "");
solAssert(
m_options.input.mode == InputMode::Compiler ||
m_options.input.mode == InputMode::CompilerWithASTImport ||
m_options.input.mode == InputMode::CompilerWithEvmAssemblyJsonImport , ""
);
if (!m_options.compiler.outputs.ewasm)
return;
@ -268,7 +284,11 @@ void CommandLineInterface::handleBytecode(string const& _contract)
void CommandLineInterface::handleSignatureHashes(string const& _contract)
{
solAssert(m_options.input.mode == InputMode::Compiler || m_options.input.mode == InputMode::CompilerWithASTImport, "");
solAssert(
m_options.input.mode == InputMode::Compiler ||
m_options.input.mode == InputMode::CompilerWithASTImport ||
m_options.input.mode == InputMode::CompilerWithEvmAssemblyJsonImport , ""
);
if (!m_options.compiler.outputs.signatureHashes)
return;
@ -286,7 +306,11 @@ void CommandLineInterface::handleSignatureHashes(string const& _contract)
void CommandLineInterface::handleMetadata(string const& _contract)
{
solAssert(m_options.input.mode == InputMode::Compiler || m_options.input.mode == InputMode::CompilerWithASTImport, "");
solAssert(
m_options.input.mode == InputMode::Compiler ||
m_options.input.mode == InputMode::CompilerWithASTImport ||
m_options.input.mode == InputMode::CompilerWithEvmAssemblyJsonImport , ""
);
if (!m_options.compiler.outputs.metadata)
return;
@ -300,7 +324,11 @@ void CommandLineInterface::handleMetadata(string const& _contract)
void CommandLineInterface::handleABI(string const& _contract)
{
solAssert(m_options.input.mode == InputMode::Compiler || m_options.input.mode == InputMode::CompilerWithASTImport, "");
solAssert(
m_options.input.mode == InputMode::Compiler ||
m_options.input.mode == InputMode::CompilerWithASTImport ||
m_options.input.mode == InputMode::CompilerWithEvmAssemblyJsonImport , ""
);
if (!m_options.compiler.outputs.abi)
return;
@ -314,7 +342,11 @@ void CommandLineInterface::handleABI(string const& _contract)
void CommandLineInterface::handleStorageLayout(string const& _contract)
{
solAssert(m_options.input.mode == InputMode::Compiler || m_options.input.mode == InputMode::CompilerWithASTImport, "");
solAssert(
m_options.input.mode == InputMode::Compiler ||
m_options.input.mode == InputMode::CompilerWithASTImport ||
m_options.input.mode == InputMode::CompilerWithEvmAssemblyJsonImport , ""
);
if (!m_options.compiler.outputs.storageLayout)
return;
@ -328,7 +360,11 @@ void CommandLineInterface::handleStorageLayout(string const& _contract)
void CommandLineInterface::handleNatspec(bool _natspecDev, string const& _contract)
{
solAssert(m_options.input.mode == InputMode::Compiler || m_options.input.mode == InputMode::CompilerWithASTImport, "");
solAssert(
m_options.input.mode == InputMode::Compiler ||
m_options.input.mode == InputMode::CompilerWithASTImport ||
m_options.input.mode == InputMode::CompilerWithEvmAssemblyJsonImport , ""
);
bool enabled = false;
std::string suffix;