Fix PR8313 by changing ValueToValueMap use a TrackingVH.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@116390 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
Rafael Espindola
2010-10-13 02:08:17 +00:00
parent 14ce175216
commit 6688c4a742
3 changed files with 15 additions and 9 deletions

View File

@@ -22,7 +22,7 @@ using namespace llvm;
Value *llvm::MapValue(const Value *V, ValueToValueMapTy &VM,
bool ModuleLevelChanges) {
Value *&VMSlot = VM[V];
TrackingVH<Value> &VMSlot = VM[V];
if (VMSlot) return VMSlot; // Does it exist in the map yet?
// NOTE: VMSlot can be invalidated by any reference to VM, which can grow the