add a function to the C api to get the context out of a module, patch
authorChris Lattner <sabre@nondot.org>
Sun, 28 Nov 2010 20:03:44 +0000 (20:03 +0000)
committerChris Lattner <sabre@nondot.org>
Sun, 28 Nov 2010 20:03:44 +0000 (20:03 +0000)
by Eric Dobson!

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@120259 91177308-0d34-0410-b5e6-96231b3b80d8

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

index 433958323f31dd061d0295e72d1379017e23193f..b9a8e4af568f37c4ef4d331dc776812c06bb5c22 100644 (file)
@@ -329,6 +329,9 @@ void LLVMDumpModule(LLVMModuleRef M);
 /** See Module::setModuleInlineAsm. */
 void LLVMSetModuleInlineAsm(LLVMModuleRef M, const char *Asm);
 
+/** See Module::getContext. */
+LLVMContextRef LLVMGetModuleContext(LLVMModuleRef M);
+
 /*===-- Types -------------------------------------------------------------===*/
 
 /* LLVM types conform to the following hierarchy:
index eb0af30a2fc2eadf300f163c58e9d689f603de44..858f49cdf5131a4d336f46c829856c771230f878 100644 (file)
@@ -138,6 +138,12 @@ void LLVMSetModuleInlineAsm(LLVMModuleRef M, const char *Asm) {
 }
 
 
+/*--.. Operations on module contexts ......................................--*/
+LLVMContextRef LLVMGetModuleContext(LLVMModuleRef M) {
+  return wrap(&unwrap(M)->getContext());
+}
+
+
 /*===-- Operations on types -----------------------------------------------===*/
 
 /*--.. Operations on all types (mostly) ....................................--*/