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
This commit is contained in:
Bill Wendling
2008-11-06 02:29:10 +00:00
parent 9092213a5e
commit b2a4298ce4
5 changed files with 105 additions and 9 deletions

View File

@@ -165,6 +165,7 @@ def int_stacksave : Intrinsic<[llvm_ptr_ty]>,
GCCBuiltin<"__builtin_stack_save">;
def int_stackrestore : Intrinsic<[llvm_void_ty, llvm_ptr_ty]>,
GCCBuiltin<"__builtin_stack_restore">;
// IntrWriteArgMem is more pessimistic than strictly necessary for prefetch,
// however it does conveniently prevent the prefetch from being reordered
// with respect to nearby accesses to the same memory.
@@ -175,6 +176,10 @@ def int_pcmarker : Intrinsic<[llvm_void_ty, llvm_i32_ty]>;
def int_readcyclecounter : Intrinsic<[llvm_i64_ty]>;
// Stack protector intrinsics.
def int_stackprotector_prologue : Intrinsic<[llvm_void_ty, llvm_ptr_ty]>;
def int_stackprotector_epilogue : Intrinsic<[llvm_ptr_ty]>;
//===------------------- Standard C Library Intrinsics --------------------===//
//