forked from OSchip/llvm-project
Add a global context, for easing backwards compatibility.
llvm-svn: 74574
This commit is contained in:
parent
d0a08e0430
commit
1938fb1954
|
@ -197,6 +197,9 @@ public:
|
|||
VectorType* getVectorTypeTruncatedElement(const VectorType* VTy);
|
||||
};
|
||||
|
||||
/// FOR BACKWARDS COMPATIBILITY - Returns a global context.
|
||||
LLVMContext* getGlobalContext();
|
||||
|
||||
}
|
||||
|
||||
#endif
|
||||
|
|
|
@ -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; }
|
||||
|
||||
|
|
Loading…
Reference in New Issue