Display user friendly instruction name

This commit is contained in:
Alex Beregszaszi 2017-06-13 20:03:32 +01:00 committed by chriseth
parent 494b9dbfaa
commit a921bd0ae4

View File

@ -447,18 +447,25 @@ void AsmAnalyzer::expectValidType(string const& type, SourceLocation const& _loc
void AsmAnalyzer::warnOnFutureInstruction(solidity::Instruction _instr, SourceLocation const& _location) void AsmAnalyzer::warnOnFutureInstruction(solidity::Instruction _instr, SourceLocation const& _location)
{ {
string instr;
switch (_instr) switch (_instr)
{ {
case solidity::Instruction::CREATE2: case solidity::Instruction::CREATE2:
instr = "create2";
break;
case solidity::Instruction::RETURNDATASIZE: case solidity::Instruction::RETURNDATASIZE:
instr = "returndatasize";
break;
case solidity::Instruction::RETURNDATACOPY: case solidity::Instruction::RETURNDATACOPY:
m_errorReporter.warning( instr = "returndatacopy";
_location,
"The \"" + _instr + "\" instruction is only available after " +
"the Metropolis hard fork. Before that it acts as an invalid instruction."
);
break; break;
default: default:
break; break;
} }
if (!instr.empty())
m_errorReporter.warning(
_location,
"The \"" + instr + "\" instruction is only available after " +
"the Metropolis hard fork. Before that it acts as an invalid instruction."
);
} }