[Hexagon] Fix some -Wunused-function with LLVM_DUMP_METHOD and -Wunused-variable

llvm-svn: 346543
This commit is contained in:
Fangrui Song 2018-11-09 19:24:48 +00:00
parent a40cce80a7
commit 60b7fb46e1
2 changed files with 9 additions and 4 deletions

View File

@ -555,10 +555,10 @@ void HexagonFrameLowering::emitPrologue(MachineFunction &MF,
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();

View File

@ -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, const SelectionDAG &G) const {
OS << '\n';
}
}
#endif
namespace {
struct ShuffleMask {