[llvm] r336744 - [LangRef] Clarify alloca of zero bytes.

Eli Friedman via llvm-commits llvm-commits at lists.llvm.org
Tue Jul 10 17:02:01 PDT 2018


Author: efriedma
Date: Tue Jul 10 17:02:01 2018
New Revision: 336744

URL: http://llvm.org/viewvc/llvm-project?rev=336744&view=rev
Log:
[LangRef] Clarify alloca of zero bytes.

Let's be conservative here; it matches what we actually implemented, and
it should be rare in practice anyway.

Differential Revision: https://reviews.llvm.org/D49042


Modified:
    llvm/trunk/docs/LangRef.rst

Modified: llvm/trunk/docs/LangRef.rst
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/docs/LangRef.rst?rev=336744&r1=336743&r2=336744&view=diff
==============================================================================
--- llvm/trunk/docs/LangRef.rst (original)
+++ llvm/trunk/docs/LangRef.rst Tue Jul 10 17:02:01 2018
@@ -7862,9 +7862,9 @@ memory is automatically released when th
 '``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 result is undefined.
-The order in which memory is allocated (ie., which way the stack grows)
-is not specified.
+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:
 """"""""




More information about the llvm-commits mailing list