xref: /freebsd/contrib/llvm-project/llvm/lib/Target/RISCV/RISCVCallingConv.h (revision 700637cbb5e582861067a11aaca4d053546871d2)
1*700637cbSDimitry Andric //===-- RISCVCallingConv.h - RISC-V Custom CC Routines ----------*- C++ -*-===//
2*700637cbSDimitry Andric //
3*700637cbSDimitry Andric // Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
4*700637cbSDimitry Andric // See https://llvm.org/LICENSE.txt for license information.
5*700637cbSDimitry Andric // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
6*700637cbSDimitry Andric //
7*700637cbSDimitry Andric //===----------------------------------------------------------------------===//
8*700637cbSDimitry Andric //
9*700637cbSDimitry Andric // This file defines the custom routines for the RISC-V Calling Convention.
10*700637cbSDimitry Andric //
11*700637cbSDimitry Andric //===----------------------------------------------------------------------===//
12*700637cbSDimitry Andric 
13*700637cbSDimitry Andric #include "MCTargetDesc/RISCVBaseInfo.h"
14*700637cbSDimitry Andric #include "llvm/CodeGen/CallingConvLower.h"
15*700637cbSDimitry Andric 
16*700637cbSDimitry Andric namespace llvm {
17*700637cbSDimitry Andric 
18*700637cbSDimitry Andric /// RISCVCCAssignFn - This target-specific function extends the default
19*700637cbSDimitry Andric /// CCValAssign with additional information used to lower RISC-V calling
20*700637cbSDimitry Andric /// conventions.
21*700637cbSDimitry Andric typedef bool RISCVCCAssignFn(unsigned ValNo, MVT ValVT, MVT LocVT,
22*700637cbSDimitry Andric                              CCValAssign::LocInfo LocInfo,
23*700637cbSDimitry Andric                              ISD::ArgFlagsTy ArgFlags, CCState &State,
24*700637cbSDimitry Andric                              bool IsFixed, bool IsRet, Type *OrigTy);
25*700637cbSDimitry Andric 
26*700637cbSDimitry Andric bool CC_RISCV(unsigned ValNo, MVT ValVT, MVT LocVT,
27*700637cbSDimitry Andric               CCValAssign::LocInfo LocInfo, ISD::ArgFlagsTy ArgFlags,
28*700637cbSDimitry Andric               CCState &State, bool IsFixed, bool IsRet, Type *OrigTy);
29*700637cbSDimitry Andric 
30*700637cbSDimitry Andric bool CC_RISCV_FastCC(unsigned ValNo, MVT ValVT, MVT LocVT,
31*700637cbSDimitry Andric                      CCValAssign::LocInfo LocInfo, ISD::ArgFlagsTy ArgFlags,
32*700637cbSDimitry Andric                      CCState &State, bool IsFixed, bool IsRet, Type *OrigTy);
33*700637cbSDimitry Andric 
34*700637cbSDimitry Andric bool CC_RISCV_GHC(unsigned ValNo, MVT ValVT, MVT LocVT,
35*700637cbSDimitry Andric                   CCValAssign::LocInfo LocInfo, ISD::ArgFlagsTy ArgFlags,
36*700637cbSDimitry Andric                   CCState &State);
37*700637cbSDimitry Andric 
38*700637cbSDimitry Andric namespace RISCV {
39*700637cbSDimitry Andric 
40*700637cbSDimitry Andric ArrayRef<MCPhysReg> getArgGPRs(const RISCVABI::ABI ABI);
41*700637cbSDimitry Andric 
42*700637cbSDimitry Andric } // end namespace RISCV
43*700637cbSDimitry Andric 
44*700637cbSDimitry Andric } // end namespace llvm
45