aboutsummaryrefslogtreecommitdiffstats
path: root/include/llvm/Analysis/ScalarEvolutionExpander.h
diff options
context:
space:
mode:
authorDan Gohman <gohman@apple.com>2010-07-27 01:19:06 +0000
committerDan Gohman <gohman@apple.com>2010-07-27 01:19:06 +0000
commitab28928fe276d20cf9533ae6b858497f835c7a53 (patch)
tree6e2f631a15f76bdb04558beccea54f41ce42fbd4 /include/llvm/Analysis/ScalarEvolutionExpander.h
parent05cfd335bbb81842bd4fabeff9d2d710cfb8d97a (diff)
downloadexternal_llvm-ab28928fe276d20cf9533ae6b858497f835c7a53.zip
external_llvm-ab28928fe276d20cf9533ae6b858497f835c7a53.tar.gz
external_llvm-ab28928fe276d20cf9533ae6b858497f835c7a53.tar.bz2
Use AssertingVH for InsertedValues and InsertedPostIncValues, to verify
that the values they refer to aren't being deleted underneath them. Make sure these containters get cleared by clear(), which IndVarSimplify and LSR both use before deleting instructions. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@109478 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'include/llvm/Analysis/ScalarEvolutionExpander.h')
-rw-r--r--include/llvm/Analysis/ScalarEvolutionExpander.h11
1 files changed, 8 insertions, 3 deletions
diff --git a/include/llvm/Analysis/ScalarEvolutionExpander.h b/include/llvm/Analysis/ScalarEvolutionExpander.h
index e4f2809..4b02f82 100644
--- a/include/llvm/Analysis/ScalarEvolutionExpander.h
+++ b/include/llvm/Analysis/ScalarEvolutionExpander.h
@@ -18,6 +18,7 @@
#include "llvm/Analysis/ScalarEvolutionNormalization.h"
#include "llvm/Support/IRBuilder.h"
#include "llvm/Support/TargetFolder.h"
+#include "llvm/Support/ValueHandle.h"
#include <set>
namespace llvm {
@@ -31,8 +32,8 @@ namespace llvm {
ScalarEvolution &SE;
std::map<std::pair<const SCEV *, Instruction *>, AssertingVH<Value> >
InsertedExpressions;
- std::set<Value*> InsertedValues;
- std::set<Value*> InsertedPostIncValues;
+ std::set<AssertingVH<Value> > InsertedValues;
+ std::set<AssertingVH<Value> > InsertedPostIncValues;
/// PostIncLoops - Addrecs referring to any of the given loops are expanded
/// in post-inc mode. For example, expanding {1,+,1}<L> in post-inc mode
@@ -70,7 +71,11 @@ namespace llvm {
/// clear - Erase the contents of the InsertedExpressions map so that users
/// trying to expand the same expression into multiple BasicBlocks or
/// different places within the same BasicBlock can do so.
- void clear() { InsertedExpressions.clear(); }
+ void clear() {
+ InsertedExpressions.clear();
+ InsertedValues.clear();
+ InsertedPostIncValues.clear();
+ }
/// getOrInsertCanonicalInductionVariable - This method returns the
/// canonical induction variable of the specified type for the specified