Preserve debug loc.
[oota-llvm.git] / lib / Analysis / ScalarEvolutionExpander.cpp
index 530a8bf52b1f4aec40c5e06607c05d0e41c78215..9f6063e56ac7f071962a5073e30e447ba2013688 100644 (file)
@@ -955,7 +955,7 @@ SCEVExpander::getAddRecExprPHILiterally(const SCEVAddRecExpr *Normalized,
     // at IVIncInsertPos.
     Instruction *InsertPos = L == IVIncInsertLoop ?
       IVIncInsertPos : Pred->getTerminator();
-    Builder.SetInsertPoint(InsertPos->getParent(), InsertPos);
+    Builder.SetInsertPoint(InsertPos);
     Value *IncV;
     // If the PHI is a pointer, use a GEP, otherwise use an add or sub.
     if (isPointer) {