@@ -1388,10 +1388,11 @@ Currently, only the following parameter attributes are defined:
13881388 which may be ``none``, or a combination of:
13891389
13901390 - ``address``: The integral address of the pointer.
1391+ - ``address_is_null`` (subet of ``address``): Whether the address is null.
13911392 - ``provenance``: The ability to access the pointer for both read and write
13921393 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.
13951396
13961397 Additionally, it is possible to specify that the pointer is captured via
13971398 the return value only, by using ``captures(ret: ...)``.
@@ -1404,6 +1405,7 @@ Currently, only the following parameter attributes are defined:
14041405 - ``captures(none)``: Pointer not captured.
14051406 - ``captures(address, provenance)``: Equivalent to omitting the attribute.
14061407 - ``captures(address)``: Address may be captured, but not provenance.
1408+ - ``captures(address_is_null)``: Only captures whether the address is null.
14071409 - ``captures(address, read_provenance)``: Both address and provenance
14081410 captured, but only for read-only access.
14091411 - ``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:
33523354
33533355 * The address of the pointer, which is its integral value. This also includes
33543356 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.
33563359 * The provenance of the pointer, which is the ability to perform memory
33573360 accesses through the pointer, in the sense of the :ref:`pointer aliasing
33583361 rules <pointeraliasing>`. We further distinguish whether only read acceses
@@ -3400,19 +3403,6 @@ function, provenance capture refers exclusively to the ability to perform
34003403accesses *after* the function returns. Memory accesses within the function
34013404itself are not considered pointer captures.
34023405
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-
34163406We can further say that the capture only occurs through a specific location.
34173407In the following example, the pointer (both address and provenance) is captured
34183408through the return value only:
0 commit comments