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
+11 -3
View File
@@ -9,16 +9,24 @@
#include "llvm/Constants.h"
#include "llvm/DerivedTypes.h"
#include "Support/STLExtras.h"
#include "Support/LeakDetector.h"
#include "SymbolTableListTraitsImpl.h"
#include <algorithm>
#include <map>
Function *ilist_traits<Function>::createNode() {
return new Function(FunctionType::get(Type::VoidTy,std::vector<const Type*>(),
false), false);
FunctionType *FTy =
FunctionType::get(Type::VoidTy, std::vector<const Type*>(), false);
Function *Ret = new Function(FTy, false);
// This should not be garbage monitored.
LeakDetector::removeGarbageObject(Ret);
return Ret;
}
GlobalVariable *ilist_traits<GlobalVariable>::createNode() {
return new GlobalVariable(Type::IntTy, false, false);
GlobalVariable *Ret = new GlobalVariable(Type::IntTy, false, false);
// This should not be garbage monitored.
LeakDetector::removeGarbageObject(Ret);
return Ret;
}
iplist<Function> &ilist_traits<Function>::getList(Module *M) {