summaryrefslogtreecommitdiffstats
path: root/llvm/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
commit47b3bd3fbb131b47268af300a65af52c159052dc (patch)
tree7784adf599940be8612e2553d23aa78a600cbd7a /llvm/lib/IR/Core.cpp
parent3461bedbfd1531fd40c252b77aaf3c04900b50ee (diff)
downloadbcm5719-llvm-47b3bd3fbb131b47268af300a65af52c159052dc.tar.gz
bcm5719-llvm-47b3bd3fbb131b47268af300a65af52c159052dc.zip
llvm-c: Add LLVMPrintTypeToString
Differential Revision: http://llvm-reviews.chandlerc.com/D1963 llvm-svn: 193149
Diffstat (limited to 'llvm/lib/IR/Core.cpp')
-rw-r--r--llvm/lib/IR/Core.cpp10
1 files changed, 10 insertions, 0 deletions
diff --git a/llvm/lib/IR/Core.cpp b/llvm/lib/IR/Core.cpp
index 7d52386b061..16af7332d3c 100644
--- a/llvm/lib/IR/Core.cpp
+++ b/llvm/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) {
OpenPOWER on IntegriCloud