New CLI output in assembly mode: --ewasm-ir

This commit is contained in:
Kamil Śliwak
2021-11-04 18:23:11 +01:00
parent affeff18f5
commit 1a19d9a5cf
20 changed files with 73 additions and 42 deletions
+8 -3
View File
@@ -446,15 +446,17 @@ bool CommandLineParser::parseOutputSelection()
{
static auto outputSupported = [](InputMode _mode, string_view _outputName)
{
static set<string> const compilerModeOutputs =
static set<string> const compilerModeOutputs = (
CompilerOutputs::componentMap() |
ranges::views::keys |
ranges::to<set>();
ranges::to<set>()
) - set<string>{CompilerOutputs::componentName(&CompilerOutputs::ewasmIR)};
static set<string> const assemblerModeOutputs = {
CompilerOutputs::componentName(&CompilerOutputs::asm_),
CompilerOutputs::componentName(&CompilerOutputs::binary),
CompilerOutputs::componentName(&CompilerOutputs::irOptimized),
CompilerOutputs::componentName(&CompilerOutputs::ewasm),
CompilerOutputs::componentName(&CompilerOutputs::ewasmIR),
};
switch (_mode)
@@ -487,6 +489,7 @@ bool CommandLineParser::parseOutputSelection()
m_options.compiler.outputs.binary = true;
m_options.compiler.outputs.irOptimized = true;
m_options.compiler.outputs.ewasm = true;
m_options.compiler.outputs.ewasmIR = true;
}
vector<string> unsupportedOutputs;
@@ -709,6 +712,7 @@ General Information)").c_str(),
(CompilerOutputs::componentName(&CompilerOutputs::ir).c_str(), "Intermediate Representation (IR) of all contracts (EXPERIMENTAL).")
(CompilerOutputs::componentName(&CompilerOutputs::irOptimized).c_str(), "Optimized intermediate Representation (IR) of all contracts (EXPERIMENTAL).")
(CompilerOutputs::componentName(&CompilerOutputs::ewasm).c_str(), "Ewasm text representation of all contracts (EXPERIMENTAL).")
(CompilerOutputs::componentName(&CompilerOutputs::ewasmIR).c_str(), "Intermediate representation (IR) converted to a form that can be translated directly into Ewasm text representation (EXPERIMENTAL).")
(CompilerOutputs::componentName(&CompilerOutputs::signatureHashes).c_str(), "Function signature hashes of the contracts.")
(CompilerOutputs::componentName(&CompilerOutputs::natspecUser).c_str(), "Natspec user documentation of all contracts.")
(CompilerOutputs::componentName(&CompilerOutputs::natspecDev).c_str(), "Natspec developer documentation of all contracts.")
@@ -923,11 +927,12 @@ bool CommandLineParser::processArgs()
if (!checkMutuallyExclusive({g_strColor, g_strNoColor}))
return false;
array<string, 8> const conflictingWithStopAfter{
array<string, 9> const conflictingWithStopAfter{
CompilerOutputs::componentName(&CompilerOutputs::binary),
CompilerOutputs::componentName(&CompilerOutputs::ir),
CompilerOutputs::componentName(&CompilerOutputs::irOptimized),
CompilerOutputs::componentName(&CompilerOutputs::ewasm),
CompilerOutputs::componentName(&CompilerOutputs::ewasmIR),
g_strGas,
CompilerOutputs::componentName(&CompilerOutputs::asm_),
CompilerOutputs::componentName(&CompilerOutputs::asmJson),