Skip to content

Commit cd1080a

Browse files
authored
Merge branch 'main' into riscv/insert-vsetvli-vl-clobber
2 parents 488edca + f038dfd commit cd1080a

File tree

848 files changed

+22580
-13490
lines changed

Some content is hidden

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

848 files changed

+22580
-13490
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//... //...

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: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -423,6 +423,11 @@ Changes in existing checks
423423
positives on return of non-const pointer and fix false positives on
424424
pointer-to-member operator.
425425

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+
426431
- Improved :doc:`misc-header-include-cycle
427432
<clang-tidy/checks/misc/header-include-cycle>` check performance.
428433

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.

clang-tools-extra/docs/clang-tidy/checks/abseil/string-find-str-contains.rst

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,8 +3,8 @@
33
abseil-string-find-str-contains
44
===============================
55

6-
Finds ``s.find(...) == string::npos`` comparisons (for various string-like types)
7-
and suggests replacing with ``absl::StrContains()``.
6+
Finds ``s.find(...) == string::npos`` comparisons (for various string-like
7+
types) and suggests replacing with ``absl::StrContains()``.
88

99
This improves readability and reduces the likelihood of accidentally mixing
1010
``find()`` and ``npos`` from different string-like types.

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

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -8,17 +8,17 @@ argument needs an explicit cast to continue compiling after upcoming API
88
changes.
99

1010
The operators ``*=``, ``/=``, ``*``, and ``/`` for ``absl::Duration`` currently
11-
accept an argument of class type that is convertible to an arithmetic type. Such
12-
a call currently converts the value to an ``int64_t``, even in a case such as
13-
``std::atomic<float>`` that would result in lossy conversion.
11+
accept an argument of class type that is convertible to an arithmetic type.
12+
Such a call currently converts the value to an ``int64_t``, even in a case such
13+
as ``std::atomic<float>`` that would result in lossy conversion.
1414

1515
Additionally, the ``absl::Duration`` factory functions (``absl::Hours``,
1616
``absl::Minutes``, etc) currently accept an ``int64_t`` or a floating-point
1717
type. Similar to the arithmetic operators, calls with an argument of class type
1818
that is convertible to an arithmetic type go through the ``int64_t`` path.
1919

20-
These operators and factories will be changed to only accept arithmetic types to
21-
prevent unintended behavior. After these changes are released, passing an
20+
These operators and factories will be changed to only accept arithmetic types
21+
to prevent unintended behavior. After these changes are released, passing an
2222
argument of class type will no longer compile, even if the type is implicitly
2323
convertible to an arithmetic type.
2424

0 commit comments

Comments
 (0)