Skip to content

Commit 775e712

Browse files
authored
Merge branch 'main' into hgh/libcxx/nodiscard-to-smartptr
2 parents 660ff09 + b4aa3d3 commit 775e712

File tree

248 files changed

+7143
-7638
lines changed

Some content is hidden

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

248 files changed

+7143
-7638
lines changed

.ci/monolithic-linux.sh

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -64,13 +64,13 @@ cmake -S "${MONOREPO_ROOT}"/llvm -B "${BUILD_DIR}" \
6464

6565
start-group "ninja"
6666

67-
if [[ "${targets}" != "" ]]; then
67+
if [[ -n "${targets}" ]]; then
6868
# Targets are not escaped as they are passed as separate arguments.
6969
ninja -C "${BUILD_DIR}" -k 0 ${targets} |& tee ninja.log
7070
cp ${BUILD_DIR}/.ninja_log ninja.ninja_log
7171
fi
7272

73-
if [[ "${runtime_targets}" != "" ]]; then
73+
if [[ -n "${runtime_targets}" ]]; then
7474
start-group "ninja Runtimes"
7575

7676
ninja -C "${BUILD_DIR}" ${runtime_targets} |& tee ninja_runtimes.log
@@ -79,7 +79,7 @@ fi
7979

8080
# Compiling runtimes with just-built Clang and running their tests
8181
# as an additional testing for Clang.
82-
if [[ "${runtime_targets_needs_reconfig}" != "" ]]; then
82+
if [[ -n "${runtime_targets_needs_reconfig}" ]]; then
8383
start-group "CMake Runtimes C++26"
8484

8585
cmake \

.ci/monolithic-windows.sh

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -51,13 +51,13 @@ cmake -S "${MONOREPO_ROOT}"/llvm -B "${BUILD_DIR}" \
5151

5252
start-group "ninja"
5353

54-
if [[ "${targets}" != "" ]]; then
54+
if [[ -n "${targets}" ]]; then
5555
# Targets are not escaped as they are passed as separate arguments.
5656
ninja -C "${BUILD_DIR}" -k 0 ${targets} |& tee ninja.log
5757
cp ${BUILD_DIR}/.ninja_log ninja.ninja_log
5858
fi
5959

60-
if [[ "${runtimes_targets}" != "" ]]; then
60+
if [[ -n "${runtimes_targets}" ]]; then
6161
start-group "ninja runtimes"
6262

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

.ci/premerge_advisor_explain.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -148,7 +148,7 @@ def main(
148148

149149
# Skip looking for results on AArch64 for now because the premerge advisor
150150
# service is not available on AWS currently.
151-
if platform.machine() == "arm64":
151+
if platform.machine() == "arm64" or platform.machine() == "aarch64":
152152
sys.exit(0)
153153

154154
main(

.ci/premerge_advisor_upload.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -59,7 +59,7 @@ def main(commit_sha, workflow_run_number, build_log_files):
5959

6060
# Skip uploading results on AArch64 for now because the premerge advisor
6161
# service is not available on AWS currently.
62-
if platform.machine() == "arm64":
62+
if platform.machine() == "arm64" or platform.machine() == "aarch64":
6363
sys.exit(0)
6464

6565
main(args.commit_sha, args.workflow_run_number, args.build_log_files)

.ci/utils.sh

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,7 @@ function at-exit {
3333
# If building fails there will be no results files.
3434
shopt -s nullglob
3535

36-
if [[ "$GITHUB_ACTIONS" != "" ]]; then
36+
if [[ -n "$GITHUB_ACTIONS" ]]; then
3737
python "${MONOREPO_ROOT}"/.ci/generate_test_report_github.py \
3838
$retcode "${BUILD_DIR}"/test-results.*.xml "${MONOREPO_ROOT}"/ninja*.log \
3939
>> $GITHUB_STEP_SUMMARY
@@ -44,7 +44,7 @@ function at-exit {
4444
fi
4545

4646
if [[ "$retcode" != "0" ]]; then
47-
if [[ "$GITHUB_ACTIONS" != "" ]]; then
47+
if [[ -n "$GITHUB_ACTIONS" ]]; then
4848
python "${MONOREPO_ROOT}"/.ci/premerge_advisor_upload.py \
4949
$(git rev-parse HEAD~1) $GITHUB_RUN_NUMBER \
5050
"${BUILD_DIR}"/test-results.*.xml "${MONOREPO_ROOT}"/ninja*.log
@@ -59,10 +59,10 @@ trap at-exit EXIT
5959

6060
function start-group {
6161
groupname=$1
62-
if [[ "$GITHUB_ACTIONS" != "" ]]; then
62+
if [[ -n "$GITHUB_ACTIONS" ]]; then
6363
echo "::endgroup"
6464
echo "::group::$groupname"
65-
elif [[ "$POSTCOMMIT_CI" != "" ]]; then
65+
elif [[ -n "$POSTCOMMIT_CI" ]]; then
6666
echo "@@@$STEP@@@"
6767
else
6868
echo "Starting $groupname"
@@ -73,6 +73,6 @@ export PIP_BREAK_SYSTEM_PACKAGES=1
7373
pip install -q -r "${MONOREPO_ROOT}"/.ci/all_requirements.txt
7474

7575
# The ARM64 builders run on AWS and don't have access to the GCS cache.
76-
if [[ "$GITHUB_ACTIONS" != "" ]] && [[ "$RUNNER_ARCH" != "ARM64" ]]; then
76+
if [[ -n "$GITHUB_ACTIONS" ]] && [[ "$RUNNER_ARCH" != "ARM64" ]]; then
7777
python .ci/cache_lit_timing_files.py download
7878
fi

.github/workflows/release-binaries.yml

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -188,9 +188,6 @@ jobs:
188188
with:
189189
ref: ${{ needs.prepare.outputs.ref }}
190190

191-
- name: Install Ninja
192-
uses: llvm/actions/install-ninja@5dd955034a6742a2e21d82bf165fcb1050ae7b49 # main
193-
194191
- name: Set Build Prefix
195192
id: setup-stage
196193
shell: bash

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

Lines changed: 9 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -67,6 +67,11 @@ static auto typeWithNameIn(const std::vector<StringRef> &Names) {
6767
hasCanonicalType(hasDeclaration(namedDecl(hasAnyName(Names)))));
6868
}
6969

70+
static auto functionWithNameIn(const std::vector<StringRef> &Names) {
71+
auto Call = callExpr(callee(functionDecl(hasAnyName(Names))));
72+
return anyOf(expr(cxxBindTemporaryExpr(has(Call))), expr(Call));
73+
}
74+
7075
CoroutineHostileRAIICheck::CoroutineHostileRAIICheck(StringRef Name,
7176
ClangTidyContext *Context)
7277
: ClangTidyCheck(Name, Context),
@@ -83,9 +88,8 @@ void CoroutineHostileRAIICheck::registerMatchers(MatchFinder *Finder) {
8388
hasAttr(attr::Kind::ScopedLockable)))))
8489
.bind("scoped-lockable");
8590
auto OtherRAII = varDecl(typeWithNameIn(RAIITypesList)).bind("raii");
86-
auto AllowedSuspend = awaitable(
87-
anyOf(typeWithNameIn(AllowedAwaitablesList),
88-
callExpr(callee(functionDecl(hasAnyName(AllowedCallees))))));
91+
auto AllowedSuspend = awaitable(anyOf(typeWithNameIn(AllowedAwaitablesList),
92+
functionWithNameIn(AllowedCallees)));
8993
Finder->addMatcher(
9094
expr(anyOf(coawaitExpr(unless(AllowedSuspend)), coyieldExpr()),
9195
forEachPrevStmt(
@@ -113,9 +117,9 @@ void CoroutineHostileRAIICheck::storeOptions(
113117
ClangTidyOptions::OptionMap &Opts) {
114118
Options.store(Opts, "RAIITypesList",
115119
utils::options::serializeStringList(RAIITypesList));
116-
Options.store(Opts, "SafeAwaitableList",
120+
Options.store(Opts, "AllowedAwaitablesList",
117121
utils::options::serializeStringList(AllowedAwaitablesList));
118-
Options.store(Opts, "SafeCallees",
122+
Options.store(Opts, "AllowedCallees",
119123
utils::options::serializeStringList(AllowedCallees));
120124
}
121125
} // namespace clang::tidy::misc

clang-tools-extra/test/clang-tidy/checkers/misc/coroutine-hostile-raii.cpp

Lines changed: 10 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
// RUN: -config="{CheckOptions: {\
33
// RUN: misc-coroutine-hostile-raii.RAIITypesList: 'my::Mutex; ::my::other::Mutex', \
44
// RUN: misc-coroutine-hostile-raii.AllowedAwaitablesList: 'safe::awaitable; ::transformable::awaitable', \
5-
// RUN: misc-coroutine-hostile-raii.AllowedCallees: 'safe::AwaitFunc; ::safe::Obj::AwaitMethod' \
5+
// RUN: misc-coroutine-hostile-raii.AllowedCallees: 'safe::AwaitFunc; ::safe::Obj::AwaitMethod; retExemptedAwaitable' \
66
// RUN: }}"
77

88
namespace std {
@@ -163,7 +163,10 @@ ReturnObject RAIISafeSuspendTest() {
163163
// ================================================================================
164164
// Safe transformable awaitable
165165
// ================================================================================
166-
struct transformable { struct awaitable{}; };
166+
struct transformable {
167+
struct awaitable{};
168+
struct unsafe_awaitable{};
169+
};
167170
using alias_transformable_awaitable = transformable::awaitable;
168171
struct UseTransformAwaitable {
169172
struct promise_type {
@@ -172,13 +175,18 @@ struct UseTransformAwaitable {
172175
std::suspend_always final_suspend() noexcept { return {}; }
173176
void unhandled_exception() {}
174177
std::suspend_always await_transform(transformable::awaitable) { return {}; }
178+
std::suspend_always await_transform(transformable::unsafe_awaitable) {
179+
return {};
180+
}
175181
};
176182
};
177183

178184
auto retAwaitable() { return transformable::awaitable{}; }
185+
auto retExemptedAwaitable() { return transformable::unsafe_awaitable{}; }
179186
UseTransformAwaitable RAIISafeSuspendTest2() {
180187
absl::Mutex a;
181188
co_await retAwaitable();
189+
co_await retExemptedAwaitable();
182190
co_await transformable::awaitable{};
183191
co_await alias_transformable_awaitable{};
184192
}

clang/include/clang/CIR/MissingFeatures.h

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,6 @@ struct MissingFeatures {
2929

3030
// Unhandled global/linkage information.
3131
static bool opGlobalThreadLocal() { return false; }
32-
static bool opGlobalConstant() { return false; }
3332
static bool opGlobalWeakRef() { return false; }
3433
static bool opGlobalUnnamedAddr() { return false; }
3534
static bool opGlobalSection() { return false; }

clang/lib/AST/ByteCode/Context.cpp

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,6 @@
2121
#include "clang/AST/ASTLambda.h"
2222
#include "clang/AST/Expr.h"
2323
#include "clang/Basic/TargetInfo.h"
24-
#include "llvm/Support/SystemZ/zOSSupport.h"
2524

2625
using namespace clang;
2726
using namespace clang::interp;

0 commit comments

Comments
 (0)