1 //===-- M68kCallLowering.h - Call lowering ----------------------*- C++ -*-===//
3 // Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
4 // See https://llvm.org/LICENSE.txt for license information.
5 // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
7 //===----------------------------------------------------------------------===//
10 /// This file implements the lowering of LLVM calls to machine code calls for
13 //===----------------------------------------------------------------------===//
15 #ifndef LLVM_LIB_TARGET_M68K_GLSEL_M68KCALLLOWERING_H
16 #define LLVM_LIB_TARGET_M68K_GLSEL_M68KCALLLOWERING_H
18 #include "llvm/CodeGen/CallingConvLower.h"
19 #include "llvm/CodeGen/GlobalISel/CallLowering.h"
20 #include "llvm/CodeGen/ValueTypes.h"
24 class M68kTargetLowering
;
25 class MachineInstrBuilder
;
27 class M68kCallLowering
: public CallLowering
{
28 // TODO: We are only supporting return instruction with no value at this time
32 M68kCallLowering(const M68kTargetLowering
&TLI
);
34 bool lowerReturn(MachineIRBuilder
&MIRBuilder
, const Value
*Val
,
35 ArrayRef
<Register
> VRegs
, FunctionLoweringInfo
&FLI
,
36 Register SwiftErrorVReg
) const override
;
38 bool lowerFormalArguments(MachineIRBuilder
&MIRBuilder
, const Function
&F
,
39 ArrayRef
<ArrayRef
<Register
>> VRegs
,
40 FunctionLoweringInfo
&FLI
) const override
;
42 bool lowerCall(MachineIRBuilder
&MIRBuilder
,
43 CallLoweringInfo
&Info
) const override
;
45 bool enableBigEndian() const override
;
47 struct M68kIncomingValueHandler
: public CallLowering::IncomingValueHandler
{
48 M68kIncomingValueHandler(MachineIRBuilder
&MIRBuilder
,
49 MachineRegisterInfo
&MRI
)
50 : CallLowering::IncomingValueHandler(MIRBuilder
, MRI
) {}
55 void assignValueToReg(Register ValVReg
, Register PhysReg
,
56 const CCValAssign
&VA
) override
;
58 void assignValueToAddress(Register ValVReg
, Register Addr
, LLT MemTy
,
59 const MachinePointerInfo
&MPO
,
60 const CCValAssign
&VA
) override
;
62 Register
getStackAddress(uint64_t Size
, int64_t Offset
,
63 MachinePointerInfo
&MPO
,
64 ISD::ArgFlagsTy Flags
) override
;
66 } // end namespace llvm
68 #endif // LLVM_LIB_TARGET_M68K_GLSEL_M68KCALLLOWERING_H