diff options
author | Alex Beregszaszi <alex@rtfs.hu> | 2017-06-14 03:03:32 +0800 |
---|---|---|
committer | chriseth <chris@ethereum.org> | 2017-06-14 22:00:39 +0800 |
commit | a921bd0ae4afbd6eb55d65beb832546971a65dd4 (patch) | |
tree | 936675f4a56e035dcc0e7a263979747dee6f3419 /libsolidity/inlineasm/AsmAnalysis.cpp | |
parent | 494b9dbfaae2b1cf4c4d76e0be457b1e077af30c (diff) | |
download | dexon-solidity-a921bd0ae4afbd6eb55d65beb832546971a65dd4.tar dexon-solidity-a921bd0ae4afbd6eb55d65beb832546971a65dd4.tar.gz dexon-solidity-a921bd0ae4afbd6eb55d65beb832546971a65dd4.tar.bz2 dexon-solidity-a921bd0ae4afbd6eb55d65beb832546971a65dd4.tar.lz dexon-solidity-a921bd0ae4afbd6eb55d65beb832546971a65dd4.tar.xz dexon-solidity-a921bd0ae4afbd6eb55d65beb832546971a65dd4.tar.zst dexon-solidity-a921bd0ae4afbd6eb55d65beb832546971a65dd4.zip |
Display user friendly instruction name
Diffstat (limited to 'libsolidity/inlineasm/AsmAnalysis.cpp')
-rw-r--r-- | libsolidity/inlineasm/AsmAnalysis.cpp | 17 |
1 files changed, 12 insertions, 5 deletions
diff --git a/libsolidity/inlineasm/AsmAnalysis.cpp b/libsolidity/inlineasm/AsmAnalysis.cpp index a3d38cc9..630e0abf 100644 --- a/libsolidity/inlineasm/AsmAnalysis.cpp +++ b/libsolidity/inlineasm/AsmAnalysis.cpp @@ -447,18 +447,25 @@ void AsmAnalyzer::expectValidType(string const& type, SourceLocation const& _loc void AsmAnalyzer::warnOnFutureInstruction(solidity::Instruction _instr, SourceLocation const& _location) { + string instr; switch (_instr) { case solidity::Instruction::CREATE2: + instr = "create2"; + break; case solidity::Instruction::RETURNDATASIZE: + instr = "returndatasize"; + break; case solidity::Instruction::RETURNDATACOPY: - m_errorReporter.warning( - _location, - "The \"" + _instr + "\" instruction is only available after " + - "the Metropolis hard fork. Before that it acts as an invalid instruction." - ); + instr = "returndatacopy"; break; default: 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." + ); } |