diff options
-rw-r--r-- | lib/VMCore/Value.cpp | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/lib/VMCore/Value.cpp b/lib/VMCore/Value.cpp index 8bc99a8590..790ae17a98 100644 --- a/lib/VMCore/Value.cpp +++ b/lib/VMCore/Value.cpp @@ -56,6 +56,11 @@ Value::~Value() { #endif assert(use_begin() == use_end() && "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); } |