[llvm-commits] [llvm] r125845 - in /llvm/trunk: include/llvm-c/Core.h lib/VMCore/Core.cpp
Rafael Espindola
rafael.espindola at gmail.com
Fri Feb 18 08:35:37 PST 2011
Author: rafael
Date: Fri Feb 18 10:35:37 2011
New Revision: 125845
URL: http://llvm.org/viewvc/llvm-project?rev=125845&view=rev
Log:
Expose getTypeName to the C API. Patch by Patrick Walton.
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=125845&r1=125844&r2=125845&view=diff
==============================================================================
--- llvm/trunk/include/llvm-c/Core.h (original)
+++ llvm/trunk/include/llvm-c/Core.h Fri Feb 18 10:35:37 2011
@@ -322,6 +322,7 @@
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);
Modified: llvm/trunk/lib/VMCore/Core.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/VMCore/Core.cpp?rev=125845&r1=125844&r2=125845&view=diff
==============================================================================
--- llvm/trunk/lib/VMCore/Core.cpp (original)
+++ llvm/trunk/lib/VMCore/Core.cpp Fri Feb 18 10:35:37 2011
@@ -128,6 +128,10 @@
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();
}
More information about the llvm-commits
mailing list