mirror of
https://github.com/RPCSX/llvm.git
synced 2024-11-30 23:20:54 +00:00
Fix a bug in the recent rewrite of the leakdetector that caused all of the
nightly tests to be really messed up. The problem was that the new leakdetector was depending on undefined behavior: the order of destruction of static objects. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@11488 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
parent
2e6fcafff2
commit
8709927af8
@ -17,7 +17,6 @@
|
||||
using namespace llvm;
|
||||
|
||||
namespace {
|
||||
|
||||
template <typename T>
|
||||
struct LeakDetectorImpl {
|
||||
LeakDetectorImpl(const char* const name) : Cache(0), Name(name) { }
|
||||
@ -64,21 +63,25 @@ namespace {
|
||||
|
||||
private:
|
||||
std::set<const T*> Ts;
|
||||
const T* Cache;
|
||||
const char* const Name;
|
||||
const T* Cache;
|
||||
const char* const Name;
|
||||
};
|
||||
|
||||
typedef LeakDetectorImpl<void> Objects;
|
||||
typedef LeakDetectorImpl<Value> LLVMObjects;
|
||||
|
||||
Objects& getObjects() {
|
||||
static Objects o("GENERIC");
|
||||
return o;
|
||||
static Objects *o = 0;
|
||||
if (o == 0)
|
||||
o = new Objects("GENERIC");
|
||||
return *o;
|
||||
}
|
||||
|
||||
LLVMObjects& getLLVMObjects() {
|
||||
static LLVMObjects o("LLVM");
|
||||
return o;
|
||||
static LLVMObjects *o = 0;
|
||||
if (o == 0)
|
||||
o = new LLVMObjects("LLVM");
|
||||
return *o;
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -17,7 +17,6 @@
|
||||
using namespace llvm;
|
||||
|
||||
namespace {
|
||||
|
||||
template <typename T>
|
||||
struct LeakDetectorImpl {
|
||||
LeakDetectorImpl(const char* const name) : Cache(0), Name(name) { }
|
||||
@ -64,21 +63,25 @@ namespace {
|
||||
|
||||
private:
|
||||
std::set<const T*> Ts;
|
||||
const T* Cache;
|
||||
const char* const Name;
|
||||
const T* Cache;
|
||||
const char* const Name;
|
||||
};
|
||||
|
||||
typedef LeakDetectorImpl<void> Objects;
|
||||
typedef LeakDetectorImpl<Value> LLVMObjects;
|
||||
|
||||
Objects& getObjects() {
|
||||
static Objects o("GENERIC");
|
||||
return o;
|
||||
static Objects *o = 0;
|
||||
if (o == 0)
|
||||
o = new Objects("GENERIC");
|
||||
return *o;
|
||||
}
|
||||
|
||||
LLVMObjects& getLLVMObjects() {
|
||||
static LLVMObjects o("LLVM");
|
||||
return o;
|
||||
static LLVMObjects *o = 0;
|
||||
if (o == 0)
|
||||
o = new LLVMObjects("LLVM");
|
||||
return *o;
|
||||
}
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user