From b397ebf86a294c2313a9a3e9b67b3ff54630272c Mon Sep 17 00:00:00 2001 From: whitequark Date: Tue, 17 Apr 2018 14:52:43 +0000 Subject: [PATCH] [LLVM-C] [PR34633] Avoid calling ->dump() methods from LLVMDump*. LLVMDump* functions are available in Release builds too. Patch by Brenton Bostick. Differential Revision: https://reviews.llvm.org/D44600 git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@330189 91177308-0d34-0410-b5e6-96231b3b80d8 --- lib/IR/Core.cpp | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) diff --git a/lib/IR/Core.cpp b/lib/IR/Core.cpp index cf1cd28a46c..032b2ea729c 100644 --- a/lib/IR/Core.cpp +++ b/lib/IR/Core.cpp @@ -402,11 +402,9 @@ LLVMContextRef LLVMGetTypeContext(LLVMTypeRef Ty) { return wrap(&unwrap(Ty)->getContext()); } -#if !defined(NDEBUG) || defined(LLVM_ENABLE_DUMP) -LLVM_DUMP_METHOD void LLVMDumpType(LLVMTypeRef Ty) { - return unwrap(Ty)->dump(); +void LLVMDumpType(LLVMTypeRef Ty) { + return unwrap(Ty)->print(errs(), /*IsForDebug=*/true); } -#endif char *LLVMPrintTypeToString(LLVMTypeRef Ty) { std::string buf; @@ -701,7 +699,7 @@ void LLVMSetValueName(LLVMValueRef Val, const char *Name) { unwrap(Val)->setName(Name); } -LLVM_DUMP_METHOD void LLVMDumpValue(LLVMValueRef Val) { +void LLVMDumpValue(LLVMValueRef Val) { unwrap(Val)->print(errs(), /*IsForDebug=*/true); } -- 2.11.0