class MachineFunction;
class MachineBasicBlock;
class TargetFrameLowering;
+class TargetMachine;
class BitVector;
class Value;
class AllocaInst;
isSpillSlot(isSS), MayNeedSP(NSP), Alloca(Val), PreAllocated(false) {}
};
+ const TargetMachine &TM;
+
/// Objects - The list of stack objects allocated...
///
std::vector<StackObject> Objects;
/// CSIValid - Has CSInfo been set yet?
bool CSIValid;
- /// TargetFrameLowering - Target information about frame layout.
- ///
- const TargetFrameLowering &TFI;
-
/// LocalFrameObjects - References to frame indices which are mapped
/// into the local frame allocation block. <FrameIdx, LocalOffset>
SmallVector<std::pair<int, int64_t>, 32> LocalFrameObjects;
/// just allocate them normally.
bool UseLocalStackAllocationBlock;
+ /// Whether the "realign-stack" option is on.
+ bool RealignOption;
+
+ const TargetFrameLowering *getFrameLowering() const;
public:
- explicit MachineFrameInfo(const TargetFrameLowering &tfi) : TFI(tfi) {
+ explicit MachineFrameInfo(const TargetMachine &TM, bool RealignOpt)
+ : TM(TM), RealignOption(RealignOpt) {
StackSize = NumFixedObjects = OffsetAdjustment = MaxAlignment = 0;
HasVarSizedObjects = false;
FrameAddressTaken = false;
///
void setStackSize(uint64_t Size) { StackSize = Size; }
+ /// Estimate and return the size of the stack frame.
+ unsigned estimateStackSize(const MachineFunction &MF) const;
+
/// getOffsetAdjustment - Return the correction for frame offsets.
///
int getOffsetAdjustment() const { return OffsetAdjustment; }