llvm-c: Add LLVMDumpType
authorAnders Waldenborg <anders@0x63.nu>
Wed, 16 Oct 2013 21:30:25 +0000 (21:30 +0000)
committerAnders Waldenborg <anders@0x63.nu>
Wed, 16 Oct 2013 21:30:25 +0000 (21:30 +0000)
The C API currently allows to dump values (LLVMDumpValue), but a similar method for types was not exported.

Patch by Peter Zotov

Differential Revision: http://llvm-reviews.chandlerc.com/D1911

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@192852 91177308-0d34-0410-b5e6-96231b3b80d8

include/llvm-c/Core.h
lib/IR/Core.cpp

index caadab1bac2c24c643522fdf182e8331a3ff9226..d39128db1a6d0322627d4ae123702dafcf69a8a9 100644 (file)
@@ -699,6 +699,13 @@ LLVMBool LLVMTypeIsSized(LLVMTypeRef Ty);
  */
 LLVMContextRef LLVMGetTypeContext(LLVMTypeRef Ty);
 
+/**
+ * Dump a representation of a type to stderr.
+ *
+ * @see llvm::Type::dump()
+ */
+void LLVMDumpType(LLVMTypeRef Val);
+
 /**
  * @defgroup LLVMCCoreTypeInt Integer Types
  *
index cf1c1df0ed6770913a5d95d565f7d4fe89b6a5ed..7d52386b061ad85f9a463149814d8cbca513f92c 100644 (file)
@@ -220,6 +220,10 @@ LLVMContextRef LLVMGetTypeContext(LLVMTypeRef Ty) {
   return wrap(&unwrap(Ty)->getContext());
 }
 
+void LLVMDumpType(LLVMTypeRef Ty) {
+  return unwrap(Ty)->dump();
+}
+
 /*--.. Operations on integer types .........................................--*/
 
 LLVMTypeRef LLVMInt1TypeInContext(LLVMContextRef C)  {