aboutsummaryrefslogtreecommitdiff
path: root/llvm/lib/Transforms/IPO/PartialInlining.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/IPO/PartialInlining.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/IPO/PartialInlining.cpp')
-rw-r--r--llvm/lib/Transforms/IPO/PartialInlining.cpp9
1 files changed, 5 insertions, 4 deletions
diff --git a/llvm/lib/Transforms/IPO/PartialInlining.cpp b/llvm/lib/Transforms/IPO/PartialInlining.cpp
index 5957e84..76d6dfa 100644
--- a/llvm/lib/Transforms/IPO/PartialInlining.cpp
+++ b/llvm/lib/Transforms/IPO/PartialInlining.cpp
@@ -58,12 +58,13 @@ Function* PartialInliner::unswitchFunction(Function* F) {
BasicBlock* returnBlock = nullptr;
BasicBlock* nonReturnBlock = nullptr;
unsigned returnCount = 0;
- for (BasicBlock *Succ : successors(entryBlock))
- if (isa<ReturnInst>(Succ->getTerminator())) {
- returnBlock = Succ;
+ for (succ_iterator SI = succ_begin(entryBlock), SE = succ_end(entryBlock);
+ SI != SE; ++SI)
+ if (isa<ReturnInst>((*SI)->getTerminator())) {
+ returnBlock = *SI;
returnCount++;
} else
- nonReturnBlock = Succ;
+ nonReturnBlock = *SI;
if (returnCount != 1)
return nullptr;