@@ -1388,10 +1388,11 @@ Currently, only the following parameter attributes are defined:
1388
1388
which may be ``none``, or a combination of:
1389
1389
1390
1390
- ``address``: The integral address of the pointer.
1391
+ - ``address_is_null`` (subet of ``address``): Whether the address is null.
1391
1392
- ``provenance``: The ability to access the pointer for both read and write
1392
1393
after the function returns.
1393
- - ``read_provenance``: The ability to access the pointer only for reads
1394
- after the function returns.
1394
+ - ``read_provenance`` (subset of ``provenance``) : The ability to access the
1395
+ pointer only for reads after the function returns.
1395
1396
1396
1397
Additionally, it is possible to specify that the pointer is captured via
1397
1398
the return value only, by using ``captures(ret: ...)``.
@@ -1404,6 +1405,7 @@ Currently, only the following parameter attributes are defined:
1404
1405
- ``captures(none)``: Pointer not captured.
1405
1406
- ``captures(address, provenance)``: Equivalent to omitting the attribute.
1406
1407
- ``captures(address)``: Address may be captured, but not provenance.
1408
+ - ``captures(address_is_null)``: Only captures whether the address is null.
1407
1409
- ``captures(address, read_provenance)``: Both address and provenance
1408
1410
captured, but only for read-only access.
1409
1411
- ``captures(ret: address, provenance)``: Pointer captured through return
@@ -3352,7 +3354,8 @@ memory before the call, the call may capture two components of the pointer:
3352
3354
3353
3355
* The address of the pointer, which is its integral value. This also includes
3354
3356
parts of the address or any information about the address, including the
3355
- fact that it does not equal one specific value.
3357
+ fact that it does not equal one specific value. We further distinguish
3358
+ whether only the fact that the address is/isn't null is captured.
3356
3359
* The provenance of the pointer, which is the ability to perform memory
3357
3360
accesses through the pointer, in the sense of the :ref:`pointer aliasing
3358
3361
rules <pointeraliasing>`. We further distinguish whether only read acceses
@@ -3400,19 +3403,6 @@ function, provenance capture refers exclusively to the ability to perform
3400
3403
accesses *after* the function returns. Memory accesses within the function
3401
3404
itself are not considered pointer captures.
3402
3405
3403
- Comparison of a pointer with a null pointer is generally also considered an
3404
- address capture. As an exception, if the pointer is known to be either null
3405
- or in bounds of an allocated object, it is not considered an address capture.
3406
- As such, the following example does not capture the pointer argument due to
3407
- the presence of the ``dereferenceable_or_null`` attribute:
3408
-
3409
- .. code-block:: llvm
3410
-
3411
- define i1 @f(ptr dereferenceable_or_null(4) %a) {
3412
- %c = icmp eq ptr %a, null
3413
- ret i1 %c
3414
- }
3415
-
3416
3406
We can further say that the capture only occurs through a specific location.
3417
3407
In the following example, the pointer (both address and provenance) is captured
3418
3408
through the return value only:
0 commit comments