Skip to content

Commit a032c72

Browse files
committed
[solc] Enable handling for InputMode::CompilerWithEvmAssemblyJsonImport.
1 parent 1ca002c commit a032c72

File tree

1 file changed

+45
-9
lines changed

1 file changed

+45
-9
lines changed

solc/CommandLineInterface.cpp

Lines changed: 45 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -185,7 +185,11 @@ void CommandLineInterface::handleBinary(string const& _contract)
185185

186186
void CommandLineInterface::handleOpcode(string const& _contract)
187187
{
188-
solAssert(m_options.input.mode == InputMode::Compiler || m_options.input.mode == InputMode::CompilerWithASTImport, "");
188+
solAssert(
189+
m_options.input.mode == InputMode::Compiler ||
190+
m_options.input.mode == InputMode::CompilerWithASTImport ||
191+
m_options.input.mode == InputMode::CompilerWithEvmAssemblyJsonImport , ""
192+
);
189193

190194
if (!m_options.output.dir.empty())
191195
createFile(m_compiler->filesystemFriendlyName(_contract) + ".opcode", evmasm::disassemble(m_compiler->object(_contract).bytecode));
@@ -199,7 +203,11 @@ void CommandLineInterface::handleOpcode(string const& _contract)
199203

200204
void CommandLineInterface::handleIR(string const& _contractName)
201205
{
202-
solAssert(m_options.input.mode == InputMode::Compiler || m_options.input.mode == InputMode::CompilerWithASTImport, "");
206+
solAssert(
207+
m_options.input.mode == InputMode::Compiler ||
208+
m_options.input.mode == InputMode::CompilerWithASTImport ||
209+
m_options.input.mode == InputMode::CompilerWithEvmAssemblyJsonImport , ""
210+
);
203211

204212
if (!m_options.compiler.outputs.ir)
205213
return;
@@ -215,7 +223,11 @@ void CommandLineInterface::handleIR(string const& _contractName)
215223

216224
void CommandLineInterface::handleIROptimized(string const& _contractName)
217225
{
218-
solAssert(m_options.input.mode == InputMode::Compiler || m_options.input.mode == InputMode::CompilerWithASTImport, "");
226+
solAssert(
227+
m_options.input.mode == InputMode::Compiler ||
228+
m_options.input.mode == InputMode::CompilerWithASTImport ||
229+
m_options.input.mode == InputMode::CompilerWithEvmAssemblyJsonImport , ""
230+
);
219231

220232
if (!m_options.compiler.outputs.irOptimized)
221233
return;
@@ -231,7 +243,11 @@ void CommandLineInterface::handleIROptimized(string const& _contractName)
231243

232244
void CommandLineInterface::handleEwasm(string const& _contractName)
233245
{
234-
solAssert(m_options.input.mode == InputMode::Compiler || m_options.input.mode == InputMode::CompilerWithASTImport, "");
246+
solAssert(
247+
m_options.input.mode == InputMode::Compiler ||
248+
m_options.input.mode == InputMode::CompilerWithASTImport ||
249+
m_options.input.mode == InputMode::CompilerWithEvmAssemblyJsonImport , ""
250+
);
235251

236252
if (!m_options.compiler.outputs.ewasm)
237253
return;
@@ -268,7 +284,11 @@ void CommandLineInterface::handleBytecode(string const& _contract)
268284

269285
void CommandLineInterface::handleSignatureHashes(string const& _contract)
270286
{
271-
solAssert(m_options.input.mode == InputMode::Compiler || m_options.input.mode == InputMode::CompilerWithASTImport, "");
287+
solAssert(
288+
m_options.input.mode == InputMode::Compiler ||
289+
m_options.input.mode == InputMode::CompilerWithASTImport ||
290+
m_options.input.mode == InputMode::CompilerWithEvmAssemblyJsonImport , ""
291+
);
272292

273293
if (!m_options.compiler.outputs.signatureHashes)
274294
return;
@@ -286,7 +306,11 @@ void CommandLineInterface::handleSignatureHashes(string const& _contract)
286306

287307
void CommandLineInterface::handleMetadata(string const& _contract)
288308
{
289-
solAssert(m_options.input.mode == InputMode::Compiler || m_options.input.mode == InputMode::CompilerWithASTImport, "");
309+
solAssert(
310+
m_options.input.mode == InputMode::Compiler ||
311+
m_options.input.mode == InputMode::CompilerWithASTImport ||
312+
m_options.input.mode == InputMode::CompilerWithEvmAssemblyJsonImport , ""
313+
);
290314

291315
if (!m_options.compiler.outputs.metadata)
292316
return;
@@ -300,7 +324,11 @@ void CommandLineInterface::handleMetadata(string const& _contract)
300324

301325
void CommandLineInterface::handleABI(string const& _contract)
302326
{
303-
solAssert(m_options.input.mode == InputMode::Compiler || m_options.input.mode == InputMode::CompilerWithASTImport, "");
327+
solAssert(
328+
m_options.input.mode == InputMode::Compiler ||
329+
m_options.input.mode == InputMode::CompilerWithASTImport ||
330+
m_options.input.mode == InputMode::CompilerWithEvmAssemblyJsonImport , ""
331+
);
304332

305333
if (!m_options.compiler.outputs.abi)
306334
return;
@@ -314,7 +342,11 @@ void CommandLineInterface::handleABI(string const& _contract)
314342

315343
void CommandLineInterface::handleStorageLayout(string const& _contract)
316344
{
317-
solAssert(m_options.input.mode == InputMode::Compiler || m_options.input.mode == InputMode::CompilerWithASTImport, "");
345+
solAssert(
346+
m_options.input.mode == InputMode::Compiler ||
347+
m_options.input.mode == InputMode::CompilerWithASTImport ||
348+
m_options.input.mode == InputMode::CompilerWithEvmAssemblyJsonImport , ""
349+
);
318350

319351
if (!m_options.compiler.outputs.storageLayout)
320352
return;
@@ -328,7 +360,11 @@ void CommandLineInterface::handleStorageLayout(string const& _contract)
328360

329361
void CommandLineInterface::handleNatspec(bool _natspecDev, string const& _contract)
330362
{
331-
solAssert(m_options.input.mode == InputMode::Compiler || m_options.input.mode == InputMode::CompilerWithASTImport, "");
363+
solAssert(
364+
m_options.input.mode == InputMode::Compiler ||
365+
m_options.input.mode == InputMode::CompilerWithASTImport ||
366+
m_options.input.mode == InputMode::CompilerWithEvmAssemblyJsonImport , ""
367+
);
332368

333369
bool enabled = false;
334370
std::string suffix;

0 commit comments

Comments
 (0)