diff options
author | Chris Lattner <sabre@nondot.org> | 2010-03-15 18:42:01 +0000 |
---|---|---|
committer | Chris Lattner <sabre@nondot.org> | 2010-03-15 18:42:01 +0000 |
commit | 49ee281213ee148db2a7ccdb708c8bb7d46129c0 (patch) | |
tree | d9ca0dbc97d855cace51cd5fcd91ac0a19a6466e /llvm/lib/CodeGen/UnreachableBlockElim.cpp | |
parent | b397e43dea379bd436dda3fa92da449deaf70244 (diff) | |
download | bcm5719-llvm-49ee281213ee148db2a7ccdb708c8bb7d46129c0.tar.gz bcm5719-llvm-49ee281213ee148db2a7ccdb708c8bb7d46129c0.zip |
revert r98550, it isn't necessary or sufficient.
llvm-svn: 98558
Diffstat (limited to 'llvm/lib/CodeGen/UnreachableBlockElim.cpp')
-rw-r--r-- | llvm/lib/CodeGen/UnreachableBlockElim.cpp | 18 |
1 files changed, 3 insertions, 15 deletions
diff --git a/llvm/lib/CodeGen/UnreachableBlockElim.cpp b/llvm/lib/CodeGen/UnreachableBlockElim.cpp index c0d4494d5b9..7b338126d47 100644 --- a/llvm/lib/CodeGen/UnreachableBlockElim.cpp +++ b/llvm/lib/CodeGen/UnreachableBlockElim.cpp @@ -58,25 +58,13 @@ FunctionPass *llvm::createUnreachableBlockEliminationPass() { return new UnreachableBlockElim(); } -static void MarkReachableFrom(BasicBlock *BB, - SmallPtrSet<BasicBlock*, 8> &Reachable) { - for (df_ext_iterator<BasicBlock*, SmallPtrSet<BasicBlock*, 8> > I = - df_ext_begin(BB, Reachable), E = df_ext_end(BB, Reachable); I != E; ++I) - ; // Mark all reachable blocks. -} - bool UnreachableBlockElim::runOnFunction(Function &F) { SmallPtrSet<BasicBlock*, 8> Reachable; // Mark all reachable blocks. - MarkReachableFrom(&F.getEntryBlock(), Reachable); - - // Mark any address-taken blocks. We don't want codegen to delete these - // because the address may already be referenced by another function and the - // label may be referenced. - for (Function::iterator I = F.begin(), E = F.end(); I != E; ++I) - if (I->hasAddressTaken() && !Reachable.count(I)) - MarkReachableFrom(I, Reachable); + for (df_ext_iterator<Function*, SmallPtrSet<BasicBlock*, 8> > I = + df_ext_begin(&F, Reachable), E = df_ext_end(&F, Reachable); I != E; ++I) + /* Mark all reachable blocks */; // Loop over all dead blocks, remembering them and deleting all instructions // in them. |