Skip to content

Commit c1e7132

Browse files
authored
Merge branch 'main' into new-feature
2 parents b29aee7 + 401308f commit c1e7132

File tree

750 files changed

+28391
-19135
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

750 files changed

+28391
-19135
lines changed

.ci/metrics/metrics.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -40,6 +40,7 @@
4040
GITHUB_JOB_TO_TRACK = {
4141
"github_llvm_premerge_checks": {
4242
"Build and Test Linux": "premerge_linux",
43+
"Build and Test Linux AArch64": "premerge_linux_aarch64",
4344
"Build and Test Windows": "premerge_windows",
4445
},
4546
"github_libcxx_premerge_checks": {

.github/workflows/build-ci-container-tooling.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -72,7 +72,7 @@ jobs:
7272
- name: Test Container
7373
run: |
7474
# Use --pull=never to ensure we are testing the just built image.
75-
podman run --pull=never --rm -it ${{ steps.vars.outputs.container-name-format-tag }} /usr/bin/bash -x -c 'cd $HOME && clang-format --version | grep version && black --version | grep black'
75+
podman run --pull=never --rm -it ${{ steps.vars.outputs.container-name-format-tag }} /usr/bin/bash -x -c 'cd $HOME && clang-format --version | grep version && git-clang-format -h | grep usage && black --version | grep black'
7676
podman run --pull=never --rm -it ${{ steps.vars.outputs.container-name-lint-tag }} /usr/bin/bash -x -c 'cd $HOME && clang-tidy --version | grep version && clang-tidy-diff.py -h | grep usage'
7777
7878
push-ci-container:

.github/workflows/containers/github-action-ci-tooling/Dockerfile

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,8 @@ RUN apt-get update && \
1010
tar -xvJf llvm.tar.xz -C /llvm-extract \
1111
# Only unpack these tools to save space on Github runner.
1212
LLVM-${LLVM_VERSION}-Linux-X64/bin/clang-tidy \
13-
LLVM-${LLVM_VERSION}-Linux-X64/bin/clang-format && \
13+
LLVM-${LLVM_VERSION}-Linux-X64/bin/clang-format \
14+
LLVM-${LLVM_VERSION}-Linux-X64/bin/git-clang-format && \
1415
rm llvm.tar.xz
1516

1617

@@ -35,7 +36,9 @@ RUN apt-get update && \
3536
FROM base AS ci-container-code-format
3637
ARG LLVM_VERSION
3738

38-
COPY --from=llvm-downloader /llvm-extract/LLVM-${LLVM_VERSION}-Linux-X64/bin/clang-format ${LLVM_SYSROOT}/bin/clang-format
39+
COPY --from=llvm-downloader /llvm-extract/LLVM-${LLVM_VERSION}-Linux-X64/bin/clang-format \
40+
/llvm-extract/LLVM-${LLVM_VERSION}-Linux-X64/bin/git-clang-format \
41+
${LLVM_SYSROOT}/bin/
3942

4043
ENV PATH=${LLVM_SYSROOT}/bin:${PATH}
4144

.github/workflows/containers/github-action-ci/Dockerfile

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ FROM docker.io/library/ubuntu:24.04 AS base
22
ENV LLVM_SYSROOT=/opt/llvm
33

44
FROM base AS stage1-toolchain
5-
ENV LLVM_VERSION=21.1.1
5+
ENV LLVM_VERSION=21.1.3
66

77
RUN apt-get update && \
88
apt-get install -y \
@@ -62,7 +62,6 @@ RUN apt-get update && \
6262
# Having a symlink from python to python3 enables code sharing between
6363
# the Linux and Windows pipelines.
6464
python3-pip \
65-
python3-venv \
6665
file \
6766
tzdata \
6867
python-is-python3 && \

clang-tools-extra/clang-tidy/readability/ImplicitBoolConversionCheck.cpp

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -89,7 +89,8 @@ static void fixGenericExprCastToBool(DiagnosticBuilder &Diag,
8989

9090
const Expr *SubExpr = Cast->getSubExpr();
9191

92-
bool NeedInnerParens = utils::fixit::areParensNeededForStatement(*SubExpr);
92+
bool NeedInnerParens =
93+
utils::fixit::areParensNeededForStatement(*SubExpr->IgnoreImpCasts());
9394
bool NeedOuterParens =
9495
Parent != nullptr && utils::fixit::areParensNeededForStatement(*Parent);
9596

clang-tools-extra/clangd/ClangdLSPServer.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -81,7 +81,7 @@ CodeAction toCodeAction(const ClangdServer::CodeActionResult::Rename &R,
8181
const URIForFile &File) {
8282
CodeAction CA;
8383
CA.title = R.FixMessage;
84-
CA.kind = std::string(CodeAction::REFACTOR_KIND);
84+
CA.kind = std::string(CodeAction::QUICKFIX_KIND);
8585
CA.command.emplace();
8686
CA.command->title = R.FixMessage;
8787
CA.command->command = std::string(ApplyRenameCommand);

clang-tools-extra/clangd/FindTarget.cpp

Lines changed: 4 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1040,16 +1040,11 @@ class ExplicitReferenceCollector
10401040
if (auto *S = N.get<Stmt>())
10411041
return refInStmt(S, Resolver);
10421042
if (auto *NNSL = N.get<NestedNameSpecifierLoc>()) {
1043+
if (auto TL = NNSL->getAsTypeLoc())
1044+
return refInTypeLoc(NNSL->getAsTypeLoc(), Resolver);
10431045
// (!) 'DeclRelation::Alias' ensures we do not lose namespace aliases.
1044-
NestedNameSpecifierLoc Qualifier;
1045-
SourceLocation NameLoc;
1046-
if (auto TL = NNSL->getAsTypeLoc()) {
1047-
Qualifier = TL.getPrefix();
1048-
NameLoc = TL.getNonPrefixBeginLoc();
1049-
} else {
1050-
Qualifier = NNSL->getAsNamespaceAndPrefix().Prefix;
1051-
NameLoc = NNSL->getLocalBeginLoc();
1052-
}
1046+
NestedNameSpecifierLoc Qualifier = NNSL->getAsNamespaceAndPrefix().Prefix;
1047+
SourceLocation NameLoc = NNSL->getLocalBeginLoc();
10531048
return {
10541049
ReferenceLoc{Qualifier, NameLoc, false,
10551050
explicitReferenceTargets(

clang-tools-extra/clangd/unittests/ClangdLSPServerTests.cpp

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -235,7 +235,8 @@ TEST_F(LSPTest, ClangTidyRename) {
235235
.takeValue()
236236
.getAsArray())[0];
237237

238-
ASSERT_EQ((*RenameCommand.getAsObject())["title"], "change 'foo' to 'Foo'");
238+
ASSERT_EQ((*RenameCommand.getAsObject())["title"],
239+
"Apply fix: change 'foo' to 'Foo'");
239240

240241
Client.expectServerCall("workspace/applyEdit");
241242
Client.call("workspace/executeCommand", RenameCommand);

clang-tools-extra/docs/ReleaseNotes.rst

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -402,6 +402,11 @@ Changes in existing checks
402402
declarations and macros in system headers. The documentation is also improved
403403
to differentiate the general options from the specific ones.
404404

405+
- Improved :doc:`readability-implicit-bool-conversion
406+
<clang-tidy/checks/readability/implicit-bool-conversion>` check by correctly
407+
adding parentheses when the inner expression are implicitly converted
408+
multiple times.
409+
405410
- Improved :doc:`readability-qualified-auto
406411
<clang-tidy/checks/readability/qualified-auto>` check by adding the option
407412
`IgnoreAliasing`, that allows not looking at underlying types of type aliases.

clang-tools-extra/test/clang-tidy/checkers/abseil/duration-addition.cpp

Lines changed: 19 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
// RUN: %check_clang_tidy --match-partial-fixes %s abseil-duration-addition %t -- -- -I%S/Inputs
1+
// RUN: %check_clang_tidy %s abseil-duration-addition %t -- -- -I%S/Inputs
22

33
#include "absl/time/time.h"
44

@@ -8,68 +8,68 @@ void f() {
88

99
i = absl::ToUnixHours(t) + 5;
1010
// CHECK-MESSAGES: [[@LINE-1]]:7: warning: perform addition in the duration domain [abseil-duration-addition]
11-
// CHECK-FIXES: absl::ToUnixHours(t + absl::Hours(5))
11+
// CHECK-FIXES: i = absl::ToUnixHours(t + absl::Hours(5));
1212
i = absl::ToUnixMinutes(t) + 5;
1313
// CHECK-MESSAGES: [[@LINE-1]]:7: warning: perform addition in the duration domain [abseil-duration-addition]
14-
// CHECK-FIXES: absl::ToUnixMinutes(t + absl::Minutes(5))
14+
// CHECK-FIXES: i = absl::ToUnixMinutes(t + absl::Minutes(5));
1515
i = absl::ToUnixSeconds(t) + 5;
1616
// CHECK-MESSAGES: [[@LINE-1]]:7: warning: perform addition in the duration domain [abseil-duration-addition]
17-
// CHECK-FIXES: absl::ToUnixSeconds(t + absl::Seconds(5))
17+
// CHECK-FIXES: i = absl::ToUnixSeconds(t + absl::Seconds(5));
1818
i = absl::ToUnixMillis(t) + 5;
1919
// CHECK-MESSAGES: [[@LINE-1]]:7: warning: perform addition in the duration domain [abseil-duration-addition]
20-
// CHECK-FIXES: absl::ToUnixMillis(t + absl::Milliseconds(5))
20+
// CHECK-FIXES: i = absl::ToUnixMillis(t + absl::Milliseconds(5));
2121
i = absl::ToUnixMicros(t) + 5;
2222
// CHECK-MESSAGES: [[@LINE-1]]:7: warning: perform addition in the duration domain [abseil-duration-addition]
23-
// CHECK-FIXES: absl::ToUnixMicros(t + absl::Microseconds(5))
23+
// CHECK-FIXES: i = absl::ToUnixMicros(t + absl::Microseconds(5));
2424
i = absl::ToUnixNanos(t) + 5;
2525
// CHECK-MESSAGES: [[@LINE-1]]:7: warning: perform addition in the duration domain [abseil-duration-addition]
26-
// CHECK-FIXES: absl::ToUnixNanos(t + absl::Nanoseconds(5))
26+
// CHECK-FIXES: i = absl::ToUnixNanos(t + absl::Nanoseconds(5));
2727

2828
i = 3 + absl::ToUnixHours(t);
2929
// CHECK-MESSAGES: [[@LINE-1]]:7: warning: perform addition in the duration domain [abseil-duration-addition]
30-
// CHECK-FIXES: absl::ToUnixHours(absl::Hours(3) + t)
30+
// CHECK-FIXES: i = absl::ToUnixHours(absl::Hours(3) + t);
3131
i = 3 + absl::ToUnixMinutes(t);
3232
// CHECK-MESSAGES: [[@LINE-1]]:7: warning: perform addition in the duration domain [abseil-duration-addition]
33-
// CHECK-FIXES: absl::ToUnixMinutes(absl::Minutes(3) + t)
33+
// CHECK-FIXES: i = absl::ToUnixMinutes(absl::Minutes(3) + t);
3434
i = 3 + absl::ToUnixSeconds(t);
3535
// CHECK-MESSAGES: [[@LINE-1]]:7: warning: perform addition in the duration domain [abseil-duration-addition]
36-
// CHECK-FIXES: absl::ToUnixSeconds(absl::Seconds(3) + t)
36+
// CHECK-FIXES: i = absl::ToUnixSeconds(absl::Seconds(3) + t);
3737
i = 3 + absl::ToUnixMillis(t);
3838
// CHECK-MESSAGES: [[@LINE-1]]:7: warning: perform addition in the duration domain [abseil-duration-addition]
39-
// CHECK-FIXES: absl::ToUnixMillis(absl::Milliseconds(3) + t)
39+
// CHECK-FIXES: i = absl::ToUnixMillis(absl::Milliseconds(3) + t);
4040
i = 3 + absl::ToUnixMicros(t);
4141
// CHECK-MESSAGES: [[@LINE-1]]:7: warning: perform addition in the duration domain [abseil-duration-addition]
42-
// CHECK-FIXES: absl::ToUnixMicros(absl::Microseconds(3) + t)
42+
// CHECK-FIXES: i = absl::ToUnixMicros(absl::Microseconds(3) + t);
4343
i = 3 + absl::ToUnixNanos(t);
4444
// CHECK-MESSAGES: [[@LINE-1]]:7: warning: perform addition in the duration domain [abseil-duration-addition]
45-
// CHECK-FIXES: absl::ToUnixNanos(absl::Nanoseconds(3) + t)
45+
// CHECK-FIXES: i = absl::ToUnixNanos(absl::Nanoseconds(3) + t);
4646

4747
// Undoing inverse conversions
4848
i = absl::ToUnixMicros(t) + absl::ToInt64Microseconds(absl::Seconds(1));
4949
// CHECK-MESSAGES: [[@LINE-1]]:7: warning: perform addition in the duration domain [abseil-duration-addition]
50-
// CHECK-FIXES: absl::ToUnixMicros(t + absl::Seconds(1))
50+
// CHECK-FIXES: i = absl::ToUnixMicros(t + absl::Seconds(1));
5151

5252
// Parens
5353
i = 3 + (absl::ToUnixHours(t));
5454
// CHECK-MESSAGES: [[@LINE-1]]:7: warning: perform addition in the duration domain [abseil-duration-addition]
55-
// CHECK-FIXES: absl::ToUnixHours(absl::Hours(3) + t)
55+
// CHECK-FIXES: i = absl::ToUnixHours(absl::Hours(3) + t);
5656

5757
// Float folding
5858
i = absl::ToUnixSeconds(t) + 5.0;
5959
// CHECK-MESSAGES: [[@LINE-1]]:7: warning: perform addition in the duration domain [abseil-duration-addition]
60-
// CHECK-FIXES: absl::ToUnixSeconds(t + absl::Seconds(5))
60+
// CHECK-FIXES: i = absl::ToUnixSeconds(t + absl::Seconds(5));
6161

6262
// We can rewrite the argument of the duration conversion
6363
#define THIRTY absl::FromUnixSeconds(30)
6464
i = absl::ToUnixSeconds(THIRTY) + 1;
6565
// CHECK-MESSAGES: [[@LINE-1]]:7: warning: perform addition in the duration domain [abseil-duration-addition]
66-
// CHECK-FIXES: absl::ToUnixSeconds(THIRTY + absl::Seconds(1))
66+
// CHECK-FIXES: i = absl::ToUnixSeconds(THIRTY + absl::Seconds(1));
6767
#undef THIRTY
6868

6969
// Some other contexts
7070
if (absl::ToUnixSeconds(t) + 1.0 > 10) {}
7171
// CHECK-MESSAGES: [[@LINE-1]]:7: warning: perform addition in the duration domain [abseil-duration-addition]
72-
// CHECK-FIXES: absl::ToUnixSeconds(t + absl::Seconds(1))
72+
// CHECK-FIXES: if (absl::ToUnixSeconds(t + absl::Seconds(1)) > 10) {}
7373

7474
// These should not match
7575
i = 5 + 6;
@@ -88,7 +88,7 @@ template<typename T>
8888
void foo(absl::Time t) {
8989
int i = absl::ToUnixNanos(t) + T{};
9090
// CHECK-MESSAGES: [[@LINE-1]]:11: warning: perform addition in the duration domain [abseil-duration-addition]
91-
// CHECK-FIXES: absl::ToUnixNanos(t + absl::Nanoseconds(T{}))
91+
// CHECK-FIXES: int i = absl::ToUnixNanos(t + absl::Nanoseconds(T{}));
9292
}
9393

9494
void g() {

0 commit comments

Comments
 (0)