Add a C wrapper for accessing the global default context.
authorOwen Anderson <resistor@mac.com>
Thu, 2 Jul 2009 00:16:38 +0000 (00:16 +0000)
committerOwen Anderson <resistor@mac.com>
Thu, 2 Jul 2009 00:16:38 +0000 (00:16 +0000)
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@74675 91177308-0d34-0410-b5e6-96231b3b80d8

include/llvm-c/Core.h
lib/VMCore/Core.cpp

index 7019b4cc660e1d02d672931ec2fe0ab55e011223..c022c101775ae46349020b543a0483e6abc59ccf 100644 (file)
@@ -195,6 +195,7 @@ void LLVMDisposeMessage(char *Message);
 
 /* Create and destroy contexts. */
 LLVMContextRef LLVMContextCreate();
+LLVMContextRef LLVMGetGlobalContext();
 void LLVMContextDispose(LLVMContextRef C);
 
 /* Create and destroy modules. */ 
index 9f92e6f29496cac2b9531541c557eef18b05fcc9..f7fb1bbf7df46fdd2cdef415391ba5bda8e3bee4 100644 (file)
@@ -45,6 +45,10 @@ LLVMContextRef LLVMContextCreate() {
   return wrap(new LLVMContext());
 }
 
+LLVMContextRef LLVMGetGlobalContext() {
+  return wrap(&getGlobalContext());
+}
+
 void LLVMContextDispose(LLVMContextRef C) {
   delete unwrap(C);
 }