aboutsummaryrefslogtreecommitdiffstats
path: root/libevmasm/Instruction.cpp
diff options
context:
space:
mode:
authorDimitry <winsvega@mail.ru>2016-04-02 20:56:43 +0800
committerDimitry <winsvega@mail.ru>2016-04-02 20:56:43 +0800
commit858c41260d4cec26ba38ea3bd2ef71dcede63f7c (patch)
tree8dd03312a5f926f8dd95a4a7f0798c2b6624c1e3 /libevmasm/Instruction.cpp
parentccbd3ff63feb696025c18211c3c93bab47f755b0 (diff)
downloaddexon-solidity-858c41260d4cec26ba38ea3bd2ef71dcede63f7c.tar.gz
dexon-solidity-858c41260d4cec26ba38ea3bd2ef71dcede63f7c.tar.zst
dexon-solidity-858c41260d4cec26ba38ea3bd2ef71dcede63f7c.zip
rename namespace for instruction.h/cpp in libevmasm
Diffstat (limited to 'libevmasm/Instruction.cpp')
-rw-r--r--libevmasm/Instruction.cpp18
1 files changed, 9 insertions, 9 deletions
diff --git a/libevmasm/Instruction.cpp b/libevmasm/Instruction.cpp
index 2703112d..e61b8e64 100644
--- a/libevmasm/Instruction.cpp
+++ b/libevmasm/Instruction.cpp
@@ -19,7 +19,7 @@
* @date 2014
*/
-#include "Instruction.h"
+#include "./Instruction.h"
#include <functional>
#include <libdevcore/Common.h>
@@ -27,9 +27,9 @@
#include <libdevcore/Log.h>
using namespace std;
using namespace dev;
-using namespace dev::eth;
+using namespace dev::solidity;
-const std::map<std::string, Instruction> dev::eth::c_instructions =
+const std::map<std::string, Instruction> dev::solidity::c_instructions =
{
{ "STOP", Instruction::STOP },
{ "ADD", Instruction::ADD },
@@ -297,7 +297,7 @@ static const std::map<Instruction, InstructionInfo> c_instructionInfo =
{ Instruction::SUICIDE, { "SUICIDE", 0, 1, 0, true, ZeroTier } }
};
-void dev::eth::eachInstruction(
+void dev::solidity::eachInstruction(
bytes const& _mem,
function<void(Instruction,u256 const&)> const& _onInstruction
)
@@ -307,7 +307,7 @@ void dev::eth::eachInstruction(
Instruction instr = Instruction(*it);
size_t additional = 0;
if (isValidInstruction(instr))
- additional = instructionInfo(instr).additional;
+ additional = getInstructionInfo(instr).additional;
u256 data;
for (size_t i = 0; i < additional; ++i)
{
@@ -319,7 +319,7 @@ void dev::eth::eachInstruction(
}
}
-string dev::eth::disassemble(bytes const& _mem)
+string dev::solidity::disassemble(bytes const& _mem)
{
stringstream ret;
eachInstruction(_mem, [&](Instruction _instr, u256 const& _data) {
@@ -327,7 +327,7 @@ string dev::eth::disassemble(bytes const& _mem)
ret << "0x" << hex << int(_instr) << " ";
else
{
- InstructionInfo info = instructionInfo(_instr);
+ InstructionInfo info = getInstructionInfo(_instr);
ret << info.name << " ";
if (info.additional)
ret << "0x" << hex << _data << " ";
@@ -336,7 +336,7 @@ string dev::eth::disassemble(bytes const& _mem)
return ret.str();
}
-InstructionInfo dev::eth::instructionInfo(Instruction _inst)
+InstructionInfo dev::solidity::getInstructionInfo(Instruction _inst)
{
try
{
@@ -348,7 +348,7 @@ InstructionInfo dev::eth::instructionInfo(Instruction _inst)
}
}
-bool dev::eth::isValidInstruction(Instruction _inst)
+bool dev::solidity::isValidInstruction(Instruction _inst)
{
return !!c_instructionInfo.count(_inst);
}