summaryrefslogtreecommitdiff
path: root/lib/Transforms/Scalar/CallSiteSplitting.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'lib/Transforms/Scalar/CallSiteSplitting.cpp')
-rw-r--r--lib/Transforms/Scalar/CallSiteSplitting.cpp11
1 files changed, 4 insertions, 7 deletions
diff --git a/lib/Transforms/Scalar/CallSiteSplitting.cpp b/lib/Transforms/Scalar/CallSiteSplitting.cpp
index 207243231aad..caa73b2ff01c 100644
--- a/lib/Transforms/Scalar/CallSiteSplitting.cpp
+++ b/lib/Transforms/Scalar/CallSiteSplitting.cpp
@@ -265,15 +265,12 @@ static void splitCallSite(CallSite CS, BasicBlock *PredBB1, BasicBlock *PredBB2,
CallSite CS2(CallInst2);
// Handle PHIs used as arguments in the call-site.
- for (auto &PI : *TailBB) {
- PHINode *PN = dyn_cast<PHINode>(&PI);
- if (!PN)
- break;
+ for (PHINode &PN : TailBB->phis()) {
unsigned ArgNo = 0;
for (auto &CI : CS.args()) {
- if (&*CI == PN) {
- CS1.setArgument(ArgNo, PN->getIncomingValueForBlock(SplitBlock1));
- CS2.setArgument(ArgNo, PN->getIncomingValueForBlock(SplitBlock2));
+ if (&*CI == &PN) {
+ CS1.setArgument(ArgNo, PN.getIncomingValueForBlock(SplitBlock1));
+ CS2.setArgument(ArgNo, PN.getIncomingValueForBlock(SplitBlock2));
}
++ArgNo;
}