summaryrefslogtreecommitdiffstats
path: root/llvm/lib/VMCore
diff options
context:
space:
mode:
authorChris Lattner <sabre@nondot.org>2009-08-04 04:31:02 +0000
committerChris Lattner <sabre@nondot.org>2009-08-04 04:31:02 +0000
commit59c08e76caf44901535720b6188539e8a8bd8bab (patch)
tree334286ebd6450064cc271d86f5284c5d1d4bd4eb /llvm/lib/VMCore
parentad9a6c4855fb5a696b9be36e120cbc364cb7160a (diff)
downloadbcm5719-llvm-59c08e76caf44901535720b6188539e8a8bd8bab.tar.gz
bcm5719-llvm-59c08e76caf44901535720b6188539e8a8bd8bab.zip
switch ValueMap to using AssertingVH. This is an old patch I had laying
around in a tree I forgot about. llvm-svn: 78048
Diffstat (limited to 'llvm/lib/VMCore')
-rw-r--r--llvm/lib/VMCore/Value.cpp16
1 files changed, 8 insertions, 8 deletions
diff --git a/llvm/lib/VMCore/Value.cpp b/llvm/lib/VMCore/Value.cpp
index 2cdd55217cc..8710b9461e8 100644
--- a/llvm/lib/VMCore/Value.cpp
+++ b/llvm/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.
OpenPOWER on IntegriCloud