[llvm] [IR] Introduce captures attribute (PR #116990)
Florian Hahn via llvm-commits
llvm-commits at lists.llvm.org
Mon Jan 13 03:24:11 PST 2025
================
@@ -1379,6 +1379,42 @@ Currently, only the following parameter attributes are defined:
function, returning a pointer to allocated storage disjoint from the
storage for any other object accessible to the caller.
+``captures(...)``
+ This attributes restrict the ways in which the callee may capture the
+ pointer. This is not a valid attribute for return values. This attribute
+ applies only to the particular copy of the pointer passed in this argument.
+
+ The arguments of ``captures`` is a list of captured pointer components,
+ which may be ``none``, or a combination of:
+
+ - ``address``: The integral address of the pointer.
+ - ``address_is_null`` (subset of ``address``): Whether the address is null.
+ - ``provenance``: The ability to access the pointer for both read and write
----------------
fhahn wrote:
Just curious, if we already have a separate `read_provenance`, would it make sense to have `write_provenance` instead of just `provenance`?
https://github.com/llvm/llvm-project/pull/116990
More information about the llvm-commits
mailing list