llvm.org GIT mirror llvm / db47ed0
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 Owen Anderson 11 years ago
2 changed file(s) with 10 addition(s) and 0 deletion(s). Raw diff Collapse all Expand all
196196 VectorType* getVectorTypeTruncatedElement(const VectorType* VTy);
197197 };
198198
199 /// FOR BACKWARDS COMPATIBILITY - Returns a global context.
200 LLVMContext* getGlobalContext();
201
199202 }
200203
201204 #endif
1414 #include "llvm/LLVMContext.h"
1515 #include "llvm/Constants.h"
1616 #include "llvm/DerivedTypes.h"
17 #include "llvm/Support/ManagedStatic.h"
1718 #include "LLVMContextImpl.h"
1819
1920 using namespace llvm;
21
22 static ManagedStatic GlobalContext;
23
24 LLVMContext* getGlobalContext() {
25 return &*GlobalContext;
26 }
2027
2128 LLVMContext::LLVMContext() : pImpl(new LLVMContextImpl()) { }
2229 LLVMContext::~LLVMContext() { delete pImpl; }