LLVM  5.0.0
ARMCallLowering.h
Go to the documentation of this file.
1 //===-- llvm/lib/Target/ARM/ARMCallLowering.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_ARM_ARMCALLLOWERING
16 #define LLVM_LIB_TARGET_ARM_ARMCALLLOWERING
17 
21 
22 namespace llvm {
23 
24 class ARMTargetLowering;
25 class MachineInstrBuilder;
26 
27 class ARMCallLowering : public CallLowering {
28 public:
30 
31  bool lowerReturn(MachineIRBuilder &MIRBuiler, const Value *Val,
32  unsigned VReg) const override;
33 
34  bool lowerFormalArguments(MachineIRBuilder &MIRBuilder, const Function &F,
35  ArrayRef<unsigned> VRegs) const override;
36 
37  bool lowerCall(MachineIRBuilder &MIRBuilder, CallingConv::ID CallConv,
38  const MachineOperand &Callee, const ArgInfo &OrigRet,
39  ArrayRef<ArgInfo> OrigArgs) const override;
40 
41 private:
42  bool lowerReturnVal(MachineIRBuilder &MIRBuilder, const Value *Val,
43  unsigned VReg, MachineInstrBuilder &Ret) const;
44 
45  typedef std::function<void(unsigned Reg, uint64_t Offset)> SplitArgTy;
46 
47  /// Split an argument into one or more arguments that the CC lowering can cope
48  /// with (e.g. replace pointers with integers).
49  void splitToValueTypes(const ArgInfo &OrigArg,
50  SmallVectorImpl<ArgInfo> &SplitArgs,
51  MachineFunction &MF,
52  const SplitArgTy &PerformArgSplit) const;
53 };
54 } // End of namespace llvm
55 #endif
static const MCPhysReg VRegs[32]
bool lowerReturn(MachineIRBuilder &MIRBuiler, const Value *Val, unsigned VReg) const override
This hook must be implemented to lower outgoing return values, described by Val, into the specified v...
ARMCallLowering(const ARMTargetLowering &TLI)
This class consists of common code factored out of the SmallVector class to reduce code duplication b...
Definition: APFloat.h:42
#define F(x, y, z)
Definition: MD5.cpp:55
bool lowerFormalArguments(MachineIRBuilder &MIRBuilder, const Function &F, ArrayRef< unsigned > VRegs) const override
This hook must be implemented to lower the incoming (formal) arguments, described by Args...
Helper class to build MachineInstr.
MachineOperand class - Representation of each machine instruction operand.
bool lowerCall(MachineIRBuilder &MIRBuilder, CallingConv::ID CallConv, const MachineOperand &Callee, const ArgInfo &OrigRet, ArrayRef< ArgInfo > OrigArgs) const override
This hook must be implemented to lower the given call instruction, including argument and return valu...
LLVM Value Representation.
Definition: Value.h:73
This file describes how to lower LLVM calls to machine code calls.