Expose getTypeName to the C API. Patch by Patrick Walton.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@125845 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
Rafael Espindola 2011-02-18 16:35:37 +00:00
parent 39a7de72c8
commit 1e09e5b979
2 changed files with 5 additions and 0 deletions

View File

@ -322,6 +322,7 @@ void LLVMSetTarget(LLVMModuleRef M, const char *Triple);
LLVMBool LLVMAddTypeName(LLVMModuleRef M, const char *Name, LLVMTypeRef Ty);
void LLVMDeleteTypeName(LLVMModuleRef M, const char *Name);
LLVMTypeRef LLVMGetTypeByName(LLVMModuleRef M, const char *Name);
const char *LLVMGetTypeName(LLVMModuleRef M, LLVMTypeRef Ty);
/** See Module::dump. */
void LLVMDumpModule(LLVMModuleRef M);

View File

@ -128,6 +128,10 @@ LLVMTypeRef LLVMGetTypeByName(LLVMModuleRef M, const char *Name) {
return wrap(unwrap(M)->getTypeByName(Name));
}
const char *LLVMGetTypeName(LLVMModuleRef M, LLVMTypeRef Ty) {
return unwrap(M)->getTypeName(unwrap(Ty)).c_str();
}
void LLVMDumpModule(LLVMModuleRef M) {
unwrap(M)->dump();
}