Skip to content

Commit c80a964

Browse files
authored
update staled Core.Compiler.Effects documentation (#53507)
1 parent 71f68b4 commit c80a964

File tree

1 file changed

+6
-7
lines changed

1 file changed

+6
-7
lines changed

base/compiler/effects.jl

Lines changed: 6 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -43,15 +43,16 @@ following meanings:
4343
except that it may access or modify mutable memory pointed to by its call arguments.
4444
This may later be refined to `ALWAYS_TRUE` in a case when call arguments are known to be immutable.
4545
This state corresponds to LLVM's `inaccessiblemem_or_argmemonly` function attribute.
46-
- `noub::Bool`: indicates that the method will not execute any undefined behavior (for any input).
46+
- `noub::UInt8`: indicates that the method will not execute any undefined behavior (for any input).
4747
Note that undefined behavior may technically cause the method to violate any other effect
4848
assertions (such as `:consistent` or `:effect_free`) as well, but we do not model this,
4949
and they assume the absence of undefined behavior.
50+
* `ALWAYS_TRUE`: this method is guaranteed to not execute any undefined behavior.
51+
* `ALWAYS_FALSE`: this method may execute undefined behavior.
52+
* `NOUB_IF_NOINBOUNDS`: this method is guaranteed to not execute any undefined behavior
53+
if the caller does not set nor propagate the `@inbounds` context.
5054
- `nonoverlayed::Bool`: indicates that any methods that may be called within this method
5155
are not defined in an [overlayed method table](@ref OverlayMethodTable).
52-
- `noinbounds::Bool`: If set, indicates that this method does not read the parent's `:inbounds`
53-
state. In particular, it does not have any reached `:boundscheck` exprs, not propagates inbounds
54-
to any children that do.
5556
5657
Note that the representations above are just internal implementation details and thus likely
5758
to change in the future. See [`Base.@assume_effects`](@ref) for more detailed explanation
@@ -92,9 +93,7 @@ The output represents the state of different effect properties in the following
9293
7. `noub` (`u`):
9394
- `+u` (green): `true`
9495
- `-u` (red): `false`
95-
8. `noinbounds` (`i`):
96-
- `+i` (green): `true`
97-
- `-i` (red): `false`
96+
- `?u` (yellow): `NOUB_IF_NOINBOUNDS`
9897
9998
Additionally, if the `nonoverlayed` property is false, a red prime symbol (′) is displayed after the tuple.
10099
"""

0 commit comments

Comments
 (0)