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/Target/AArch64/AArch64PromoteConstant.cpp b/llvm/lib/Target/AArch64/AArch64PromoteConstant.cpp
index a8dc6e7..01d8a35 100644
--- a/llvm/lib/Target/AArch64/AArch64PromoteConstant.cpp
+++ b/llvm/lib/Target/AArch64/AArch64PromoteConstant.cpp
@@ -119,7 +119,7 @@
   /// Iterate over the functions and promote the interesting constants into
   /// global variables with module scope.
   bool runOnModule(Module &M) override {
-    DEBUG(dbgs() << getPassName() << '\n');
+    LLVM_DEBUG(dbgs() << getPassName() << '\n');
     if (skipModule(M))
       return false;
     bool Changed = false;
@@ -380,9 +380,9 @@
         (IPI.first->getParent() != NewPt->getParent() &&
          DT.dominates(IPI.first->getParent(), NewPt->getParent()))) {
       // No need to insert this point. Just record the dominated use.
-      DEBUG(dbgs() << "Insertion point dominated by:\n");
-      DEBUG(IPI.first->print(dbgs()));
-      DEBUG(dbgs() << '\n');
+      LLVM_DEBUG(dbgs() << "Insertion point dominated by:\n");
+      LLVM_DEBUG(IPI.first->print(dbgs()));
+      LLVM_DEBUG(dbgs() << '\n');
       IPI.second.emplace_back(User, OpNo);
       return true;
     }
@@ -408,9 +408,9 @@
       // Instructions are in the same block.
       // By construction, NewPt is dominating the other.
       // Indeed, isDominated returned false with the exact same arguments.
-      DEBUG(dbgs() << "Merge insertion point with:\n");
-      DEBUG(IPI->first->print(dbgs()));
-      DEBUG(dbgs() << "\nat considered insertion point.\n");
+      LLVM_DEBUG(dbgs() << "Merge insertion point with:\n");
+      LLVM_DEBUG(IPI->first->print(dbgs()));
+      LLVM_DEBUG(dbgs() << "\nat considered insertion point.\n");
       appendAndTransferDominatedUses(NewPt, User, OpNo, IPI, InsertPts);
       return true;
     }
@@ -430,11 +430,11 @@
     }
     // else, CommonDominator is the block of NewBB, hence NewBB is the last
     // possible insertion point in that block.
-    DEBUG(dbgs() << "Merge insertion point with:\n");
-    DEBUG(IPI->first->print(dbgs()));
-    DEBUG(dbgs() << '\n');
-    DEBUG(NewPt->print(dbgs()));
-    DEBUG(dbgs() << '\n');
+    LLVM_DEBUG(dbgs() << "Merge insertion point with:\n");
+    LLVM_DEBUG(IPI->first->print(dbgs()));
+    LLVM_DEBUG(dbgs() << '\n');
+    LLVM_DEBUG(NewPt->print(dbgs()));
+    LLVM_DEBUG(dbgs() << '\n');
     appendAndTransferDominatedUses(NewPt, User, OpNo, IPI, InsertPts);
     return true;
   }
@@ -443,15 +443,15 @@
 
 void AArch64PromoteConstant::computeInsertionPoint(
     Instruction *User, unsigned OpNo, InsertionPoints &InsertPts) {
-  DEBUG(dbgs() << "Considered use, opidx " << OpNo << ":\n");
-  DEBUG(User->print(dbgs()));
-  DEBUG(dbgs() << '\n');
+  LLVM_DEBUG(dbgs() << "Considered use, opidx " << OpNo << ":\n");
+  LLVM_DEBUG(User->print(dbgs()));
+  LLVM_DEBUG(dbgs() << '\n');
 
   Instruction *InsertionPoint = findInsertionPoint(*User, OpNo);
 
-  DEBUG(dbgs() << "Considered insertion point:\n");
-  DEBUG(InsertionPoint->print(dbgs()));
-  DEBUG(dbgs() << '\n');
+  LLVM_DEBUG(dbgs() << "Considered insertion point:\n");
+  LLVM_DEBUG(InsertionPoint->print(dbgs()));
+  LLVM_DEBUG(dbgs() << '\n');
 
   if (isDominated(InsertionPoint, User, OpNo, InsertPts))
     return;
@@ -460,7 +460,7 @@
   if (tryAndMerge(InsertionPoint, User, OpNo, InsertPts))
     return;
 
-  DEBUG(dbgs() << "Keep considered insertion point\n");
+  LLVM_DEBUG(dbgs() << "Keep considered insertion point\n");
 
   // It is definitely useful by its own
   InsertPts[InsertionPoint].emplace_back(User, OpNo);
@@ -476,9 +476,9 @@
       *F.getParent(), C.getType(), true, GlobalValue::InternalLinkage, nullptr,
       "_PromotedConst", nullptr, GlobalVariable::NotThreadLocal);
   PC.GV->setInitializer(&C);
-  DEBUG(dbgs() << "Global replacement: ");
-  DEBUG(PC.GV->print(dbgs()));
-  DEBUG(dbgs() << '\n');
+  LLVM_DEBUG(dbgs() << "Global replacement: ");
+  LLVM_DEBUG(PC.GV->print(dbgs()));
+  LLVM_DEBUG(dbgs() << '\n');
   ++NumPromoted;
 }
 
@@ -495,10 +495,10 @@
     // Create the load of the global variable.
     IRBuilder<> Builder(IPI.first);
     LoadInst *LoadedCst = Builder.CreateLoad(&PromotedGV);
-    DEBUG(dbgs() << "**********\n");
-    DEBUG(dbgs() << "New def: ");
-    DEBUG(LoadedCst->print(dbgs()));
-    DEBUG(dbgs() << '\n');
+    LLVM_DEBUG(dbgs() << "**********\n");
+    LLVM_DEBUG(dbgs() << "New def: ");
+    LLVM_DEBUG(LoadedCst->print(dbgs()));
+    LLVM_DEBUG(dbgs() << '\n');
 
     // Update the dominated uses.
     for (auto Use : IPI.second) {
@@ -507,11 +507,11 @@
                           findInsertionPoint(*Use.first, Use.second)) &&
              "Inserted definition does not dominate all its uses!");
 #endif
-      DEBUG({
-            dbgs() << "Use to update " << Use.second << ":";
-            Use.first->print(dbgs());
-            dbgs() << '\n';
-            });
+      LLVM_DEBUG({
+        dbgs() << "Use to update " << Use.second << ":";
+        Use.first->print(dbgs());
+        dbgs() << '\n';
+      });
       Use.first->setOperand(Use.second, LoadedCst);
       ++NumPromotedUses;
     }
@@ -523,7 +523,7 @@
     PromotionCacheTy &PromotionCache) {
   // Promote the constants.
   for (auto U = Updates.begin(), E = Updates.end(); U != E;) {
-    DEBUG(dbgs() << "** Compute insertion points **\n");
+    LLVM_DEBUG(dbgs() << "** Compute insertion points **\n");
     auto First = U;
     Constant *C = First->C;
     InsertionPoints InsertPts;