Skip to content

Commit cd62acd

Browse files
committed
Address some feedback for the release notes and also explain about
unoptimized-vs-optimized builds
1 parent 783eca9 commit cd62acd

File tree

1 file changed

+18
-13
lines changed

1 file changed

+18
-13
lines changed

clang/docs/ReleaseNotes.rst

Lines changed: 18 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -141,22 +141,27 @@ Non-comprehensive list of changes in this release
141141

142142
- Added ``__builtin_elementwise_minnumnum`` and ``__builtin_elementwise_maxnumnum``.
143143

144-
- Trapping UBSan (e.g. ``-fsanitize-trap=undefined``) now emits a string
145-
describing the reason for trapping into the generated debug info. This feature
146-
allows debuggers (e.g. LLDB) to display the reason for trapping if the trap is
147-
reached. The string is currently encoded in the debug info as an artificial
148-
frame that claims to be inlined at the trap location. The function used for
149-
the artificial frame is an artificial function whose name encodes the reason
150-
for trapping. The encoding used is currently the same as
151-
``__builtin_verbose_trap`` but might change in the future. This feature is
144+
- Trapping UBSan (e.g. ``-fsanitize=undefined -fsanitize-trap=undefined``) now
145+
emits a string describing the reason for trapping into the generated debug
146+
info. This feature allows debuggers (e.g. LLDB) to display the reason for
147+
trapping if the trap is reached. The string is currently encoded in the debug
148+
info as an artificial frame that claims to be inlined at the trap location.
149+
The function used for the artificial frame is an artificial function whose
150+
name encodes the reason for trapping. The encoding used is currently the same
151+
as ``__builtin_verbose_trap`` but might change in the future. This feature is
152152
enabled by default but can be disabled by compiling with
153153
``-fno-sanitize-debug-trap-reasons``. The feature has a ``basic`` and
154154
``detailed`` mode (the default). The ``basic`` mode emits a hard-coded string
155-
per trap kind (e.g. integer overflow) and the ``detailed`` mode emits a more
156-
descriptive string describing each individual trap. The ``detailed`` mode
157-
produces larger debug info than ``basic`` but is more helpful for debugging.
158-
The ``-fsanitize-debug-trap-reasons=`` flag can be used to switch between the
159-
different modes.
155+
per trap kind (e.g. ``Integer addition overflowed``) and the ``detailed`` mode
156+
emits a more descriptive string describing each individual trap (e.g. ``signed
157+
integer addition overflow in 'a + b'``). The ``detailed`` mode produces larger
158+
debug info than ``basic`` but is more helpful for debugging. The
159+
``-fsanitize-debug-trap-reasons=`` flag can be used to switch between the
160+
different modes or disable the feature entirely. Note due to trap merging in
161+
optimized builds (i.e. in each function all traps of the same kind get merged
162+
into the same trap instruction) the trap reasons might be removed. To prevent
163+
this build without optimizations (i.e. use `-O0` or use the `optnone` function
164+
attribute) or use the `fno-sanitize-merge=` flag in optimized builds.
160165

161166
- ``__builtin_elementwise_max`` and ``__builtin_elementwise_min`` functions for integer types can
162167
now be used in constant expressions.

0 commit comments

Comments
 (0)