[llvm] 93bc038 - [M68k] fix -Wdefaulted-function-deleted and -Woverloaded-virtual
Nick Desaulniers via llvm-commits
llvm-commits at lists.llvm.org
Fri Apr 30 11:23:45 PDT 2021
Author: Nick Desaulniers
Date: 2021-04-30T11:23:31-07:00
New Revision: 93bc038126304cffc230fbc5561c78efa6fe4209
URL: https://github.com/llvm/llvm-project/commit/93bc038126304cffc230fbc5561c78efa6fe4209
DIFF: https://github.com/llvm/llvm-project/commit/93bc038126304cffc230fbc5561c78efa6fe4209.diff
LOG: [M68k] fix -Wdefaulted-function-deleted and -Woverloaded-virtual
Fixes the following warnings observerd when building the experimental
m68k backend (-DLLVM_EXPERIMENTAL_TARGETS_TO_BUILD="M68k"):
../lib/Target/M68k/M68kMachineFunction.h:71:3: warning: explicitly
defaulted default constructor is implicitly deleted
[-Wdefaulted-function-deleted]
M68kMachineFunctionInfo() = default;
^
../lib/Target/M68k/M68kMachineFunction.h:24:20: note: default
constructor of 'M68kMachineFunctionInfo' is implicitly deleted because
field 'MF' of reference type 'llvm::MachineFunction &' would not be
initialized
MachineFunction &MF;
^
In file included from ../lib/Target/M68k/M68kISelLowering.cpp:18:
In file included from ../lib/Target/M68k/M68kSubtarget.h:17:
../lib/Target/M68k/M68kFrameLowering.h:60:8: warning:
'llvm::M68kFrameLowering::emitCalleeSavedFrameMoves' hides overloaded
virtual functions [-Woverloaded-virtual]
void emitCalleeSavedFrameMoves(MachineBasicBlock &MBB,
^
../include/llvm/CodeGen/TargetFrameLowering.h:215:3: note: hidden
overloaded virtual function
'llvm::TargetFrameLowering::emitCalleeSavedFrameMoves' declared here:
different number of parameters (2 vs 3)
emitCalleeSavedFrameMoves(MachineBasicBlock &MBB,
^
../include/llvm/CodeGen/TargetFrameLowering.h:218:16: note: hidden
overloaded virtual function
'llvm::TargetFrameLowering::emitCalleeSavedFrameMoves' declared here:
different number of parameters (4 vs 3)
virtual void emitCalleeSavedFrameMoves(MachineBasicBlock &MBB,
^
pr/50071
Reviewed By: myhsu
Differential Revision: https://reviews.llvm.org/D101588
Added:
Modified:
llvm/lib/Target/M68k/M68kFrameLowering.cpp
llvm/lib/Target/M68k/M68kFrameLowering.h
llvm/lib/Target/M68k/M68kMachineFunction.h
Removed:
################################################################################
diff --git a/llvm/lib/Target/M68k/M68kFrameLowering.cpp b/llvm/lib/Target/M68k/M68kFrameLowering.cpp
index f9a187aac3a93..749a5dc8f7776 100644
--- a/llvm/lib/Target/M68k/M68kFrameLowering.cpp
+++ b/llvm/lib/Target/M68k/M68kFrameLowering.cpp
@@ -449,7 +449,7 @@ void M68kFrameLowering::BuildCFI(MachineBasicBlock &MBB,
void M68kFrameLowering::emitCalleeSavedFrameMoves(
MachineBasicBlock &MBB, MachineBasicBlock::iterator MBBI,
- const DebugLoc &DL) const {
+ const DebugLoc &DL, bool IsProlog) const {
MachineFunction &MF = *MBB.getParent();
MachineFrameInfo &MFI = MF.getFrameInfo();
MachineModuleInfo &MMI = MF.getMMI();
@@ -656,7 +656,7 @@ void M68kFrameLowering::emitPrologue(MachineFunction &MF,
// Emit DWARF info specifying the offsets of the callee-saved registers.
if (PushedRegs)
- emitCalleeSavedFrameMoves(MBB, MBBI, DL);
+ emitCalleeSavedFrameMoves(MBB, MBBI, DL, true);
}
// TODO Interrupt handlers
diff --git a/llvm/lib/Target/M68k/M68kFrameLowering.h b/llvm/lib/Target/M68k/M68kFrameLowering.h
index f9236b4af0b01..c953f855910d6 100644
--- a/llvm/lib/Target/M68k/M68kFrameLowering.h
+++ b/llvm/lib/Target/M68k/M68kFrameLowering.h
@@ -59,7 +59,8 @@ class M68kFrameLowering : public TargetFrameLowering {
void emitCalleeSavedFrameMoves(MachineBasicBlock &MBB,
MachineBasicBlock::iterator MBBI,
- const DebugLoc &DL) const;
+ const DebugLoc &DL,
+ bool IsProlog) const override;
unsigned getPSPSlotOffsetFromSP(const MachineFunction &MF) const;
diff --git a/llvm/lib/Target/M68k/M68kMachineFunction.h b/llvm/lib/Target/M68k/M68kMachineFunction.h
index c6952f9dcd383..5760bdd4b9e3d 100644
--- a/llvm/lib/Target/M68k/M68kMachineFunction.h
+++ b/llvm/lib/Target/M68k/M68kMachineFunction.h
@@ -68,7 +68,6 @@ class M68kMachineFunctionInfo : public MachineFunctionInfo {
unsigned ArgumentStackSize = 0;
public:
- M68kMachineFunctionInfo() = default;
explicit M68kMachineFunctionInfo(MachineFunction &MF) : MF(MF) {}
bool getRestoreBasePointer() const { return RestoreBasePointerOffset != 0; }
More information about the llvm-commits
mailing list