Skip to content
This repository was archived by the owner on Feb 5, 2019. It is now read-only.

Commit 5ac7dfd

Browse files
committed
[Hexagon] Fix some -Wunused-function with LLVM_DUMP_METHOD and -Wunused-variable
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@346543 91177308-0d34-0410-b5e6-96231b3b80d8
1 parent 4d8909c commit 5ac7dfd

File tree

2 files changed

+9
-4
lines changed

2 files changed

+9
-4
lines changed

lib/Target/Hexagon/HexagonFrameLowering.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -555,10 +555,10 @@ void HexagonFrameLowering::emitPrologue(MachineFunction &MF,
555555
bool HexagonFrameLowering::enableCalleeSaveSkip(
556556
const MachineFunction &MF) const {
557557
const auto &F = MF.getFunction();
558-
(void)F; // Silence unused variable in release builds
559558
assert(F.hasFnAttribute(Attribute::NoReturn) &&
560559
F.getFunction().hasFnAttribute(Attribute::NoUnwind) &&
561560
!F.getFunction().hasFnAttribute(Attribute::UWTable));
561+
(void)F;
562562

563563
// No need to save callee saved registers if the function does not return.
564564
return MF.getSubtarget<HexagonSubtarget>().noreturnStackElim();

lib/Target/Hexagon/HexagonISelDAGToDAGHVX.cpp

Lines changed: 8 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -120,7 +120,7 @@ struct Coloring {
120120
return Color == ColorKind::Red ? ColorKind::Black : ColorKind::Red;
121121
}
122122

123-
void dump() const;
123+
LLVM_DUMP_METHOD void dump() const;
124124

125125
private:
126126
ArrayRef<Node> Order;
@@ -267,7 +267,7 @@ bool Coloring::color() {
267267
return true;
268268
}
269269

270-
LLVM_DUMP_METHOD
270+
#if !defined(NDEBUG) || defined(LLVM_ENABLE_DUMP)
271271
void Coloring::dump() const {
272272
dbgs() << "{ Order: {";
273273
for (unsigned I = 0; I != Order.size(); ++I) {
@@ -309,6 +309,7 @@ void Coloring::dump() const {
309309
dbgs() << " " << C.first << " -> " << ColorKindToName(C.second) << "\n";
310310
dbgs() << " }\n}\n";
311311
}
312+
#endif
312313

313314
namespace {
314315
// Base class of for reordering networks. They don't strictly need to be
@@ -651,6 +652,7 @@ struct OpRef {
651652
IndexBits = 28,
652653
};
653654

655+
LLVM_DUMP_METHOD
654656
void print(raw_ostream &OS, const SelectionDAG &G) const;
655657

656658
private:
@@ -663,7 +665,7 @@ struct NodeTemplate {
663665
MVT Ty = MVT::Other;
664666
std::vector<OpRef> Ops;
665667

666-
void print(raw_ostream &OS, const SelectionDAG &G) const;
668+
LLVM_DUMP_METHOD void print(raw_ostream &OS, const SelectionDAG &G) const;
667669
};
668670

669671
struct ResultStack {
@@ -699,10 +701,12 @@ struct ResultStack {
699701

700702
BaseType List;
701703

704+
LLVM_DUMP_METHOD
702705
void print(raw_ostream &OS, const SelectionDAG &G) const;
703706
};
704707
} // namespace
705708

709+
#if !defined(NDEBUG) || defined(LLVM_ENABLE_DUMP)
706710
void OpRef::print(raw_ostream &OS, const SelectionDAG &G) const {
707711
if (isValue()) {
708712
OpV.getNode()->print(OS, &G);
@@ -752,6 +756,7 @@ void ResultStack::print(raw_ostream &OS, const SelectionDAG &G) const {
752756
OS << '\n';
753757
}
754758
}
759+
#endif
755760

756761
namespace {
757762
struct ShuffleMask {

0 commit comments

Comments
 (0)