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
|
|
|
//
|
2019-01-19 16:50:56 +08:00
|
|
|
// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
|
|
|
|
// See https://llvm.org/LICENSE.txt for license information.
|
|
|
|
// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
|
2016-11-11 16:27:37 +08:00
|
|
|
//
|
|
|
|
//===----------------------------------------------------------------------===//
|
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,
|
2019-06-24 23:50:29 +08:00
|
|
|
ArrayRef<Register> VRegs) const override;
|
2016-11-11 16:27:37 +08:00
|
|
|
|
|
|
|
bool lowerFormalArguments(MachineIRBuilder &MIRBuilder, const Function &F,
|
2019-06-27 16:54:17 +08:00
|
|
|
ArrayRef<ArrayRef<Register>> VRegs) const override;
|
2016-12-16 20:54:46 +08:00
|
|
|
|
2019-08-09 16:26:38 +08:00
|
|
|
bool lowerCall(MachineIRBuilder &MIRBuilder,
|
|
|
|
CallLoweringInfo &Info) const override;
|
2017-02-21 19:33:59 +08:00
|
|
|
|
2016-12-16 20:54:46 +08:00
|
|
|
private:
|
|
|
|
bool lowerReturnVal(MachineIRBuilder &MIRBuilder, const Value *Val,
|
2019-06-24 23:50:29 +08:00
|
|
|
ArrayRef<Register> VRegs,
|
2018-08-02 16:33:31 +08:00
|
|
|
MachineInstrBuilder &Ret) const;
|
2017-02-02 22:01:00 +08:00
|
|
|
|
|
|
|
/// Split an argument into one or more arguments that the CC lowering can cope
|
2019-07-17 18:01:27 +08:00
|
|
|
/// with.
|
2017-02-02 22:01:00 +08:00
|
|
|
void splitToValueTypes(const ArgInfo &OrigArg,
|
|
|
|
SmallVectorImpl<ArgInfo> &SplitArgs,
|
2019-07-17 18:01:27 +08:00
|
|
|
MachineFunction &MF) 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
|