2017-09-21 05:35:51 +08:00
|
|
|
//===- llvm/lib/Target/ARM/ARMCallLowering.h - Call lowering ----*- C++ -*-===//
|
2016-11-11 16:27:37 +08:00
|
|
|
//
|
|
|
|
// The LLVM Compiler Infrastructure
|
|
|
|
//
|
|
|
|
// This file is distributed under the University of Illinois Open Source
|
|
|
|
// License. See LICENSE.TXT for details.
|
|
|
|
//
|
|
|
|
//===----------------------------------------------------------------------===//
|
2017-09-21 05:35:51 +08:00
|
|
|
//
|
2016-11-11 16:27:37 +08:00
|
|
|
/// \file
|
|
|
|
/// This file describes how to lower LLVM calls to machine code calls.
|
2017-09-21 05:35:51 +08:00
|
|
|
//
|
2016-11-11 16:27:37 +08:00
|
|
|
//===----------------------------------------------------------------------===//
|
|
|
|
|
2017-09-21 05:35:51 +08:00
|
|
|
#ifndef LLVM_LIB_TARGET_ARM_ARMCALLLOWERING_H
|
|
|
|
#define LLVM_LIB_TARGET_ARM_ARMCALLLOWERING_H
|
2016-11-11 16:27:37 +08:00
|
|
|
|
2017-09-21 05:35:51 +08:00
|
|
|
#include "llvm/ADT/ArrayRef.h"
|
2016-11-11 16:27:37 +08:00
|
|
|
#include "llvm/CodeGen/GlobalISel/CallLowering.h"
|
2017-09-21 05:35:51 +08:00
|
|
|
#include "llvm/IR/CallingConv.h"
|
|
|
|
#include <cstdint>
|
|
|
|
#include <functional>
|
2016-11-11 16:27:37 +08:00
|
|
|
|
|
|
|
namespace llvm {
|
|
|
|
|
|
|
|
class ARMTargetLowering;
|
2017-09-21 05:35:51 +08:00
|
|
|
class MachineFunction;
|
2016-12-16 20:54:46 +08:00
|
|
|
class MachineInstrBuilder;
|
2017-09-21 05:35:51 +08:00
|
|
|
class MachineIRBuilder;
|
|
|
|
class Value;
|
2016-11-11 16:27:37 +08:00
|
|
|
|
|
|
|
class ARMCallLowering : public CallLowering {
|
|
|
|
public:
|
|
|
|
ARMCallLowering(const ARMTargetLowering &TLI);
|
|
|
|
|
2018-08-02 16:33:31 +08:00
|
|
|
bool lowerReturn(MachineIRBuilder &MIRBuilder, const Value *Val,
|
|
|
|
ArrayRef<unsigned> VRegs) const override;
|
2016-11-11 16:27:37 +08:00
|
|
|
|
|
|
|
bool lowerFormalArguments(MachineIRBuilder &MIRBuilder, const Function &F,
|
|
|
|
ArrayRef<unsigned> VRegs) const override;
|
2016-12-16 20:54:46 +08:00
|
|
|
|
2017-03-20 22:40:18 +08:00
|
|
|
bool lowerCall(MachineIRBuilder &MIRBuilder, CallingConv::ID CallConv,
|
|
|
|
const MachineOperand &Callee, const ArgInfo &OrigRet,
|
2017-02-21 19:33:59 +08:00
|
|
|
ArrayRef<ArgInfo> OrigArgs) const override;
|
|
|
|
|
2016-12-16 20:54:46 +08:00
|
|
|
private:
|
|
|
|
bool lowerReturnVal(MachineIRBuilder &MIRBuilder, const Value *Val,
|
2018-08-02 16:33:31 +08:00
|
|
|
ArrayRef<unsigned> VRegs,
|
|
|
|
MachineInstrBuilder &Ret) const;
|
2017-02-02 22:01:00 +08:00
|
|
|
|
2017-09-21 05:35:51 +08:00
|
|
|
using SplitArgTy = std::function<void(unsigned Reg, uint64_t Offset)>;
|
2017-05-29 15:01:52 +08:00
|
|
|
|
2017-02-02 22:01:00 +08:00
|
|
|
/// Split an argument into one or more arguments that the CC lowering can cope
|
|
|
|
/// with (e.g. replace pointers with integers).
|
|
|
|
void splitToValueTypes(const ArgInfo &OrigArg,
|
|
|
|
SmallVectorImpl<ArgInfo> &SplitArgs,
|
2017-05-29 15:01:52 +08:00
|
|
|
MachineFunction &MF,
|
|
|
|
const SplitArgTy &PerformArgSplit) const;
|
2016-11-11 16:27:37 +08:00
|
|
|
};
|
2017-09-21 05:35:51 +08:00
|
|
|
|
|
|
|
} // end namespace llvm
|
|
|
|
|
|
|
|
#endif // LLVM_LIB_TARGET_ARM_ARMCALLLOWERING_H
|