mirror of
https://github.com/ethereum/go-ethereum.git
synced 2026-07-22 04:36:42 +00:00
Cleanups
This commit is contained in:
parent
9c244ed08e
commit
98a30815ac
3 changed files with 4 additions and 11 deletions
|
|
@ -59,7 +59,6 @@ public:
|
||||||
BasicBlock(const BasicBlock&) = delete;
|
BasicBlock(const BasicBlock&) = delete;
|
||||||
void operator=(const BasicBlock&) = delete;
|
void operator=(const BasicBlock&) = delete;
|
||||||
|
|
||||||
operator llvm::BasicBlock*() { return m_llvmBB; } // TODO: Remove it
|
|
||||||
llvm::BasicBlock* llvm() { return m_llvmBB; }
|
llvm::BasicBlock* llvm() { return m_llvmBB; }
|
||||||
|
|
||||||
bytes::const_iterator begin() { return m_begin; }
|
bytes::const_iterator begin() { return m_begin; }
|
||||||
|
|
|
||||||
|
|
@ -147,7 +147,7 @@ std::unique_ptr<llvm::Module> Compiler::compile(bytes const& _bytecode, std::str
|
||||||
Stack stack(m_builder, runtimeManager);
|
Stack stack(m_builder, runtimeManager);
|
||||||
Arith256 arith(m_builder);
|
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)
|
for (auto basicBlockPairIt = m_basicBlocks.begin(); basicBlockPairIt != m_basicBlocks.end(); ++basicBlockPairIt)
|
||||||
{
|
{
|
||||||
|
|
|
||||||
|
|
@ -20,19 +20,13 @@ public:
|
||||||
struct Options
|
struct Options
|
||||||
{
|
{
|
||||||
/// Optimize stack operations between basic blocks
|
/// Optimize stack operations between basic blocks
|
||||||
bool optimizeStack;
|
bool optimizeStack = true;
|
||||||
|
|
||||||
/// Rewrite switch instructions to sequences of branches
|
/// Rewrite switch instructions to sequences of branches
|
||||||
bool rewriteSwitchToBranches;
|
bool rewriteSwitchToBranches = true;
|
||||||
|
|
||||||
/// Dump CFG as a .dot file for graphviz
|
/// Dump CFG as a .dot file for graphviz
|
||||||
bool dumpCFG;
|
bool dumpCFG = false;
|
||||||
|
|
||||||
Options():
|
|
||||||
optimizeStack(true),
|
|
||||||
rewriteSwitchToBranches(true),
|
|
||||||
dumpCFG(false)
|
|
||||||
{}
|
|
||||||
};
|
};
|
||||||
|
|
||||||
using ProgramCounter = uint64_t;
|
using ProgramCounter = uint64_t;
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue