mirror of
https://github.com/c64scene-ar/llvm-6502.git
synced 2026-04-20 16:17:38 +00:00
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:
+11
-3
@@ -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) {
|
||||
|
||||
Reference in New Issue
Block a user