From cc6a5ea6e33d3febafc4334617230c528a0c4fa7 Mon Sep 17 00:00:00 2001 From: Min-Yih Hsu Date: Mon, 16 Oct 2023 20:44:53 -0700 Subject: [PATCH] [M68k][NFC] Fix some unused variable warnings Induced by variables that are only used in assertion statements. NFC. --- llvm/lib/Target/M68k/M68kInstrInfo.cpp | 4 ++++ llvm/lib/Target/M68k/MCTargetDesc/M68kMCCodeEmitter.cpp | 7 +++---- 2 files changed, 7 insertions(+), 4 deletions(-) diff --git a/llvm/lib/Target/M68k/M68kInstrInfo.cpp b/llvm/lib/Target/M68k/M68kInstrInfo.cpp index 8d36e94d8e69..d56fef9e9029 100644 --- a/llvm/lib/Target/M68k/M68kInstrInfo.cpp +++ b/llvm/lib/Target/M68k/M68kInstrInfo.cpp @@ -361,6 +361,7 @@ bool M68kInstrInfo::ExpandMOVX_RR(MachineInstrBuilder &MIB, MVT MVTDst, assert(RCDst && RCSrc && "Wrong use of MOVX_RR"); assert(RCDst != RCSrc && "You cannot use the same Reg Classes with MOVX_RR"); + (void)RCSrc; // We need to find the super source register that matches the size of Dst unsigned SSrc = RI.getMatchingMegaReg(Src, RCDst); @@ -407,6 +408,7 @@ bool M68kInstrInfo::ExpandMOVSZX_RR(MachineInstrBuilder &MIB, bool IsSigned, assert(RCDst && RCSrc && "Wrong use of MOVSX_RR"); assert(RCDst != RCSrc && "You cannot use the same Reg Classes with MOVSX_RR"); + (void)RCSrc; // We need to find the super source register that matches the size of Dst unsigned SSrc = RI.getMatchingMegaReg(Src, RCDst); @@ -746,6 +748,7 @@ void M68kInstrInfo::storeRegToStackSlot( const MachineFrameInfo &MFI = MBB.getParent()->getFrameInfo(); assert(MFI.getObjectSize(FrameIndex) >= TRI->getSpillSize(*RC) && "Stack slot is too small to store"); + (void)MFI; unsigned Opc = getStoreRegOpcode(SrcReg, RC, TRI, Subtarget); DebugLoc DL = MBB.findDebugLoc(MI); @@ -763,6 +766,7 @@ void M68kInstrInfo::loadRegFromStackSlot(MachineBasicBlock &MBB, const MachineFrameInfo &MFI = MBB.getParent()->getFrameInfo(); assert(MFI.getObjectSize(FrameIndex) >= TRI->getSpillSize(*RC) && "Stack slot is too small to load"); + (void)MFI; unsigned Opc = getLoadRegOpcode(DstReg, RC, TRI, Subtarget); DebugLoc DL = MBB.findDebugLoc(MI); diff --git a/llvm/lib/Target/M68k/MCTargetDesc/M68kMCCodeEmitter.cpp b/llvm/lib/Target/M68k/MCTargetDesc/M68kMCCodeEmitter.cpp index 16460f0a105b..32a5bb1dc670 100644 --- a/llvm/lib/Target/M68k/MCTargetDesc/M68kMCCodeEmitter.cpp +++ b/llvm/lib/Target/M68k/MCTargetDesc/M68kMCCodeEmitter.cpp @@ -203,10 +203,9 @@ void M68kMCCodeEmitter::encodeInstruction(const MCInst &MI, SmallVectorImpl &CB, SmallVectorImpl &Fixups, const MCSubtargetInfo &STI) const { - unsigned Opcode = MI.getOpcode(); - - LLVM_DEBUG(dbgs() << "EncodeInstruction: " << MCII.getName(Opcode) << "(" - << Opcode << ")\n"); + LLVM_DEBUG(dbgs() << "EncodeInstruction: " << MCII.getName(MI.getOpcode()) + << "(" << Opcode << ")\n"); + (void)MCII; // Try using the new method first. APInt EncodedInst(16, 0U);