121
|
1 //===- llvm/lib/Target/X86/X86CallLowering.h - Call lowering ----*- C++ -*-===//
|
120
|
2 //
|
|
3 // The LLVM Compiler Infrastructure
|
|
4 //
|
|
5 // This file is distributed under the University of Illinois Open Source
|
|
6 // License. See LICENSE.TXT for details.
|
|
7 //
|
|
8 //===----------------------------------------------------------------------===//
|
121
|
9 //
|
120
|
10 /// \file
|
|
11 /// This file describes how to lower LLVM calls to machine code calls.
|
121
|
12 //
|
120
|
13 //===----------------------------------------------------------------------===//
|
|
14
|
121
|
15 #ifndef LLVM_LIB_TARGET_X86_X86CALLLOWERING_H
|
|
16 #define LLVM_LIB_TARGET_X86_X86CALLLOWERING_H
|
120
|
17
|
|
18 #include "llvm/ADT/ArrayRef.h"
|
|
19 #include "llvm/CodeGen/GlobalISel/CallLowering.h"
|
121
|
20 #include <functional>
|
120
|
21
|
|
22 namespace llvm {
|
|
23
|
121
|
24 class DataLayout;
|
|
25 class MachineRegisterInfo;
|
120
|
26 class X86TargetLowering;
|
|
27
|
|
28 class X86CallLowering : public CallLowering {
|
|
29 public:
|
|
30 X86CallLowering(const X86TargetLowering &TLI);
|
|
31
|
|
32 bool lowerReturn(MachineIRBuilder &MIRBuiler, const Value *Val,
|
|
33 unsigned VReg) const override;
|
|
34
|
|
35 bool lowerFormalArguments(MachineIRBuilder &MIRBuilder, const Function &F,
|
|
36 ArrayRef<unsigned> VRegs) const override;
|
121
|
37
|
|
38 bool lowerCall(MachineIRBuilder &MIRBuilder, CallingConv::ID CallConv,
|
|
39 const MachineOperand &Callee, const ArgInfo &OrigRet,
|
|
40 ArrayRef<ArgInfo> OrigArgs) const override;
|
|
41
|
|
42 private:
|
|
43 /// A function of this type is used to perform value split action.
|
|
44 using SplitArgTy = std::function<void(ArrayRef<unsigned>)>;
|
|
45
|
|
46 bool splitToValueTypes(const ArgInfo &OrigArgInfo,
|
|
47 SmallVectorImpl<ArgInfo> &SplitArgs,
|
|
48 const DataLayout &DL, MachineRegisterInfo &MRI,
|
|
49 SplitArgTy SplitArg) const;
|
120
|
50 };
|
121
|
51
|
|
52 } // end namespace llvm
|
|
53
|
|
54 #endif // LLVM_LIB_TARGET_X86_X86CALLLOWERING_H
|