summaryrefslogtreecommitdiffstats
path: root/llvm/lib/IR/Core.cpp
diff options
context:
space:
mode:
authorPeter Zotov <whitequark@whitequark.org>2013-11-06 09:21:01 +0000
committerPeter Zotov <whitequark@whitequark.org>2013-11-06 09:21:01 +0000
commitcd93b370d5978a37c0eda541b3d594f16c7a28b4 (patch)
tree7936d969b99607e9facfd053f9c08390737cf764 /llvm/lib/IR/Core.cpp
parent08b0418828a1af90d1d7365d0e4abc0ba075bef9 (diff)
downloadbcm5719-llvm-cd93b370d5978a37c0eda541b3d594f16c7a28b4.tar.gz
bcm5719-llvm-cd93b370d5978a37c0eda541b3d594f16c7a28b4.zip
[llvm-c] Implement LLVMPrintValueToString
Original patch by Chris Wailes llvm-svn: 194135
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 40db69b3700..63cc2f6f06a 100644
--- a/llvm/lib/IR/Core.cpp
+++ b/llvm/lib/IR/Core.cpp
@@ -474,6 +474,16 @@ void LLVMDumpValue(LLVMValueRef Val) {
unwrap(Val)->dump();
}
+char* LLVMPrintValueToString(LLVMValueRef Val) {
+ std::string buf;
+ raw_string_ostream os(buf);
+
+ unwrap(Val)->print(os);
+ os.flush();
+
+ return strdup(buf.c_str());
+}
+
void LLVMReplaceAllUsesWith(LLVMValueRef OldVal, LLVMValueRef NewVal) {
unwrap(OldVal)->replaceAllUsesWith(unwrap(NewVal));
}
OpenPOWER on IntegriCloud