Add a global context, for easing backwards compatibility.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@74574 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
Owen Anderson committed 2009-06-30 23:39:59 +00:00
1 parent d9627e11bf
commit db47ed0925
2 files changed
+10

No files matched your search

+3
View File
@@ -197,6 +197,9 @@ public:
VectorType* getVectorTypeTruncatedElement(const VectorType* VTy);
};
/// FOR BACKWARDS COMPATIBILITY - Returns a global context.
LLVMContext* getGlobalContext();
}
#endif
+7
View File
@@ -15,10 +15,17 @@
#include "llvm/LLVMContext.h"
#include "llvm/Constants.h"
#include "llvm/DerivedTypes.h"
#include "llvm/Support/ManagedStatic.h"
#include "LLVMContextImpl.h"
using namespace llvm;
static ManagedStatic<LLVMContext> GlobalContext;
LLVMContext* getGlobalContext() {
return &*GlobalContext;
}
LLVMContext::LLVMContext() : pImpl(new LLVMContextImpl()) { }
LLVMContext::~LLVMContext() { delete pImpl; }