[llvm] r273798 - [RSForGC] Bring computeLiveOutSeed up to code; NFC
Sanjoy Das via llvm-commits
llvm-commits at lists.llvm.org
Sat Jun 25 21:55:30 PDT 2016
Author: sanjoy
Date: Sat Jun 25 23:55:30 2016
New Revision: 273798
URL: http://llvm.org/viewvc/llvm-project?rev=273798&view=rev
Log:
[RSForGC] Bring computeLiveOutSeed up to code; NFC
Modified:
llvm/trunk/lib/Transforms/Scalar/RewriteStatepointsForGC.cpp
Modified: llvm/trunk/lib/Transforms/Scalar/RewriteStatepointsForGC.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Transforms/Scalar/RewriteStatepointsForGC.cpp?rev=273798&r1=273797&r2=273798&view=diff
==============================================================================
--- llvm/trunk/lib/Transforms/Scalar/RewriteStatepointsForGC.cpp (original)
+++ llvm/trunk/lib/Transforms/Scalar/RewriteStatepointsForGC.cpp Sat Jun 25 23:55:30 2016
@@ -2408,17 +2408,17 @@ static void computeLiveInValues(BasicBlo
}
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);
- }
}
}
}
More information about the llvm-commits
mailing list