Differential Revision: http://llvm-reviews.chandlerc.com/D1963
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@193149
91177308-0d34-0410-b5e6-
96231b3b80d8
void LLVMDumpType(LLVMTypeRef Val);
/**
+ * Return a string representation of the type. Use
+ * LLVMDisposeMessage to free the string.
+ *
+ * @see llvm::Type::print()
+ */
+char *LLVMPrintTypeToString(LLVMTypeRef Val);
+
+/**
* @defgroup LLVMCCoreTypeInt Integer Types
*
* Functions in this section operate on integer types.
return unwrap(Ty)->dump();
}
+char *LLVMPrintTypeToString(LLVMTypeRef Ty) {
+ std::string buf;
+ raw_string_ostream os(buf);
+
+ unwrap(Ty)->print(os);
+ os.flush();
+
+ return strdup(buf.c_str());
+}
+
/*--.. Operations on integer types .........................................--*/
LLVMTypeRef LLVMInt1TypeInContext(LLVMContextRef C) {