diff options
Diffstat (limited to 'lib/IR')
-rw-r--r-- | lib/IR/Core.cpp | 10 |
1 files changed, 10 insertions, 0 deletions
diff --git a/lib/IR/Core.cpp b/lib/IR/Core.cpp index 40db69b370..63cc2f6f06 100644 --- a/lib/IR/Core.cpp +++ b/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)); } |