diff options
| author | Rafael Espindola <rafael.espindola@gmail.com> | 2011-02-18 16:35:37 +0000 |
|---|---|---|
| committer | Rafael Espindola <rafael.espindola@gmail.com> | 2011-02-18 16:35:37 +0000 |
| commit | 7c0cb2bbf552d093ad8ff293a88200ebe67922d2 (patch) | |
| tree | dd059664111731e97db24e51fdaf5f2766e61fbd | |
| parent | 84653b3674faa2ddbbbd68208b15d58047a658c7 (diff) | |
| download | bcm5719-llvm-7c0cb2bbf552d093ad8ff293a88200ebe67922d2.tar.gz bcm5719-llvm-7c0cb2bbf552d093ad8ff293a88200ebe67922d2.zip | |
Expose getTypeName to the C API. Patch by Patrick Walton.
llvm-svn: 125845
| -rw-r--r-- | llvm/include/llvm-c/Core.h | 1 | ||||
| -rw-r--r-- | llvm/lib/VMCore/Core.cpp | 4 |
2 files changed, 5 insertions, 0 deletions
diff --git a/llvm/include/llvm-c/Core.h b/llvm/include/llvm-c/Core.h index d8a491d82be..39c3cb40117 100644 --- a/llvm/include/llvm-c/Core.h +++ b/llvm/include/llvm-c/Core.h @@ -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); diff --git a/llvm/lib/VMCore/Core.cpp b/llvm/lib/VMCore/Core.cpp index 5fd37351e2d..35c3a2e9258 100644 --- a/llvm/lib/VMCore/Core.cpp +++ b/llvm/lib/VMCore/Core.cpp @@ -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(); } |

