blob: 204e6974c702e3601cdddf8a8c33ffa8d1d71728 [file] [log] [blame]
Zvi Rackover76dbf262016-11-15 06:34:33 +00001//===-- llvm/lib/Target/X86/X86CallLowering.h - Call lowering -----===//
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//===----------------------------------------------------------------------===//
9///
10/// \file
11/// This file describes how to lower LLVM calls to machine code calls.
12///
13//===----------------------------------------------------------------------===//
14
15#ifndef LLVM_LIB_TARGET_X86_X86CALLLOWERING
16#define LLVM_LIB_TARGET_X86_X86CALLLOWERING
17
18#include "llvm/ADT/ArrayRef.h"
19#include "llvm/CodeGen/GlobalISel/CallLowering.h"
20
21namespace llvm {
22
23class Function;
24class MachineIRBuilder;
25class X86TargetLowering;
26class Value;
27
28class X86CallLowering : public CallLowering {
29public:
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;
Igor Breger5c31a4c2017-02-06 08:37:41 +000037private:
38 /// A function of this type is used to perform value split action.
Tim Northoverc2c545b2017-03-06 23:50:28 +000039 typedef std::function<void(unsigned, uint64_t)> SplitArgTy;
Igor Breger5c31a4c2017-02-06 08:37:41 +000040
41 void splitToValueTypes(const ArgInfo &OrigArgInfo,
42 SmallVectorImpl<ArgInfo> &SplitArgs,
43 const DataLayout &DL, MachineRegisterInfo &MRI,
44 SplitArgTy SplitArg) const;
Zvi Rackover76dbf262016-11-15 06:34:33 +000045};
46} // End of namespace llvm;
47#endif