summaryrefslogtreecommitdiff
path: root/docs/LangRef.rst
diff options
context:
space:
mode:
authorMichael Gottesman <mgottesman@apple.com>2013-08-12 18:35:32 +0000
committerMichael Gottesman <mgottesman@apple.com>2013-08-12 18:35:32 +0000
commit2a64a639e5f2870a2a898a593fc37a800f977d5e (patch)
tree7ebd26063df19146c89c5ddd25edff81a597a211 /docs/LangRef.rst
parent67d135ae40b121a138e334a175d0e02dbb54eeca (diff)
downloadllvm-2a64a639e5f2870a2a898a593fc37a800f977d5e.tar.gz
llvm-2a64a639e5f2870a2a898a593fc37a800f977d5e.tar.bz2
llvm-2a64a639e5f2870a2a898a593fc37a800f977d5e.tar.xz
[stackprotector] Added intrinsic llvm.stackprotectorcheck.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@188191 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'docs/LangRef.rst')
-rw-r--r--docs/LangRef.rst50
1 files changed, 44 insertions, 6 deletions
diff --git a/docs/LangRef.rst b/docs/LangRef.rst
index a8feb12a12..8b0be1bf3d 100644
--- a/docs/LangRef.rst
+++ b/docs/LangRef.rst
@@ -8641,14 +8641,52 @@ enough space to hold the value of the guard.
Semantics:
""""""""""
-This intrinsic causes the prologue/epilogue inserter to force the
-position of the ``AllocaInst`` stack slot to be before local variables
-on the stack. This is to ensure that if a local variable on the stack is
-overwritten, it will destroy the value of the guard. When the function
-exits, the guard on the stack is checked against the original guard. If
-they are different, then the program aborts by calling the
+This intrinsic causes the prologue/epilogue inserter to force the position of
+the ``AllocaInst`` stack slot to be before local variables on the stack. This is
+to ensure that if a local variable on the stack is overwritten, it will destroy
+the value of the guard. When the function exits, the guard on the stack is
+checked against the original guard by ``llvm.stackprotectorcheck``. If they are
+different, then ``llvm.stackprotectorcheck`` causes the program to abort by
+calling the ``__stack_chk_fail()`` function.
+
+'``llvm.stackprotectorcheck``' Intrinsic
+^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
+
+Syntax:
+"""""""
+
+::
+
+ declare void @llvm.stackprotectorcheck(i8** <guard>)
+
+Overview:
+"""""""""
+
+The ``llvm.stackprotectorcheck`` intrinsic compares ``guard`` against an already
+created stack protector and if they do not equal calls the
``__stack_chk_fail()`` function.
+Arguments:
+""""""""""
+
+The ``llvm.stackprotectorcheck`` intrinsic requires one pointer argument, the
+the variable ``@__stack_chk_guard``.
+
+Semantics:
+""""""""""
+
+This intrinsic is provided to perform the stack protector check by comparing
+``guard`` with the stack slot created by ``llvm.stackprotector`` and if the
+values do not match call the ``__stack_chk_fail()`` function.
+
+The reason to provide this as an IR level intrinsic instead of implementing it
+via other IR operations is that in order to perform this operation at the IR
+level without an intrinsic, one would need to create additional basic blocks to
+handle the success/failure cases. This makes it difficult to stop the stack
+protector check from disrupting sibling tail calls in Codegen. With this
+intrinsic, we are able to generate the stack protector basic blocks late in
+codegen after the tail call decision has occured.
+
'``llvm.objectsize``' Intrinsic
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^