diff options
author | Nicola Zaghen <nicola.zaghen@imgtec.com> | 2018-05-14 12:53:11 +0000 |
---|---|---|
committer | Nicola Zaghen <nicola.zaghen@imgtec.com> | 2018-05-14 12:53:11 +0000 |
commit | d34e60ca8532511acb8c93ef26297e349fbec86a (patch) | |
tree | 1a095bc8694498d94232e81b95c1da05d462d3ec /llvm/lib/IR | |
parent | affbc99bea94e77f7ebccd8ba887e33051bd04ee (diff) | |
download | bcm5719-llvm-d34e60ca8532511acb8c93ef26297e349fbec86a.tar.gz bcm5719-llvm-d34e60ca8532511acb8c93ef26297e349fbec86a.zip |
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
Diffstat (limited to 'llvm/lib/IR')
-rw-r--r-- | llvm/lib/IR/ConstantsContext.h | 4 | ||||
-rw-r--r-- | llvm/lib/IR/Core.cpp | 19 | ||||
-rw-r--r-- | llvm/lib/IR/Pass.cpp | 8 | ||||
-rw-r--r-- | llvm/lib/IR/SafepointIRVerifier.cpp | 21 | ||||
-rw-r--r-- | llvm/lib/IR/ValueSymbolTable.cpp | 7 |
5 files changed, 33 insertions, 26 deletions
diff --git a/llvm/lib/IR/ConstantsContext.h b/llvm/lib/IR/ConstantsContext.h index 6585304e767..e9f31e4ded6 100644 --- a/llvm/lib/IR/ConstantsContext.h +++ b/llvm/lib/IR/ConstantsContext.h @@ -695,7 +695,9 @@ public: return nullptr; } - void dump() const { DEBUG(dbgs() << "Constant.cpp: ConstantUniqueMap\n"); } + void dump() const { + LLVM_DEBUG(dbgs() << "Constant.cpp: ConstantUniqueMap\n"); + } }; } // end namespace llvm diff --git a/llvm/lib/IR/Core.cpp b/llvm/lib/IR/Core.cpp index 02311db66e3..5f13f237d0d 100644 --- a/llvm/lib/IR/Core.cpp +++ b/llvm/lib/IR/Core.cpp @@ -1669,8 +1669,9 @@ void LLVMSetLinkage(LLVMValueRef Global, LLVMLinkage Linkage) { GV->setLinkage(GlobalValue::LinkOnceODRLinkage); break; case LLVMLinkOnceODRAutoHideLinkage: - DEBUG(errs() << "LLVMSetLinkage(): LLVMLinkOnceODRAutoHideLinkage is no " - "longer supported."); + LLVM_DEBUG( + errs() << "LLVMSetLinkage(): LLVMLinkOnceODRAutoHideLinkage is no " + "longer supported."); break; case LLVMWeakAnyLinkage: GV->setLinkage(GlobalValue::WeakAnyLinkage); @@ -1694,19 +1695,21 @@ void LLVMSetLinkage(LLVMValueRef Global, LLVMLinkage Linkage) { GV->setLinkage(GlobalValue::PrivateLinkage); break; case LLVMDLLImportLinkage: - DEBUG(errs() - << "LLVMSetLinkage(): LLVMDLLImportLinkage is no longer supported."); + LLVM_DEBUG( + errs() + << "LLVMSetLinkage(): LLVMDLLImportLinkage is no longer supported."); break; case LLVMDLLExportLinkage: - DEBUG(errs() - << "LLVMSetLinkage(): LLVMDLLExportLinkage is no longer supported."); + LLVM_DEBUG( + errs() + << "LLVMSetLinkage(): LLVMDLLExportLinkage is no longer supported."); break; case LLVMExternalWeakLinkage: GV->setLinkage(GlobalValue::ExternalWeakLinkage); break; case LLVMGhostLinkage: - DEBUG(errs() - << "LLVMSetLinkage(): LLVMGhostLinkage is no longer supported."); + LLVM_DEBUG( + errs() << "LLVMSetLinkage(): LLVMGhostLinkage is no longer supported."); break; case LLVMCommonLinkage: GV->setLinkage(GlobalValue::CommonLinkage); diff --git a/llvm/lib/IR/Pass.cpp b/llvm/lib/IR/Pass.cpp index 0c7dfb6e9e7..a1dc1788249 100644 --- a/llvm/lib/IR/Pass.cpp +++ b/llvm/lib/IR/Pass.cpp @@ -160,8 +160,8 @@ bool FunctionPass::skipFunction(const Function &F) const { return true; if (F.hasFnAttribute(Attribute::OptimizeNone)) { - DEBUG(dbgs() << "Skipping pass '" << getPassName() << "' on function " - << F.getName() << "\n"); + LLVM_DEBUG(dbgs() << "Skipping pass '" << getPassName() << "' on function " + << F.getName() << "\n"); return true; } return false; @@ -195,8 +195,8 @@ bool BasicBlockPass::skipBasicBlock(const BasicBlock &BB) const { if (F->hasFnAttribute(Attribute::OptimizeNone)) { // Report this only once per function. if (&BB == &F->getEntryBlock()) - DEBUG(dbgs() << "Skipping pass '" << getPassName() - << "' on function " << F->getName() << "\n"); + LLVM_DEBUG(dbgs() << "Skipping pass '" << getPassName() + << "' on function " << F->getName() << "\n"); return true; } return false; diff --git a/llvm/lib/IR/SafepointIRVerifier.cpp b/llvm/lib/IR/SafepointIRVerifier.cpp index 04deb434cec..25a7f8d6d51 100644 --- a/llvm/lib/IR/SafepointIRVerifier.cpp +++ b/llvm/lib/IR/SafepointIRVerifier.cpp @@ -535,16 +535,16 @@ bool GCPtrTracker::removeValidUnrelocatedDefs(const BasicBlock *BB, Contribution.erase(&I); PoisonedDefs.erase(&I); ValidUnrelocatedDefs.insert(&I); - DEBUG(dbgs() << "Removing urelocated " << I << " from Contribution of " - << BB->getName() << "\n"); + LLVM_DEBUG(dbgs() << "Removing urelocated " << I + << " from Contribution of " << BB->getName() << "\n"); ContributionChanged = true; } else if (PoisonedPointerDef) { // Mark pointer as poisoned, remove its def from Contribution and trigger // update of all successors. Contribution.erase(&I); PoisonedDefs.insert(&I); - DEBUG(dbgs() << "Removing poisoned " << I << " from Contribution of " - << BB->getName() << "\n"); + LLVM_DEBUG(dbgs() << "Removing poisoned " << I << " from Contribution of " + << BB->getName() << "\n"); ContributionChanged = true; } else { bool Cleared = false; @@ -594,11 +594,11 @@ void GCPtrTracker::transferBlock(const BasicBlock *BB, BasicBlockState &BBS, AvailableOut = std::move(Temp); } - DEBUG(dbgs() << "Transfered block " << BB->getName() << " from "; - PrintValueSet(dbgs(), AvailableIn.begin(), AvailableIn.end()); - dbgs() << " to "; - PrintValueSet(dbgs(), AvailableOut.begin(), AvailableOut.end()); - dbgs() << "\n";); + LLVM_DEBUG(dbgs() << "Transfered block " << BB->getName() << " from "; + PrintValueSet(dbgs(), AvailableIn.begin(), AvailableIn.end()); + dbgs() << " to "; + PrintValueSet(dbgs(), AvailableOut.begin(), AvailableOut.end()); + dbgs() << "\n";); } void GCPtrTracker::transferInstruction(const Instruction &I, bool &Cleared, @@ -698,7 +698,8 @@ void InstructionVerifier::reportInvalidUse(const Value &V, } static void Verify(const Function &F, const DominatorTree &DT) { - DEBUG(dbgs() << "Verifying gc pointers in function: " << F.getName() << "\n"); + LLVM_DEBUG(dbgs() << "Verifying gc pointers in function: " << F.getName() + << "\n"); if (PrintOnly) dbgs() << "Verifying gc pointers in function: " << F.getName() << "\n"; diff --git a/llvm/lib/IR/ValueSymbolTable.cpp b/llvm/lib/IR/ValueSymbolTable.cpp index 15988caa65e..0a7f2803cd4 100644 --- a/llvm/lib/IR/ValueSymbolTable.cpp +++ b/llvm/lib/IR/ValueSymbolTable.cpp @@ -75,7 +75,8 @@ void ValueSymbolTable::reinsertValue(Value* V) { // Try inserting the name, assuming it won't conflict. if (vmap.insert(V->getValueName())) { - //DEBUG(dbgs() << " Inserted value: " << V->getValueName() << ": " << *V << "\n"); + // LLVM_DEBUG(dbgs() << " Inserted value: " << V->getValueName() << ": " << + // *V << "\n"); return; } @@ -90,7 +91,7 @@ void ValueSymbolTable::reinsertValue(Value* V) { } void ValueSymbolTable::removeValueName(ValueName *V) { - //DEBUG(dbgs() << " Removing Value: " << V->getKeyData() << "\n"); + // LLVM_DEBUG(dbgs() << " Removing Value: " << V->getKeyData() << "\n"); // Remove the value from the symbol table. vmap.remove(V); } @@ -102,7 +103,7 @@ ValueName *ValueSymbolTable::createValueName(StringRef Name, Value *V) { // In the common case, the name is not already in the symbol table. auto IterBool = vmap.insert(std::make_pair(Name, V)); if (IterBool.second) { - //DEBUG(dbgs() << " Inserted value: " << Entry.getKeyData() << ": " + // LLVM_DEBUG(dbgs() << " Inserted value: " << Entry.getKeyData() << ": " // << *V << "\n"); return &*IterBool.first; } |