[llvm] [IR] Introduce captures attribute (PR #116990)

Eli Friedman via llvm-commits llvm-commits at lists.llvm.org
Tue Nov 26 15:07:04 PST 2024


================
@@ -1379,6 +1379,38 @@ 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`` (subet of ``address``): Whether the address is null.
----------------
efriedma-quic wrote:

```suggestion
    - ``address_is_null`` (subset of ``address``): Whether the address is null.
```

https://github.com/llvm/llvm-project/pull/116990


More information about the llvm-commits mailing list