diff options
author | Benjamin Kramer <benny.kra@googlemail.com> | 2013-10-01 12:17:11 +0000 |
---|---|---|
committer | Benjamin Kramer <benny.kra@googlemail.com> | 2013-10-01 12:17:11 +0000 |
commit | 341562b9fb6574b1c9492e52cec24106cd31ce51 (patch) | |
tree | ed68a4cc9dc471affb0dc7f6f374e5c41c138264 /lib/Analysis/ScalarEvolutionExpander.cpp | |
parent | ced450f0e6266eb8c2624fc1895cbc2749d715c3 (diff) | |
download | llvm-341562b9fb6574b1c9492e52cec24106cd31ce51.tar.gz llvm-341562b9fb6574b1c9492e52cec24106cd31ce51.tar.bz2 llvm-341562b9fb6574b1c9492e52cec24106cd31ce51.tar.xz |
SCEVExpander: Fix a regression I introduced by to eagerly adding RAII objects.
PR17425.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@191741 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/Analysis/ScalarEvolutionExpander.cpp')
-rw-r--r-- | lib/Analysis/ScalarEvolutionExpander.cpp | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/lib/Analysis/ScalarEvolutionExpander.cpp b/lib/Analysis/ScalarEvolutionExpander.cpp index 1ab989f4d3..f373a80681 100644 --- a/lib/Analysis/ScalarEvolutionExpander.cpp +++ b/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)); } |