https://github.com/vbvictor updated https://github.com/llvm/llvm-project/pull/160193
>From e78a08ba18618ad8b1bc4e0a7203fc311d8fb75e Mon Sep 17 00:00:00 2001 From: Baranov Victor <[email protected]> Date: Mon, 22 Sep 2025 23:22:19 +0300 Subject: [PATCH 1/7] WIP --- .github/workflows/pr-code-lint.yml | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/.github/workflows/pr-code-lint.yml b/.github/workflows/pr-code-lint.yml index bc70933147bd2..3efd75471a317 100644 --- a/.github/workflows/pr-code-lint.yml +++ b/.github/workflows/pr-code-lint.yml @@ -47,10 +47,13 @@ jobs: echo "Changed files:" echo "$CHANGED_FILES" + # The clang tidy version should always be upgraded to the first version + # of a release cycle (x.1.0) or the last version of a release cycle, or + # if there have been relevant clang-format backports. - name: Install clang-tidy uses: aminya/setup-cpp@17c11551771948abc5752bbf3183482567c7caf0 # v1.1.1 with: - clang-tidy: 20.1.8 + clang-tidy: 21.1.0 - name: Setup Python env uses: actions/setup-python@42375524e23c412d93fb67b49958b491fce71c38 # v5.4.0 >From d7afc695fd4bd983f4e693dde6b58e567d7e025d Mon Sep 17 00:00:00 2001 From: Victor Baranov <[email protected]> Date: Tue, 23 Sep 2025 23:44:28 +0300 Subject: [PATCH 2/7] add ccache --- .github/workflows/pr-code-lint.yml | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/.github/workflows/pr-code-lint.yml b/.github/workflows/pr-code-lint.yml index 3efd75471a317..89ee6b116d2f4 100644 --- a/.github/workflows/pr-code-lint.yml +++ b/.github/workflows/pr-code-lint.yml @@ -62,6 +62,11 @@ jobs: - name: Install Python dependencies run: python3 -m pip install -r llvm/utils/git/requirements_linting.txt + + - name: Setup ccache + uses: hendrikmuhs/ccache-action@a1209f81afb8c005c13b4296c32e363431bffea5 # v1.2.17 + with: + max-size: "2000M" # TODO: create special mapping for 'codegen' targets, for now build predefined set # TODO: add entrypoint in 'compute_projects.py' that only adds a project and its direct dependencies >From 3e7982527f9766a9a1a362ce28ee7ad3bdd73ec1 Mon Sep 17 00:00:00 2001 From: Victor Baranov <[email protected]> Date: Tue, 23 Sep 2025 23:49:29 +0300 Subject: [PATCH 3/7] wip --- .github/workflows/pr-code-lint.yml | 2 -- 1 file changed, 2 deletions(-) diff --git a/.github/workflows/pr-code-lint.yml b/.github/workflows/pr-code-lint.yml index 89ee6b116d2f4..6ae9559772019 100644 --- a/.github/workflows/pr-code-lint.yml +++ b/.github/workflows/pr-code-lint.yml @@ -19,8 +19,6 @@ jobs: defaults: run: shell: bash - container: - image: 'ghcr.io/llvm/ci-ubuntu-24.04:latest' timeout-minutes: 60 concurrency: group: ${{ github.workflow }}-${{ github.ref }} >From 4212d1849971081abb8042ffb4837776a3b46c2c Mon Sep 17 00:00:00 2001 From: Victor Baranov <[email protected]> Date: Tue, 23 Sep 2025 23:54:03 +0300 Subject: [PATCH 4/7] broke style --- clang-tools-extra/clang-tidy/ClangTidy.cpp | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/clang-tools-extra/clang-tidy/ClangTidy.cpp b/clang-tools-extra/clang-tidy/ClangTidy.cpp index 7e18f3806a143..d81c4cd0e0a84 100644 --- a/clang-tools-extra/clang-tidy/ClangTidy.cpp +++ b/clang-tools-extra/clang-tidy/ClangTidy.cpp @@ -182,7 +182,7 @@ class ErrorReporter { } } } - reportFix(Diag, Error.Message.Fix); + ReportFix(Diag, Error.Message.Fix); } for (auto Fix : FixLocations) { Diags.Report(Fix.first, Fix.second ? diag::note_fixit_applied @@ -266,7 +266,7 @@ class ErrorReporter { return SourceMgr.getLocForStartOfFile(ID).getLocWithOffset(Offset); } - void reportFix(const DiagnosticBuilder &Diag, + void ReportFix(const DiagnosticBuilder &Diag, const llvm::StringMap<Replacements> &Fix) { for (const auto &FileAndReplacements : Fix) { for (const auto &Repl : FileAndReplacements.second) { @@ -290,7 +290,7 @@ class ErrorReporter { << Message.Message; for (const FileByteRange &FBR : Message.Ranges) Diag << getRange(FBR); - reportFix(Diag, Message.Fix); + ReportFix(Diag, Message.Fix); } CharSourceRange getRange(const FileByteRange &Range) { >From 16314c218bb50316ebc7596cd2d81c0378452310 Mon Sep 17 00:00:00 2001 From: Victor Baranov <[email protected]> Date: Wed, 24 Sep 2025 00:06:37 +0300 Subject: [PATCH 5/7] add sccache --- .github/workflows/pr-code-lint.yml | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/.github/workflows/pr-code-lint.yml b/.github/workflows/pr-code-lint.yml index 6ae9559772019..1cdf77c8185ff 100644 --- a/.github/workflows/pr-code-lint.yml +++ b/.github/workflows/pr-code-lint.yml @@ -64,7 +64,9 @@ jobs: - name: Setup ccache uses: hendrikmuhs/ccache-action@a1209f81afb8c005c13b4296c32e363431bffea5 # v1.2.17 with: - max-size: "2000M" + max-size: 2G + key: post-commit-analyzer + variant: sccache # TODO: create special mapping for 'codegen' targets, for now build predefined set # TODO: add entrypoint in 'compute_projects.py' that only adds a project and its direct dependencies >From a632ed48c94168fb6f1e15caf9b3eae7ba327e1d Mon Sep 17 00:00:00 2001 From: Victor Baranov <[email protected]> Date: Wed, 24 Sep 2025 00:12:13 +0300 Subject: [PATCH 6/7] fix cache key --- .github/workflows/pr-code-lint.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/pr-code-lint.yml b/.github/workflows/pr-code-lint.yml index 1cdf77c8185ff..caa2a134c521d 100644 --- a/.github/workflows/pr-code-lint.yml +++ b/.github/workflows/pr-code-lint.yml @@ -65,7 +65,7 @@ jobs: uses: hendrikmuhs/ccache-action@a1209f81afb8c005c13b4296c32e363431bffea5 # v1.2.17 with: max-size: 2G - key: post-commit-analyzer + key: premerge-clang-tidy variant: sccache # TODO: create special mapping for 'codegen' targets, for now build predefined set >From c5f8ae93c6d99f4dbb96837e08e7d08621572062 Mon Sep 17 00:00:00 2001 From: Victor Baranov <[email protected]> Date: Wed, 24 Sep 2025 19:01:49 +0300 Subject: [PATCH 7/7] WIP --- clang-tools-extra/clang-tidy/ClangTidy.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/clang-tools-extra/clang-tidy/ClangTidy.cpp b/clang-tools-extra/clang-tidy/ClangTidy.cpp index d81c4cd0e0a84..2bd8b3fead4a3 100644 --- a/clang-tools-extra/clang-tidy/ClangTidy.cpp +++ b/clang-tools-extra/clang-tidy/ClangTidy.cpp @@ -284,7 +284,7 @@ class ErrorReporter { } void reportNote(const tooling::DiagnosticMessage &Message) { - SourceLocation Loc = getLocation(Message.FilePath, Message.FileOffset); + auto Loc = getLocation(Message.FilePath, Message.FileOffset); auto Diag = Diags.Report(Loc, Diags.getCustomDiagID(DiagnosticsEngine::Note, "%0")) << Message.Message; _______________________________________________ cfe-commits mailing list [email protected] https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits
