Skip to content

Commit 073cda7

Browse files
authored
Merge branch 'llvm:main' into fix-jitlink
2 parents 5834439 + f7e6521 commit 073cda7

File tree

1,258 files changed

+43530
-23572
lines changed

Some content is hidden

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

1,258 files changed

+43530
-23572
lines changed

.ci/monolithic-windows.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -55,7 +55,7 @@ start-group "ninja"
5555
ninja -C "${BUILD_DIR}" -k 0 ${targets} |& tee ninja.log
5656
cp ${BUILD_DIR}/.ninja_log ninja.ninja_log
5757

58-
if [[ "${runtime_targets}" != "" ]]; then
58+
if [[ "${runtimes_targets}" != "" ]]; then
5959
start-group "ninja runtimes"
6060

6161
ninja -C "${BUILD_DIR}" -k 0 ${runtimes_targets} |& tee ninja_runtimes.log

.github/workflows/bazel-checks.yml

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,11 @@ jobs:
3333
3434
bazel-build:
3535
name: "Bazel Build/Test"
36-
runs-on: llvm-premerge-linux-runners
36+
# Only run on US Central workers so we only have to keep one cache warm as
37+
# the cache buckets are per cluster.
38+
runs-on:
39+
group: llvm-premerge-cluster-us-central
40+
labels: llvm-premerge-linux-runners
3741
if: github.repository == 'llvm/llvm-project'
3842
steps:
3943
- name: Fetch LLVM sources
@@ -44,7 +48,7 @@ jobs:
4448
- name: Setup System Dependencies
4549
run: |
4650
sudo apt-get update
47-
sudo apt-get install -y libmpfr-dev libpfm4-dev
51+
sudo apt-get install -y libmpfr-dev libpfm4-dev m4 libedit-dev
4852
sudo curl -L https://github.com/bazelbuild/bazelisk/releases/download/v1.27.0/bazelisk-amd64.deb > /tmp/bazelisk.deb
4953
sudo apt-get install -y /tmp/bazelisk.deb
5054
rm /tmp/bazelisk.deb
@@ -54,4 +58,4 @@ jobs:
5458
bazelisk test --config=ci --sandbox_base="" \
5559
--remote_cache=https://storage.googleapis.com/$CACHE_GCS_BUCKET-bazel \
5660
--google_default_credentials \
57-
@llvm-project//llvm/unittests:adt_tests
61+
@llvm-project//... //...

.github/workflows/release-binaries.yml

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -191,12 +191,6 @@ jobs:
191191
- name: Install Ninja
192192
uses: llvm/actions/install-ninja@42d80571b13f4599bbefbc7189728b64723c7f78 # main
193193

194-
- name: Setup Windows
195-
if: startsWith(runner.os, 'Windows')
196-
uses: llvm/actions/setup-windows@42d80571b13f4599bbefbc7189728b64723c7f78 # main
197-
with:
198-
arch: amd64
199-
200194
- name: Set Build Prefix
201195
id: setup-stage
202196
shell: bash

clang-tools-extra/clang-tidy/google/AvoidCStyleCastsCheck.cpp

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -269,6 +269,12 @@ void AvoidCStyleCastsCheck::check(const MatchFinder::MatchResult &Result) {
269269
return;
270270
}
271271
break;
272+
case CK_BaseToDerived:
273+
if (!needsConstCast(SourceType, DestType)) {
274+
ReplaceWithNamedCast("static_cast");
275+
return;
276+
}
277+
break;
272278
default:
273279
break;
274280
}

clang-tools-extra/clang-tidy/misc/CoroutineHostileRAIICheck.cpp

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -73,15 +73,19 @@ CoroutineHostileRAIICheck::CoroutineHostileRAIICheck(StringRef Name,
7373
RAIITypesList(utils::options::parseStringList(
7474
Options.get("RAIITypesList", "std::lock_guard;std::scoped_lock"))),
7575
AllowedAwaitablesList(utils::options::parseStringList(
76-
Options.get("AllowedAwaitablesList", ""))) {}
76+
Options.get("AllowedAwaitablesList", ""))),
77+
AllowedCallees(
78+
utils::options::parseStringList(Options.get("AllowedCallees", ""))) {}
7779

7880
void CoroutineHostileRAIICheck::registerMatchers(MatchFinder *Finder) {
7981
// A suspension happens with co_await or co_yield.
8082
auto ScopedLockable = varDecl(hasType(hasCanonicalType(hasDeclaration(
8183
hasAttr(attr::Kind::ScopedLockable)))))
8284
.bind("scoped-lockable");
8385
auto OtherRAII = varDecl(typeWithNameIn(RAIITypesList)).bind("raii");
84-
auto AllowedSuspend = awaitable(typeWithNameIn(AllowedAwaitablesList));
86+
auto AllowedSuspend = awaitable(
87+
anyOf(typeWithNameIn(AllowedAwaitablesList),
88+
callExpr(callee(functionDecl(hasAnyName(AllowedCallees))))));
8589
Finder->addMatcher(
8690
expr(anyOf(coawaitExpr(unless(AllowedSuspend)), coyieldExpr()),
8791
forEachPrevStmt(
@@ -111,5 +115,7 @@ void CoroutineHostileRAIICheck::storeOptions(
111115
utils::options::serializeStringList(RAIITypesList));
112116
Options.store(Opts, "SafeAwaitableList",
113117
utils::options::serializeStringList(AllowedAwaitablesList));
118+
Options.store(Opts, "SafeCallees",
119+
utils::options::serializeStringList(AllowedCallees));
114120
}
115121
} // namespace clang::tidy::misc

clang-tools-extra/clang-tidy/misc/CoroutineHostileRAIICheck.h

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -46,6 +46,9 @@ class CoroutineHostileRAIICheck : public ClangTidyCheck {
4646
// List of fully qualified awaitable types which are considered safe to
4747
// co_await.
4848
std::vector<StringRef> AllowedAwaitablesList;
49+
// List of callees whose return values are considered safe to directly
50+
// co_await.
51+
std::vector<StringRef> AllowedCallees;
4952
};
5053

5154
} // namespace clang::tidy::misc

clang-tools-extra/docs/ReleaseNotes.rst

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -402,6 +402,10 @@ Changes in existing checks
402402
adding an option to allow pointer arithmetic via prefix/postfix increment or
403403
decrement operators.
404404

405+
- Improved :doc:`google-readability-casting
406+
<clang-tidy/checks/google/readability-casting>` check by adding fix-it
407+
notes for downcasts.
408+
405409
- Improved :doc:`llvm-prefer-isa-or-dyn-cast-in-conditionals
406410
<clang-tidy/checks/llvm/prefer-isa-or-dyn-cast-in-conditionals>` check:
407411

@@ -419,6 +423,11 @@ Changes in existing checks
419423
positives on return of non-const pointer and fix false positives on
420424
pointer-to-member operator.
421425

426+
- Improved :doc:`misc-coroutine-hostile-raii
427+
<clang-tidy/checks/misc/coroutine-hostile-raii>` check by adding the option
428+
`AllowedCallees`, that allows exempting safely awaitable callees from the
429+
check.
430+
422431
- Improved :doc:`misc-header-include-cycle
423432
<clang-tidy/checks/misc/header-include-cycle>` check performance.
424433

clang-tools-extra/docs/clang-tidy/checks/abseil/duration-addition.rst

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -3,10 +3,10 @@
33
abseil-duration-addition
44
========================
55

6-
Check for cases where addition should be performed in the ``absl::Time`` domain.
7-
When adding two values, and one is known to be an ``absl::Time``, we can infer
8-
that the other should be interpreted as an ``absl::Duration`` of a similar
9-
scale, and make that inference explicit.
6+
Checks for cases where addition should be performed in the ``absl::Time``
7+
domain. When adding two values, and one is known to be an ``absl::Time``,
8+
we can infer that the other should be interpreted as an ``absl::Duration``
9+
of a similar scale, and make that inference explicit.
1010

1111
Examples:
1212

clang-tools-extra/docs/clang-tidy/checks/abseil/duration-division.rst

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,8 +4,10 @@ abseil-duration-division
44
========================
55

66
``absl::Duration`` arithmetic works like it does with integers. That means that
7-
division of two ``absl::Duration`` objects returns an ``int64`` with any fractional
8-
component truncated toward 0. See `this link <https://github.com/abseil/abseil-cpp/blob/29ff6d4860070bf8fcbd39c8805d0c32d56628a3/absl/time/time.h#L137>`_ for more information on arithmetic with ``absl::Duration``.
7+
division of two ``absl::Duration`` objects returns an ``int64`` with any
8+
fractional component truncated toward 0.
9+
See `this link <https://github.com/abseil/abseil-cpp/blob/29ff6d4860070bf8fcbd39c8805d0c32d56628a3/absl/time/time.h#L137>`_
10+
for more information on arithmetic with ``absl::Duration``.
911

1012
For example:
1113

clang-tools-extra/docs/clang-tidy/checks/abseil/faster-strsplit-delimiter.rst

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -5,9 +5,9 @@ abseil-faster-strsplit-delimiter
55

66
Finds instances of ``absl::StrSplit()`` or ``absl::MaxSplits()`` where the
77
delimiter is a single character string literal and replaces with a character.
8-
The check will offer a suggestion to change the string literal into a character.
9-
It will also catch code using ``absl::ByAnyChar()`` for just a single character
10-
and will transform that into a single character as well.
8+
The check will offer a suggestion to change the string literal into a
9+
character. It will also catch code using ``absl::ByAnyChar()`` for just a
10+
single character and will transform that into a single character as well.
1111

1212
These changes will give the same result, but using characters rather than
1313
single character string literals is more efficient and readable.

0 commit comments

Comments
 (0)