Skip to content

Commit f39e20c

Browse files
authored
Merge branch 'main' into fix-boolean-expr-check
2 parents 096ca90 + 1c6e5b2 commit f39e20c

File tree

449 files changed

+26623
-10712
lines changed

Some content is hidden

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

449 files changed

+26623
-10712
lines changed

.ci/generate_test_report_lib.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -298,6 +298,7 @@ def plural(num_tests):
298298
title,
299299
return_code,
300300
junit_objects,
301+
ninja_logs,
301302
size_limit,
302303
list_failures=False,
303304
)

.ci/generate_test_report_lib_test.py

Lines changed: 0 additions & 30 deletions
Original file line numberDiff line numberDiff line change
@@ -408,36 +408,6 @@ def test_no_failures_build_failed_ninja_log(self):
408408
)
409409

410410
def test_no_failures_multiple_build_failed_ninja_log(self):
411-
test = generate_test_report_lib.generate_report(
412-
"Foo",
413-
1,
414-
[
415-
junit_from_xml(
416-
dedent(
417-
"""\
418-
<?xml version="1.0" encoding="UTF-8"?>
419-
<testsuites time="0.00">
420-
<testsuite name="Passed" tests="1" failures="0" skipped="0" time="0.00">
421-
<testcase classname="Bar/test_1" name="test_1" time="0.00"/>
422-
</testsuite>
423-
</testsuites>"""
424-
)
425-
)
426-
],
427-
[
428-
[
429-
"[1/5] test/1.stamp",
430-
"[2/5] test/2.stamp",
431-
"FAILED: touch test/2.stamp",
432-
"Wow! Be Kind!",
433-
"[3/5] test/3.stamp",
434-
"[4/5] test/4.stamp",
435-
"FAILED: touch test/4.stamp",
436-
"Wow! I Dare You!",
437-
"[5/5] test/5.stamp",
438-
]
439-
],
440-
)
441411
self.assertEqual(
442412
generate_test_report_lib.generate_report(
443413
"Foo",

.github/workflows/commit-access-review.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -266,7 +266,7 @@ def count_prs(gh: github.Github, triage_list: dict, start_date: datetime.datetim
266266

267267
def main():
268268
token = sys.argv[1]
269-
gh = github.Github(login_or_token=token)
269+
gh = github.Github(auth=github.Auth.Token(token))
270270
org = gh.get_organization("llvm")
271271
repo = org.get_repo("llvm-project")
272272
one_year_ago = datetime.datetime.now() - datetime.timedelta(days=365)

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

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -39,16 +39,13 @@ RUN regsvr32 /S "C:\BuildTools\DIA SDK\bin\amd64\msdia140.dll" & \
3939

4040
# install tools as described in https://llvm.org/docs/GettingStartedVS.html
4141
# and a few more that were not documented...
42-
# Pin an older version of Python; the current Python 3.10 fails when
43-
# doing "pip install" for the other dependencies, as it fails to find libxml
44-
# while compiling some package.
4542
# We version pin the other packages as well to ensure the container build is as
4643
# reproducible as possible to prevent issues when upgrading only part of the
4744
# container.
4845
RUN choco install -y ninja --version 1.13.1 && \
4946
choco install -y git --version 2.50.1 && \
5047
choco install -y sccache --version 0.10.0 && \
51-
choco install -y python3 --version 3.9.7
48+
choco install -y python3 --version 3.12.3
5249

5350
# Testing requires psutil
5451
RUN pip install psutil

.github/workflows/release-asset-audit.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -80,7 +80,7 @@ def _write_comment_and_exit_with_error(comment):
8080
def main():
8181
token = sys.argv[1]
8282

83-
gh = github.Github(login_or_token=token)
83+
gh = github.Github(auth=github.Auth.Token(token))
8484
repo = gh.get_repo("llvm/llvm-project")
8585

8686
for release in repo.get_releases():

clang-tools-extra/clang-tidy/.clang-tidy

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,7 @@ Checks: >
1515
cppcoreguidelines-virtual-class-destructor,
1616
google-readability-casting,
1717
misc-const-correctness,
18+
misc-include-cleaner,
1819
modernize-*,
1920
-modernize-avoid-c-arrays,
2021
-modernize-pass-by-value,
@@ -42,3 +43,5 @@ Checks: >
4243
CheckOptions:
4344
- key: performance-move-const-arg.CheckTriviallyCopyableMove
4445
value: false
46+
- key: misc-include-cleaner.MissingIncludes
47+
value: false

clang-tools-extra/clang-tidy/ClangTidy.cpp

Lines changed: 19 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,7 @@
3333
#include "clang/Lex/PreprocessorOptions.h"
3434
#include "clang/Rewrite/Frontend/FixItRewriter.h"
3535
#include "clang/Tooling/Core/Diagnostic.h"
36-
#include "clang/Tooling/DiagnosticsYaml.h"
36+
#include "clang/Tooling/DiagnosticsYaml.h" // IWYU pragma: keep
3737
#include "clang/Tooling/Refactoring.h"
3838
#include "clang/Tooling/Tooling.h"
3939
#include "llvm/Support/Process.h"
@@ -586,6 +586,24 @@ runClangTidy(clang::tidy::ClangTidyContext &Context,
586586
return AdjustedArgs;
587587
};
588588

589+
// Remove unwanted arguments passed to the compiler
590+
const ArgumentsAdjuster PerFileArgumentRemover =
591+
[&Context](const CommandLineArguments &Args, StringRef Filename) {
592+
ClangTidyOptions Opts = Context.getOptionsForFile(Filename);
593+
CommandLineArguments AdjustedArgs = Args;
594+
595+
if (Opts.RemovedArgs) {
596+
for (const StringRef ArgToRemove : *Opts.RemovedArgs) {
597+
AdjustedArgs.erase(std::remove(AdjustedArgs.begin(),
598+
AdjustedArgs.end(), ArgToRemove),
599+
AdjustedArgs.end());
600+
}
601+
}
602+
603+
return AdjustedArgs;
604+
};
605+
606+
Tool.appendArgumentsAdjuster(PerFileArgumentRemover);
589607
Tool.appendArgumentsAdjuster(PerFileExtraArgumentsInserter);
590608
Tool.appendArgumentsAdjuster(getStripPluginsAdjuster());
591609
Context.setEnableProfiling(EnableCheckProfile);

clang-tools-extra/clang-tidy/ClangTidyForceLinker.h

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
//===- ClangTidyForceLinker.h - clang-tidy --------------------------------===//
1+
//===----------------------------------------------------------------------===//
22
//
33
// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
44
// See https://llvm.org/LICENSE.txt for license information.
@@ -10,7 +10,6 @@
1010
#define LLVM_CLANG_TOOLS_EXTRA_CLANG_TIDY_CLANGTIDYFORCELINKER_H
1111

1212
#include "clang-tidy-config.h"
13-
#include "llvm/Support/Compiler.h"
1413

1514
namespace clang::tidy {
1615

clang-tools-extra/clang-tidy/ClangTidyModule.cpp

Lines changed: 6 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -23,9 +23,9 @@ void ClangTidyCheckFactories::registerCheckFactory(StringRef Name,
2323
std::vector<std::unique_ptr<ClangTidyCheck>>
2424
ClangTidyCheckFactories::createChecks(ClangTidyContext *Context) const {
2525
std::vector<std::unique_ptr<ClangTidyCheck>> Checks;
26-
for (const auto &Factory : Factories) {
27-
if (Context->isCheckEnabled(Factory.getKey()))
28-
Checks.emplace_back(Factory.getValue()(Factory.getKey(), Context));
26+
for (const auto &[CheckName, Factory] : Factories) {
27+
if (Context->isCheckEnabled(CheckName))
28+
Checks.emplace_back(Factory(CheckName, Context));
2929
}
3030
return Checks;
3131
}
@@ -35,11 +35,10 @@ ClangTidyCheckFactories::createChecksForLanguage(
3535
ClangTidyContext *Context) const {
3636
std::vector<std::unique_ptr<ClangTidyCheck>> Checks;
3737
const LangOptions &LO = Context->getLangOpts();
38-
for (const auto &Factory : Factories) {
39-
if (!Context->isCheckEnabled(Factory.getKey()))
38+
for (const auto &[CheckName, Factory] : Factories) {
39+
if (!Context->isCheckEnabled(CheckName))
4040
continue;
41-
std::unique_ptr<ClangTidyCheck> Check =
42-
Factory.getValue()(Factory.getKey(), Context);
41+
std::unique_ptr<ClangTidyCheck> Check = Factory(CheckName, Context);
4342
if (Check->isLanguageVersionSupported(LO))
4443
Checks.push_back(std::move(Check));
4544
}

clang-tools-extra/clang-tidy/ClangTidyOptions.cpp

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -232,6 +232,7 @@ template <> struct MappingTraits<ClangTidyOptions> {
232232
IO.mapOptional("CheckOptions", Options.CheckOptions);
233233
IO.mapOptional("ExtraArgs", Options.ExtraArgs);
234234
IO.mapOptional("ExtraArgsBefore", Options.ExtraArgsBefore);
235+
IO.mapOptional("RemovedArgs", Options.RemovedArgs);
235236
IO.mapOptional("InheritParentConfig", Options.InheritParentConfig);
236237
IO.mapOptional("UseColor", Options.UseColor);
237238
IO.mapOptional("SystemHeaders", Options.SystemHeaders);
@@ -254,6 +255,7 @@ ClangTidyOptions ClangTidyOptions::getDefaults() {
254255
Options.SystemHeaders = false;
255256
Options.FormatStyle = "none";
256257
Options.User = std::nullopt;
258+
Options.RemovedArgs = std::nullopt;
257259
for (const ClangTidyModuleRegistry::entry &Module :
258260
ClangTidyModuleRegistry::entries())
259261
Options.mergeWith(Module.instantiate()->getModuleOptions(), 0);
@@ -297,6 +299,7 @@ ClangTidyOptions &ClangTidyOptions::mergeWith(const ClangTidyOptions &Other,
297299
overrideValue(UseColor, Other.UseColor);
298300
mergeVectors(ExtraArgs, Other.ExtraArgs);
299301
mergeVectors(ExtraArgsBefore, Other.ExtraArgsBefore);
302+
mergeVectors(RemovedArgs, Other.RemovedArgs);
300303
// FIXME: how to handle duplicate names check?
301304
mergeVectors(CustomChecks, Other.CustomChecks);
302305
for (const auto &KeyValue : Other.CheckOptions) {

0 commit comments

Comments
 (0)