add a function to the C api to get the context out of a module, patch

by Eric Dobson!



git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@120259 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
Chris Lattner 2010-11-28 20:03:44 +00:00
parent bf953eaba3
commit a1ac3bbec7
2 changed files with 9 additions and 0 deletions

View 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:

View 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) ....................................--*/