Browse Source

Cleanups

cl-refactor
Paweł Bylica 10 years ago
parent
commit
98a30815ac
  1. 1
      libevmjit/BasicBlock.h
  2. 2
      libevmjit/Compiler.cpp
  3. 12
      libevmjit/Compiler.h

1
libevmjit/BasicBlock.h

@ -59,7 +59,6 @@ public:
BasicBlock(const BasicBlock&) = delete;
void operator=(const BasicBlock&) = delete;
operator llvm::BasicBlock*() { return m_llvmBB; } // TODO: Remove it
llvm::BasicBlock* llvm() { return m_llvmBB; }
bytes::const_iterator begin() { return m_begin; }

2
libevmjit/Compiler.cpp

@ -147,7 +147,7 @@ std::unique_ptr<llvm::Module> Compiler::compile(bytes const& _bytecode, std::str
Stack stack(m_builder, runtimeManager);
Arith256 arith(m_builder);
m_builder.CreateBr(m_basicBlocks.empty() ? m_stopBB : m_basicBlocks.begin()->second);
m_builder.CreateBr(m_basicBlocks.empty() ? m_stopBB : m_basicBlocks.begin()->second.llvm());
for (auto basicBlockPairIt = m_basicBlocks.begin(); basicBlockPairIt != m_basicBlocks.end(); ++basicBlockPairIt)
{

12
libevmjit/Compiler.h

@ -20,19 +20,13 @@ public:
struct Options
{
/// Optimize stack operations between basic blocks
bool optimizeStack;
bool optimizeStack = true;
/// Rewrite switch instructions to sequences of branches
bool rewriteSwitchToBranches;
bool rewriteSwitchToBranches = true;
/// Dump CFG as a .dot file for graphviz
bool dumpCFG;
Options():
optimizeStack(true),
rewriteSwitchToBranches(true),
dumpCFG(false)
{}
bool dumpCFG = false;
};
using ProgramCounter = uint64_t;

Loading…
Cancel
Save