[llvm] r318373 - Add NDEBUG checks around LLVM_DUMP_METHOD functions for Wunused-function warnings.
Eric Christopher via llvm-commits
llvm-commits at lists.llvm.org
Wed Nov 15 19:18:15 PST 2017
Author: echristo
Date: Wed Nov 15 19:18:15 2017
New Revision: 318373
URL: http://llvm.org/viewvc/llvm-project?rev=318373&view=rev
Log:
Add NDEBUG checks around LLVM_DUMP_METHOD functions for Wunused-function warnings.
Modified:
llvm/trunk/lib/Target/AMDGPU/SIWholeQuadMode.cpp
llvm/trunk/lib/Target/Hexagon/HexagonConstExtenders.cpp
Modified: llvm/trunk/lib/Target/AMDGPU/SIWholeQuadMode.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Target/AMDGPU/SIWholeQuadMode.cpp?rev=318373&r1=318372&r2=318373&view=diff
==============================================================================
--- llvm/trunk/lib/Target/AMDGPU/SIWholeQuadMode.cpp (original)
+++ llvm/trunk/lib/Target/AMDGPU/SIWholeQuadMode.cpp Wed Nov 15 19:18:15 2017
@@ -103,6 +103,7 @@ public:
explicit PrintState(int State) : State(State) {}
};
+#ifndef NDEBUG
static raw_ostream &operator<<(raw_ostream &OS, const PrintState &PS) {
if (PS.State & StateWQM)
OS << "WQM";
@@ -119,6 +120,7 @@ static raw_ostream &operator<<(raw_ostre
return OS;
}
+#endif
struct InstrInfo {
char Needs = 0;
@@ -219,7 +221,8 @@ FunctionPass *llvm::createSIWholeQuadMod
return new SIWholeQuadMode;
}
-void SIWholeQuadMode::printInfo() {
+#ifndef NDEBUG
+LLVM_DEBUG_METHOD void SIWholeQuadMode::printInfo() {
for (const auto &BII : Blocks) {
dbgs() << "\nBB#" << BII.first->getNumber() << ":\n"
<< " InNeeds = " << PrintState(BII.second.InNeeds)
@@ -236,6 +239,7 @@ void SIWholeQuadMode::printInfo() {
}
}
}
+#endif
void SIWholeQuadMode::markInstruction(MachineInstr &MI, char Flag,
std::vector<WorkItem> &Worklist) {
Modified: llvm/trunk/lib/Target/Hexagon/HexagonConstExtenders.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Target/Hexagon/HexagonConstExtenders.cpp?rev=318373&r1=318372&r2=318373&view=diff
==============================================================================
--- llvm/trunk/lib/Target/Hexagon/HexagonConstExtenders.cpp (original)
+++ llvm/trunk/lib/Target/Hexagon/HexagonConstExtenders.cpp Wed Nov 15 19:18:15 2017
@@ -548,13 +548,14 @@ static unsigned ReplaceCounter = 0;
char HCE::ID = 0;
+#ifndef NDEBUG
LLVM_DUMP_METHOD void RangeTree::dump() const {
dbgs() << "Root: " << Root << '\n';
if (Root)
dump(Root);
}
-void RangeTree::dump(const Node *N) const {
+LLVM_DUMP_METHOD void RangeTree::dump(const Node *N) const {
dbgs() << "Node: " << N << '\n';
dbgs() << " Height: " << N->Height << '\n';
dbgs() << " Count: " << N->Count << '\n';
@@ -568,6 +569,7 @@ void RangeTree::dump(const Node *N) cons
if (N->Right)
dump(N->Right);
}
+#endif
void RangeTree::order(Node *N, SmallVectorImpl<Node*> &Seq) const {
if (N == nullptr)
More information about the llvm-commits
mailing list