diff options
author | Anders Waldenborg <anders@0x63.nu> | 2013-10-22 06:58:34 +0000 |
---|---|---|
committer | Anders Waldenborg <anders@0x63.nu> | 2013-10-22 06:58:34 +0000 |
commit | 47b3bd3fbb131b47268af300a65af52c159052dc (patch) | |
tree | 7784adf599940be8612e2553d23aa78a600cbd7a /llvm/lib | |
parent | 3461bedbfd1531fd40c252b77aaf3c04900b50ee (diff) | |
download | bcm5719-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')
-rw-r--r-- | llvm/lib/IR/Core.cpp | 10 |
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) { |