Remove "using namespace" from header and move Instruction to dev::eth.

This commit is contained in:
chriseth
2019-03-28 13:48:11 +01:00
parent 77b8b4874d
commit 2308904f68
66 changed files with 190 additions and 220 deletions
@@ -92,13 +92,14 @@ void copyZeroExtended(
using u512 = boost::multiprecision::number<boost::multiprecision::cpp_int_backend<512, 256, boost::multiprecision::unsigned_magnitude, boost::multiprecision::unchecked, void>>;
u256 EVMInstructionInterpreter::eval(
solidity::Instruction _instruction,
dev::eth::Instruction _instruction,
vector<u256> const& _arguments
)
{
using dev::solidity::Instruction;
using namespace dev::eth;
using dev::eth::Instruction;
auto info = solidity::instructionInfo(_instruction);
auto info = instructionInfo(_instruction);
yulAssert(size_t(info.args) == _arguments.size(), "");
auto const& arg = _arguments;
@@ -474,9 +475,9 @@ bool EVMInstructionInterpreter::logMemory(bool _write, u256 const& _offset, u256
return false;
}
void EVMInstructionInterpreter::logTrace(solidity::Instruction _instruction, std::vector<u256> const& _arguments, bytes const& _data)
void EVMInstructionInterpreter::logTrace(dev::eth::Instruction _instruction, std::vector<u256> const& _arguments, bytes const& _data)
{
logTrace(solidity::instructionInfo(_instruction).name, _arguments, _data);
logTrace(dev::eth::instructionInfo(_instruction).name, _arguments, _data);
}
void EVMInstructionInterpreter::logTrace(std::string const& _pseudoInstruction, std::vector<u256> const& _arguments, bytes const& _data)
@@ -28,7 +28,7 @@
namespace dev
{
namespace solidity
namespace eth
{
enum class Instruction: uint8_t;
}
@@ -66,7 +66,7 @@ public:
explicit EVMInstructionInterpreter(InterpreterState& _state):
m_state(_state)
{}
dev::u256 eval(dev::solidity::Instruction _instruction, std::vector<dev::u256> const& _arguments);
dev::u256 eval(dev::eth::Instruction _instruction, std::vector<dev::u256> const& _arguments);
private:
/// Record a memory read in the trace. Also updates m_state.msize
@@ -78,7 +78,7 @@ private:
bool logMemory(bool _write, dev::u256 const& _offset, dev::u256 const& _size = 32, dev::bytes const& _data = {});
void logTrace(dev::solidity::Instruction _instruction, std::vector<dev::u256> const& _arguments = {}, dev::bytes const& _data = {});
void logTrace(dev::eth::Instruction _instruction, std::vector<dev::u256> const& _arguments = {}, dev::bytes const& _data = {});
/// Appends a log to the trace representing an instruction or similar operation by string,
/// with arguments and auxiliary data (if nonempty).
void logTrace(std::string const& _pseudoInstruction, std::vector<dev::u256> const& _arguments = {}, dev::bytes const& _data = {});