From 6233cf565f85d0f156d68b5774baf7ca43b8623c Mon Sep 17 00:00:00 2001 From: Akira Hatanaka Date: Tue, 30 Oct 2012 19:23:25 +0000 Subject: Add definition of function MipsTargetLowering::passArgOnStack which emits nodes for passing a function call argument on a stack. llvm-svn: 167041 --- llvm/lib/Target/Mips/MipsISelLowering.cpp | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) (limited to 'llvm/lib/Target/Mips/MipsISelLowering.cpp') diff --git a/llvm/lib/Target/Mips/MipsISelLowering.cpp b/llvm/lib/Target/Mips/MipsISelLowering.cpp index 4479c48a915..77f1bac8776 100644 --- a/llvm/lib/Target/Mips/MipsISelLowering.cpp +++ b/llvm/lib/Target/Mips/MipsISelLowering.cpp @@ -2676,6 +2676,24 @@ IsEligibleForTailCallOptimization(const MipsCC &MipsCCInfo, bool IsVarArg, return MipsCCInfo.reservedArgArea() == NextStackOffset; } +SDValue +MipsTargetLowering::passArgOnStack(SDValue StackPtr, unsigned Offset, + SDValue Chain, SDValue Arg, DebugLoc DL, + bool IsTailCall, SelectionDAG &DAG) const { + if (!IsTailCall) { + SDValue PtrOff = DAG.getNode(ISD::ADD, DL, getPointerTy(), StackPtr, + DAG.getIntPtrConstant(Offset)); + return DAG.getStore(Chain, DL, Arg, PtrOff, MachinePointerInfo(), false, + false, 0); + } + + MachineFrameInfo *MFI = DAG.getMachineFunction().getFrameInfo(); + int FI = MFI->CreateFixedObject(Arg.getValueSizeInBits() / 8, Offset, false); + SDValue FIN = DAG.getFrameIndex(FI, getPointerTy()); + return DAG.getStore(Chain, DL, Arg, FIN, MachinePointerInfo(), + /*isVolatile=*/ true, false, 0); +} + /// LowerCall - functions arguments are copied from virtual regs to /// (physical regs)/(stack frame), CALLSEQ_START and CALLSEQ_END are emitted. SDValue -- cgit v1.2.3