summaryrefslogtreecommitdiffstats
path: root/llvm/lib/Transforms
diff options
context:
space:
mode:
authorSanjoy Das <sanjoy@playingwithpointers.com>2016-06-26 04:55:30 +0000
committerSanjoy Das <sanjoy@playingwithpointers.com>2016-06-26 04:55:30 +0000
commit83186b067d6bb01ae62113882957521227f83fa1 (patch)
treec37aea73cf680353d998aa453c978381327fb3f0 /llvm/lib/Transforms
parentb2df57af65c98f7d416a30d94b8d1873626f49c8 (diff)
downloadbcm5719-llvm-83186b067d6bb01ae62113882957521227f83fa1.tar.gz
bcm5719-llvm-83186b067d6bb01ae62113882957521227f83fa1.zip
[RSForGC] Bring computeLiveOutSeed up to code; NFC
llvm-svn: 273798
Diffstat (limited to 'llvm/lib/Transforms')
-rw-r--r--llvm/lib/Transforms/Scalar/RewriteStatepointsForGC.cpp14
1 files changed, 7 insertions, 7 deletions
diff --git a/llvm/lib/Transforms/Scalar/RewriteStatepointsForGC.cpp b/llvm/lib/Transforms/Scalar/RewriteStatepointsForGC.cpp
index f7aa7723af6..ccb3bbbc659 100644
--- a/llvm/lib/Transforms/Scalar/RewriteStatepointsForGC.cpp
+++ b/llvm/lib/Transforms/Scalar/RewriteStatepointsForGC.cpp
@@ -2408,17 +2408,17 @@ static void computeLiveInValues(BasicBlock::reverse_iterator rbegin,
}
static void computeLiveOutSeed(BasicBlock *BB, SetVector<Value *> &LiveTmp) {
-
for (BasicBlock *Succ : successors(BB)) {
- const BasicBlock::iterator E(Succ->getFirstNonPHI());
- for (BasicBlock::iterator I = Succ->begin(); I != E; I++) {
- PHINode *Phi = cast<PHINode>(&*I);
- Value *V = Phi->getIncomingValueForBlock(BB);
+ for (auto &I : *Succ) {
+ PHINode *PN = dyn_cast<PHINode>(&I);
+ if (!PN)
+ break;
+
+ Value *V = PN->getIncomingValueForBlock(BB);
assert(!isUnhandledGCPointerType(V->getType()) &&
"support for FCA unimplemented");
- if (isHandledGCPointerType(V->getType()) && !isa<Constant>(V)) {
+ if (isHandledGCPointerType(V->getType()) && !isa<Constant>(V))
LiveTmp.insert(V);
- }
}
}
}
OpenPOWER on IntegriCloud