LangRef: note that `allockind("free")` requires void return
authorAugie Fackler <augie@google.com>
Tue, 26 Jul 2022 13:59:21 +0000 (09:59 -0400)
committerAugie Fackler <augie@google.com>
Tue, 26 Jul 2022 14:10:14 +0000 (10:10 -0400)
Otherwise we have to work pretty hard to ensure a discarded alloc/free
pair doesn't remove a return value that's still useful.

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

llvm/docs/LangRef.rst

index 53df75b..bc1f63f 100644 (file)
@@ -1593,6 +1593,7 @@ example:
       will match that of the ``allocptr`` argument and the ``allocptr``
       argument is invalidated, even if the function returns the same address.
     * "free": the function frees the block of memory specified by ``allocptr``.
+      Functions marked as "free" ``allockind`` must return void.
     * "uninitialized": Any newly-allocated memory (either a new block from
       a "alloc" function or the enlarged capacity from a "realloc" function)
       will be uninitialized.