diff --git a/llvm/lib/Target/M68k/GISel/M68kCallLowering.cpp b/llvm/lib/Target/M68k/GISel/M68kCallLowering.cpp index b0ada29d1ceab24..ba6917f8eaf0d79 100644 --- a/llvm/lib/Target/M68k/GISel/M68kCallLowering.cpp +++ b/llvm/lib/Target/M68k/GISel/M68kCallLowering.cpp @@ -25,6 +25,27 @@ using namespace llvm; +namespace { + +struct M68kFormalArgHandler : public M68kIncomingValueHandler { + M68kFormalArgHandler(MachineIRBuilder &MIRBuilder, MachineRegisterInfo &MRI) + : M68kIncomingValueHandler(MIRBuilder, MRI) {} +}; + +struct CallReturnHandler : public M68kIncomingValueHandler { + CallReturnHandler(MachineIRBuilder &MIRBuilder, MachineRegisterInfo &MRI, + MachineInstrBuilder &MIB) + : M68kIncomingValueHandler(MIRBuilder, MRI), MIB(MIB) {} + +private: + void assignValueToReg(Register ValVReg, Register PhysReg, + const CCValAssign &VA) override; + + MachineInstrBuilder &MIB; +}; + +} // end anonymous namespace + M68kCallLowering::M68kCallLowering(const M68kTargetLowering &TLI) : CallLowering(&TLI) {} @@ -118,7 +139,7 @@ bool M68kCallLowering::lowerFormalArguments(MachineIRBuilder &MIRBuilder, CCAssignFn *AssignFn = TLI.getCCAssignFn(F.getCallingConv(), false, F.isVarArg()); IncomingValueAssigner ArgAssigner(AssignFn); - FormalArgHandler ArgHandler(MIRBuilder, MRI); + M68kFormalArgHandler ArgHandler(MIRBuilder, MRI); return determineAndHandleAssignments(ArgHandler, ArgAssigner, SplitArgs, MIRBuilder, F.getCallingConv(), F.isVarArg()); diff --git a/llvm/lib/Target/M68k/GISel/M68kCallLowering.h b/llvm/lib/Target/M68k/GISel/M68kCallLowering.h index a1589e96aa3d9ce..405e096c8791f94 100644 --- a/llvm/lib/Target/M68k/GISel/M68kCallLowering.h +++ b/llvm/lib/Target/M68k/GISel/M68kCallLowering.h @@ -62,23 +62,6 @@ struct M68kIncomingValueHandler : public CallLowering::IncomingValueHandler { MachinePointerInfo &MPO, ISD::ArgFlagsTy Flags) override; }; - -struct FormalArgHandler : public M68kIncomingValueHandler { - FormalArgHandler(MachineIRBuilder &MIRBuilder, MachineRegisterInfo &MRI) - : M68kIncomingValueHandler(MIRBuilder, MRI) {} -}; - -struct CallReturnHandler : public M68kIncomingValueHandler { - CallReturnHandler(MachineIRBuilder &MIRBuilder, MachineRegisterInfo &MRI, - MachineInstrBuilder &MIB) - : M68kIncomingValueHandler(MIRBuilder, MRI), MIB(MIB) {} - -private: - void assignValueToReg(Register ValVReg, Register PhysReg, - CCValAssign VA) override; - - MachineInstrBuilder &MIB; -}; } // end namespace llvm #endif // LLVM_LIB_TARGET_M68K_GLSEL_M68KCALLLOWERING_H