summaryrefslogtreecommitdiffstats
path: root/llvm/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
commitd184bc209c2663b74b63d5f2c4d774823e285c4d (patch)
tree10250e335f48f1f8cb2b5782dfb0d4ee8b662bff /llvm/lib/Analysis/ScalarEvolutionExpander.cpp
parentfe87034cefd09c87ce90b00ac23bf28b0e714465 (diff)
downloadbcm5719-llvm-d184bc209c2663b74b63d5f2c4d774823e285c4d.tar.gz
bcm5719-llvm-d184bc209c2663b74b63d5f2c4d774823e285c4d.zip
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. llvm-svn: 72364
Diffstat (limited to 'llvm/lib/Analysis/ScalarEvolutionExpander.cpp')
-rw-r--r--llvm/lib/Analysis/ScalarEvolutionExpander.cpp2
1 files changed, 1 insertions, 1 deletions
diff --git a/llvm/lib/Analysis/ScalarEvolutionExpander.cpp b/llvm/lib/Analysis/ScalarEvolutionExpander.cpp
index 507ced74fd1..fc66ddb6f48 100644
--- a/llvm/lib/Analysis/ScalarEvolutionExpander.cpp
+++ b/llvm/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;
OpenPOWER on IntegriCloud