Repository navigation
Use clang-22 - #108400
Use clang-22#108400
clang-22#108400Conversation
|
Workflow [PR], commit [39a2c49] Summary: ❌
AI ReviewSummaryThis PR switches CI and the bundled toolchain/docs from Findings
Final Verdict
LLVM Coverage Report
Changed lines: Changed C/C++ lines covered: 15/15 (100.00%) · Uncovered code |
This comment was marked as low quality.
This comment was marked as low quality.
Replace .find(needle) != npos / .find(needle) == npos patterns with .contains(needle) / !.contains(needle) across 37 source and test files. This resolves the remaining readability-container-contains clang-tidy warnings from the clang-22 migration (PR #108400). Files touched: programs/server, src/Analyzer, src/Backups/tests, src/Client, src/Common, src/Databases, src/Disks, src/Functions, src/IO/tests, src/Interpreters, src/Parsers/Kusto, src/Processors, src/Server, src/Storages (Kafka, MergeTree, ObjectStorage, MongoDB, URL) Assisted-by: Claude Opus 4.6 via GitHub Copilot Signed-off-by: Konstantin Bogdanov <[email protected]>
Algunenano
left a comment
There was a problem hiding this comment.
LGTM. We should update docs/en too if possible, but we can do it in another PR (or in this one if you need to push other changes as well)
The Clang install snippet still called `llvm.sh 21` right above an example using `CC=clang-22`/`CXX=clang++-22`, left over from the toolchain's move to LLVM 22 in `ci/jobs/build_toolchain.py`. Co-Authored-By: Claude Sonnet 5 <[email protected]>
| ===3=== | ||
| {"operation_name":"auto DB::DistributedSink::runWritingJob(JobReplica &, const Block &, size_t)::(anonymous class)::operator()() const","cluster":"test_cluster_two_shards_localhost","shard":"1","rows":"1","bytes":"8"} | ||
| {"operation_name":"auto DB::DistributedSink::runWritingJob(JobReplica &, const Block &, size_t)::(anonymous class)::operator()() const","cluster":"test_cluster_two_shards_localhost","shard":"2","rows":"1","bytes":"8"} | ||
| {"operation_name":"auto DB::DistributedSink::runWritingJob(JobReplica &, const Block &, size_t)::(lambda)::operator()() const","cluster":"test_cluster_two_shards_localhost","shard":"1","rows":"1","bytes":"8"} |
There was a problem hiding this comment.
This reference is still asserting the compiler-specific __PRETTY_FUNCTION__ spelling of the lambda in DistributedSink::runWritingJob (src/Storages/Distributed/DistributedSink.cpp:377). The only reason these lines changed from (anonymous class) to (lambda) is the clang-21 -> clang-22 pretty-printer difference, so the next toolchain or demangler change will churn this reference again without any tracing regression.
Can we normalize the lambda portion in the query output, or assert a stable span property instead of the exact operation_name text?
| const size_t unrolled_end = count / unroll_count * unroll_count; | ||
|
|
||
| /// Keep this outer loop scalar: `clang-22` otherwise vectorizes it into a slow strided gather instead of letting the unrolled inner loop SLP-vectorize into contiguous loads (worst for `Linf`/`BFloat16`). | ||
| _Pragma("clang loop vectorize(disable)") |
There was a problem hiding this comment.
This loop-shape fix is still incomplete for the global clang-22 switch. src/Functions/array/arrayDotProduct.cpp uses the same outer-i += unroll_count / inner-s pattern in both dotProductBatchImpl (:48-52) and dotProductConstBatchImpl (:87-90), so arrayDotProduct is still exposed to the same slow strided-gather codegen even after array*Norm / array*Distance are patched here.
Please either apply the same _Pragma("clang loop vectorize(disable)") there or add a focused benchmark showing the dot-product kernels are unaffected.
| # Auto-detect available LLVM profdata tool | ||
| llvm_profdata = None | ||
| for ver in ["21", "20", "18", "19", "17", "16", ""]: | ||
| for ver in ["22", "21", "20", "18", "19", "17", "16", ""]: |
There was a problem hiding this comment.
This fallback is still out of order: it probes llvm-profdata-18 before llvm-profdata-19, and ci/jobs/integration_test_job.py:1005 has the same list. If an image carries LLVM 18 and 19 but not 20+ during a future toolchain transition, these coverage jobs will pick the older tool and recreate the same cross-major mismatch this PR is trying to remove. Please make both lists strictly descending (22, 21, 20, 19, 18, 17, 16, "") to match unit_tests_job.py and merge_llvm_coverage.sh.
Build (arm_tidy) is red on master: src/Databases/DatabaseRemote.cpp:1058:26: error: use 'contains' to check for membership [readability-container-contains,-warnings-as-errors] clang-tidy runs as warnings-as-errors there, so the single diagnostic aborts the build and every PR that merges master inherits the red. The line is not an authoring mistake. readability-container-contains under clang-tidy-21 flags the find(...) != end() container form but not std::string::find(char) != npos; clang-tidy-22 flags both. The compiler bump landed in #108400 at 2026-08-10 17:33 UTC and the branch carrying this line merged at ~00:15 UTC, so the TU entered master's tidy build already diagnosed by a checker that had not diagnosed it during the branch's own 12 green runs. String is std::string and the project builds at C++23, so contains is available and exactly equivalent. Verified by asserting (s.find(':') != npos) == s.contains(':'), and the full guard including !starts_with('['), over 13 inputs covering empty, ":", "::", leading and trailing ':', bare and bracketed IPv6, non-IPv6 hosts and an embedded NUL. No behaviour change. The last green master commit already contained the clang-22 bump, so any other new violation of this check must lie in the green-to-red range. Sweeping that range's added lines for all three forms the check recognises yields exactly this one line. Related: #110975
Changelog category (leave one):
Changelog entry (a user-readable short description of the changes that goes into CHANGELOG.md):
Use
clang-22in CI.