mirror of
https://github.com/ethereum/go-ethereum.git
synced 2026-07-22 04:36:42 +00:00
Improve Compiler code formatting
This commit is contained in:
parent
f06445fcbb
commit
e24c9c2286
1 changed files with 20 additions and 20 deletions
|
|
@ -120,7 +120,7 @@ void Compiler::createBasicBlocks(bytesConstRef bytecode)
|
||||||
}
|
}
|
||||||
|
|
||||||
// Remove split points generated from jumps out of code or into data.
|
// Remove split points generated from jumps out of code or into data.
|
||||||
for (auto it = splitPoints.cbegin(); it != splitPoints.cend(); )
|
for (auto it = splitPoints.cbegin(); it != splitPoints.cend();)
|
||||||
{
|
{
|
||||||
if (*it > bytecode.size() || !validJumpTargets[*it])
|
if (*it > bytecode.size() || !validJumpTargets[*it])
|
||||||
it = splitPoints.erase(it);
|
it = splitPoints.erase(it);
|
||||||
|
|
@ -128,7 +128,7 @@ void Compiler::createBasicBlocks(bytesConstRef bytecode)
|
||||||
++it;
|
++it;
|
||||||
}
|
}
|
||||||
|
|
||||||
for (auto it = splitPoints.cbegin(); it != splitPoints.cend(); )
|
for (auto it = splitPoints.cbegin(); it != splitPoints.cend();)
|
||||||
{
|
{
|
||||||
auto beginInstIdx = *it;
|
auto beginInstIdx = *it;
|
||||||
++it;
|
++it;
|
||||||
|
|
@ -523,7 +523,7 @@ void Compiler::compileBasicBlock(BasicBlock& basicBlock, bytesConstRef bytecode,
|
||||||
|
|
||||||
case Instruction::ANY_PUSH:
|
case Instruction::ANY_PUSH:
|
||||||
{
|
{
|
||||||
auto numBytes = static_cast<size_t>(inst)-static_cast<size_t>(Instruction::PUSH1) + 1;
|
auto numBytes = static_cast<size_t>(inst) - static_cast<size_t>(Instruction::PUSH1) + 1;
|
||||||
auto value = llvm::APInt(256, 0);
|
auto value = llvm::APInt(256, 0);
|
||||||
for (decltype(numBytes) i = 0; i < numBytes; ++i) // TODO: Use pc as iterator
|
for (decltype(numBytes) i = 0; i < numBytes; ++i) // TODO: Use pc as iterator
|
||||||
{
|
{
|
||||||
|
|
@ -538,14 +538,14 @@ void Compiler::compileBasicBlock(BasicBlock& basicBlock, bytesConstRef bytecode,
|
||||||
|
|
||||||
case Instruction::ANY_DUP:
|
case Instruction::ANY_DUP:
|
||||||
{
|
{
|
||||||
auto index = static_cast<size_t>(inst)-static_cast<size_t>(Instruction::DUP1);
|
auto index = static_cast<size_t>(inst) - static_cast<size_t>(Instruction::DUP1);
|
||||||
stack.dup(index);
|
stack.dup(index);
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
case Instruction::ANY_SWAP:
|
case Instruction::ANY_SWAP:
|
||||||
{
|
{
|
||||||
auto index = static_cast<size_t>(inst)-static_cast<size_t>(Instruction::SWAP1) + 1;
|
auto index = static_cast<size_t>(inst) - static_cast<size_t>(Instruction::SWAP1) + 1;
|
||||||
stack.swap(index);
|
stack.swap(index);
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue