1
0
mirror of https://github.com/RPCS3/llvm-mirror.git synced 2025-02-01 05:01:59 +01:00

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

llvm-svn: 125845
This commit is contained in:
Rafael Espindola 2011-02-18 16:35:37 +00:00
parent 1ddd628de0
commit 05e2f8b789
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); LLVMBool LLVMAddTypeName(LLVMModuleRef M, const char *Name, LLVMTypeRef Ty);
void LLVMDeleteTypeName(LLVMModuleRef M, const char *Name); void LLVMDeleteTypeName(LLVMModuleRef M, const char *Name);
LLVMTypeRef LLVMGetTypeByName(LLVMModuleRef M, const char *Name); LLVMTypeRef LLVMGetTypeByName(LLVMModuleRef M, const char *Name);
const char *LLVMGetTypeName(LLVMModuleRef M, LLVMTypeRef Ty);
/** See Module::dump. */ /** See Module::dump. */
void LLVMDumpModule(LLVMModuleRef M); void LLVMDumpModule(LLVMModuleRef M);

View File

@ -128,6 +128,10 @@ LLVMTypeRef LLVMGetTypeByName(LLVMModuleRef M, const char *Name) {
return wrap(unwrap(M)->getTypeByName(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) { void LLVMDumpModule(LLVMModuleRef M) {
unwrap(M)->dump(); unwrap(M)->dump();
} }