aboutsummaryrefslogtreecommitdiff
path: root/lib/Analysis/ScalarEvolutionExpander.cpp
diff options
context:
space:
mode:
authorTorok Edwin <edwintorok@gmail.com>2009-05-24 14:23:16 +0000
committerTorok Edwin <edwintorok@gmail.com>2009-05-24 14:23:16 +0000
commitb679de2a21f5ecbae81b444290d72af93aa5b0b3 (patch)
tree8a582e9fdfcd6bc1efa5b91248c86aafe4c22f00 /lib/Analysis/ScalarEvolutionExpander.cpp
parented2f8c557a86612ee14fea25e7be2d3c1445951a (diff)
The rewriter may hold references to instructions that are deleted because they are trivially dead.
Fix by clearing the rewriter cache before deleting the trivially dead instructions. Also make InsertedExpressions use an AssertingVH to catch these bugs easier. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@72364 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/Analysis/ScalarEvolutionExpander.cpp')
-rw-r--r--lib/Analysis/ScalarEvolutionExpander.cpp2
1 files changed, 1 insertions, 1 deletions
diff --git a/lib/Analysis/ScalarEvolutionExpander.cpp b/lib/Analysis/ScalarEvolutionExpander.cpp
index 507ced74fd..fc66ddb6f4 100644
--- a/lib/Analysis/ScalarEvolutionExpander.cpp
+++ b/lib/Analysis/ScalarEvolutionExpander.cpp
@@ -526,7 +526,7 @@ Value *SCEVExpander::expandCodeFor(SCEVHandle SH, const Type *Ty) {
Value *SCEVExpander::expand(const SCEV *S) {
// Check to see if we already expanded this.
- std::map<SCEVHandle, Value*>::iterator I = InsertedExpressions.find(S);
+ std::map<SCEVHandle, AssertingVH<Value> >::iterator I = InsertedExpressions.find(S);
if (I != InsertedExpressions.end())
return I->second;