Browse Source

Improve Compiler code formatting

cl-refactor
Paweł Bylica 10 years ago
parent
commit
e24c9c2286
  1. 10
      libevmjit/Compiler.cpp

10
libevmjit/Compiler.cpp

@ -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…
Cancel
Save