]> granicus.if.org Git - llvm/commitdiff
[LangRef] add to description of alloca instruction
authorSanjay Patel <spatel@rotateright.com>
Tue, 19 Feb 2019 22:35:12 +0000 (22:35 +0000)
committerSanjay Patel <spatel@rotateright.com>
Tue, 19 Feb 2019 22:35:12 +0000 (22:35 +0000)
As mentioned in D58359, we can explicitly state that the
memory allocated is uninitialized and reading that memory
produces undef.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@354394 91177308-0d34-0410-b5e6-96231b3b80d8

docs/LangRef.rst

index 044f3521ce6cfebda46a37812a38870bd69b82cf..8483d74dd4ff04e2e15b00a40227a290acd8c6de 100644 (file)
@@ -8364,15 +8364,16 @@ boundary compatible with the type.
 Semantics:
 """"""""""
 
-Memory is allocated; a pointer is returned. The operation is undefined
-if there is insufficient stack space for the allocation. '``alloca``'d
-memory is automatically released when the function returns. The
-'``alloca``' instruction is commonly used to represent automatic
-variables that must have an address available. When the function returns
-(either with the ``ret`` or ``resume`` instructions), the memory is
-reclaimed. Allocating zero bytes is legal, but the returned pointer may not
-be unique. The order in which memory is allocated (ie., which way the stack
-grows) is not specified.
+Memory is allocated; a pointer is returned. The allocated memory is
+uninitialized, and loading from uninitialized memory produces an undefined
+value. The operation itself is undefined if there is insufficient stack
+space for the allocation.'``alloca``'d memory is automatically released
+when the function returns. The '``alloca``' instruction is commonly used
+to represent automatic variables that must have an address available. When
+the function returns (either with the ``ret`` or ``resume`` instructions),
+the memory is reclaimed. Allocating zero bytes is legal, but the returned
+pointer may not be unique. The order in which memory is allocated (ie.,
+which way the stack grows) is not specified.
 
 Example:
 """"""""