[llvm-branch-commits] [clang] 🍒[NFC][BoundsSafety] Give `counted_by_or_null`, `sized_by`, and `sized_by_or_null` their own documentation (#212877) (PR #217720)
Oliver Hunt via llvm-branch-commits
llvm-branch-commits at lists.llvm.org
Thu Aug 20 23:58:12 PDT 2026
================
@@ -9971,6 +10037,159 @@ requirement:
}];
}
+def SizedByDocs : Documentation {
+ let Category = DocCatField;
+ let Heading = "sized_by";
+ let Content = [{
+The ``sized_by`` attribute is applied to a pointer to indicate that the pointer
+points to memory containing at least the number of *bytes* given by the
+attribute's argument. It is closely related to ``counted_by``; the difference is
+that ``counted_by`` counts the number of *elements* of the pointee type, whereas
+``sized_by`` counts the number of *bytes*. This makes ``sized_by`` the natural
+choice for ``void *`` and other byte buffers.
+
+This attribute is used by `-fbounds-safety <BoundsSafety.html>`__ to propagate
+bounds information on API surfaces without any ABI changes. This attribute is
----------------
ojhunt wrote:
Ditto on a separate doc file
https://github.com/llvm/llvm-project/pull/217720
More information about the llvm-branch-commits
mailing list