aboutsummaryrefslogtreecommitdiff
path: root/llvm/lib/Transforms/Utils/Local.cpp
diff options
context:
space:
mode:
authorDuncan P. N. Exon Smith <dexonsmith@apple.com>2014-07-21 17:06:51 +0000
committerDuncan P. N. Exon Smith <dexonsmith@apple.com>2014-07-21 17:06:51 +0000
commit6c99015fe2c1814f793530adc96f48050081612e (patch)
tree6dd9bd97817fed538386fcedbf363d38470ace2a /llvm/lib/Transforms/Utils/Local.cpp
parent1aaad6970cee96c214cc663bc7ae2cecb6fd1e7c (diff)
downloadllvm-6c99015fe2c1814f793530adc96f48050081612e.zip
llvm-6c99015fe2c1814f793530adc96f48050081612e.tar.gz
llvm-6c99015fe2c1814f793530adc96f48050081612e.tar.bz2
Revert "[C++11] Add predecessors(BasicBlock *) / successors(BasicBlock *) iterator ranges."
This reverts commit r213474 (and r213475), which causes a miscompile on a stage2 LTO build. I'll reply on the list in a moment. llvm-svn: 213562
Diffstat (limited to 'llvm/lib/Transforms/Utils/Local.cpp')
-rw-r--r--llvm/lib/Transforms/Utils/Local.cpp16
1 files changed, 8 insertions, 8 deletions
diff --git a/llvm/lib/Transforms/Utils/Local.cpp b/llvm/lib/Transforms/Utils/Local.cpp
index 113a2ae..a5e443f 100644
--- a/llvm/lib/Transforms/Utils/Local.cpp
+++ b/llvm/lib/Transforms/Utils/Local.cpp
@@ -1129,8 +1129,8 @@ static void changeToUnreachable(Instruction *I, bool UseLLVMTrap) {
BasicBlock *BB = I->getParent();
// Loop over all of the successors, removing BB's entry from any PHI
// nodes.
- for (BasicBlock *Succ : successors(BB))
- Succ->removePredecessor(BB);
+ for (succ_iterator SI = succ_begin(BB), SE = succ_end(BB); SI != SE; ++SI)
+ (*SI)->removePredecessor(BB);
// Insert a call to llvm.trap right before this. This turns the undefined
// behavior into a hard fail instead of falling through into random code.
@@ -1236,9 +1236,9 @@ static bool markAliveBlocks(BasicBlock *BB,
}
Changed |= ConstantFoldTerminator(BB, true);
- for (BasicBlock *Succ : successors(BB))
- if (Reachable.insert(Succ))
- Worklist.push_back(Succ);
+ for (succ_iterator SI = succ_begin(BB), SE = succ_end(BB); SI != SE; ++SI)
+ if (Reachable.insert(*SI))
+ Worklist.push_back(*SI);
} while (!Worklist.empty());
return Changed;
}
@@ -1263,9 +1263,9 @@ bool llvm::removeUnreachableBlocks(Function &F) {
if (Reachable.count(BB))
continue;
- for (BasicBlock *Succ : successors(BB))
- if (Reachable.count(Succ))
- Succ->removePredecessor(BB);
+ for (succ_iterator SI = succ_begin(BB), SE = succ_end(BB); SI != SE; ++SI)
+ if (Reachable.count(*SI))
+ (*SI)->removePredecessor(BB);
BB->dropAllReferences();
}