aboutsummaryrefslogtreecommitdiffstats
path: root/lib
diff options
context:
space:
mode:
authorOwen Anderson <resistor@mac.com>2009-06-30 23:39:59 +0000
committerOwen Anderson <resistor@mac.com>2009-06-30 23:39:59 +0000
commit3d94802526a044f83caf8b5c980ff67691d44c97 (patch)
treeccc254ed7e9375ffcf8e80cea2ccd16e7863c83a /lib
parentd1d1e83b06a0e19a9f6d065b29d0a74622b97aef (diff)
downloadexternal_llvm-3d94802526a044f83caf8b5c980ff67691d44c97.zip
external_llvm-3d94802526a044f83caf8b5c980ff67691d44c97.tar.gz
external_llvm-3d94802526a044f83caf8b5c980ff67691d44c97.tar.bz2
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
Diffstat (limited to 'lib')
-rw-r--r--lib/VMCore/LLVMContext.cpp7
1 files changed, 7 insertions, 0 deletions
diff --git a/lib/VMCore/LLVMContext.cpp b/lib/VMCore/LLVMContext.cpp
index e0fe6ab..09c7fcc 100644
--- a/lib/VMCore/LLVMContext.cpp
+++ b/lib/VMCore/LLVMContext.cpp
@@ -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; }