aboutsummaryrefslogtreecommitdiff
path: root/llvm/lib/Transforms/Utils/CloneFunction.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/CloneFunction.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/CloneFunction.cpp')
-rw-r--r--llvm/lib/Transforms/Utils/CloneFunction.cpp5
1 files changed, 3 insertions, 2 deletions
diff --git a/llvm/lib/Transforms/Utils/CloneFunction.cpp b/llvm/lib/Transforms/Utils/CloneFunction.cpp
index f148ea1..5c8f20d 100644
--- a/llvm/lib/Transforms/Utils/CloneFunction.cpp
+++ b/llvm/lib/Transforms/Utils/CloneFunction.cpp
@@ -514,8 +514,9 @@ void llvm::CloneAndPruneFunctionInto(Function *NewFunc, const Function *OldFunc,
assert(NumPreds < PN->getNumIncomingValues());
// Count how many times each predecessor comes to this block.
std::map<BasicBlock*, unsigned> PredCount;
- for (BasicBlock *Pred : predecessors(NewBB))
- --PredCount[Pred];
+ for (pred_iterator PI = pred_begin(NewBB), E = pred_end(NewBB);
+ PI != E; ++PI)
+ --PredCount[*PI];
// Figure out how many entries to remove from each PHI.
for (unsigned i = 0, e = PN->getNumIncomingValues(); i != e; ++i)