Skip to content

Commit 1efa4ce

Browse files
authored
Merge branch 'main' into users/kparzysz/b02-dispatch-block
2 parents c015d5e + 3231cb4 commit 1efa4ce

File tree

728 files changed

+127802
-9797
lines changed

Some content is hidden

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

728 files changed

+127802
-9797
lines changed

.clang-tidy

Lines changed: 13 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,16 @@
1-
Checks: '-*,clang-diagnostic-*,llvm-*,misc-*,-misc-const-correctness,-misc-unused-parameters,-misc-non-private-member-variables-in-classes,-misc-no-recursion,-misc-use-anonymous-namespace,readability-identifier-naming,-misc-include-cleaner'
1+
Checks: >
2+
-*,
3+
clang-diagnostic-*,
4+
llvm-*,
5+
misc-*,
6+
-misc-const-correctness,
7+
-misc-include-cleaner,
8+
-misc-no-recursion,
9+
-misc-non-private-member-variables-in-classes,
10+
-misc-unused-parameters,
11+
-misc-use-anonymous-namespace,
12+
readability-identifier-naming
13+
214
CheckOptions:
315
- key: readability-identifier-naming.ClassCase
416
value: CamelCase

.github/workflows/libcxx-build-and-test.yaml

Lines changed: 8 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -36,8 +36,7 @@ concurrency:
3636
jobs:
3737
stage1:
3838
if: github.repository_owner == 'llvm'
39-
runs-on: libcxx-self-hosted-linux
40-
container: ghcr.io/llvm/libcxx-linux-builder:b060022103f551d8ca1dad84122ef73927c86512
39+
runs-on: llvm-premerge-libcxx-runners
4140
continue-on-error: false
4241
strategy:
4342
fail-fast: false
@@ -74,8 +73,7 @@ jobs:
7473
**/crash_diagnostics/*
7574
stage2:
7675
if: github.repository_owner == 'llvm'
77-
runs-on: libcxx-self-hosted-linux
78-
container: ghcr.io/llvm/libcxx-linux-builder:2b57ebb50b6d418e70382e655feaa619b558e254
76+
runs-on: llvm-premerge-libcxx-runners
7977
needs: [ stage1 ]
8078
continue-on-error: false
8179
strategy:
@@ -149,21 +147,20 @@ jobs:
149147
'generic-static',
150148
'bootstrapping-build'
151149
]
152-
machine: [ 'libcxx-self-hosted-linux' ]
150+
machine: [ 'llvm-premerge-libcxx-runners' ]
153151
include:
154152
- config: 'generic-cxx26'
155-
machine: libcxx-self-hosted-linux
153+
machine: llvm-premerge-libcxx-runners
156154
- config: 'generic-asan'
157-
machine: libcxx-self-hosted-linux
155+
machine: llvm-premerge-libcxx-runners
158156
- config: 'generic-tsan'
159-
machine: libcxx-self-hosted-linux
157+
machine: llvm-premerge-libcxx-runners
160158
- config: 'generic-ubsan'
161-
machine: libcxx-self-hosted-linux
159+
machine: llvm-premerge-libcxx-runners
162160
# Use a larger machine for MSAN to avoid timeout and memory allocation issues.
163161
- config: 'generic-msan'
164-
machine: libcxx-self-hosted-linux
162+
machine: llvm-premerge-libcxx-runners
165163
runs-on: ${{ matrix.machine }}
166-
container: ghcr.io/llvm/libcxx-linux-builder:2b57ebb50b6d418e70382e655feaa619b558e254
167164
steps:
168165
- uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
169166
- name: ${{ matrix.config }}

.github/workflows/libcxx-restart-preempted-jobs.yaml

Lines changed: 0 additions & 158 deletions
This file was deleted.

.github/workflows/pr-code-format.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -55,7 +55,7 @@ jobs:
5555
- name: Install clang-format
5656
uses: aminya/setup-cpp@17c11551771948abc5752bbf3183482567c7caf0 # v1.1.1
5757
with:
58-
clangformat: 20.1.5
58+
clangformat: 20.1.8
5959

6060
- name: Setup Python env
6161
uses: actions/setup-python@42375524e23c412d93fb67b49958b491fce71c38 # v5.4.0

.github/workflows/premerge.yaml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -63,6 +63,7 @@ jobs:
6363
6464
./.ci/monolithic-linux.sh "${projects_to_build}" "${project_check_targets}" "${runtimes_to_build}" "${runtimes_check_targets}" "${runtimes_check_targets_needs_reconfig}"
6565
- name: Upload Artifacts
66+
if: '!cancelled()'
6667
uses: actions/upload-artifact@65c4c4a1ddee5b72f698fdd19549f0f0fb45cf08 # v4.6.0
6768
with:
6869
name: Premerge Artifacts (Linux)
@@ -113,6 +114,7 @@ jobs:
113114
call C:\\BuildTools\\Common7\\Tools\\VsDevCmd.bat -arch=amd64 -host_arch=amd64
114115
bash .ci/monolithic-windows.sh "${{ steps.vars.outputs.windows-projects }}" "${{ steps.vars.outputs.windows-check-targets }}"
115116
- name: Upload Artifacts
117+
if: '!cancelled()'
116118
uses: actions/upload-artifact@65c4c4a1ddee5b72f698fdd19549f0f0fb45cf08 # v4.6.0
117119
with:
118120
name: Premerge Artifacts (Windows)

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

Lines changed: 29 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,17 @@ using namespace clang::ast_matchers;
1515

1616
namespace clang::tidy::readability {
1717

18+
NamedParameterCheck::NamedParameterCheck(StringRef Name,
19+
ClangTidyContext *Context)
20+
: ClangTidyCheck(Name, Context),
21+
InsertPlainNamesInForwardDecls(
22+
Options.get("InsertPlainNamesInForwardDecls", false)) {}
23+
24+
void NamedParameterCheck::storeOptions(ClangTidyOptions::OptionMap &Opts) {
25+
Options.store(Opts, "InsertPlainNamesInForwardDecls",
26+
InsertPlainNamesInForwardDecls);
27+
}
28+
1829
void NamedParameterCheck::registerMatchers(ast_matchers::MatchFinder *Finder) {
1930
Finder->addMatcher(functionDecl().bind("decl"), this);
2031
}
@@ -84,7 +95,8 @@ void NamedParameterCheck::check(const MatchFinder::MatchResult &Result) {
8495

8596
for (auto P : UnnamedParams) {
8697
// Fallback to an unused marker.
87-
StringRef NewName = "unused";
98+
static constexpr StringRef FallbackName = "unused";
99+
StringRef NewName = FallbackName;
88100

89101
// If the method is overridden, try to copy the name from the base method
90102
// into the overrider.
@@ -105,12 +117,25 @@ void NamedParameterCheck::check(const MatchFinder::MatchResult &Result) {
105117
NewName = Name;
106118
}
107119

108-
// Now insert the comment. Note that getLocation() points to the place
120+
// Now insert the fix. Note that getLocation() points to the place
109121
// where the name would be, this allows us to also get complex cases like
110122
// function pointers right.
111123
const ParmVarDecl *Parm = P.first->getParamDecl(P.second);
112-
D << FixItHint::CreateInsertion(Parm->getLocation(),
113-
" /*" + NewName.str() + "*/");
124+
125+
// The fix depends on the InsertPlainNamesInForwardDecls option,
126+
// whether this is a forward declaration and whether the parameter has
127+
// a real name.
128+
const bool IsForwardDeclaration = (!Definition || Function != Definition);
129+
if (InsertPlainNamesInForwardDecls && IsForwardDeclaration &&
130+
NewName != FallbackName) {
131+
// For forward declarations with InsertPlainNamesInForwardDecls enabled,
132+
// insert the parameter name without comments.
133+
D << FixItHint::CreateInsertion(Parm->getLocation(),
134+
" " + NewName.str());
135+
} else {
136+
D << FixItHint::CreateInsertion(Parm->getLocation(),
137+
" /*" + NewName.str() + "*/");
138+
}
114139
}
115140
}
116141
}

clang-tools-extra/clang-tidy/readability/NamedParameterCheck.h

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -26,13 +26,16 @@ namespace clang::tidy::readability {
2626
/// Corresponding cpplint.py check name: 'readability/function'.
2727
class NamedParameterCheck : public ClangTidyCheck {
2828
public:
29-
NamedParameterCheck(StringRef Name, ClangTidyContext *Context)
30-
: ClangTidyCheck(Name, Context) {}
29+
NamedParameterCheck(StringRef Name, ClangTidyContext *Context);
3130
void registerMatchers(ast_matchers::MatchFinder *Finder) override;
3231
void check(const ast_matchers::MatchFinder::MatchResult &Result) override;
32+
void storeOptions(ClangTidyOptions::OptionMap &Opts) override;
3333
std::optional<TraversalKind> getCheckTraversalKind() const override {
3434
return TK_IgnoreUnlessSpelledInSource;
3535
}
36+
37+
private:
38+
const bool InsertPlainNamesInForwardDecls;
3639
};
3740

3841
} // namespace clang::tidy::readability

clang-tools-extra/clangd/ModulesBuilder.cpp

Lines changed: 31 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -160,6 +160,16 @@ class ReusablePrerequisiteModules : public PrerequisiteModules {
160160
RequiredModule->getModuleFilePath().str());
161161
}
162162

163+
std::string getAsString() const {
164+
std::string Result;
165+
llvm::raw_string_ostream OS(Result);
166+
for (const auto &ModuleFile : RequiredModules) {
167+
OS << "-fmodule-file=" << ModuleFile->getModuleName() << "="
168+
<< ModuleFile->getModuleFilePath() << " ";
169+
}
170+
return Result;
171+
}
172+
163173
bool canReuse(const CompilerInvocation &CI,
164174
llvm::IntrusiveRefCntPtr<llvm::vfs::FileSystem>) const override;
165175

@@ -296,8 +306,27 @@ buildModuleFile(llvm::StringRef ModuleName, PathRef ModuleUnitFileName,
296306
GenerateReducedModuleInterfaceAction Action;
297307
Clang->ExecuteAction(Action);
298308

299-
if (Clang->getDiagnostics().hasErrorOccurred())
300-
return llvm::createStringError("Compilation failed");
309+
if (Clang->getDiagnostics().hasErrorOccurred()) {
310+
std::string Cmds;
311+
for (const auto &Arg : Inputs.CompileCommand.CommandLine) {
312+
if (!Cmds.empty())
313+
Cmds += " ";
314+
Cmds += Arg;
315+
}
316+
317+
clangd::vlog("Failed to compile {0} with command: {1}.", ModuleUnitFileName,
318+
Cmds);
319+
320+
std::string BuiltModuleFilesStr = BuiltModuleFiles.getAsString();
321+
if (!BuiltModuleFilesStr.empty())
322+
clangd::vlog("The actual used module files built by clangd is {0}",
323+
BuiltModuleFilesStr);
324+
325+
return llvm::createStringError(
326+
llvm::formatv("Failed to compile {0}. Use '--log=verbose' to view "
327+
"detailed failure reasons.",
328+
ModuleUnitFileName));
329+
}
301330

302331
return ModuleFile{ModuleName, Inputs.CompileCommand.Output};
303332
}

clang-tools-extra/docs/ReleaseNotes.rst

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -215,7 +215,7 @@ Changes in existing checks
215215
- Improved :doc:`cppcoreguidelines-missing-std-forward
216216
<clang-tidy/checks/cppcoreguidelines/missing-std-forward>` check by adding a
217217
flag to specify the function used for forwarding instead of ``std::forward``.
218-
218+
219219
- Improved :doc:`cppcoreguidelines-pro-bounds-pointer-arithmetic
220220
<clang-tidy/checks/cppcoreguidelines/pro-bounds-pointer-arithmetic>` check by
221221
fixing false positives when calling indexing operators that do not perform
@@ -342,6 +342,11 @@ Changes in existing checks
342342
false negatives where math expressions are the operand of assignment operators
343343
or comparison operators.
344344

345+
- Improved :doc:`readability-named-parameter
346+
<clang-tidy/checks/readability/named-parameter>` check by adding the option
347+
`InsertPlainNamesInForwardDecls` to insert parameter names without comments
348+
for forward declarations only.
349+
345350
- Improved :doc:`readability-qualified-auto
346351
<clang-tidy/checks/readability/qualified-auto>` check by adding the option
347352
`AllowedTypes`, that excludes specified types from adding qualifiers.

0 commit comments

Comments
 (0)