[PATCH] D103328: [CodeGen][NFC] Remove unused virtual function

Min-Yih Hsu via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Fri May 28 09:50:07 PDT 2021


myhsu created this revision.
myhsu added a reviewer: dblaikie.
Herald added subscribers: pengfei, hiraditya.
myhsu requested review of this revision.
Herald added a project: LLVM.
Herald added a subscriber: llvm-commits.

Context: https://reviews.llvm.org/D101588

`TargetFrameLowering::emitCalleeSavedFrameMoves` with 4 arguments is not used anywhere in CodeGen. Thus it shouldn't be exposed as a virtual function. NFC.


Repository:
  rG LLVM Github Monorepo

https://reviews.llvm.org/D103328

Files:
  llvm/include/llvm/CodeGen/TargetFrameLowering.h
  llvm/lib/Target/M68k/M68kFrameLowering.cpp
  llvm/lib/Target/M68k/M68kFrameLowering.h
  llvm/lib/Target/X86/X86FrameLowering.h


Index: llvm/lib/Target/X86/X86FrameLowering.h
===================================================================
--- llvm/lib/Target/X86/X86FrameLowering.h
+++ llvm/lib/Target/X86/X86FrameLowering.h
@@ -65,8 +65,7 @@
 
   void emitCalleeSavedFrameMoves(MachineBasicBlock &MBB,
                                  MachineBasicBlock::iterator MBBI,
-                                 const DebugLoc &DL,
-                                 bool IsPrologue) const override;
+                                 const DebugLoc &DL, bool IsPrologue) const;
 
   /// emitProlog/emitEpilog - These methods insert prolog and epilog code into
   /// the function.
Index: llvm/lib/Target/M68k/M68kFrameLowering.h
===================================================================
--- llvm/lib/Target/M68k/M68kFrameLowering.h
+++ llvm/lib/Target/M68k/M68kFrameLowering.h
@@ -57,10 +57,12 @@
   void BuildCFI(MachineBasicBlock &MBB, MachineBasicBlock::iterator MBBI,
                 const DebugLoc &DL, const MCCFIInstruction &CFIInst) const;
 
+  // This is used for suppressing -Woverloaded-virtual
+  using TargetFrameLowering::emitCalleeSavedFrameMoves;
+
   void emitCalleeSavedFrameMoves(MachineBasicBlock &MBB,
                                  MachineBasicBlock::iterator MBBI,
-                                 const DebugLoc &DL,
-                                 bool IsProlog) const override;
+                                 const DebugLoc &DL) const;
 
   unsigned getPSPSlotOffsetFromSP(const MachineFunction &MF) const;
 
Index: llvm/lib/Target/M68k/M68kFrameLowering.cpp
===================================================================
--- llvm/lib/Target/M68k/M68kFrameLowering.cpp
+++ llvm/lib/Target/M68k/M68kFrameLowering.cpp
@@ -449,7 +449,7 @@
 
 void M68kFrameLowering::emitCalleeSavedFrameMoves(
     MachineBasicBlock &MBB, MachineBasicBlock::iterator MBBI,
-    const DebugLoc &DL, bool IsProlog) const {
+    const DebugLoc &DL) const {
   MachineFunction &MF = *MBB.getParent();
   MachineFrameInfo &MFI = MF.getFrameInfo();
   MachineModuleInfo &MMI = MF.getMMI();
@@ -656,7 +656,7 @@
 
     // Emit DWARF info specifying the offsets of the callee-saved registers.
     if (PushedRegs)
-      emitCalleeSavedFrameMoves(MBB, MBBI, DL, true);
+      emitCalleeSavedFrameMoves(MBB, MBBI, DL);
   }
 
   // TODO Interrupt handlers
Index: llvm/include/llvm/CodeGen/TargetFrameLowering.h
===================================================================
--- llvm/include/llvm/CodeGen/TargetFrameLowering.h
+++ llvm/include/llvm/CodeGen/TargetFrameLowering.h
@@ -215,11 +215,6 @@
   emitCalleeSavedFrameMoves(MachineBasicBlock &MBB,
                             MachineBasicBlock::iterator MBBI) const {}
 
-  virtual void emitCalleeSavedFrameMoves(MachineBasicBlock &MBB,
-                                         MachineBasicBlock::iterator MBBI,
-                                         const DebugLoc &DL,
-                                         bool IsPrologue) const {}
-
   /// Replace a StackProbe stub (if any) with the actual probe code inline
   virtual void inlineStackProbe(MachineFunction &MF,
                                 MachineBasicBlock &PrologueMBB) const {}


-------------- next part --------------
A non-text attachment was scrubbed...
Name: D103328.348552.patch
Type: text/x-patch
Size: 3197 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20210528/7548447f/attachment.bin>


More information about the llvm-commits mailing list