1//===-- WebAssemblyCallLowering.h - Call lowering for GlobalISel -*- 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/// \file
10/// This file describes how to lower LLVM calls to machine code calls.
11///
12//===----------------------------------------------------------------------===//
13
14#ifndef LLVM_LIB_TARGET_WEBASSEMBLY_GISEL_WEBASSEMBLYCALLLOWERING_H
15#define LLVM_LIB_TARGET_WEBASSEMBLY_GISEL_WEBASSEMBLYCALLLOWERING_H
16
17#include "WebAssemblyISelLowering.h"
18#include "llvm/CodeGen/GlobalISel/CallLowering.h"
19#include "llvm/IR/CallingConv.h"
20
21namespace llvm {
22
23class WebAssemblyTargetLowering;
24
25class WebAssemblyCallLowering : public CallLowering {
26public:
27 WebAssemblyCallLowering(const WebAssemblyTargetLowering &TLI);
28
29 bool canLowerReturn(MachineFunction &MF, CallingConv::ID CallConv,
30 SmallVectorImpl<BaseArgInfo> &Outs,
31 bool IsVarArg) const override;
32 bool lowerReturn(MachineIRBuilder &MIRBuilder, const Value *Val,
33 ArrayRef<Register> VRegs, FunctionLoweringInfo &FLI,
34 Register SwiftErrorVReg) const override;
35 bool lowerFormalArguments(MachineIRBuilder &MIRBuilder, const Function &F,
36 ArrayRef<ArrayRef<Register>> VRegs,
37 FunctionLoweringInfo &FLI) const override;
38 bool lowerCall(MachineIRBuilder &MIRBuilder,
39 CallLoweringInfo &Info) const override;
40};
41} // namespace llvm
42
43#endif
44