[llvm] r346543 - [Hexagon] Fix some -Wunused-function with LLVM_DUMP_METHOD and -Wunused-variable
Fangrui Song via llvm-commits
llvm-commits at lists.llvm.org
Fri Nov 9 11:24:48 PST 2018
Author: maskray
Date: Fri Nov 9 11:24:48 2018
New Revision: 346543
URL: http://llvm.org/viewvc/llvm-project?rev=346543&view=rev
Log:
[Hexagon] Fix some -Wunused-function with LLVM_DUMP_METHOD and -Wunused-variable
Modified:
llvm/trunk/lib/Target/Hexagon/HexagonFrameLowering.cpp
llvm/trunk/lib/Target/Hexagon/HexagonISelDAGToDAGHVX.cpp
Modified: llvm/trunk/lib/Target/Hexagon/HexagonFrameLowering.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Target/Hexagon/HexagonFrameLowering.cpp?rev=346543&r1=346542&r2=346543&view=diff
==============================================================================
--- llvm/trunk/lib/Target/Hexagon/HexagonFrameLowering.cpp (original)
+++ llvm/trunk/lib/Target/Hexagon/HexagonFrameLowering.cpp Fri Nov 9 11:24:48 2018
@@ -555,10 +555,10 @@ void HexagonFrameLowering::emitPrologue(
bool HexagonFrameLowering::enableCalleeSaveSkip(
const MachineFunction &MF) const {
const auto &F = MF.getFunction();
- (void)F; // Silence unused variable in release builds
assert(F.hasFnAttribute(Attribute::NoReturn) &&
F.getFunction().hasFnAttribute(Attribute::NoUnwind) &&
!F.getFunction().hasFnAttribute(Attribute::UWTable));
+ (void)F;
// No need to save callee saved registers if the function does not return.
return MF.getSubtarget<HexagonSubtarget>().noreturnStackElim();
Modified: llvm/trunk/lib/Target/Hexagon/HexagonISelDAGToDAGHVX.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Target/Hexagon/HexagonISelDAGToDAGHVX.cpp?rev=346543&r1=346542&r2=346543&view=diff
==============================================================================
--- llvm/trunk/lib/Target/Hexagon/HexagonISelDAGToDAGHVX.cpp (original)
+++ llvm/trunk/lib/Target/Hexagon/HexagonISelDAGToDAGHVX.cpp Fri Nov 9 11:24:48 2018
@@ -120,7 +120,7 @@ struct Coloring {
return Color == ColorKind::Red ? ColorKind::Black : ColorKind::Red;
}
- void dump() const;
+ LLVM_DUMP_METHOD void dump() const;
private:
ArrayRef<Node> Order;
@@ -267,7 +267,7 @@ bool Coloring::color() {
return true;
}
-LLVM_DUMP_METHOD
+#if !defined(NDEBUG) || defined(LLVM_ENABLE_DUMP)
void Coloring::dump() const {
dbgs() << "{ Order: {";
for (unsigned I = 0; I != Order.size(); ++I) {
@@ -309,6 +309,7 @@ void Coloring::dump() const {
dbgs() << " " << C.first << " -> " << ColorKindToName(C.second) << "\n";
dbgs() << " }\n}\n";
}
+#endif
namespace {
// Base class of for reordering networks. They don't strictly need to be
@@ -651,6 +652,7 @@ struct OpRef {
IndexBits = 28,
};
+ LLVM_DUMP_METHOD
void print(raw_ostream &OS, const SelectionDAG &G) const;
private:
@@ -663,7 +665,7 @@ struct NodeTemplate {
MVT Ty = MVT::Other;
std::vector<OpRef> Ops;
- void print(raw_ostream &OS, const SelectionDAG &G) const;
+ LLVM_DUMP_METHOD void print(raw_ostream &OS, const SelectionDAG &G) const;
};
struct ResultStack {
@@ -699,10 +701,12 @@ struct ResultStack {
BaseType List;
+ LLVM_DUMP_METHOD
void print(raw_ostream &OS, const SelectionDAG &G) const;
};
} // namespace
+#if !defined(NDEBUG) || defined(LLVM_ENABLE_DUMP)
void OpRef::print(raw_ostream &OS, const SelectionDAG &G) const {
if (isValue()) {
OpV.getNode()->print(OS, &G);
@@ -752,6 +756,7 @@ void ResultStack::print(raw_ostream &OS,
OS << '\n';
}
}
+#endif
namespace {
struct ShuffleMask {
More information about the llvm-commits
mailing list