Enable "garbage detection" of LLVM objects. Now users should be obnoxious

warnings.  If they accidentally leak LLVM Value's.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@3620 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
Chris Lattner
2002-09-08 18:59:35 +00:00
parent bd78696719
commit d1e693f2a3
5 changed files with 70 additions and 7 deletions
+4
View File
@@ -7,6 +7,7 @@
#include "llvm/InstrTypes.h"
#include "llvm/SymbolTable.h"
#include "llvm/DerivedTypes.h"
#include "Support/LeakDetector.h"
#include <algorithm>
//===----------------------------------------------------------------------===//
@@ -39,6 +40,9 @@ Value::~Value() {
}
#endif
assert(Uses.begin() == Uses.end());
// There should be no uses of this object anymore, remove it.
LeakDetector::removeGarbageObject(this);
}
void Value::replaceAllUsesWith(Value *D) {