[llvm-commits] [llvm] r120259 - in /llvm/trunk: include/llvm-c/Core.h lib/VMCore/Core.cpp
Chris Lattner
sabre at nondot.org
Sun Nov 28 12:03:44 PST 2010
Author: lattner
Date: Sun Nov 28 14:03:44 2010
New Revision: 120259
URL: http://llvm.org/viewvc/llvm-project?rev=120259&view=rev
Log:
add a function to the C api to get the context out of a module, patch
by Eric Dobson!
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=120259&r1=120258&r2=120259&view=diff
==============================================================================
--- llvm/trunk/include/llvm-c/Core.h (original)
+++ llvm/trunk/include/llvm-c/Core.h Sun Nov 28 14:03:44 2010
@@ -329,6 +329,9 @@
/** 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:
Modified: llvm/trunk/lib/VMCore/Core.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/VMCore/Core.cpp?rev=120259&r1=120258&r2=120259&view=diff
==============================================================================
--- llvm/trunk/lib/VMCore/Core.cpp (original)
+++ llvm/trunk/lib/VMCore/Core.cpp Sun Nov 28 14:03:44 2010
@@ -138,6 +138,12 @@
}
+/*--.. Operations on module contexts ......................................--*/
+LLVMContextRef LLVMGetModuleContext(LLVMModuleRef M) {
+ return wrap(&unwrap(M)->getContext());
+}
+
+
/*===-- Operations on types -----------------------------------------------===*/
/*--.. Operations on all types (mostly) ....................................--*/
More information about the llvm-commits
mailing list