[clang-tidy] Add `bugprone-missing-end-comparison` check (#182543)
This PR introduces a new check `bugprone-missing-end-comparison`.
It detects instances where the result of a standard algorithm is used
directly in a boolean context without being compared against the
corresponding end iterator.
Currently the check can't handle algorithms returning `std::pair` and
`std::ranges::mismatch_result`, but it should be a good enough starting
point for future improvements.
As of AI-Usage: Assisted by Gemini CLI (for pre-commit reviewing,
documentation and some code refactor/cleanup)
Closes https://github.com/llvm/llvm-project/issues/178731
---------
Co-authored-by: EugeneZelenko <eugene.zelenko at gmail.com>
[RISCV] Disable Zilsd CSR-pair generation when push/pop or save-restore is enabled (#200623)
We were generating duplicate/worse code due to the generation of the
`Zilsd` load/store doubles for handling `CSR's` when `Zcmp/Xqccmp` or
`Save/Restore Libcalls` were enabled.
[clang] implement CWG2064: ignore value dependence for decltype
The 'decltype' for a value-dependent (but non-type-dependent) should be known,
so this patch makes them non-opaque instead.
This patch also implements what's neceessary to allow overloading
on pure differences in instantiation dependence, making `std::void_t`
usable for SFINAE purposes.
This also readds a few test cases from da98651, which was a previous attempt
at resolving CWG2064.
Fixes #8740
Fixes #61818
Fixes #190388
[clang-tidy] Fix false positive in bugprone-use-after-move for std::tie (#192895)
std::tie(a, b) = expr reinitializes all variables passed to std::tie
because the tuple assignment operator writes back through the stored
references. The check was not recognizing this pattern, causing a false
positive on the second std::tie assignment in loops like:
std::tie(a, b) = foo(std::move(a), std::move(b));
std::tie(a, b) = foo(std::move(a), std::move(b)); // false positive
Add std::tie assignment as a reinitialization case in
makeReinitMatcher().
Fixes #136105.
---
**AI Disclosure:** Claude (Anthropic) was used to assist in diagnosing
the CI test failure and identifying the off-by-one line number in the
[5 lines not shown]
[clang][clang-tools-extra] Remove unused DenseMapInfo::getTombstoneKey (#200634)
#200595 changed DenseMap to no longer create tombstone buckets, so
DenseMapInfo<T>::getTombstoneKey() is never called. Remove dead
definitions and dead tombstone branches.
[clang] fix getTemplateInstantiationArgs (#199528)
This implements a new strategy for collecting the template arguments, by
relying on the qualifiers and template parameter lists to navigate the
template context of out-of-line definitions.
This greatly simplifies the signature of that function, by removing a
bunch of workarounds, and simpliffying a couple that weren't removed
yet.
Since this now relies on qualifiers and template parameter lists, this
patch expends most of its effort making sure these are placed,
transformed and propagated to template instantiations.
Also makes the explicit specialization AST nodes stop abusing the
template parameter lists by storing it's own template parameter list,
creating a dedicated field for them, similar to partial specializations.
Fixes #101330
[Instrumentor] Improve the config wizard script (#199108)
This makes the config wizard script more generic as we grow
instrumentation opportunities. Better output, e.g., clear paths, are
also displayed now.
Prepared with Claude (AI) and tested by me afterwards.
18127 Improve test-runner interrupt handling
Reviewed by: Toomas Soome <tsoome at me.com>
Reviewed by: Bill Sommerfeld <sommerfeld at hamachi.org>
Approved by: Robert Mustacchi <rm+illumos at fingolfin.org>
[DirectX] Disable DCE and DSE for -O0 (#192520)
These are optimisation passes which are inappropriate to run when the
user has requested no optimisations, and which make it more difficult to
write tests.
Co-authored-by: Andrew Savonichev <andrew.savonichev at gmail.com>