mirror of
https://github.com/ethereum/go-ethereum.git
synced 2026-07-21 20:26:41 +00:00
Merge branch 'develop-evmcc' of github.com:imapp-pl/ethereum into develop-evmcc
This commit is contained in:
commit
8909c150a1
1 changed files with 19 additions and 0 deletions
|
|
@ -875,6 +875,25 @@ void Compiler::compileBasicBlock(BasicBlock& basicBlock, bytesConstRef bytecode,
|
||||||
|
|
||||||
void Compiler::linkBasicBlocks(Stack& stack)
|
void Compiler::linkBasicBlocks(Stack& stack)
|
||||||
{
|
{
|
||||||
|
// Remove dead basic blocks
|
||||||
|
auto sthErased = false;
|
||||||
|
do
|
||||||
|
{
|
||||||
|
sthErased = false;
|
||||||
|
for (auto it = basicBlocks.begin(); it != basicBlocks.end();)
|
||||||
|
{
|
||||||
|
auto llvmBB = it->second.llvm();
|
||||||
|
if (llvm::pred_begin(llvmBB) == llvm::pred_end(llvmBB))
|
||||||
|
{
|
||||||
|
llvmBB->eraseFromParent();
|
||||||
|
basicBlocks.erase(it++);
|
||||||
|
sthErased = true;
|
||||||
|
}
|
||||||
|
else
|
||||||
|
++it;
|
||||||
|
}
|
||||||
|
} while (sthErased);
|
||||||
|
|
||||||
struct BBInfo
|
struct BBInfo
|
||||||
{
|
{
|
||||||
BasicBlock& bblock;
|
BasicBlock& bblock;
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue