aboutsummaryrefslogtreecommitdiffstats
path: root/lib/IR/Core.cpp
diff options
context:
space:
mode:
authorAnders Waldenborg <anders@0x63.nu>2013-10-22 06:58:34 +0000
committerAnders Waldenborg <anders@0x63.nu>2013-10-22 06:58:34 +0000
commit18b9105d02ee152e7f8faab751d6f356428c3054 (patch)
tree2416179e0d6ae8dfa81103982352717a36a54022 /lib/IR/Core.cpp
parente877eebfe9d716ed1101aecf958af473836e70e1 (diff)
downloadexternal_llvm-18b9105d02ee152e7f8faab751d6f356428c3054.zip
external_llvm-18b9105d02ee152e7f8faab751d6f356428c3054.tar.gz
external_llvm-18b9105d02ee152e7f8faab751d6f356428c3054.tar.bz2
llvm-c: Add LLVMPrintTypeToString
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
Diffstat (limited to 'lib/IR/Core.cpp')
-rw-r--r--lib/IR/Core.cpp10
1 files changed, 10 insertions, 0 deletions
diff --git a/lib/IR/Core.cpp b/lib/IR/Core.cpp
index 7d52386..16af733 100644
--- a/lib/IR/Core.cpp
+++ b/lib/IR/Core.cpp
@@ -224,6 +224,16 @@ void LLVMDumpType(LLVMTypeRef Ty) {
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) {