diff options
author | Chris Lattner <sabre@nondot.org> | 2009-08-04 04:31:02 +0000 |
---|---|---|
committer | Chris Lattner <sabre@nondot.org> | 2009-08-04 04:31:02 +0000 |
commit | c9d156f7eff0d5d15ce7e579dbce07d78cde4b73 (patch) | |
tree | d4520a2b83f9fbac34e293e1962a10c3d4e0e24d /lib/VMCore/Value.cpp | |
parent | 09a25f3624c3a9abd554f3dbb0983009d830e5f1 (diff) | |
download | external_llvm-c9d156f7eff0d5d15ce7e579dbce07d78cde4b73.zip external_llvm-c9d156f7eff0d5d15ce7e579dbce07d78cde4b73.tar.gz external_llvm-c9d156f7eff0d5d15ce7e579dbce07d78cde4b73.tar.bz2 |
switch ValueMap to using AssertingVH. This is an old patch I had laying
around in a tree I forgot about.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@78048 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/VMCore/Value.cpp')
-rw-r--r-- | lib/VMCore/Value.cpp | 16 |
1 files changed, 8 insertions, 8 deletions
diff --git a/lib/VMCore/Value.cpp b/lib/VMCore/Value.cpp index 2cdd552..8710b94 100644 --- a/lib/VMCore/Value.cpp +++ b/lib/VMCore/Value.cpp @@ -57,6 +57,14 @@ Value::Value(const Type *ty, unsigned scid) } Value::~Value() { + // If this value is named, destroy the name. This should not be in a symtab + // at this point. + if (Name) + Name->Destroy(); + + // There should be no uses of this object anymore, remove it. + LeakDetector::removeGarbageObject(this); + // Notify all ValueHandles (if present) that this value is going away. if (HasValueHandle) ValueHandleBase::ValueIsDeleted(this); @@ -76,14 +84,6 @@ Value::~Value() { } #endif assert(use_empty() && "Uses remain when a value is destroyed!"); - - // If this value is named, destroy the name. This should not be in a symtab - // at this point. - if (Name) - Name->Destroy(); - - // There should be no uses of this object anymore, remove it. - LeakDetector::removeGarbageObject(this); } /// hasNUses - Return true if this Value has exactly N users. |