1 //===-- RISCVCallingConv.h - RISC-V Custom CC Routines ----------*- C++ -*-===// 2 // 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 6 // 7 //===----------------------------------------------------------------------===// 8 // 9 // This file defines the custom routines for the RISC-V Calling Convention. 10 // 11 //===----------------------------------------------------------------------===// 12 13 #include "MCTargetDesc/RISCVBaseInfo.h" 14 #include "llvm/CodeGen/CallingConvLower.h" 15 16 namespace llvm { 17 18 /// RISCVCCAssignFn - This target-specific function extends the default 19 /// CCValAssign with additional information used to lower RISC-V calling 20 /// conventions. 21 typedef bool RISCVCCAssignFn(unsigned ValNo, MVT ValVT, MVT LocVT, 22 CCValAssign::LocInfo LocInfo, 23 ISD::ArgFlagsTy ArgFlags, CCState &State, 24 bool IsFixed, bool IsRet, Type *OrigTy); 25 26 bool CC_RISCV(unsigned ValNo, MVT ValVT, MVT LocVT, 27 CCValAssign::LocInfo LocInfo, ISD::ArgFlagsTy ArgFlags, 28 CCState &State, bool IsFixed, bool IsRet, Type *OrigTy); 29 30 bool CC_RISCV_FastCC(unsigned ValNo, MVT ValVT, MVT LocVT, 31 CCValAssign::LocInfo LocInfo, ISD::ArgFlagsTy ArgFlags, 32 CCState &State, bool IsFixed, bool IsRet, Type *OrigTy); 33 34 bool CC_RISCV_GHC(unsigned ValNo, MVT ValVT, MVT LocVT, 35 CCValAssign::LocInfo LocInfo, ISD::ArgFlagsTy ArgFlags, 36 CCState &State); 37 38 namespace RISCV { 39 40 ArrayRef<MCPhysReg> getArgGPRs(const RISCVABI::ABI ABI); 41 42 } // end namespace RISCV 43 44 } // end namespace llvm 45