[llvm] r192852 - llvm-c: Add LLVMDumpType

Anders Waldenborg anders at 0x63.nu
Wed Oct 16 14:30:25 PDT 2013


Author: andersg
Date: Wed Oct 16 16:30:25 2013
New Revision: 192852

URL: http://llvm.org/viewvc/llvm-project?rev=192852&view=rev
Log:
llvm-c: Add LLVMDumpType

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


Modified:
    llvm/trunk/include/llvm-c/Core.h
    llvm/trunk/lib/IR/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=192852&r1=192851&r2=192852&view=diff
==============================================================================
--- llvm/trunk/include/llvm-c/Core.h (original)
+++ llvm/trunk/include/llvm-c/Core.h Wed Oct 16 16:30:25 2013
@@ -700,6 +700,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
  *
  * Functions in this section operate on integer types.

Modified: llvm/trunk/lib/IR/Core.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/IR/Core.cpp?rev=192852&r1=192851&r2=192852&view=diff
==============================================================================
--- llvm/trunk/lib/IR/Core.cpp (original)
+++ llvm/trunk/lib/IR/Core.cpp Wed Oct 16 16:30:25 2013
@@ -220,6 +220,10 @@ LLVMContextRef LLVMGetTypeContext(LLVMTy
   return wrap(&unwrap(Ty)->getContext());
 }
 
+void LLVMDumpType(LLVMTypeRef Ty) {
+  return unwrap(Ty)->dump();
+}
+
 /*--.. Operations on integer types .........................................--*/
 
 LLVMTypeRef LLVMInt1TypeInContext(LLVMContextRef C)  {





More information about the llvm-commits mailing list