mirror of
https://github.com/RPCSX/llvm.git
synced 2025-01-31 17:42:40 +00:00
simplify code, no functionality change.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@47116 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
parent
0fec975a18
commit
13daadbd25
@ -162,13 +162,15 @@ static bool RemoveUnreachableBlocks(Function &F) {
|
||||
|
||||
// Loop over all of the basic blocks that are not reachable, dropping all of
|
||||
// their internal references...
|
||||
for (Function::iterator BB = ++F.begin(), E = F.end(); BB != E; ++BB)
|
||||
if (!Reachable.count(BB)) {
|
||||
for (succ_iterator SI = succ_begin(BB), SE = succ_end(BB); SI!=SE; ++SI)
|
||||
if (Reachable.count(*SI))
|
||||
(*SI)->removePredecessor(BB);
|
||||
BB->dropAllReferences();
|
||||
}
|
||||
for (Function::iterator BB = ++F.begin(), E = F.end(); BB != E; ++BB) {
|
||||
if (Reachable.count(BB))
|
||||
continue;
|
||||
|
||||
for (succ_iterator SI = succ_begin(BB), SE = succ_end(BB); SI != SE; ++SI)
|
||||
if (Reachable.count(*SI))
|
||||
(*SI)->removePredecessor(BB);
|
||||
BB->dropAllReferences();
|
||||
}
|
||||
|
||||
for (Function::iterator I = ++F.begin(); I != F.end();)
|
||||
if (!Reachable.count(I))
|
||||
|
Loading…
x
Reference in New Issue
Block a user