Skip to content

Commit 5256924

Browse files
authored
[LangRef] Clarify semantics of objectsize min parameter (#156309)
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. Fixes #156192.
1 parent 0909f04 commit 5256924

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
@@ -29724,9 +29724,15 @@ Arguments:
2972429724
""""""""""
2972529725

2972629726
The ``llvm.objectsize`` intrinsic takes four arguments. The first argument is a
29727-
pointer to or into the ``object``. The second argument determines whether
29728-
``llvm.objectsize`` returns 0 (if true) or -1 (if false) when the object size is
29729-
unknown. The third argument controls how ``llvm.objectsize`` acts when ``null``
29727+
pointer to or into the ``object``.
29728+
29729+
The second argument determines whether ``llvm.objectsize`` returns the minimum
29730+
(if true) or maximum (if false) object size. The minimum size may be any size
29731+
smaller than or equal to the actual object size (including 0 if unknown). The
29732+
maximum size may be any size greater than or equal to the actual object size
29733+
(including -1 if unknown).
29734+
29735+
The third argument controls how ``llvm.objectsize`` acts when ``null``
2973029736
in address space 0 is used as its pointer argument. If it's ``false``,
2973129737
``llvm.objectsize`` reports 0 bytes available when given ``null``. Otherwise, if
2973229738
the ``null`` is in a non-zero address space or if ``true`` is given for the

0 commit comments

Comments
 (0)