From 22dffde22e783acc6b4db8a8343676d769d7ce69 Mon Sep 17 00:00:00 2001 From: Evgeny Mankov Date: Wed, 11 Jul 2018 18:21:00 +0300 Subject: [PATCH] [HIPIFY] Add DEBUG(X) macro compatibility In LLVM 7.0 DEBUG(X) was deleted, LLVM_DEBUG(X) should be used instead. --- hipamd/hipify-clang/src/LLVMCompat.h | 4 ++++ hipamd/hipify-clang/src/main.cpp | 2 +- 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/hipamd/hipify-clang/src/LLVMCompat.h b/hipamd/hipify-clang/src/LLVMCompat.h index 3e2fe1aebb..72b6832012 100644 --- a/hipamd/hipify-clang/src/LLVMCompat.h +++ b/hipamd/hipify-clang/src/LLVMCompat.h @@ -23,6 +23,10 @@ namespace llcompat { #define GET_NUM_ARGS() getNumArgs() #endif +#if LLVM_VERSION_MAJOR < 7 + #define LLVM_DEBUG(X) DEBUG(X) +#endif + void PrintStackTraceOnErrorSignal(); /** diff --git a/hipamd/hipify-clang/src/main.cpp b/hipamd/hipify-clang/src/main.cpp index ccf627b147..e420ab0681 100644 --- a/hipamd/hipify-clang/src/main.cpp +++ b/hipamd/hipify-clang/src/main.cpp @@ -132,7 +132,7 @@ int main(int argc, const char **argv) { // Hipify _all_ the things! if (Tool.runAndSave(&actionFactory)) { - DEBUG(llvm::dbgs() << "Skipped some replacements.\n"); + LLVM_DEBUG(llvm::dbgs() << "Skipped some replacements.\n"); } // Either move the tmpfile to the output, or remove it.