From b33b34a7dc447cf52702b8892c9829344e81f73a Mon Sep 17 00:00:00 2001 From: Akira Hatanaka Date: Tue, 30 Oct 2012 19:37:25 +0000 Subject: [PATCH] Add code for saving formal argument information to MipsFunctionInfo. This information will be used by IsEligibleForTailCallOptimization to determine whether a call can be tail-call optimized. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@167043 91177308-0d34-0410-b5e6-96231b3b80d8 --- lib/Target/Mips/MipsISelLowering.cpp | 2 ++ lib/Target/Mips/MipsMachineFunction.h | 11 +++++++++++ 2 files changed, 13 insertions(+) diff --git a/lib/Target/Mips/MipsISelLowering.cpp b/lib/Target/Mips/MipsISelLowering.cpp index 77f1bac8776..862790b4d2c 100644 --- a/lib/Target/Mips/MipsISelLowering.cpp +++ b/lib/Target/Mips/MipsISelLowering.cpp @@ -3021,6 +3021,8 @@ MipsTargetLowering::LowerFormalArguments(SDValue Chain, MipsCC MipsCCInfo(CallConv, isVarArg, IsO32, CCInfo); MipsCCInfo.analyzeFormalArguments(Ins); + MipsFI->setFormalArgInfo(CCInfo.getNextStackOffset(), + MipsCCInfo.hasByValArg()); Function::const_arg_iterator FuncArg = DAG.getMachineFunction().getFunction()->arg_begin(); diff --git a/lib/Target/Mips/MipsMachineFunction.h b/lib/Target/Mips/MipsMachineFunction.h index f9efe07e0ee..663aaecf5c0 100644 --- a/lib/Target/Mips/MipsMachineFunction.h +++ b/lib/Target/Mips/MipsMachineFunction.h @@ -47,6 +47,10 @@ class MipsFunctionInfo : public MachineFunctionInfo { /// VarArgsFrameIndex - FrameIndex for start of varargs area. int VarArgsFrameIndex; + // Formal argument information obtained during call to LowerFormalArguments. + unsigned NextStackOffset; + bool HasByvalArg; + bool EmitNOAT; public: @@ -67,6 +71,13 @@ public: int getVarArgsFrameIndex() const { return VarArgsFrameIndex; } void setVarArgsFrameIndex(int Index) { VarArgsFrameIndex = Index; } + unsigned nextStackOffset() const { return NextStackOffset; } + bool hasByvalArg() const { return HasByvalArg; } + void setFormalArgInfo(unsigned Offset, bool HasByval) { + NextStackOffset = Offset; + HasByvalArg = HasByval; + } + bool getEmitNOAT() const { return EmitNOAT; } void setEmitNOAT() { EmitNOAT = true; } }; -- 2.34.1