brintos

brintos / llvm-project-archived public Read only

0
0
Text · 1.9 KiB · 1154449 Raw
56 lines · c
1//===-- RISCVCallLowering.h - Call lowering ---------------------*- 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-exception6//7//===----------------------------------------------------------------------===//8//9/// \file10/// This file describes how to lower LLVM calls to machine code calls.11//12//===----------------------------------------------------------------------===//13 14#ifndef LLVM_LIB_TARGET_RISCV_RISCVCALLLOWERING_H15#define LLVM_LIB_TARGET_RISCV_RISCVCALLLOWERING_H16 17#include "llvm/CodeGen/CallingConvLower.h"18#include "llvm/CodeGen/GlobalISel/CallLowering.h"19 20namespace llvm {21 22class MachineInstrBuilder;23class MachineIRBuilder;24class RISCVTargetLowering;25 26class RISCVCallLowering : public CallLowering {27 28public:29  RISCVCallLowering(const RISCVTargetLowering &TLI);30 31  bool lowerReturn(MachineIRBuilder &MIRBuiler, const Value *Val,32                   ArrayRef<Register> VRegs,33                   FunctionLoweringInfo &FLI) const override;34 35  bool canLowerReturn(MachineFunction &MF, CallingConv::ID CallConv,36                      SmallVectorImpl<BaseArgInfo> &Outs,37                      bool IsVarArg) const override;38 39  bool lowerFormalArguments(MachineIRBuilder &MIRBuilder, const Function &F,40                            ArrayRef<ArrayRef<Register>> VRegs,41                            FunctionLoweringInfo &FLI) const override;42 43  bool lowerCall(MachineIRBuilder &MIRBuilder,44                 CallLoweringInfo &Info) const override;45 46private:47  void saveVarArgRegisters(MachineIRBuilder &MIRBuilder,48                           CallLowering::IncomingValueHandler &Handler,49                           IncomingValueAssigner &Assigner,50                           CCState &CCInfo) const;51};52 53} // end namespace llvm54 55#endif // LLVM_LIB_TARGET_RISCV_RISCVCALLLOWERING_H56