diff options
author | Anders Waldenborg <anders@0x63.nu> | 2013-10-16 21:30:25 +0000 |
---|---|---|
committer | Anders Waldenborg <anders@0x63.nu> | 2013-10-16 21:30:25 +0000 |
commit | 75a5df1d1e086f3d9c46e1b602381fb56a8911f3 (patch) | |
tree | 277795ed31834cc0a2c322a0f35a1203473a0e16 | |
parent | 36a02c02895ec18953c1bf1e87b78f8c8b8d7947 (diff) | |
download | external_llvm-75a5df1d1e086f3d9c46e1b602381fb56a8911f3.zip external_llvm-75a5df1d1e086f3d9c46e1b602381fb56a8911f3.tar.gz external_llvm-75a5df1d1e086f3d9c46e1b602381fb56a8911f3.tar.bz2 |
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
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@192852 91177308-0d34-0410-b5e6-96231b3b80d8
-rw-r--r-- | include/llvm-c/Core.h | 7 | ||||
-rw-r--r-- | lib/IR/Core.cpp | 4 |
2 files changed, 11 insertions, 0 deletions
diff --git a/include/llvm-c/Core.h b/include/llvm-c/Core.h index caadab1..d39128d 100644 --- a/include/llvm-c/Core.h +++ b/include/llvm-c/Core.h @@ -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. diff --git a/lib/IR/Core.cpp b/lib/IR/Core.cpp index cf1c1df..7d52386 100644 --- a/lib/IR/Core.cpp +++ b/lib/IR/Core.cpp @@ -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) { |