diff options
| author | Mingming Liu <mingmingl@google.com> | 2025-09-10 15:25:31 -0700 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2025-09-10 15:25:31 -0700 |
| commit | 1417dafa1db9cb1b2b09438aa9f53ea5ab6e36e2 (patch) | |
| tree | 57f4b1f313c8cf74eed8819870f39c36ea263c68 /clang/docs | |
| parent | 898b813bc8a6d0276bf0f4769f5f2f64b34e632d (diff) | |
| parent | b8cefcb601ddaa18482555c4ff363c01a270c2fe (diff) | |
Merge branch 'main' into users/mingmingl-llvm/samplefdo-profile-formatusers/mingmingl-llvm/samplefdo-profile-format
Diffstat (limited to 'clang/docs')
| -rw-r--r-- | clang/docs/AddressSanitizer.rst | 2 | ||||
| -rw-r--r-- | clang/docs/InternalsManual.rst | 2 | ||||
| -rw-r--r-- | clang/docs/LanguageExtensions.rst | 61 | ||||
| -rw-r--r-- | clang/docs/OpenMPSupport.rst | 65 | ||||
| -rw-r--r-- | clang/docs/ReleaseNotes.rst | 98 | ||||
| -rw-r--r-- | clang/docs/SanitizerSpecialCaseList.rst | 2 | ||||
| -rw-r--r-- | clang/docs/UsersManual.rst | 57 | ||||
| -rw-r--r-- | clang/docs/analyzer/checkers.rst | 33 | ||||
| -rw-r--r-- | clang/docs/index.rst | 1 |
9 files changed, 220 insertions, 101 deletions
diff --git a/clang/docs/AddressSanitizer.rst b/clang/docs/AddressSanitizer.rst index 8d9295f246f0..21e1a3652192 100644 --- a/clang/docs/AddressSanitizer.rst +++ b/clang/docs/AddressSanitizer.rst @@ -297,7 +297,7 @@ Instrumentation code outlining By default AddressSanitizer inlines the instrumentation code to improve the run-time performance, which leads to increased binary size. Using the -(clang flag ``-fsanitize-address-outline-instrumentation` default: ``false``) +(clang flag ``-fsanitize-address-outline-instrumentation`` default: ``false``) flag forces all code instrumentation to be outlined, which reduces the size of the generated code, but also reduces the run-time performance. diff --git a/clang/docs/InternalsManual.rst b/clang/docs/InternalsManual.rst index 756db85c6945..bd742273f4ed 100644 --- a/clang/docs/InternalsManual.rst +++ b/clang/docs/InternalsManual.rst @@ -343,7 +343,7 @@ Class: Description: This is a formatter which represents the argument number in a human-readable format: the value ``123`` stays ``123``, ``12345`` becomes ``12.34k``, - ``6666666` becomes ``6.67M``, and so on for 'G' and 'T'. + ``6666666`` becomes ``6.67M``, and so on for 'G' and 'T'. **"objcclass" format** diff --git a/clang/docs/LanguageExtensions.rst b/clang/docs/LanguageExtensions.rst index 3c6c97bb1fa1..ad190eace5b0 100644 --- a/clang/docs/LanguageExtensions.rst +++ b/clang/docs/LanguageExtensions.rst @@ -875,12 +875,14 @@ of different sizes and signs is forbidden in binary and ternary builtins. for the comparison. T __builtin_elementwise_fshl(T x, T y, T z) perform a funnel shift left. Concatenate x and y (x is the most integer types significant bits of the wide value), the combined value is shifted - left by z, and the most significant bits are extracted to produce + left by z (modulo the bit width of the original arguments), + and the most significant bits are extracted to produce a result that is the same size as the original arguments. T __builtin_elementwise_fshr(T x, T y, T z) perform a funnel shift right. Concatenate x and y (x is the most integer types significant bits of the wide value), the combined value is shifted - right by z, and the least significant bits are extracted to produce + right by z (modulo the bit width of the original arguments), + and the least significant bits are extracted to produce a result that is the same size as the original arguments. T __builtin_elementwise_ctlz(T x[, T y]) return the number of leading 0 bits in the first argument. If integer types the first argument is 0 and an optional second argument is provided, @@ -946,7 +948,14 @@ Let ``VT`` be a vector type and ``ET`` the element type of ``VT``. Each builtin accesses memory according to a provided boolean mask. These are provided as ``__builtin_masked_load`` and ``__builtin_masked_store``. The first -argument is always boolean mask vector. +argument is always boolean mask vector. The ``__builtin_masked_load`` builtin +takes an optional third vector argument that will be used for the result of the +masked-off lanes. These builtins assume the memory is always aligned. + +The ``__builtin_masked_expand_load`` and ``__builtin_masked_compress_store`` +builtins have the same interface but store the result in consecutive indices. +Effectively this performs the ``if (mask[i]) val[i] = ptr[j++]`` and ``if +(mask[i]) ptr[j++] = val[i]`` pattern respectively. Example: @@ -955,9 +964,19 @@ Example: using v8b = bool [[clang::ext_vector_type(8)]]; using v8i = int [[clang::ext_vector_type(8)]]; - v8i load(v8b m, v8i *p) { return __builtin_masked_load(m, p); } - - void store(v8b m, v8i v, v8i *p) { __builtin_masked_store(m, v, p); } + v8i load(v8b mask, v8i *ptr) { return __builtin_masked_load(mask, ptr); } + + v8i load_expand(v8b mask, v8i *ptr) { + return __builtin_masked_expand_load(mask, ptr); + } + + void store(v8b mask, v8i val, v8i *ptr) { + __builtin_masked_store(mask, val, ptr); + } + + void store_compress(v8b mask, v8i val, v8i *ptr) { + __builtin_masked_compress_store(mask, val, ptr); + } Matrix Types @@ -2032,6 +2051,9 @@ The following type trait primitives are supported by Clang. Those traits marked Returns true if a reference ``T`` can be copy-initialized from a temporary of type a non-cv-qualified ``U``. * ``__underlying_type`` (C++, GNU, Microsoft) +* ``__builtin_lt_synthesises_from_spaceship``, ``__builtin_gt_synthesises_from_spaceship``, + ``__builtin_le_synthesises_from_spaceship``, ``__builtin_ge_synthesises_from_spaceship`` (Clang): + These builtins can be used to determine whether the corresponding operator is synthesised from a spaceship operator. In addition, the following expression traits are supported: @@ -4182,7 +4204,7 @@ builtin, the mangler emits their usual pattern without any special treatment. ----------------------- ``__builtin_popcountg`` returns the number of 1 bits in the argument. The -argument can be of any unsigned integer type. +argument can be of any unsigned integer type or fixed boolean vector. **Syntax**: @@ -4214,7 +4236,13 @@ such as ``unsigned __int128`` and C23 ``unsigned _BitInt(N)``. ``__builtin_clzg`` (respectively ``__builtin_ctzg``) returns the number of leading (respectively trailing) 0 bits in the first argument. The first argument -can be of any unsigned integer type. +can be of any unsigned integer type or fixed boolean vector. + +For boolean vectors, these builtins interpret the vector like a bit-field where +the ith element of the vector is bit i of the bit-field, counting from the +least significant end. ``__builtin_clzg`` returns the number of zero elements at +the end of the vector, while ``__builtin_ctzg`` returns the number of zero +elements at the start of the vector. If the first argument is 0 and an optional second argument of ``int`` type is provided, then the second argument is returned. If the first argument is 0, but @@ -5154,6 +5182,23 @@ If no address spaces names are provided, all address spaces are fenced. __builtin_amdgcn_fence(__ATOMIC_SEQ_CST, "workgroup", "local") __builtin_amdgcn_fence(__ATOMIC_SEQ_CST, "workgroup", "local", "global") +__builtin_amdgcn_ballot_w{32,64} +^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + +``__builtin_amdgcn_ballot_w{32,64}`` returns a bitmask that contains its +boolean argument as a bit for every lane of the current wave that is currently +active (i.e., that is converged with the executing thread), and a 0 bit for +every lane that is not active. + +The result is uniform, i.e. it is the same in every active thread of the wave. + +__builtin_amdgcn_inverse_ballot_w{32,64} +^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + +Given a wave-uniform bitmask, ``__builtin_amdgcn_inverse_ballot_w{32,64}(mask)`` +returns the bit at the position of the current lane. It is almost equivalent to +``(mask & (1 << lane_id)) != 0``, except that its behavior is only defined if +the given mask has the same value for all active lanes of the current wave. ARM/AArch64 Language Extensions ------------------------------- diff --git a/clang/docs/OpenMPSupport.rst b/clang/docs/OpenMPSupport.rst index 2b510747bea9..cb8ea5e51110 100644 --- a/clang/docs/OpenMPSupport.rst +++ b/clang/docs/OpenMPSupport.rst @@ -364,17 +364,26 @@ implementation. +=============================================================+===========================+===========================+==========================================================================+
| free-agent threads | :none:`unclaimed` | :none:`unclaimed` | |
+-------------------------------------------------------------+---------------------------+---------------------------+--------------------------------------------------------------------------+
-| threadset clause | :`worked on` | :none:`unclaimed` | |
+| threadset clause | :part:`in progress` | :none:`unclaimed` | |
+-------------------------------------------------------------+---------------------------+---------------------------+--------------------------------------------------------------------------+
-| Recording of task graphs | :none:`unclaimed` | :none:`unclaimed` | |
+| Recording of task graphs | :part:`in progress` | :part:`in progress` | clang: jtb20, flang: kparzysz |
+-------------------------------------------------------------+---------------------------+---------------------------+--------------------------------------------------------------------------+
| Parallel inductions | :none:`unclaimed` | :none:`unclaimed` | |
+-------------------------------------------------------------+---------------------------+---------------------------+--------------------------------------------------------------------------+
| init_complete for scan directive | :none:`unclaimed` | :none:`unclaimed` | |
+-------------------------------------------------------------+---------------------------+---------------------------+--------------------------------------------------------------------------+
-| Loop transformation constructs | :none:`unclaimed` | :none:`unclaimed` | |
+| loop interchange transformation | :good:`done` | :none:`unclaimed` | Clang (interchange): https://github.com/llvm/llvm-project/pull/93022 |
+| | | | Clang (permutation): https://github.com/llvm/llvm-project/pull/92030 |
+-------------------------------------------------------------+---------------------------+---------------------------+--------------------------------------------------------------------------+
-| loop stripe transformation | :good:`done` | https://github.com/llvm/llvm-project/pull/119891 |
+| loop reverse transformation | :good:`done` | :none:`unclaimed` | https://github.com/llvm/llvm-project/pull/92916 |
++-------------------------------------------------------------+---------------------------+---------------------------+--------------------------------------------------------------------------+
+| loop stripe transformation | :good:`done` | :none:`unclaimed` | https://github.com/llvm/llvm-project/pull/119891 |
++-------------------------------------------------------------+---------------------------+---------------------------+--------------------------------------------------------------------------+
+| loop fusion transformation | :part:`in progress` | :none:`unclaimed` | https://github.com/llvm/llvm-project/pull/139293 |
++-------------------------------------------------------------+---------------------------+---------------------------+--------------------------------------------------------------------------+
+| loop index set splitting transformation | :none:`unclaimed` | :none:`unclaimed` | |
++-------------------------------------------------------------+---------------------------+---------------------------+--------------------------------------------------------------------------+
+| loop transformation apply clause | :none:`unclaimed` | :none:`unclaimed` | |
+-------------------------------------------------------------+---------------------------+---------------------------+--------------------------------------------------------------------------+
| workdistribute construct | | :none:`in progress` | @skc7, @mjklemm |
+-------------------------------------------------------------+---------------------------+---------------------------+--------------------------------------------------------------------------+
@@ -386,15 +395,15 @@ implementation. +-------------------------------------------------------------+---------------------------+---------------------------+--------------------------------------------------------------------------+
| rule-based compound directives | :none:`unclaimed` | :part:`In Progress` | Testing for Fortran missing |
+-------------------------------------------------------------+---------------------------+---------------------------+--------------------------------------------------------------------------+
-| C23, C++23 | :none:`unclaimed` | :none:`unclaimed` | |
+| C23, C++23 | :none:`unclaimed` | | |
+-------------------------------------------------------------+---------------------------+---------------------------+--------------------------------------------------------------------------+
-| Fortran 2023 | :none:`unclaimed` | :none:`unclaimed` | |
+| Fortran 2023 | | :none:`unclaimed` | |
+-------------------------------------------------------------+---------------------------+---------------------------+--------------------------------------------------------------------------+
| decl attribute for declarative directives | :none:`unclaimed` | :none:`unclaimed` | |
+-------------------------------------------------------------+---------------------------+---------------------------+--------------------------------------------------------------------------+
-| C attribute syntax | :none:`unclaimed` | :none:`unclaimed` | |
+| C attribute syntax | :none:`unclaimed` | | |
+-------------------------------------------------------------+---------------------------+---------------------------+--------------------------------------------------------------------------+
-| pure directives in DO CONCURRENT | :none:`unclaimed` | :none:`unclaimed` | |
+| pure directives in DO CONCURRENT | | :none:`unclaimed` | |
+-------------------------------------------------------------+---------------------------+---------------------------+--------------------------------------------------------------------------+
| Optional argument for all clauses | :none:`unclaimed` | :none:`unclaimed` | |
+-------------------------------------------------------------+---------------------------+---------------------------+--------------------------------------------------------------------------+
@@ -405,7 +414,7 @@ implementation. | Extensions to depobj construct | :none:`unclaimed` | :none:`unclaimed` | |
+-------------------------------------------------------------+---------------------------+---------------------------+--------------------------------------------------------------------------+
| Extensions to atomic construct | :none:`unclaimed` | :none:`unclaimed` | |
-+-------------------------------------------------------------+---------------------------+---------------------------+--------------------------------------------------------------------------+
++-------------------------------------------------------------+---------------------------+---------------------------+--------------------------------------------------------------------------+
| Private reductions | :good:`mostly` | :none:`unclaimed` | Parse/Sema:https://github.com/llvm/llvm-project/pull/129938 |
| | | | Codegen: https://github.com/llvm/llvm-project/pull/134709 |
+-------------------------------------------------------------+---------------------------+---------------------------+--------------------------------------------------------------------------+
@@ -423,7 +432,7 @@ implementation. +-------------------------------------------------------------+---------------------------+---------------------------+--------------------------------------------------------------------------+
| atomics constructs on concurrent loop regions | :good:`done` | :none:`unclaimed` | https://github.com/llvm/llvm-project/pull/125621 |
+-------------------------------------------------------------+---------------------------+---------------------------+--------------------------------------------------------------------------+
-| Loop construct with DO CONCURRENT | :none:`unclaimed` | :part:`In Progress` | |
+| Loop construct with DO CONCURRENT | | :part:`In Progress` | |
+-------------------------------------------------------------+---------------------------+---------------------------+--------------------------------------------------------------------------+
| device_type clause for target construct | :none:`unclaimed` | :none:`unclaimed` | |
+-------------------------------------------------------------+---------------------------+---------------------------+--------------------------------------------------------------------------+
@@ -443,9 +452,10 @@ implementation. +-------------------------------------------------------------+---------------------------+---------------------------+--------------------------------------------------------------------------+
| Traits for default device envirable | :none:`unclaimed` | :none:`unclaimed` | |
+-------------------------------------------------------------+---------------------------+---------------------------+--------------------------------------------------------------------------+
-| Optionally omit array length expression | :good:`done` | :none:`unclaimed` | https://github.com/llvm/llvm-project/pull/148048 |
+| Optionally omit array length expression | :good:`done` | :none:`unclaimed` | (Parse) https://github.com/llvm/llvm-project/pull/148048, |
+| | | | (Sema) https://github.com/llvm/llvm-project/pull/152786 |
+-------------------------------------------------------------+---------------------------+---------------------------+--------------------------------------------------------------------------+
-| Canonical loop sequences | :none:`unclaimed` | :part:`In Progress` | |
+| Canonical loop sequences | :part:`in progress` | :part:`in progress` | Clang: https://github.com/llvm/llvm-project/pull/139293 |
+-------------------------------------------------------------+---------------------------+---------------------------+--------------------------------------------------------------------------+
| Clarifications to Fortran map semantics | :none:`unclaimed` | :none:`unclaimed` | |
+-------------------------------------------------------------+---------------------------+---------------------------+--------------------------------------------------------------------------+
@@ -476,13 +486,42 @@ implementation. +-------------------------------------------------------------+---------------------------+---------------------------+--------------------------------------------------------------------------+
| Local clause on declare target | :part:`In Progress` | :none:`unclaimed` | |
+-------------------------------------------------------------+---------------------------+---------------------------+--------------------------------------------------------------------------+
-| groupprivate directive | :part:`In Progress` | :part:`In Progress` | Flang: kparzysz, mjklemm |
+| groupprivate directive | :part:`In Progress` | :part:`partial` | Flang: kparzysz, mjklemm |
+| | | | |
+| | | | Flang parser: https://github.com/llvm/llvm-project/pull/153807 |
+| | | | Flang sema: https://github.com/llvm/llvm-project/pull/154779 |
+-------------------------------------------------------------+---------------------------+---------------------------+--------------------------------------------------------------------------+
| variable-category on default clause | :part:`In Progress` | :none:`unclaimed` | |
+-------------------------------------------------------------+---------------------------+---------------------------+--------------------------------------------------------------------------+
| Changes to omp_target_is_accessible | :part:`In Progress` | :part:`In Progress` | |
+-------------------------------------------------------------+---------------------------+---------------------------+--------------------------------------------------------------------------+
+
+.. _OpenMP 6.1 implementation details:
+
+OpenMP 6.1 Implementation Details (Experimental)
+================================================
+
+The following table provides a quick overview over various OpenMP 6.1 features
+and their implementation status. Since OpenMP 6.1 has not yet been released, the
+following features are experimental and are subject to change at any time.
+Please post on the `Discourse forums (Runtimes - OpenMP category)`_ for more
+information or if you want to help with the
+implementation.
+
++-------------------------------------------------------------+---------------------------+---------------------------+--------------------------------------------------------------------------+
+|Feature | C/C++ Status | Fortran Status | Reviews |
++=============================================================+===========================+===========================+==========================================================================+
+| dyn_groupprivate clause | :part:`In Progress` | :part:`In Progress` | C/C++: kevinsala (https://github.com/llvm/llvm-project/pull/152651 |
+| | | | https://github.com/llvm/llvm-project/pull/152830 |
+| | | | https://github.com/llvm/llvm-project/pull/152831) |
++-------------------------------------------------------------+---------------------------+---------------------------+--------------------------------------------------------------------------+
+| loop flatten transformation | :none:`unclaimed` | :none:`unclaimed` | |
++-------------------------------------------------------------+---------------------------+---------------------------+--------------------------------------------------------------------------+
+| loop grid/tile modifiers for sizes clause | :none:`unclaimed` | :none:`unclaimed` | |
++-------------------------------------------------------------+---------------------------+---------------------------+--------------------------------------------------------------------------+
+
+
OpenMP Extensions
=================
diff --git a/clang/docs/ReleaseNotes.rst b/clang/docs/ReleaseNotes.rst index 99d51f35a483..c0e3fafc379c 100644 --- a/clang/docs/ReleaseNotes.rst +++ b/clang/docs/ReleaseNotes.rst @@ -84,6 +84,9 @@ C++ Specific Potentially Breaking Changes static_assert((b.*mp)() == 1); // newly rejected static_assert((c.*mp)() == 1); // accepted +- ``VarTemplateSpecializationDecl::getTemplateArgsAsWritten()`` method now + returns ``nullptr`` for implicitly instantiated declarations. + ABI Changes in This Version --------------------------- @@ -109,6 +112,11 @@ What's New in Clang |release|? C++ Language Changes -------------------- +- A new family of builtins ``__builtin_*_synthesises_from_spaceship`` has been added. These can be queried to know + whether the ``<`` (``lt``), ``>`` (``gt``), ``<=`` (``le``), or ``>=`` (``ge``) operators are synthesised from a + ``<=>``. This makes it possible to optimize certain facilities by using the ``<=>`` operation directly instead of + doing multiple comparisons. + C++2c Feature Support ^^^^^^^^^^^^^^^^^^^^^ @@ -129,6 +137,7 @@ C Language Changes C2y Feature Support ^^^^^^^^^^^^^^^^^^^ +- Clang now supports `N3355 <https://www.open-std.org/jtc1/sc22/wg14/www/docs/n3355.htm>`_ Named Loops. C23 Feature Support ^^^^^^^^^^^^^^^^^^^ @@ -141,14 +150,27 @@ Non-comprehensive list of changes in this release - Added ``__builtin_elementwise_minnumnum`` and ``__builtin_elementwise_maxnumnum``. -- Trapping UBSan (e.g. ``-fsanitize-trap=undefined``) now emits a string describing the reason for - trapping into the generated debug info. This feature allows debuggers (e.g. LLDB) to display - the reason for trapping if the trap is reached. The string is currently encoded in the debug - info as an artificial frame that claims to be inlined at the trap location. The function used - for the artificial frame is an artificial function whose name encodes the reason for trapping. - The encoding used is currently the same as ``__builtin_verbose_trap`` but might change in the future. - This feature is enabled by default but can be disabled by compiling with - ``-fno-sanitize-annotate-debug-info-traps``. +- Trapping UBSan (e.g. ``-fsanitize=undefined -fsanitize-trap=undefined``) now + emits a string describing the reason for trapping into the generated debug + info. This feature allows debuggers (e.g. LLDB) to display the reason for + trapping if the trap is reached. The string is currently encoded in the debug + info as an artificial frame that claims to be inlined at the trap location. + The function used for the artificial frame is an artificial function whose + name encodes the reason for trapping. The encoding used is currently the same + as ``__builtin_verbose_trap`` but might change in the future. This feature is + enabled by default but can be disabled by compiling with + ``-fno-sanitize-debug-trap-reasons``. The feature has a ``basic`` and + ``detailed`` mode (the default). The ``basic`` mode emits a hard-coded string + per trap kind (e.g. ``Integer addition overflowed``) and the ``detailed`` mode + emits a more descriptive string describing each individual trap (e.g. ``signed + integer addition overflow in 'a + b'``). The ``detailed`` mode produces larger + debug info than ``basic`` but is more helpful for debugging. The + ``-fsanitize-debug-trap-reasons=`` flag can be used to switch between the + different modes or disable the feature entirely. Note due to trap merging in + optimized builds (i.e. in each function all traps of the same kind get merged + into the same trap instruction) the trap reasons might be removed. To prevent + this build without optimizations (i.e. use `-O0` or use the `optnone` function + attribute) or use the `fno-sanitize-merge=` flag in optimized builds. - ``__builtin_elementwise_max`` and ``__builtin_elementwise_min`` functions for integer types can now be used in constant expressions. @@ -156,8 +178,13 @@ Non-comprehensive list of changes in this release - A vector of booleans is now a valid condition for the ternary ``?:`` operator. This binds to a simple vector select operation. -- Added ``__builtin_masked_load`` and ``__builtin_masked_store`` for conditional - memory loads from vectors. Binds to the LLVM intrinsic of the same name. +- Added ``__builtin_masked_load``, ``__builtin_masked_expand_load``, + ``__builtin_masked_store``, ``__builtin_masked_compress_store`` for + conditional memory loads from vectors. Binds to the LLVM intrinsics of the + same name. + +- The ``__builtin_popcountg``, ``__builtin_ctzg``, and ``__builtin_clzg`` + functions now accept fixed-size boolean vectors. - Use of ``__has_feature`` to detect the ``ptrauth_qualifier`` and ``ptrauth_intrinsics`` features has been deprecated, and is restricted to the arm64e target only. The @@ -179,10 +206,13 @@ Non-comprehensive list of changes in this release Currently, the use of ``__builtin_dedup_pack`` is limited to template arguments and base specifiers, it also must be used within a template context. +- ``__builtin_assume_dereferenceable`` now accepts non-constant size operands. New Compiler Flags ------------------ -- New option ``-fno-sanitize-annotate-debug-info-traps`` added to disable emitting trap reasons into the debug info when compiling with trapping UBSan (e.g. ``-fsanitize-trap=undefined``). +- New option ``-fno-sanitize-debug-trap-reasons`` added to disable emitting trap reasons into the debug info when compiling with trapping UBSan (e.g. ``-fsanitize-trap=undefined``). +- New option ``-fsanitize-debug-trap-reasons=`` added to control emitting trap reasons into the debug info when compiling with trapping UBSan (e.g. ``-fsanitize-trap=undefined``). + Lanai Support ^^^^^^^^^^^^^^ @@ -193,6 +223,7 @@ Deprecated Compiler Flags Modified Compiler Flags ----------------------- +- The `-gkey-instructions` compiler flag is now enabled by default when DWARF is emitted for plain C/C++ and optimizations are enabled. (#GH149509) Removed Compiler Flags ------------------------- @@ -221,11 +252,13 @@ Improvements to Clang's diagnostics "format specifies type 'unsigned int' but the argument has type 'int', which differs in signedness [-Wformat-signedness]" "signedness of format specifier 'u' is incompatible with 'c' [-Wformat-signedness]" and the API-visible diagnostic id will be appropriate. - + - Fixed false positives in ``-Waddress-of-packed-member`` diagnostics when potential misaligned members get processed before they can get discarded. (#GH144729) +- Clang now emits dignostic with correct message in case of assigning to const reference captured in lambda. (#GH105647) + - Fixed false positive in ``-Wmissing-noreturn`` diagnostic when it was requiring the usage of ``[[noreturn]]`` on lambdas before C++23 (#GH154493). @@ -239,6 +272,14 @@ Improvements to Clang's diagnostics specializations in th same way as it already did for other declarators. (#GH147333) +- A new warning ``-Walloc-size`` has been added to detect calls to functions + decorated with the ``alloc_size`` attribute don't allocate enough space for + the target pointer type. + +- The :doc:`ThreadSafetyAnalysis` attributes ``ACQUIRED_BEFORE(...)`` and + ``ACQUIRED_AFTER(...)`` have been moved to the stable feature set and no + longer require ``-Wthread-safety-beta`` to be used. + Improvements to Clang's time-trace ---------------------------------- @@ -249,14 +290,24 @@ Bug Fixes in This Version ------------------------- - Fix a crash when marco name is empty in ``#pragma push_macro("")`` or ``#pragma pop_macro("")``. (#GH149762). -- `-Wunreachable-code`` now diagnoses tautological or contradictory +- Fix a crash in variable length array (e.g. ``int a[*]``) function parameter type + being used in ``_Countof`` expression. (#GH152826). +- ``-Wunreachable-code`` now diagnoses tautological or contradictory comparisons such as ``x != 0 || x != 1.0`` and ``x == 0 && x == 1.0`` on targets that treat ``_Float16``/``__fp16`` as native scalar types. Previously the warning was silently lost because the operands differed only by an implicit cast chain. (#GH149967). +- Fix crash in ``__builtin_function_start`` by checking for invalid + first parameter. (#GH113323). - Fixed a crash with incompatible pointer to integer conversions in designated initializers involving string literals. (#GH154046) +- Clang now emits a frontend error when a function marked with the `flatten` attribute + calls another function that requires target features not enabled in the caller. This + prevents a fatal error in the backend. - Fixed scope of typedefs present inside a template class. (#GH91451) +- Builtin elementwise operators now accept vector arguments that have different + qualifiers on their elements. For example, vector of 4 ``const float`` values + and vector of 4 ``float`` values. (#GH155405) Bug Fixes to Compiler Builtins ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ @@ -273,6 +324,7 @@ Bug Fixes to Attribute Support is skipped, such as error recovery and code completion. (#GH153551) - Using ``[[gnu::cleanup(some_func)]]`` where some_func is annotated with ``[[gnu::error("some error")]]`` now correctly triggers an error. (#GH146520) +- Fix a crash when the function name is empty in the `swift_name` attribute. (#GH157075) Bug Fixes to C++ Support ^^^^^^^^^^^^^^^^^^^^^^^^ @@ -291,6 +343,18 @@ Bug Fixes to C++ Support - Fix the parsing of variadic member functions when the ellipis immediately follows a default argument.(#GH153445) - Fixed a bug that caused ``this`` captured by value in a lambda with a dependent explicit object parameter to not be instantiated properly. (#GH154054) +- Fixed a bug where our ``member-like constrained friend`` checking caused an incorrect analysis of lambda captures. (#GH156225) +- Fixed a crash when implicit conversions from initialize list to arrays of + unknown bound during constant evaluation. (#GH151716) +- Support the dynamic_cast to final class optimization with pointer + authentication enabled. (#GH152601) +- Fix the check for narrowing int-to-float conversions, so that they are detected in + cases where converting the float back to an integer is undefined behaviour (#GH157067). +- Fix a crash when applying binary or ternary operators to two same function types with different spellings, + where at least one of the function parameters has an attribute which affects + the function type. +- Fix an assertion failure when a ``constexpr`` variable is only referenced through + ``__builtin_addressof``, and related issues with builtin arguments. (#GH154034) Bug Fixes to AST Handling ^^^^^^^^^^^^^^^^^^^^^^^^^ @@ -324,9 +388,13 @@ X86 Support arithmetic can now be used in C++ constant expressions. - Some SSE, AVX and AVX512 intrinsics have been converted to wrap generic __builtin intrinsics. -- NOTE: Please avoid use of the __builtin_ia32_* intrinsics - these are not +- NOTE: Please avoid use of the __builtin_ia32_* intrinsics - these are not guaranteed to exist in future releases, or match behaviour with previous releases of clang or other compilers. +- Remove `m[no-]avx10.x-[256,512]` and `m[no-]evex512` options from Clang + driver. +- Remove `[no-]evex512` feature request from intrinsics and builtins. +- Change features `avx10.x-[256,512]` to `avx10.x`. Arm and AArch64 Support ^^^^^^^^^^^^^^^^^^^^^^^ @@ -339,6 +407,7 @@ Windows Support LoongArch Support ^^^^^^^^^^^^^^^^^ +- Enable linker relaxation by default for loongarch64. RISC-V Support ^^^^^^^^^^^^^^ @@ -436,6 +505,7 @@ OpenMP Support modifier in the ``adjust_args`` clause. - Allow array length to be omitted in array section subscript expression. - Fixed non-contiguous strided update in the ``omp target update`` directive with the ``from`` clause. +- Properly handle array section/assumed-size array privatization in C/C++. Improvements ^^^^^^^^^^^^ diff --git a/clang/docs/SanitizerSpecialCaseList.rst b/clang/docs/SanitizerSpecialCaseList.rst index 194f2fc5a782..307c001664fb 100644 --- a/clang/docs/SanitizerSpecialCaseList.rst +++ b/clang/docs/SanitizerSpecialCaseList.rst @@ -128,7 +128,7 @@ precedence. Here are a few examples. type:T $ cat ignorelist4.txt - # Function `bad_bar`` will be instrumented. + # Function `bad_bar` will be instrumented. # Function `good_bar` will not be instrumented. fun:* fun:*bar diff --git a/clang/docs/UsersManual.rst b/clang/docs/UsersManual.rst index 0e85c8109fd5..a8bbf146431e 100644 --- a/clang/docs/UsersManual.rst +++ b/clang/docs/UsersManual.rst @@ -4581,59 +4581,14 @@ implicitly included in later levels. - ``-march=x86-64-v3``: (close to Haswell) AVX, AVX2, BMI1, BMI2, F16C, FMA, LZCNT, MOVBE, XSAVE - ``-march=x86-64-v4``: AVX512F, AVX512BW, AVX512CD, AVX512DQ, AVX512VL -`Intel AVX10 ISA <https://cdrdv2.intel.com/v1/dl/getContent/784267>`_ is +`Intel AVX10 ISA <https://cdrdv2.intel.com/v1/dl/getContent/784343>`_ is a major new vector ISA incorporating the modern vectorization aspects of Intel AVX-512. This ISA will be supported on all future Intel processors. -Users are supposed to use the new options ``-mavx10.N`` and ``-mavx10.N-512`` -on these processors and should not use traditional AVX512 options anymore. - -The ``N`` in ``-mavx10.N`` represents a continuous integer number starting -from ``1``. ``-mavx10.N`` is an alias of ``-mavx10.N-256``, which means to -enable all instructions within AVX10 version N at a maximum vector length of -256 bits. ``-mavx10.N-512`` enables all instructions at a maximum vector -length of 512 bits, which is a superset of instructions ``-mavx10.N`` enabled. - -Current binaries built with AVX512 features can run on Intel AVX10/512 capable -processors without re-compile, but cannot run on AVX10/256 capable processors. -Users need to re-compile their code with ``-mavx10.N``, and maybe update some -code that calling to 512-bit X86 specific intrinsics and passing or returning -512-bit vector types in function call, if they want to run on AVX10/256 capable -processors. Binaries built with ``-mavx10.N`` can run on both AVX10/256 and -AVX10/512 capable processors. - -Users can add a ``-mno-evex512`` in the command line with AVX512 options if -they want to run the binary on both legacy AVX512 and new AVX10/256 capable -processors. The option has the same constraints as ``-mavx10.N``, i.e., -cannot call to 512-bit X86 specific intrinsics and pass or return 512-bit vector -types in function call. - -Users should avoid using AVX512 features in function target attributes when -developing code for AVX10. If they have to do so, they need to add an explicit -``evex512`` or ``no-evex512`` together with AVX512 features for 512-bit or -non-512-bit functions respectively to avoid unexpected code generation. Both -command line option and target attribute of EVEX512 feature can only be used -with AVX512. They don't affect vector size of AVX10. - -User should not mix the use AVX10 and AVX512 options together at any time, -because the option combinations are conflicting sometimes. For example, a -combination of ``-mavx512f -mavx10.1-256`` doesn't show a clear intention to -compiler, since instructions in AVX512F and AVX10.1/256 intersect but do not -overlap. In this case, compiler will emit warning for it, but the behavior -is determined. It will generate the same code as option ``-mavx10.1-512``. -A similar case is ``-mavx512f -mavx10.2-256``, which equals to -``-mavx10.1-512 -mavx10.2-256``, because ``avx10.2-256`` implies ``avx10.1-256`` -and ``-mavx512f -mavx10.1-256`` equals to ``-mavx10.1-512``. - -There are some new macros introduced with AVX10 support. ``-mavx10.1-256`` will -enable ``__AVX10_1__`` and ``__EVEX256__``, while ``-mavx10.1-512`` enables -``__AVX10_1__``, ``__EVEX256__``, ``__EVEX512__`` and ``__AVX10_1_512__``. -Besides, both ``-mavx10.1-256`` and ``-mavx10.1-512`` will enable all AVX512 -feature specific macros. A AVX512 feature will enable both ``__EVEX256__``, -``__EVEX512__`` and its own macro. So ``__EVEX512__`` can be used to guard code -that can run on both legacy AVX512 and AVX10/512 capable processors but cannot -run on AVX10/256, while a AVX512 macro like ``__AVX512F__`` cannot tell the -difference among the three options. Users need to check additional macros -``__AVX10_1__`` and ``__EVEX512__`` if they want to make distinction. +Users are supposed to use the new options ``-mavx10.N`` on these processors +and should not use traditional AVX512 options anymore. The ``N`` in +``-mavx10.N`` represents a continuous integer number starting +from ``1``. Current binaries built with AVX512 features can run on Intel AVX10 +capable processors without re-compile. ARM ^^^ diff --git a/clang/docs/analyzer/checkers.rst b/clang/docs/analyzer/checkers.rst index b2effadacf9f..15d7557ae6af 100644 --- a/clang/docs/analyzer/checkers.rst +++ b/clang/docs/analyzer/checkers.rst @@ -1859,6 +1859,27 @@ this) and always check the return value of these calls. This check corresponds to SEI CERT Rule `POS36-C <https://wiki.sei.cmu.edu/confluence/display/c/POS36-C.+Observe+correct+revocation+order+while+relinquishing+privileges>`_. +.. _security-VAList: + +security.VAList (C, C++) +"""""""""""""""""""""""" +Reports use of uninitialized (or already released) ``va_list`` objects and +situations where a ``va_start`` call is not followed by ``va_end``. + +.. code-block:: c + + int test_use_after_release(int x, ...) { + va_list va; + va_start(va, x); + va_end(va); + return va_arg(va, int); // warn: va is uninitialized + } + + void test_leak(int x, ...) { + va_list va; + va_start(va, x); + } // warn: va is leaked + .. _unix-checkers: unix @@ -2932,18 +2953,6 @@ the locking/unlocking of ``mtx_t`` mutexes. mtx_lock(&mtx1); // warn: This lock has already been acquired } -.. _alpha-core-CastSize: - -alpha.core.CastSize (C) -""""""""""""""""""""""" -Check when casting a malloc'ed type ``T``, whether the size is a multiple of the size of ``T``. - -.. code-block:: c - - void test() { - int *x = (int *) malloc(11); // warn - } - .. _alpha-core-CastToStruct: alpha.core.CastToStruct (C, C++) diff --git a/clang/docs/index.rst b/clang/docs/index.rst index 542bfc94cd57..be654af57f89 100644 --- a/clang/docs/index.rst +++ b/clang/docs/index.rst @@ -45,6 +45,7 @@ Using Clang as a Compiler BoundsSafetyImplPlans ControlFlowIntegrity LTOVisibility + PointerAuthentication SafeStack ShadowCallStack SourceBasedCodeCoverage |
