aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorDimitry <dimitry@ethdev.com>2016-04-04 19:27:09 +0800
committerDimitry <dimitry@ethdev.com>2016-04-04 19:27:09 +0800
commitd43d4347bf1e37bb8f114c9df0e2ae62545fbc87 (patch)
tree2f8ee0e7ff5c349f42391689796ab8930d0fe1ff
parent98165100658bc4f29e6194f0c5ede6e5b9d516f5 (diff)
downloaddexon-solidity-d43d4347bf1e37bb8f114c9df0e2ae62545fbc87.tar
dexon-solidity-d43d4347bf1e37bb8f114c9df0e2ae62545fbc87.tar.gz
dexon-solidity-d43d4347bf1e37bb8f114c9df0e2ae62545fbc87.tar.bz2
dexon-solidity-d43d4347bf1e37bb8f114c9df0e2ae62545fbc87.tar.lz
dexon-solidity-d43d4347bf1e37bb8f114c9df0e2ae62545fbc87.tar.xz
dexon-solidity-d43d4347bf1e37bb8f114c9df0e2ae62545fbc87.tar.zst
dexon-solidity-d43d4347bf1e37bb8f114c9df0e2ae62545fbc87.zip
return instructionInfo style
-rw-r--r--libevmasm/Assembly.cpp4
-rw-r--r--libevmasm/AssemblyItem.cpp4
-rw-r--r--libevmasm/CommonSubexpressionEliminator.cpp4
-rw-r--r--libevmasm/ExpressionClasses.cpp2
-rw-r--r--libevmasm/GasMeter.cpp2
-rw-r--r--libevmasm/Instruction.cpp6
-rw-r--r--libevmasm/Instruction.h2
-rw-r--r--libevmasm/KnownState.cpp2
-rw-r--r--libevmasm/SemanticInformation.cpp2
-rw-r--r--liblll/CodeFragment.cpp2
-rw-r--r--libsolidity/inlineasm/AsmParser.cpp4
11 files changed, 17 insertions, 17 deletions
diff --git a/libevmasm/Assembly.cpp b/libevmasm/Assembly.cpp
index 89159412..7277865e 100644
--- a/libevmasm/Assembly.cpp
+++ b/libevmasm/Assembly.cpp
@@ -121,7 +121,7 @@ ostream& Assembly::streamAsm(ostream& _out, string const& _prefix, StringMap con
switch (i.type())
{
case Operation:
- _out << " " << getInstructionInfo(i.instruction()).name << "\t" << i.getJumpTypeAsString();
+ _out << " " << instructionInfo(i.instruction()).name << "\t" << i.getJumpTypeAsString();
break;
case Push:
_out << " PUSH " << hex << i.data();
@@ -205,7 +205,7 @@ Json::Value Assembly::streamAsmJson(ostream& _out, StringMap const& _sourceCodes
{
case Operation:
collection.append(
- createJsonValue(getInstructionInfo(i.instruction()).name, i.location().start, i.location().end, i.getJumpTypeAsString()));
+ createJsonValue(instructionInfo(i.instruction()).name, i.location().start, i.location().end, i.getJumpTypeAsString()));
break;
case Push:
collection.append(
diff --git a/libevmasm/AssemblyItem.cpp b/libevmasm/AssemblyItem.cpp
index 2bdc6391..599ded85 100644
--- a/libevmasm/AssemblyItem.cpp
+++ b/libevmasm/AssemblyItem.cpp
@@ -57,7 +57,7 @@ int AssemblyItem::deposit() const
switch (m_type)
{
case Operation:
- return getInstructionInfo(instruction()).ret - getInstructionInfo(instruction()).args;
+ return instructionInfo(instruction()).ret - instructionInfo(instruction()).args;
case Push:
case PushString:
case PushTag:
@@ -93,7 +93,7 @@ ostream& dev::eth::operator<<(ostream& _out, AssemblyItem const& _item)
switch (_item.type())
{
case Operation:
- _out << " " << getInstructionInfo(_item.instruction()).name;
+ _out << " " << instructionInfo(_item.instruction()).name;
if (_item.instruction() == solidity::Instruction::JUMP || _item.instruction() == solidity::Instruction::JUMPI)
_out << "\t" << _item.getJumpTypeAsString();
break;
diff --git a/libevmasm/CommonSubexpressionEliminator.cpp b/libevmasm/CommonSubexpressionEliminator.cpp
index 80fc100c..0797dd29 100644
--- a/libevmasm/CommonSubexpressionEliminator.cpp
+++ b/libevmasm/CommonSubexpressionEliminator.cpp
@@ -399,7 +399,7 @@ void CSECodeGenerator::generateClassElement(Id _c, bool _allowSequenced)
m_stack.erase(m_stackHeight - i);
}
appendItem(*expr.item);
- if (expr.item->type() != Operation || getInstructionInfo(expr.item->instruction()).ret == 1)
+ if (expr.item->type() != Operation || instructionInfo(expr.item->instruction()).ret == 1)
{
m_stack[m_stackHeight] = _c;
m_classPositions[_c].insert(m_stackHeight);
@@ -407,7 +407,7 @@ void CSECodeGenerator::generateClassElement(Id _c, bool _allowSequenced)
else
{
assertThrow(
- getInstructionInfo(expr.item->instruction()).ret == 0,
+ instructionInfo(expr.item->instruction()).ret == 0,
OptimizerException,
"Invalid number of return values."
);
diff --git a/libevmasm/ExpressionClasses.cpp b/libevmasm/ExpressionClasses.cpp
index 804ec947..9d13a57a 100644
--- a/libevmasm/ExpressionClasses.cpp
+++ b/libevmasm/ExpressionClasses.cpp
@@ -435,7 +435,7 @@ string Pattern::toString() const
switch (m_type)
{
case Operation:
- s << getInstructionInfo(Instruction(unsigned(m_data))).name;
+ s << instructionInfo(Instruction(unsigned(m_data))).name;
break;
case Push:
s << "PUSH " << hex << m_data;
diff --git a/libevmasm/GasMeter.cpp b/libevmasm/GasMeter.cpp
index d57fc351..eab3037b 100644
--- a/libevmasm/GasMeter.cpp
+++ b/libevmasm/GasMeter.cpp
@@ -209,7 +209,7 @@ u256 GasMeter::runGas(Instruction _instruction, EVMSchedule const& _es)
if (_instruction == Instruction::JUMPDEST)
return 1;
- int tier = getInstructionInfo(_instruction).gasPriceTier;
+ int tier = instructionInfo(_instruction).gasPriceTier;
assertThrow(tier != InvalidTier, OptimizerException, "Invalid gas tier.");
return _es.tierStepGas[tier];
}
diff --git a/libevmasm/Instruction.cpp b/libevmasm/Instruction.cpp
index e61b8e64..da765c41 100644
--- a/libevmasm/Instruction.cpp
+++ b/libevmasm/Instruction.cpp
@@ -307,7 +307,7 @@ void dev::solidity::eachInstruction(
Instruction instr = Instruction(*it);
size_t additional = 0;
if (isValidInstruction(instr))
- additional = getInstructionInfo(instr).additional;
+ additional = instructionInfo(instr).additional;
u256 data;
for (size_t i = 0; i < additional; ++i)
{
@@ -327,7 +327,7 @@ string dev::solidity::disassemble(bytes const& _mem)
ret << "0x" << hex << int(_instr) << " ";
else
{
- InstructionInfo info = getInstructionInfo(_instr);
+ InstructionInfo info = instructionInfo(_instr);
ret << info.name << " ";
if (info.additional)
ret << "0x" << hex << _data << " ";
@@ -336,7 +336,7 @@ string dev::solidity::disassemble(bytes const& _mem)
return ret.str();
}
-InstructionInfo dev::solidity::getInstructionInfo(Instruction _inst)
+InstructionInfo dev::solidity::instructionInfo(Instruction _inst)
{
try
{
diff --git a/libevmasm/Instruction.h b/libevmasm/Instruction.h
index ff94569c..0b06a677 100644
--- a/libevmasm/Instruction.h
+++ b/libevmasm/Instruction.h
@@ -250,7 +250,7 @@ struct InstructionInfo
};
/// Information on all the instructions.
-InstructionInfo getInstructionInfo(Instruction _inst);
+InstructionInfo instructionInfo(Instruction _inst);
/// check whether instructions exists
bool isValidInstruction(Instruction _inst);
diff --git a/libevmasm/KnownState.cpp b/libevmasm/KnownState.cpp
index 100598a7..dd269ff4 100644
--- a/libevmasm/KnownState.cpp
+++ b/libevmasm/KnownState.cpp
@@ -101,7 +101,7 @@ KnownState::StoreOperation KnownState::feedItem(AssemblyItem const& _item, bool
else
{
Instruction instruction = _item.instruction();
- InstructionInfo info = getInstructionInfo(instruction);
+ InstructionInfo info = instructionInfo(instruction);
if (SemanticInformation::isDupInstruction(_item))
setStackElement(
m_stackHeight + 1,
diff --git a/libevmasm/SemanticInformation.cpp b/libevmasm/SemanticInformation.cpp
index 0c0a6e6b..13d77876 100644
--- a/libevmasm/SemanticInformation.cpp
+++ b/libevmasm/SemanticInformation.cpp
@@ -53,7 +53,7 @@ bool SemanticInformation::breaksCSEAnalysisBlock(AssemblyItem const& _item)
return true; // GAS and PC assume a specific order of opcodes
if (_item.instruction() == Instruction::MSIZE)
return true; // msize is modified already by memory access, avoid that for now
- InstructionInfo info = getInstructionInfo(_item.instruction());
+ InstructionInfo info = instructionInfo(_item.instruction());
if (_item.instruction() == Instruction::SSTORE)
return false;
if (_item.instruction() == Instruction::MSTORE)
diff --git a/liblll/CodeFragment.cpp b/liblll/CodeFragment.cpp
index 87643ec1..7998a5b5 100644
--- a/liblll/CodeFragment.cpp
+++ b/liblll/CodeFragment.cpp
@@ -375,7 +375,7 @@ void CodeFragment::constructOperation(sp::utree const& _t, CompilerState& _s)
else if (c_instructions.count(us))
{
auto it = c_instructions.find(us);
- int ea = getInstructionInfo(it->second).args;
+ int ea = instructionInfo(it->second).args;
if (ea >= 0)
requireSize(ea);
else
diff --git a/libsolidity/inlineasm/AsmParser.cpp b/libsolidity/inlineasm/AsmParser.cpp
index ae63598d..68050733 100644
--- a/libsolidity/inlineasm/AsmParser.cpp
+++ b/libsolidity/inlineasm/AsmParser.cpp
@@ -154,7 +154,7 @@ assembly::Statement Parser::parseElementaryOperation(bool _onlySinglePusher)
dev::solidity::Instruction const& instr = s_instructions[literal];
if (_onlySinglePusher)
{
- InstructionInfo info = dev::solidity::getInstructionInfo(instr);
+ InstructionInfo info = dev::solidity::instructionInfo(instr);
if (info.ret != 1)
fatalParserError("Instruction " + info.name + " not allowed in this context.");
}
@@ -200,7 +200,7 @@ FunctionalInstruction Parser::parseFunctionalInstruction(assembly::Statement con
if (_instruction.type() != typeid(Instruction))
fatalParserError("Assembly instruction required in front of \"(\")");
solidity::Instruction instr = boost::get<solidity::assembly::Instruction>(_instruction).instruction;
- InstructionInfo instrInfo = getInstructionInfo(instr);
+ InstructionInfo instrInfo = instructionInfo(instr);
if (solidity::Instruction::DUP1 <= instr && instr <= solidity::Instruction::DUP16)
fatalParserError("DUPi instructions not allowed for functional notation");
if (solidity::Instruction::SWAP1 <= instr && instr <= solidity::Instruction::SWAP16)