Skip to content

Commit

Permalink
[M68k][NFC] Fix some unused variable warnings
Browse files Browse the repository at this point in the history
Induced by variables that are only used in assertion statements. NFC.
  • Loading branch information
mshockwave committed Oct 17, 2023
1 parent 5a6ef95 commit cc6a5ea
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 4 deletions.
4 changes: 4 additions & 0 deletions llvm/lib/Target/M68k/M68kInstrInfo.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down Expand Up @@ -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);
Expand Down Expand Up @@ -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);
Expand All @@ -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);
Expand Down
7 changes: 3 additions & 4 deletions llvm/lib/Target/M68k/MCTargetDesc/M68kMCCodeEmitter.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -203,10 +203,9 @@ void M68kMCCodeEmitter::encodeInstruction(const MCInst &MI,
SmallVectorImpl<char> &CB,
SmallVectorImpl<MCFixup> &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);
Expand Down

0 comments on commit cc6a5ea

Please sign in to comment.