Fix a nasty memory leak, caused by my revamp of the value symbol table.

llvm-svn: 35195
This commit is contained in:
Chris Lattner 2007-03-20 00:18:10 +00:00
parent 6682721316
commit af867a3937
1 changed files with 5 additions and 0 deletions

View File

@ -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);
}