// the function. This field has no meaning for a variable sized element.
int64_t SPOffset;
- StackObject(uint64_t Sz, unsigned Al, int64_t SP, bool IM = false)
+ StackObject(uint64_t Sz, unsigned Al, int64_t SP = 0, bool IM = false)
: Size(Sz), Alignment(Al), isImmutable(IM), SPOffset(SP) {}
};
bool HasVarSizedObjects;
/// FrameAddressTaken - This boolean keeps track of whether there is a call
- /// to builtin @llvm.frameaddress.
+ /// to builtin \@llvm.frameaddress.
bool FrameAddressTaken;
/// StackSize - The prolog/epilog code inserter calculates the final stack
/// only valid during and after prolog/epilog code insertion.
bool HasCalls;
+ /// StackProtectorIdx - The frame index for the stack protector.
+ int StackProtectorIdx;
+
/// MaxCallFrameSize - This contains the size of the largest call frame if the
/// target uses frame setup/destroy pseudo instructions (as defined in the
/// TargetFrameInfo class). This information is important for frame pointer
///
const TargetFrameInfo &TFI;
public:
- MachineFrameInfo(const TargetFrameInfo &tfi) : TFI(tfi) {
+ explicit MachineFrameInfo(const TargetFrameInfo &tfi) : TFI(tfi) {
StackSize = NumFixedObjects = OffsetAdjustment = MaxAlignment = 0;
HasVarSizedObjects = false;
FrameAddressTaken = false;
HasCalls = false;
+ StackProtectorIdx = -1;
MaxCallFrameSize = 0;
MMI = 0;
}
///
bool hasVarSizedObjects() const { return HasVarSizedObjects; }
+ /// getStackProtectorIndex/setStackProtectorIndex - Return the index for the
+ /// stack protector object.
+ ///
+ int getStackProtectorIndex() const { return StackProtectorIdx; }
+ void setStackProtectorIndex(int I) { StackProtectorIdx = I; }
+
/// isFrameAddressTaken - This method may be called any time after instruction
/// selection is complete to determine if there is a call to
- /// @llvm.frameaddress in this function.
+ /// \@llvm.frameaddress in this function.
bool isFrameAddressTaken() const { return FrameAddressTaken; }
void setFrameAddressIsTaken(bool T) { FrameAddressTaken = T; }
///
int CreateStackObject(uint64_t Size, unsigned Alignment) {
assert(Size != 0 && "Cannot allocate zero size stack objects!");
- Objects.push_back(StackObject(Size, Alignment, -1));
+ Objects.push_back(StackObject(Size, Alignment));
return (int)Objects.size()-NumFixedObjects-1;
}
///
int CreateVariableSizedObject() {
HasVarSizedObjects = true;
- Objects.push_back(StackObject(0, 1, -1));
+ Objects.push_back(StackObject(0, 1));
return (int)Objects.size()-NumFixedObjects-1;
}