From d184bc209c2663b74b63d5f2c4d774823e285c4d Mon Sep 17 00:00:00 2001 From: Torok Edwin Date: Sun, 24 May 2009 14:23:16 +0000 Subject: 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 --- llvm/lib/Analysis/ScalarEvolutionExpander.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'llvm/lib/Analysis/ScalarEvolutionExpander.cpp') 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::iterator I = InsertedExpressions.find(S); + std::map >::iterator I = InsertedExpressions.find(S); if (I != InsertedExpressions.end()) return I->second; -- cgit v1.2.3