aboutsummaryrefslogtreecommitdiff
path: root/include/llvm/CodeGen/MachineFrameInfo.h
diff options
context:
space:
mode:
authorBill Wendling <isanbard@gmail.com>2008-11-06 02:29:10 +0000
committerBill Wendling <isanbard@gmail.com>2008-11-06 02:29:10 +0000
commitb2a4298ce41e7ef80cd75a3c1dfa6433f0759a1a (patch)
tree90348b042f4b796ea7643d4966ccb2207a5bfdfa /include/llvm/CodeGen/MachineFrameInfo.h
parent9092213a5e50d4991f900d2df009d27bddfd9941 (diff)
Implement the stack protector stack accesses via intrinsics:
- stackprotector_prologue creates a stack object and stores the guard there. - stackprotector_epilogue reads the stack guard from the stack position created by stackprotector_prologue. - The PrologEpilogInserter was changed to make sure that the stack guard is first on the stack frame. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@58791 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'include/llvm/CodeGen/MachineFrameInfo.h')
-rw-r--r--include/llvm/CodeGen/MachineFrameInfo.h19
1 files changed, 19 insertions, 0 deletions
diff --git a/include/llvm/CodeGen/MachineFrameInfo.h b/include/llvm/CodeGen/MachineFrameInfo.h
index e808b43828..2741664972 100644
--- a/include/llvm/CodeGen/MachineFrameInfo.h
+++ b/include/llvm/CodeGen/MachineFrameInfo.h
@@ -150,6 +150,12 @@ class MachineFrameInfo {
/// only valid during and after prolog/epilog code insertion.
bool HasCalls;
+ /// HasStackProtector - Set to true if this function has stack protectors.
+ bool HasStackProtector;
+
+ /// 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
@@ -180,6 +186,8 @@ public:
HasVarSizedObjects = false;
FrameAddressTaken = false;
HasCalls = false;
+ HasStackProtector = false;
+ StackProtectorIdx = -1;
MaxCallFrameSize = 0;
MMI = 0;
}
@@ -195,6 +203,17 @@ public:
///
bool hasVarSizedObjects() const { return HasVarSizedObjects; }
+ /// hasStackProtector - Return true if the function has a stack protector.
+ ///
+ bool hasStackProtector() const { return HasStackProtector; }
+ void setStackProtector(bool T) { HasStackProtector = T; }
+
+ /// 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.