From 57e1f39713a252a109d96817cc0c4ee1cff9fe68 Mon Sep 17 00:00:00 2001 From: Chris Lattner Date: Fri, 13 Jan 2006 02:03:13 +0000 Subject: [PATCH] Add llvm.stacksave and llvm.stackrestore. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@25264 91177308-0d34-0410-b5e6-96231b3b80d8 --- docs/LangRef.html | 68 +++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 68 insertions(+) diff --git a/docs/LangRef.html b/docs/LangRef.html index 241006695b9..751efa1b855 100644 --- a/docs/LangRef.html +++ b/docs/LangRef.html @@ -127,6 +127,8 @@
  1. 'llvm.returnaddress' Intrinsic
  2. 'llvm.frameaddress' Intrinsic
  3. +
  4. 'llvm.stacksave' Intrinsic
  5. +
  6. 'llvm.stackrestore' Intrinsic
  7. 'llvm.prefetch' Intrinsic
  8. 'llvm.pcmarker' Intrinsic
  9. llvm.readcyclecounter' Intrinsic
  10. @@ -2787,6 +2789,72 @@ source-language caller.

    + + + +
    + +
    Syntax:
    +
    +  declare sbyte *%llvm.stacksave()
    +
    + +
    Overview:
    + +

    +The 'llvm.stacksave' intrinsic is used to remember the current state of +the function stack, for use with +llvm.stackrestore. This is useful for implementing language +features like scoped automatic variable sized arrays in C99. +

    + +
    Semantics:
    + +

    +This intrinsic returns a opaque pointer value that can be passed to llvm.stackrestore. When an +llvm.stackrestore intrinsic is executed with a value saved from +llvm.stacksave, it effectively restores the state of the stack to the +state it was in when the llvm.stacksave intrinsic executed. In +practice, this pops any alloca blocks from the stack +that were allocated after the llvm.stacksave was executed. +

    + +
    + + + + +
    + +
    Syntax:
    +
    +  declare void %llvm.stackrestore(sbyte* %ptr)
    +
    + +
    Overview:
    + +

    +The 'llvm.stackrestore' intrinsic is used to restore the state of +the function stack to the state it was in when the corresponding llvm.stacksave intrinsic executed. This is +useful for implementing language features like scoped automatic variable sized +arrays in C99. +

    + +
    Semantics:
    + +

    +See the description for llvm.stacksave. +

    + +
    + +