[llvm-commits] [llvm] r74675 - in /llvm/trunk: include/llvm-c/Core.h lib/VMCore/Core.cpp

Owen Anderson resistor at mac.com
Wed Jul 1 17:16:39 PDT 2009


Author: resistor
Date: Wed Jul  1 19:16:38 2009
New Revision: 74675

URL: http://llvm.org/viewvc/llvm-project?rev=74675&view=rev
Log:
Add a C wrapper for accessing the global default context.

Modified:
    llvm/trunk/include/llvm-c/Core.h
    llvm/trunk/lib/VMCore/Core.cpp

Modified: llvm/trunk/include/llvm-c/Core.h
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/include/llvm-c/Core.h?rev=74675&r1=74674&r2=74675&view=diff

==============================================================================
--- llvm/trunk/include/llvm-c/Core.h (original)
+++ llvm/trunk/include/llvm-c/Core.h Wed Jul  1 19:16:38 2009
@@ -195,6 +195,7 @@
 
 /* Create and destroy contexts. */
 LLVMContextRef LLVMContextCreate();
+LLVMContextRef LLVMGetGlobalContext();
 void LLVMContextDispose(LLVMContextRef C);
 
 /* Create and destroy modules. */ 

Modified: llvm/trunk/lib/VMCore/Core.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/VMCore/Core.cpp?rev=74675&r1=74674&r2=74675&view=diff

==============================================================================
--- llvm/trunk/lib/VMCore/Core.cpp (original)
+++ llvm/trunk/lib/VMCore/Core.cpp Wed Jul  1 19:16:38 2009
@@ -45,6 +45,10 @@
   return wrap(new LLVMContext());
 }
 
+LLVMContextRef LLVMGetGlobalContext() {
+  return wrap(&getGlobalContext());
+}
+
 void LLVMContextDispose(LLVMContextRef C) {
   delete unwrap(C);
 }





More information about the llvm-commits mailing list