[llvm] cc6a5ea - [M68k][NFC] Fix some unused variable warnings
Min-Yih Hsu via llvm-commits
llvm-commits at lists.llvm.org
Mon Oct 16 20:52:20 PDT 2023
Author: Min-Yih Hsu
Date: 2023-10-16T20:51:11-07:00
New Revision: cc6a5ea6e33d3febafc4334617230c528a0c4fa7
URL: https://github.com/llvm/llvm-project/commit/cc6a5ea6e33d3febafc4334617230c528a0c4fa7
DIFF: https://github.com/llvm/llvm-project/commit/cc6a5ea6e33d3febafc4334617230c528a0c4fa7.diff
LOG: [M68k][NFC] Fix some unused variable warnings
Induced by variables that are only used in assertion statements. NFC.
Added:
Modified:
llvm/lib/Target/M68k/M68kInstrInfo.cpp
llvm/lib/Target/M68k/MCTargetDesc/M68kMCCodeEmitter.cpp
Removed:
################################################################################
diff --git a/llvm/lib/Target/M68k/M68kInstrInfo.cpp b/llvm/lib/Target/M68k/M68kInstrInfo.cpp
index 8d36e94d8e6960a..d56fef9e9029af8 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 16460f0a105b863..32a5bb1dc670613 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<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);
More information about the llvm-commits
mailing list