aboutsummaryrefslogtreecommitdiff
path: root/llvm/lib/Analysis/ScalarEvolutionExpander.cpp
diff options
context:
space:
mode:
authorBenjamin Kramer <benny.kra@googlemail.com>2013-10-01 12:17:11 +0000
committerBenjamin Kramer <benny.kra@googlemail.com>2013-10-01 12:17:11 +0000
commit58f1ced564c278562e0591d1aa467c6583d36919 (patch)
tree2563faec0209336c49efa4d19c0d8ab338d858bc /llvm/lib/Analysis/ScalarEvolutionExpander.cpp
parent89e160d9752d431cf415d3706247e08e9ea44f4c (diff)
downloadllvm-58f1ced564c278562e0591d1aa467c6583d36919.zip
llvm-58f1ced564c278562e0591d1aa467c6583d36919.tar.gz
llvm-58f1ced564c278562e0591d1aa467c6583d36919.tar.bz2
SCEVExpander: Fix a regression I introduced by to eagerly adding RAII objects.
PR17425. llvm-svn: 191741
Diffstat (limited to 'llvm/lib/Analysis/ScalarEvolutionExpander.cpp')
-rw-r--r--llvm/lib/Analysis/ScalarEvolutionExpander.cpp5
1 files changed, 4 insertions, 1 deletions
diff --git a/llvm/lib/Analysis/ScalarEvolutionExpander.cpp b/llvm/lib/Analysis/ScalarEvolutionExpander.cpp
index 1ab989f..f373a80 100644
--- a/llvm/lib/Analysis/ScalarEvolutionExpander.cpp
+++ b/llvm/lib/Analysis/ScalarEvolutionExpander.cpp
@@ -569,7 +569,7 @@ Value *SCEVExpander::expandAddToGEP(const SCEV *const *op_begin,
}
// Save the original insertion point so we can restore it when we're done.
- BuilderType::InsertPointGuard Guard(Builder);
+ BuilderType::InsertPoint SaveInsertPt = Builder.saveIP();
// Move the insertion point out of as many loops as we can.
while (const Loop *L = SE.LI->getLoopFor(Builder.GetInsertBlock())) {
@@ -604,6 +604,9 @@ Value *SCEVExpander::expandAddToGEP(const SCEV *const *op_begin,
Ops.push_back(SE.getUnknown(GEP));
rememberInstruction(GEP);
+ // Restore the original insert point.
+ Builder.restoreIP(SaveInsertPt);
+
return expand(SE.getAddExpr(Ops));
}