llvm.org GIT mirror llvm / b084c50
[CodeGen] Remove dead call-or-prologue enum from CCState This enum has been dead since Olivier Stannard re-implemented ARM byval handling in r202985 (2014). git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@293943 91177308-0d34-0410-b5e6-96231b3b80d8 Reid Kleckner 3 years ago
3 changed file(s) with 10 addition(s) and 42 deletion(s). Raw diff Collapse all Expand all
181181 typedef bool CCCustomFn(unsigned &ValNo, MVT &ValVT,
182182 MVT &LocVT, CCValAssign::LocInfo &LocInfo,
183183 ISD::ArgFlagsTy &ArgFlags, CCState &State);
184
185 /// ParmContext - This enum tracks whether calling convention lowering is in
186 /// the context of prologue or call generation. Not all backends make use of
187 /// this information.
188 typedef enum { Unknown, Prologue, Call } ParmContext;
189184
190185 /// CCState - This class holds information needed while lowering arguments and
191186 /// return values. It captures which registers are already assigned and which
255250 // during argument analysis.
256251 unsigned InRegsParamsProcessed;
257252
258 protected:
259 ParmContext CallOrPrologue;
260
261253 public:
262254 CCState(CallingConv::ID CC, bool isVarArg, MachineFunction &MF,
263255 SmallVectorImpl &locs, LLVMContext &C);
509501 InRegsParamsProcessed = 0;
510502 }
511503
512 ParmContext getCallOrPrologue() const { return CallOrPrologue; }
513
514504 // Get list of pending assignments
515505 SmallVectorImpl &getPendingLocs() {
516506 return PendingLocs;
2929 CCState::CCState(CallingConv::ID CC, bool isVarArg, MachineFunction &mf,
3030 SmallVectorImpl &locs, LLVMContext &C)
3131 : CallingConv(CC), IsVarArg(isVarArg), MF(mf),
32 TRI(*MF.getSubtarget().getRegisterInfo()), Locs(locs), Context(C),
33 CallOrPrologue(Unknown) {
32 TRI(*MF.getSubtarget().getRegisterInfo()), Locs(locs), Context(C) {
3433 // No stack is used.
3534 StackOffset = 0;
3635 MaxStackArgAlign = 1;
135135 cl::desc("Maximum size of ALL constants to promote into a constant pool"),
136136 cl::init(128));
137137
138 namespace {
139
140 class ARMCCState : public CCState {
141 public:
142 ARMCCState(CallingConv::ID CC, bool isVarArg, MachineFunction &MF,
143 SmallVectorImpl &locs, LLVMContext &C,
144 ParmContext PC)
145 : CCState(CC, isVarArg, MF, locs, C) {
146 assert(((PC == Call) || (PC == Prologue)) &&
147 "ARMCCState users must specify whether their context is call"
148 "or prologue generation.");
149 CallOrPrologue = PC;
150 }
151 };
152
153 } // end anonymous namespace
154
155138 // The APCS parameter registers.
156139 static const MCPhysReg GPRArgRegs[] = {
157140 ARM::R0, ARM::R1, ARM::R2, ARM::R3
16041587
16051588 // Assign locations to each value returned by this call.
16061589 SmallVector RVLocs;
1607 ARMCCState CCInfo(CallConv, isVarArg, DAG.getMachineFunction(), RVLocs,
1608 *DAG.getContext(), Call);
1590 CCState CCInfo(CallConv, isVarArg, DAG.getMachineFunction(), RVLocs,
1591 *DAG.getContext());
16091592 CCInfo.AnalyzeCallResult(Ins, CCAssignFnForReturn(CallConv, isVarArg));
16101593
16111594 // Copy all of the result registers out of their specified physreg.
17651748
17661749 // Analyze operands of the call, assigning locations to each operand.
17671750 SmallVector ArgLocs;
1768 ARMCCState CCInfo(CallConv, isVarArg, DAG.getMachineFunction(), ArgLocs,
1769 *DAG.getContext(), Call);
1751 CCState CCInfo(CallConv, isVarArg, DAG.getMachineFunction(), ArgLocs,
1752 *DAG.getContext());
17701753 CCInfo.AnalyzeCallOperands(Outs, CCAssignFnForCall(CallConv, isVarArg));
17711754
17721755 // Get a count of how many bytes are to be pushed on the stack.
21422125 /// this.
21432126 void ARMTargetLowering::HandleByVal(CCState *State, unsigned &Size,
21442127 unsigned Align) const {
2145 assert((State->getCallOrPrologue() == Prologue ||
2146 State->getCallOrPrologue() == Call) &&
2147 "unhandled ParmContext");
2148
21492128 // Byval (as with any stack) slots are always at least 4 byte aligned.
21502129 Align = std::max(Align, 4U);
21512130
23142293 // Check if stack adjustment is needed. For now, do not do this if any
23152294 // argument is passed on the stack.
23162295 SmallVector ArgLocs;
2317 ARMCCState CCInfo(CalleeCC, isVarArg, MF, ArgLocs, C, Call);
2296 CCState CCInfo(CalleeCC, isVarArg, MF, ArgLocs, C);
23182297 CCInfo.AnalyzeCallOperands(Outs, CCAssignFnForCall(CalleeCC, isVarArg));
23192298 if (CCInfo.getNextStackOffset()) {
23202299 // Check if the arguments are already laid out in the right way as
24162395 SmallVector RVLocs;
24172396
24182397 // CCState - Info about the registers and stack slots.
2419 ARMCCState CCInfo(CallConv, isVarArg, DAG.getMachineFunction(), RVLocs,
2420 *DAG.getContext(), Call);
2398 CCState CCInfo(CallConv, isVarArg, DAG.getMachineFunction(), RVLocs,
2399 *DAG.getContext());
24212400
24222401 // Analyze outgoing return values.
24232402 CCInfo.AnalyzeReturn(Outs, CCAssignFnForReturn(CallConv, isVarArg));
35133492
35143493 // Assign locations to all of the incoming arguments.
35153494 SmallVector ArgLocs;
3516 ARMCCState CCInfo(CallConv, isVarArg, DAG.getMachineFunction(), ArgLocs,
3517 *DAG.getContext(), Prologue);
3495 CCState CCInfo(CallConv, isVarArg, DAG.getMachineFunction(), ArgLocs,
3496 *DAG.getContext());
35183497 CCInfo.AnalyzeFormalArguments(Ins, CCAssignFnForCall(CallConv, isVarArg));
35193498
35203499 SmallVector ArgValues;