Rename DEBUG macro to LLVM_DEBUG.
    
The DEBUG() macro is very generic so it might clash with other projects.
The renaming was done as follows:
- git grep -l 'DEBUG' | xargs sed -i 's/\bDEBUG\s\?(/LLVM_DEBUG(/g'
- git diff -U0 master | ../clang/tools/clang-format/clang-format-diff.py -i -p1 -style LLVM
- Manual change to APInt
- Manually chage DOCS as regex doesn't match it.

In the transition period the DEBUG() macro is still present and aliased
to the LLVM_DEBUG() one.

Differential Revision: https://reviews.llvm.org/D43624

llvm-svn: 332240
diff --git a/llvm/lib/CodeGen/BranchRelaxation.cpp b/llvm/lib/CodeGen/BranchRelaxation.cpp
index 7446122..3866f51 100644
--- a/llvm/lib/CodeGen/BranchRelaxation.cpp
+++ b/llvm/lib/CodeGen/BranchRelaxation.cpp
@@ -288,10 +288,11 @@
   if (TII->isBranchOffsetInRange(MI.getOpcode(), DestOffset - BrOffset))
     return true;
 
-  DEBUG(dbgs() << "Out of range branch to destination "
-               << printMBBReference(DestBB) << " from "
-               << printMBBReference(*MI.getParent()) << " to " << DestOffset
-               << " offset " << DestOffset - BrOffset << '\t' << MI);
+  LLVM_DEBUG(dbgs() << "Out of range branch to destination "
+                    << printMBBReference(DestBB) << " from "
+                    << printMBBReference(*MI.getParent()) << " to "
+                    << DestOffset << " offset " << DestOffset - BrOffset << '\t'
+                    << MI);
 
   return false;
 }
@@ -360,8 +361,9 @@
       // =>
       // bne L2
       // b   L1
-      DEBUG(dbgs() << "  Invert condition and swap "
-            "its destination with " << MBB->back());
+      LLVM_DEBUG(dbgs() << "  Invert condition and swap "
+                           "its destination with "
+                        << MBB->back());
 
       removeBranch(MBB);
       insertBranch(MBB, FBB, TBB, Cond);
@@ -384,9 +386,9 @@
     // just created), so we can use the inverted the condition.
     MachineBasicBlock &NextBB = *std::next(MachineFunction::iterator(MBB));
 
-    DEBUG(dbgs() << "  Insert B to " << printMBBReference(*TBB)
-                 << ", invert condition and change dest. to "
-                 << printMBBReference(NextBB) << '\n');
+    LLVM_DEBUG(dbgs() << "  Insert B to " << printMBBReference(*TBB)
+                      << ", invert condition and change dest. to "
+                      << printMBBReference(NextBB) << '\n');
 
     removeBranch(MBB);
     // Insert a new conditional branch and a new unconditional branch.
@@ -397,8 +399,8 @@
   }
   // Branch cond can't be inverted.
   // In this case we always add a block after the MBB.
-  DEBUG(dbgs() << "  The branch condition can't be inverted. "
-               << "  Insert a new BB after " << MBB->back());
+  LLVM_DEBUG(dbgs() << "  The branch condition can't be inverted. "
+                    << "  Insert a new BB after " << MBB->back());
 
   if (!FBB)
     FBB = &(*std::next(MachineFunction::iterator(MBB)));
@@ -417,11 +419,12 @@
   NewBB = createNewBlockAfter(*MBB);
   insertUncondBranch(NewBB, TBB);
 
-  DEBUG(dbgs() << "  Insert cond B to the new BB " << printMBBReference(*NewBB)
-               << "  Keep the exiting condition.\n"
-               << "  Insert B to " << printMBBReference(*FBB) << ".\n"
-               << "  In the new BB: Insert B to "
-               << printMBBReference(*TBB) << ".\n");
+  LLVM_DEBUG(dbgs() << "  Insert cond B to the new BB "
+                    << printMBBReference(*NewBB)
+                    << "  Keep the exiting condition.\n"
+                    << "  Insert B to " << printMBBReference(*FBB) << ".\n"
+                    << "  In the new BB: Insert B to "
+                    << printMBBReference(*TBB) << ".\n");
 
   // Update the successor lists according to the transformation to follow.
   MBB->replaceSuccessor(TBB, NewBB);
@@ -541,7 +544,7 @@
 bool BranchRelaxation::runOnMachineFunction(MachineFunction &mf) {
   MF = &mf;
 
-  DEBUG(dbgs() << "***** BranchRelaxation *****\n");
+  LLVM_DEBUG(dbgs() << "***** BranchRelaxation *****\n");
 
   const TargetSubtargetInfo &ST = MF->getSubtarget();
   TII = ST.getInstrInfo();
@@ -558,7 +561,7 @@
   // sizes of each block.
   scanFunction();
 
-  DEBUG(dbgs() << "  Basic blocks before relaxation\n"; dumpBBs(););
+  LLVM_DEBUG(dbgs() << "  Basic blocks before relaxation\n"; dumpBBs(););
 
   bool MadeChange = false;
   while (relaxBranchInstructions())
@@ -567,7 +570,7 @@
   // After a while, this might be made debug-only, but it is not expensive.
   verify();
 
-  DEBUG(dbgs() << "  Basic blocks after relaxation\n\n"; dumpBBs());
+  LLVM_DEBUG(dbgs() << "  Basic blocks after relaxation\n\n"; dumpBBs());
 
   BlockInfo.clear();