mirror of
https://github.com/RPCS3/llvm.git
synced 2026-07-21 03:05:26 -04:00
Nuke getGlobalContext() from LLVM (but the C API)
The only use for getGlobalContext() is in the C API. Let's just move the static global here and nuke the C++ API. Differential Revision: http://reviews.llvm.org/D19094 From: Mehdi Amini <mehdi.amini@apple.com> git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@266380 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
@@ -235,10 +235,6 @@ private:
|
||||
friend class Module;
|
||||
};
|
||||
|
||||
/// getGlobalContext - Returns a global context. This is for LLVM clients that
|
||||
/// only care about operating on a single thread.
|
||||
extern LLVMContext &getGlobalContext();
|
||||
|
||||
// Create wrappers for C Binding types (see CBindingWrapping.h).
|
||||
DEFINE_SIMPLE_CONVERSION_FUNCTIONS(LLVMContext, LLVMContextRef)
|
||||
|
||||
|
||||
+4
-4
@@ -73,13 +73,13 @@ void LLVMDisposeMessage(char *Message) {
|
||||
|
||||
/*===-- Operations on contexts --------------------------------------------===*/
|
||||
|
||||
static ManagedStatic<LLVMContext> GlobalContext;
|
||||
|
||||
LLVMContextRef LLVMContextCreate() {
|
||||
return wrap(new LLVMContext());
|
||||
}
|
||||
|
||||
LLVMContextRef LLVMGetGlobalContext() {
|
||||
return wrap(&getGlobalContext());
|
||||
}
|
||||
LLVMContextRef LLVMGetGlobalContext() { return wrap(&*GlobalContext); }
|
||||
|
||||
void LLVMContextSetDiagnosticHandler(LLVMContextRef C,
|
||||
LLVMDiagnosticHandler Handler,
|
||||
@@ -155,7 +155,7 @@ LLVMDiagnosticSeverity LLVMGetDiagInfoSeverity(LLVMDiagnosticInfoRef DI) {
|
||||
/*===-- Operations on modules ---------------------------------------------===*/
|
||||
|
||||
LLVMModuleRef LLVMModuleCreateWithName(const char *ModuleID) {
|
||||
return wrap(new Module(ModuleID, getGlobalContext()));
|
||||
return wrap(new Module(ModuleID, *GlobalContext));
|
||||
}
|
||||
|
||||
LLVMModuleRef LLVMModuleCreateWithNameInContext(const char *ModuleID,
|
||||
|
||||
@@ -25,12 +25,6 @@
|
||||
#include <cctype>
|
||||
using namespace llvm;
|
||||
|
||||
static ManagedStatic<LLVMContext> GlobalContext;
|
||||
|
||||
LLVMContext& llvm::getGlobalContext() {
|
||||
return *GlobalContext;
|
||||
}
|
||||
|
||||
LLVMContext::LLVMContext() : pImpl(new LLVMContextImpl(*this)) {
|
||||
// Create the fixed metadata kinds. This is done in the same order as the
|
||||
// MD_* enum values so that they correspond.
|
||||
|
||||
Reference in New Issue
Block a user