#include "MipsCallLowering.h"
#include "MipsCCState.h"
#include "MipsMachineFunction.h"
#include "MipsTargetMachine.h"
#include "llvm/CodeGen/Analysis.h"
#include "llvm/CodeGen/GlobalISel/MachineIRBuilder.h"
#include "llvm/CodeGen/MachineFrameInfo.h"
usingnamespacellvm;
MipsCallLowering::MipsCallLowering(const MipsTargetLowering &TLI)
: … { … }
namespace {
struct MipsOutgoingValueAssigner : public CallLowering::OutgoingValueAssigner { … };
struct MipsIncomingValueAssigner : public CallLowering::IncomingValueAssigner { … };
class MipsIncomingValueHandler : public CallLowering::IncomingValueHandler { … };
class CallReturnHandler : public MipsIncomingValueHandler { … };
}
void MipsIncomingValueHandler::assignValueToReg(Register ValVReg,
Register PhysReg,
const CCValAssign &VA) { … }
Register MipsIncomingValueHandler::getStackAddress(uint64_t Size,
int64_t Offset,
MachinePointerInfo &MPO,
ISD::ArgFlagsTy Flags) { … }
void MipsIncomingValueHandler::assignValueToAddress(
Register ValVReg, Register Addr, LLT MemTy, const MachinePointerInfo &MPO,
const CCValAssign &VA) { … }
unsigned
MipsIncomingValueHandler::assignCustomValue(CallLowering::ArgInfo &Arg,
ArrayRef<CCValAssign> VAs,
std::function<void()> *Thunk) { … }
namespace {
class MipsOutgoingValueHandler : public CallLowering::OutgoingValueHandler { … };
}
void MipsOutgoingValueHandler::assignValueToReg(Register ValVReg,
Register PhysReg,
const CCValAssign &VA) { … }
Register MipsOutgoingValueHandler::getStackAddress(uint64_t Size,
int64_t Offset,
MachinePointerInfo &MPO,
ISD::ArgFlagsTy Flags) { … }
void MipsOutgoingValueHandler::assignValueToAddress(
Register ValVReg, Register Addr, LLT MemTy, const MachinePointerInfo &MPO,
const CCValAssign &VA) { … }
unsigned
MipsOutgoingValueHandler::assignCustomValue(CallLowering::ArgInfo &Arg,
ArrayRef<CCValAssign> VAs,
std::function<void()> *Thunk) { … }
static bool isSupportedArgumentType(Type *T) { … }
static bool isSupportedReturnType(Type *T) { … }
bool MipsCallLowering::lowerReturn(MachineIRBuilder &MIRBuilder,
const Value *Val, ArrayRef<Register> VRegs,
FunctionLoweringInfo &FLI) const { … }
bool MipsCallLowering::lowerFormalArguments(MachineIRBuilder &MIRBuilder,
const Function &F,
ArrayRef<ArrayRef<Register>> VRegs,
FunctionLoweringInfo &FLI) const { … }
bool MipsCallLowering::lowerCall(MachineIRBuilder &MIRBuilder,
CallLoweringInfo &Info) const { … }