Diana Picus | 2227493 | 2016-11-11 08:27:37 +0000 | [diff] [blame] | 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 | |
| 18 | #include "llvm/CodeGen/CallingConvLower.h" |
| 19 | #include "llvm/CodeGen/GlobalISel/CallLowering.h" |
| 20 | #include "llvm/CodeGen/ValueTypes.h" |
| 21 | |
| 22 | namespace llvm { |
| 23 | |
| 24 | class ARMTargetLowering; |
Diana Picus | 812caee | 2016-12-16 12:54:46 +0000 | [diff] [blame] | 25 | class MachineInstrBuilder; |
Diana Picus | 2227493 | 2016-11-11 08:27:37 +0000 | [diff] [blame] | 26 | |
| 27 | class ARMCallLowering : public CallLowering { |
| 28 | public: |
| 29 | ARMCallLowering(const ARMTargetLowering &TLI); |
| 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; |
Diana Picus | 812caee | 2016-12-16 12:54:46 +0000 | [diff] [blame] | 36 | |
Diana Picus | d79253a | 2017-03-20 14:40:18 +0000 | [diff] [blame^] | 37 | bool lowerCall(MachineIRBuilder &MIRBuilder, CallingConv::ID CallConv, |
| 38 | const MachineOperand &Callee, const ArgInfo &OrigRet, |
Diana Picus | 613b656 | 2017-02-21 11:33:59 +0000 | [diff] [blame] | 39 | ArrayRef<ArgInfo> OrigArgs) const override; |
| 40 | |
Diana Picus | 812caee | 2016-12-16 12:54:46 +0000 | [diff] [blame] | 41 | private: |
| 42 | bool lowerReturnVal(MachineIRBuilder &MIRBuilder, const Value *Val, |
| 43 | unsigned VReg, MachineInstrBuilder &Ret) const; |
Diana Picus | 32cd9b4 | 2017-02-02 14:01:00 +0000 | [diff] [blame] | 44 | |
| 45 | /// Split an argument into one or more arguments that the CC lowering can cope |
| 46 | /// with (e.g. replace pointers with integers). |
| 47 | void splitToValueTypes(const ArgInfo &OrigArg, |
| 48 | SmallVectorImpl<ArgInfo> &SplitArgs, |
| 49 | const DataLayout &DL, MachineRegisterInfo &MRI) const; |
Diana Picus | 2227493 | 2016-11-11 08:27:37 +0000 | [diff] [blame] | 50 | }; |
| 51 | } // End of namespace llvm |
| 52 | #endif |