[PATCH] D46952: Remove the DEBUG macro.

Nicola Zaghen via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Wed May 16 08:31:29 PDT 2018


Nicola created this revision.
Nicola added reviewers: zturner, kuhar, jyknight.
Herald added a subscriber: llvm-commits.

Now that the LLVM_DEBUG() macro landed on the various sub-projects the DEBUG macro can be removed.

Only one new use of the old DEBUG macro happened in the meantime, so I'm also cleaning that one up.


Repository:
  rL LLVM

https://reviews.llvm.org/D46952

Files:
  include/llvm/DebugInfo/PDB/DIA/DIASupport.h
  include/llvm/Support/Debug.h
  lib/Transforms/IPO/MergeFunctions.cpp


Index: lib/Transforms/IPO/MergeFunctions.cpp
===================================================================
--- lib/Transforms/IPO/MergeFunctions.cpp
+++ lib/Transforms/IPO/MergeFunctions.cpp
@@ -645,8 +645,8 @@
 static bool isThunkProfitable(Function * F) {
   if (F->size() == 1) {
     if (F->front().size() <= 2) {
-      DEBUG(dbgs() << "isThunkProfitable: " << F->getName()
-                    << " is too small to bother creating a thunk for\n");
+      LLVM_DEBUG(dbgs() << "isThunkProfitable: " << F->getName()
+                        << " is too small to bother creating a thunk for\n");
       return false;
     }
   }
Index: include/llvm/Support/Debug.h
===================================================================
--- include/llvm/Support/Debug.h
+++ include/llvm/Support/Debug.h
@@ -118,8 +118,6 @@
 //
 #define LLVM_DEBUG(X) DEBUG_WITH_TYPE(DEBUG_TYPE, X)
 
-#define DEBUG(X) LLVM_DEBUG(X)
-
 } // end namespace llvm
 
 #endif // LLVM_SUPPORT_DEBUG_H
Index: include/llvm/DebugInfo/PDB/DIA/DIASupport.h
===================================================================
--- include/llvm/DebugInfo/PDB/DIA/DIASupport.h
+++ include/llvm/DebugInfo/PDB/DIA/DIASupport.h
@@ -22,14 +22,6 @@
 #define NOMINMAX
 #endif
 
-// llvm/Support/Debug.h unconditionally #defines DEBUG as a macro.
-// DIA headers #define it if it is not already defined, so we have
-// an order of includes problem.  The real fix is to make LLVM use
-// something less generic than DEBUG, such as LLVM_DEBUG(), but it's
-// fairly prevalent.  So for now, we save the definition state and
-// restore it.
-#pragma push_macro("DEBUG")
-
 // atlbase.h has to come before windows.h
 #include <atlbase.h>
 #include <windows.h>
@@ -39,6 +31,4 @@
 #include <dia2.h>
 #include <diacreate.h>
 
-#pragma pop_macro("DEBUG")
-
 #endif // LLVM_DEBUGINFO_PDB_DIA_DIASUPPORT_H


-------------- next part --------------
A non-text attachment was scrubbed...
Name: D46952.147099.patch
Type: text/x-patch
Size: 1859 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20180516/e8f28a44/attachment.bin>


More information about the llvm-commits mailing list