Skip to content

Commit b81295e

Browse files
steakhaltru
authored andcommitted
[analyzer][docs] CSA release notes for clang-21
The commits were gathered using: ```sh git log --reverse --oneline llvmorg-20-init..llvm/main \ clang/{lib/StaticAnalyzer,include/clang/StaticAnalyzer} | grep -v NFC | \ grep -v OpenACC | grep -v -i revert | grep -v -i "webkit" ``` FYI, I also ignored Webkit changes because I assue it's fairly specific for them, and they likely already know what they ship xD. I used the `LLVM_ENABLE_SPHINX=ON` and `LLVM_ENABLE_DOXYGEN=ON` cmake options to enable the `docs-clang-html` build target, which generates the html into `build/tools/clang/docs/html/ReleaseNotes.html` of which I attach the screenshots to let you judge if it looks all good or not.
1 parent 306481b commit b81295e

File tree

1 file changed

+107
-9
lines changed

1 file changed

+107
-9
lines changed

clang/docs/ReleaseNotes.rst

Lines changed: 107 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1234,33 +1234,131 @@ Code Completion
12341234

12351235
Static Analyzer
12361236
---------------
1237-
- Fixed a crash when C++20 parenthesized initializer lists are used. This issue
1238-
was causing a crash in clang-tidy. (#GH136041)
12391237

12401238
New features
12411239
^^^^^^^^^^^^
12421240

1241+
- A new flag - `-static-libclosure` was introduced to support statically linking
1242+
the runtime for the Blocks extension on Windows. This flag currently only
1243+
changes the code generation, and even then, only on Windows. This does not
1244+
impact the linker behaviour like the other `-static-*` flags.
1245+
- OpenACC support, enabled via `-fopenacc` has reached a level of completeness
1246+
to finally be at least notionally usable. Currently, the OpenACC 3.4
1247+
specification has been completely implemented for Sema and AST creation, so
1248+
nodes will show up in the AST after having been properly checked. Lowering is
1249+
currently a work in progress, with compute, loop, and combined constructs
1250+
partially implemented, plus a handful of data and executable constructs
1251+
implemented. Lowering will only work in Clang-IR mode (so only with a compiler
1252+
built with Clang-IR enabled, and with `-fclangir` used on the command line).
1253+
However, note that the Clang-IR implementation status is also quite partial,
1254+
so frequent 'not yet implemented' diagnostics should be expected. Also, the
1255+
ACC MLIR dialect does not currently implement any lowering to LLVM-IR, so no
1256+
code generation is possible for OpenACC.
1257+
- Implemented `P2719R5 Type-aware allocation and deallocation functions <https://wg21.link/P2719>`_
1258+
as an extension in all C++ language modes.
1259+
1260+
- Added support for the ``[[clang::assume(cond)]]`` attribute, treating it as
1261+
``__builtin_assume(cond)`` for better static analysis. (#GH129234)
1262+
1263+
- Introduced per-entry-point statistics to provide more detailed analysis metrics.
1264+
Documentation: :doc:`analyzer/developer-docs/Statistics` (#GH131175)
1265+
1266+
- Added time-trace scopes for high-level analyzer steps to improve performance
1267+
debugging. Documentation: :doc:`analyzer/developer-docs/PerformanceInvestigation`
1268+
(#GH125508, #GH125884)
1269+
1270+
- Enhanced the ``check::BlockEntrance`` checker callback to provide more granular
1271+
control over block-level analysis.
1272+
`Documentation (check::BlockEntrance)
1273+
<https://clang.llvm.org/doxygen/CheckerDocumentation_8cpp_source.html>`_
1274+
(#GH140924)
1275+
1276+
- Added a new checker ``core.FixedAddressDereference`` to detect dereferences
1277+
of fixed addresses, which can be useful for finding hard-coded memory
1278+
accesses. (#GH127191, #GH132404)
1279+
12431280
Crash and bug fixes
12441281
^^^^^^^^^^^^^^^^^^^
12451282

1246-
- Fixed a crash in ``UnixAPIMisuseChecker`` and ``MallocChecker`` when analyzing
1283+
- Fixed a crash when C++20 parenthesized initializer lists are used.
1284+
This affected a crash of the well-known lambda overloaded pattern.
1285+
(#GH136041, #GH135665)
1286+
1287+
- Dropped an unjustified assertion, that was triggered in ``BugReporterVisitors.cpp``
1288+
for variable initialization detection. (#GH125044)
1289+
1290+
- Fixed a crash in ``unix.API`` and ``unix.Malloc`` when analyzing
12471291
code with non-standard ``getline`` or ``getdelim`` function signatures. (#GH144884)
12481292

1293+
- Fixed crashes involving ``__builtin_bit_cast``. (#GH139188)
1294+
1295+
- ``__datasizeof`` (C++) and ``_Countof`` (C) no longer cause a failed assertion
1296+
when given an operand of VLA type. (#GH151711)
1297+
1298+
- Fixed a crash in ``alpha.core.CastSize``. (#GH134387)
1299+
1300+
- Some ``cplusplus.PlacementNew`` false positives were fixed. (#GH150161)
1301+
12491302
Improvements
12501303
^^^^^^^^^^^^
12511304

1305+
- Added option to assume at least one iteration in loops to reduce false positives.
1306+
(#GH125494)
1307+
12521308
- The checker option ``optin.cplusplus.VirtualCall:PureOnly`` was removed,
1253-
because it had been deprecated since 2019 and it is completely useless (it
1254-
was kept only for compatibility with pre-2019 versions, setting it to true is
1255-
equivalent to completely disabling the checker).
1309+
because it had been deprecated since 2019. (#GH131823)
1310+
1311+
- Enhanced the ``core.StackAddressEscape`` to detect more cases of stack address
1312+
escapes, including return values for child stack frames. (#GH126620, #GH126986)
1313+
1314+
- Improved the ``unix.BlockInCriticalSection`` to recognize ``O_NONBLOCK``
1315+
streams and suppress reports in those cases. (#GH127049)
1316+
1317+
- Better support for lambda-converted function pointers in analysis. (#GH144906)
1318+
1319+
- Improved modeling of ``getcwd`` function in ``unix.StdCLibraryFunctions`` checker.
1320+
(#GH141076)
1321+
1322+
- Enhanced the ``optin.core.EnumCastOutOfRange`` checker to ignore ``[[clang::flag_enum]]``
1323+
enums. (#GH141232)
1324+
1325+
- Improved handling of structured bindings captured by lambdas. (#GH132579, #GH91835)
1326+
1327+
- Fixed unnamed bitfield handling in ``optin.cplusplus.UninitializedObject``. (#GH132427, #GH132001)
1328+
1329+
- Enhanced iterator checker modeling for ``insert`` operations. (#GH132596)
1330+
1331+
- Improved ``format`` attribute handling in ``optin.taint.GenericTaint``. (#GH132765)
1332+
1333+
- Added support for ``consteval`` in ``ConditionBRVisitor::VisitTerminator``.
1334+
(#GH146859, #GH139130)
1335+
1336+
- C standard streams are no longer invalidated by all C library function calls.
1337+
(#GH147766)
1338+
1339+
- Enhanced store management with region-store-binding-limit to improve performance.
1340+
See `region-store-max-binding-fanout
1341+
<https://clang.llvm.org/docs/analyzer/user-docs/Options.html#region-store-max-binding-fanout>`_
1342+
config option. Overriding these options are discouraged, unless you know what you do.
1343+
(#GH127602)
1344+
1345+
- Updated undefined assignment checker (``core.uninitialized.Assign``) diagnostics
1346+
to avoid using the term ``garbage``. (#GH126596)
1347+
1348+
- Fixed false memory leak reports involving placement new. (#GH144341)
1349+
1350+
- Avoided unnecessary super region invalidation in ``unix.cstring.*`` checkers.
1351+
(#GH146212, #GH143807)
1352+
1353+
- Enhanced handling of tainted division-by-zero error paths in the
1354+
``optin.taint.TaintedDiv`` checker. (#GH144491)
12561355

12571356
Moved checkers
12581357
^^^^^^^^^^^^^^
12591358

1260-
- After lots of improvements, the checker ``alpha.security.ArrayBoundV2`` is
1359+
- After lots of improvements, the checker ``alpha.security.ArrayBoundV2`` was
12611360
renamed to ``security.ArrayBound``. As this checker is stable now, the old
1262-
checker ``alpha.security.ArrayBound`` (which was searching for the same kind
1263-
of bugs with an different, simpler and less accurate algorithm) is removed.
1361+
checker ``alpha.security.ArrayBound`` was removed.
12641362

12651363
.. _release-notes-sanitizers:
12661364

0 commit comments

Comments
 (0)