2017-02-02 06:56:06 +08:00
|
|
|
//===--- AArch64CallLowering.h - Call lowering ------------------*- C++ -*-===//
|
2016-02-17 03:26:02 +08:00
|
|
|
//
|
|
|
|
// The LLVM Compiler Infrastructure
|
|
|
|
//
|
|
|
|
// This file is distributed under the University of Illinois Open Source
|
|
|
|
// License. See LICENSE.TXT for details.
|
|
|
|
//
|
|
|
|
//===----------------------------------------------------------------------===//
|
|
|
|
///
|
|
|
|
/// \file
|
|
|
|
/// This file describes how to lower LLVM calls to machine code calls.
|
|
|
|
///
|
|
|
|
//===----------------------------------------------------------------------===//
|
|
|
|
|
2017-02-02 06:56:06 +08:00
|
|
|
#ifndef LLVM_LIB_TARGET_AARCH64_AARCH64CALLLOWERING_H
|
|
|
|
#define LLVM_LIB_TARGET_AARCH64_AARCH64CALLLOWERING_H
|
2016-02-17 03:26:02 +08:00
|
|
|
|
2017-02-02 06:56:06 +08:00
|
|
|
#include "llvm/ADT/ArrayRef.h"
|
2016-02-17 03:26:02 +08:00
|
|
|
#include "llvm/CodeGen/GlobalISel/CallLowering.h"
|
2017-02-02 06:56:06 +08:00
|
|
|
#include <cstdint>
|
|
|
|
#include <functional>
|
2016-02-17 03:26:02 +08:00
|
|
|
|
|
|
|
namespace llvm {
|
|
|
|
|
|
|
|
class AArch64TargetLowering;
|
2016-04-15 01:23:33 +08:00
|
|
|
|
2016-02-17 03:26:02 +08:00
|
|
|
class AArch64CallLowering: public CallLowering {
|
2017-02-02 06:56:06 +08:00
|
|
|
public:
|
2016-02-17 03:26:02 +08:00
|
|
|
AArch64CallLowering(const AArch64TargetLowering &TLI);
|
2016-04-15 01:23:33 +08:00
|
|
|
|
|
|
|
bool lowerReturn(MachineIRBuilder &MIRBuiler, const Value *Val,
|
2016-02-17 03:26:02 +08:00
|
|
|
unsigned VReg) const override;
|
2016-08-11 05:44:01 +08:00
|
|
|
|
2016-09-21 20:57:35 +08:00
|
|
|
bool lowerFormalArguments(MachineIRBuilder &MIRBuilder, const Function &F,
|
2016-08-11 05:44:01 +08:00
|
|
|
ArrayRef<unsigned> VRegs) const override;
|
|
|
|
|
2017-03-20 22:40:18 +08:00
|
|
|
bool lowerCall(MachineIRBuilder &MIRBuilder, CallingConv::ID CallConv,
|
|
|
|
const MachineOperand &Callee, const ArgInfo &OrigRet,
|
2016-09-21 20:57:45 +08:00
|
|
|
ArrayRef<ArgInfo> OrigArgs) const override;
|
2016-08-11 05:44:01 +08:00
|
|
|
|
|
|
|
private:
|
2016-09-21 20:57:45 +08:00
|
|
|
typedef std::function<void(MachineIRBuilder &, Type *, unsigned,
|
|
|
|
CCValAssign &)>
|
2016-09-22 21:49:25 +08:00
|
|
|
RegHandler;
|
|
|
|
|
|
|
|
typedef std::function<void(MachineIRBuilder &, int, CCValAssign &)>
|
|
|
|
MemHandler;
|
2016-08-11 05:44:01 +08:00
|
|
|
|
2017-03-07 07:50:28 +08:00
|
|
|
typedef std::function<void(unsigned, uint64_t)> SplitArgTy;
|
2016-09-20 23:20:36 +08:00
|
|
|
|
2016-09-21 20:57:45 +08:00
|
|
|
void splitToValueTypes(const ArgInfo &OrigArgInfo,
|
|
|
|
SmallVectorImpl<ArgInfo> &SplitArgs,
|
2016-09-20 23:20:36 +08:00
|
|
|
const DataLayout &DL, MachineRegisterInfo &MRI,
|
2017-01-13 22:39:03 +08:00
|
|
|
const SplitArgTy &SplitArg) const;
|
2016-02-17 03:26:02 +08:00
|
|
|
};
|
2017-02-02 06:56:06 +08:00
|
|
|
|
|
|
|
} // end namespace llvm
|
|
|
|
|
|
|
|
#endif // LLVM_LIB_TARGET_AARCH64_AARCH64CALLLOWERING_H
|