llvm.org GIT mirror llvm / 72852a8
Constify some arguments. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@108812 91177308-0d34-0410-b5e6-96231b3b80d8 Eric Christopher 10 years ago
10 changed file(s) with 17 addition(s) and 17 deletion(s). Raw diff Collapse all Expand all
602602 /// immediately on entry to the current function. This eliminates the need for
603603 /// add/sub sp brackets around call sites. Returns true if the call frame is
604604 /// included as part of the stack frame.
605 virtual bool hasReservedCallFrame(MachineFunction &MF) const {
605 virtual bool hasReservedCallFrame(const MachineFunction &MF) const {
606606 return !hasFP(MF);
607607 }
608608
613613 /// if the function has a reserved call frame or a frame pointer. Some
614614 /// targets (Thumb2, for example) may have more complicated criteria,
615615 /// however, and can override this behavior.
616 virtual bool canSimplifyCallFramePseudos(MachineFunction &MF) const {
616 virtual bool canSimplifyCallFramePseudos(const MachineFunction &MF) const {
617617 return hasReservedCallFrame(MF) || hasFP(MF);
618618 }
619619
623623 /// reserved as its spill slot. This tells PEI not to create a new stack frame
624624 /// object for the given register. It should be called only after
625625 /// processFunctionBeforeCalleeSavedScan().
626 virtual bool hasReservedSpillSlot(MachineFunction &MF, unsigned Reg,
626 virtual bool hasReservedSpillSlot(const MachineFunction &MF, unsigned Reg,
627627 int &FrameIdx) const {
628628 return false;
629629 }
12381238 // add/sub sp brackets around call sites. Returns true if the call frame is
12391239 // included as part of the stack frame.
12401240 bool ARMBaseRegisterInfo::
1241 hasReservedCallFrame(MachineFunction &MF) const {
1241 hasReservedCallFrame(const MachineFunction &MF) const {
12421242 const MachineFrameInfo *FFI = MF.getFrameInfo();
12431243 unsigned CFSize = FFI->getMaxCallFrameSize();
12441244 // It's not always a good idea to include the call frame as part of the
12561256 // is not sufficient here since we still may reference some objects via SP
12571257 // even when FP is available in Thumb2 mode.
12581258 bool ARMBaseRegisterInfo::
1259 canSimplifyCallFramePseudos(MachineFunction &MF) const {
1259 canSimplifyCallFramePseudos(const MachineFunction &MF) const {
12601260 return hasReservedCallFrame(MF) || MF.getFrameInfo()->hasVarSizedObjects();
12611261 }
12621262
143143
144144 virtual bool requiresFrameIndexScavenging(const MachineFunction &MF) const;
145145
146 virtual bool hasReservedCallFrame(MachineFunction &MF) const;
147 virtual bool canSimplifyCallFramePseudos(MachineFunction &MF) const;
146 virtual bool hasReservedCallFrame(const MachineFunction &MF) const;
147 virtual bool canSimplifyCallFramePseudos(const MachineFunction &MF) const;
148148
149149 virtual void eliminateCallFramePseudoInstr(MachineFunction &MF,
150150 MachineBasicBlock &MBB,
6767 .addConstantPoolIndex(Idx).addImm(Pred).addReg(PredReg);
6868 }
6969
70 bool Thumb1RegisterInfo::hasReservedCallFrame(MachineFunction &MF) const {
70 bool Thumb1RegisterInfo::hasReservedCallFrame(const MachineFunction &MF) const {
7171 const MachineFrameInfo *FFI = MF.getFrameInfo();
7272 unsigned CFSize = FFI->getMaxCallFrameSize();
7373 // It's not always a good idea to include the call frame as part of the
3737 unsigned PredReg = 0) const;
3838
3939 /// Code Generation virtual methods...
40 bool hasReservedCallFrame(MachineFunction &MF) const;
40 bool hasReservedCallFrame(const MachineFunction &MF) const;
4141
4242 void eliminateCallFramePseudoInstr(MachineFunction &MF,
4343 MachineBasicBlock &MBB,
100100 MFI->isFrameAddressTaken());
101101 }
102102
103 bool MSP430RegisterInfo::hasReservedCallFrame(MachineFunction &MF) const {
103 bool MSP430RegisterInfo::hasReservedCallFrame(const MachineFunction &MF) const {
104104 return !MF.getFrameInfo()->hasVarSizedObjects();
105105 }
106106
3939 const TargetRegisterClass* getPointerRegClass(unsigned Kind = 0) const;
4040
4141 bool hasFP(const MachineFunction &MF) const;
42 bool hasReservedCallFrame(MachineFunction &MF) const;
42 bool hasReservedCallFrame(const MachineFunction &MF) const;
4343
4444 void eliminateCallFramePseudoInstr(MachineFunction &MF,
4545 MachineBasicBlock &MBB,
3333
3434 BitVector getReservedRegs(const MachineFunction &MF) const;
3535
36 bool hasReservedCallFrame(MachineFunction &MF) const { return true; }
36 bool hasReservedCallFrame(const MachineFunction &MF) const { return true; }
3737 bool hasFP(const MachineFunction &MF) const;
3838
3939 int getFrameIndexOffset(const MachineFunction &MF, int FI) const;
468468 return requiresRealignment && canRealignStack(MF);
469469 }
470470
471 bool X86RegisterInfo::hasReservedCallFrame(MachineFunction &MF) const {
471 bool X86RegisterInfo::hasReservedCallFrame(const MachineFunction &MF) const {
472472 return !MF.getFrameInfo()->hasVarSizedObjects();
473473 }
474474
475 bool X86RegisterInfo::hasReservedSpillSlot(MachineFunction &MF, unsigned Reg,
476 int &FrameIdx) const {
475 bool X86RegisterInfo::hasReservedSpillSlot(const MachineFunction &MF,
476 unsigned Reg, int &FrameIdx) const {
477477 if (Reg == FramePtr && hasFP(MF)) {
478478 FrameIdx = MF.getFrameInfo()->getObjectIndexBegin();
479479 return true;
116116
117117 bool needsStackRealignment(const MachineFunction &MF) const;
118118
119 bool hasReservedCallFrame(MachineFunction &MF) const;
119 bool hasReservedCallFrame(const MachineFunction &MF) const;
120120
121 bool hasReservedSpillSlot(MachineFunction &MF, unsigned Reg,
121 bool hasReservedSpillSlot(const MachineFunction &MF, unsigned Reg,
122122 int &FrameIdx) const;
123123
124124 void eliminateCallFramePseudoInstr(MachineFunction &MF,