Skip to content

Commit c092b00

Browse files
committed
[LangRef] Clarify semantics of objectsize min parameter
LangRef currently only says that this determines the return value if the object size if unknown. What it actually does is determine whether the minimum or maximum size is reported, which degenerates to 0 or -1 if unknown.
1 parent e41a1bd commit c092b00

File tree

1 file changed

+9
-3
lines changed

1 file changed

+9
-3
lines changed

llvm/docs/LangRef.rst

Lines changed: 9 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -29557,9 +29557,15 @@ Arguments:
2955729557
""""""""""
2955829558

2955929559
The ``llvm.objectsize`` intrinsic takes four arguments. The first argument is a
29560-
pointer to or into the ``object``. The second argument determines whether
29561-
``llvm.objectsize`` returns 0 (if true) or -1 (if false) when the object size is
29562-
unknown. The third argument controls how ``llvm.objectsize`` acts when ``null``
29560+
pointer to or into the ``object``.
29561+
29562+
The second argument determines whether ``llvm.objectsize`` returns the minimum
29563+
(if true) or maximum (if false) object size. The minimum size may be any size
29564+
smaller than or equal to the actual object size (including 0 if unknown). The
29565+
maximum size may be any size greater than or equal to the actual object size
29566+
(including -1 if unknown).
29567+
29568+
The third argument controls how ``llvm.objectsize`` acts when ``null``
2956329569
in address space 0 is used as its pointer argument. If it's ``false``,
2956429570
``llvm.objectsize`` reports 0 bytes available when given ``null``. Otherwise, if
2956529571
the ``null`` is in a non-zero address space or if ``true`` is given for the

0 commit comments

Comments
 (0)