yulopti: Fix conflict between 'l' in yulopti and OptimiserSuite and make future conflicts less likely

- OptimizerSuite uses letters so switching to punctuation marks in yulopti should help.
This commit is contained in:
Kamil Śliwak 2020-05-07 17:27:24 +02:00
parent d3d1520870
commit 156bfadad3

View File

@ -154,9 +154,9 @@ public:
} }
map<char, string> const& abbreviationMap = OptimiserSuite::stepAbbreviationToNameMap(); map<char, string> const& abbreviationMap = OptimiserSuite::stepAbbreviationToNameMap();
map<char, string> const& extraOptions = { map<char, string> const& extraOptions = {
{'q', "quit"}, {'#', "quit"},
{'l', "VarNameCleaner"}, {',', "VarNameCleaner"},
{'p', "StackCompressor"}, {';', "StackCompressor"},
}; };
printUsageBanner(abbreviationMap, extraOptions, 4); printUsageBanner(abbreviationMap, extraOptions, 4);
@ -175,14 +175,14 @@ public:
} }
else switch (option) else switch (option)
{ {
case 'q': case '#':
return; return;
case 'l': case ',':
VarNameCleaner::run(context, *m_ast); VarNameCleaner::run(context, *m_ast);
// VarNameCleaner destroys the unique names guarantee of the disambiguator. // VarNameCleaner destroys the unique names guarantee of the disambiguator.
disambiguated = false; disambiguated = false;
break; break;
case 'p': case ';':
{ {
Object obj; Object obj;
obj.code = m_ast; obj.code = m_ast;