OSDN Git Service

[LLVM-C] [PR34633] Avoid calling ->dump() methods from LLVMDump*.
authorwhitequark <whitequark@whitequark.org>
Tue, 17 Apr 2018 14:52:43 +0000 (14:52 +0000)
committerwhitequark <whitequark@whitequark.org>
Tue, 17 Apr 2018 14:52:43 +0000 (14:52 +0000)
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

index cf1cd28..032b2ea 100644 (file)
@@ -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);
 }