Skip to content

Commit 3f94e1b

Browse files
authored
Merge branch 'main' into allocate_directive_mlir
2 parents 4c1539c + f56b6ec commit 3f94e1b

File tree

489 files changed

+17702
-6198
lines changed

Some content is hidden

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

489 files changed

+17702
-6198
lines changed

.ci/generate_test_report_github.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -16,8 +16,8 @@
1616
parser.add_argument("junit_files", help="Paths to JUnit report files.", nargs="*")
1717
args = parser.parse_args()
1818

19-
report, _ = generate_test_report_lib.generate_report_from_files(
20-
args.title, args.return_code, args.junit_files, None
19+
report = generate_test_report_lib.generate_report_from_files(
20+
args.title, args.return_code, args.junit_files
2121
)
2222

2323
print(report)

.ci/generate_test_report_lib.py

Lines changed: 33 additions & 42 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,14 @@
55

66
from junitparser import JUnitXml, Failure
77

8+
SEE_BUILD_FILE_STR = "Download the build's log file to see the details."
9+
UNRELATED_FAILURES_STR = (
10+
"If these failures are unrelated to your changes (for example "
11+
"tests are broken or flaky at HEAD), please open an issue at "
12+
"https://github.com/llvm/llvm-project/issues and add the "
13+
"`infrastructure` label."
14+
)
15+
816

917
# Set size_limit to limit the byte size of the report. The default is 1MB as this
1018
# is the most that can be put into an annotation. If the generated report exceeds
@@ -18,16 +26,7 @@ def generate_report(
1826
junit_objects,
1927
size_limit=1024 * 1024,
2028
list_failures=True,
21-
buildkite_info=None,
2229
):
23-
if not junit_objects:
24-
# Note that we do not post an empty report, therefore we can ignore a
25-
# non-zero return code in situations like this.
26-
#
27-
# If we were going to post a report, then yes, it would be misleading
28-
# to say we succeeded when the final return code was non-zero.
29-
return ("", "success")
30-
3130
failures = {}
3231
tests_run = 0
3332
tests_skipped = 0
@@ -51,16 +50,28 @@ def generate_report(
5150
(test.classname + "/" + test.name, test.result[0].text)
5251
)
5352

54-
if not tests_run:
55-
return ("", None)
56-
57-
style = "success"
58-
# Either tests failed, or all tests passed but something failed to build.
59-
if tests_failed or return_code != 0:
60-
style = "error"
61-
6253
report = [f"# {title}", ""]
6354

55+
if tests_run == 0:
56+
if return_code == 0:
57+
report.extend(
58+
[
59+
"The build succeeded and no tests ran. This is expected in some "
60+
"build configurations."
61+
]
62+
)
63+
else:
64+
report.extend(
65+
[
66+
"The build failed before running any tests.",
67+
"",
68+
SEE_BUILD_FILE_STR,
69+
"",
70+
UNRELATED_FAILURES_STR,
71+
]
72+
)
73+
return "\n".join(report)
74+
6475
tests_passed = tests_run - tests_skipped - tests_failed
6576

6677
def plural(num_tests):
@@ -73,22 +84,12 @@ def plural(num_tests):
7384
if tests_failed:
7485
report.append(f"* {tests_failed} {plural(tests_failed)} failed")
7586

76-
if buildkite_info is not None:
77-
log_url = (
78-
"https://buildkite.com/organizations/{BUILDKITE_ORGANIZATION_SLUG}/"
79-
"pipelines/{BUILDKITE_PIPELINE_SLUG}/builds/{BUILDKITE_BUILD_NUMBER}/"
80-
"jobs/{BUILDKITE_JOB_ID}/download.txt".format(**buildkite_info)
81-
)
82-
download_text = f"[Download]({log_url})"
83-
else:
84-
download_text = "Download"
85-
8687
if not list_failures:
8788
report.extend(
8889
[
8990
"",
9091
"Failed tests and their output was too large to report. "
91-
f"{download_text} the build's log file to see the details.",
92+
+ SEE_BUILD_FILE_STR,
9293
]
9394
)
9495
elif failures:
@@ -118,20 +119,12 @@ def plural(num_tests):
118119
"",
119120
"All tests passed but another part of the build **failed**.",
120121
"",
121-
f"{download_text} the build's log file to see the details.",
122+
SEE_BUILD_FILE_STR,
122123
]
123124
)
124125

125126
if failures or return_code != 0:
126-
report.extend(
127-
[
128-
"",
129-
"If these failures are unrelated to your changes (for example "
130-
"tests are broken or flaky at HEAD), please open an issue at "
131-
"https://github.com/llvm/llvm-project/issues and add the "
132-
"`infrastructure` label.",
133-
]
134-
)
127+
report.extend(["", UNRELATED_FAILURES_STR])
135128

136129
report = "\n".join(report)
137130
if len(report.encode("utf-8")) > size_limit:
@@ -141,16 +134,14 @@ def plural(num_tests):
141134
junit_objects,
142135
size_limit,
143136
list_failures=False,
144-
buildkite_info=buildkite_info,
145137
)
146138

147-
return report, style
139+
return report
148140

149141

150-
def generate_report_from_files(title, return_code, junit_files, buildkite_info):
142+
def generate_report_from_files(title, return_code, junit_files):
151143
return generate_report(
152144
title,
153145
return_code,
154146
[JUnitXml.fromfile(p) for p in junit_files],
155-
buildkite_info=buildkite_info,
156147
)

.ci/generate_test_report_lib_test.py

Lines changed: 42 additions & 33 deletions
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,28 @@ def junit_from_xml(xml):
2121
class TestReports(unittest.TestCase):
2222
def test_title_only(self):
2323
self.assertEqual(
24-
generate_test_report_lib.generate_report("Foo", 0, []), ("", "success")
24+
generate_test_report_lib.generate_report("Foo", 0, []),
25+
dedent(
26+
"""\
27+
# Foo
28+
29+
The build succeeded and no tests ran. This is expected in some build configurations."""
30+
),
31+
)
32+
33+
def test_title_only_failure(self):
34+
self.assertEqual(
35+
generate_test_report_lib.generate_report("Foo", 1, []),
36+
dedent(
37+
"""\
38+
# Foo
39+
40+
The build failed before running any tests.
41+
42+
Download the build's log file to see the details.
43+
44+
If these failures are unrelated to your changes (for example tests are broken or flaky at HEAD), please open an issue at https://github.com/llvm/llvm-project/issues and add the `infrastructure` label."""
45+
),
2546
)
2647

2748
def test_no_tests_in_testsuite(self):
@@ -42,7 +63,16 @@ def test_no_tests_in_testsuite(self):
4263
)
4364
],
4465
),
45-
("", None),
66+
dedent(
67+
"""\
68+
# Foo
69+
70+
The build failed before running any tests.
71+
72+
Download the build's log file to see the details.
73+
74+
If these failures are unrelated to your changes (for example tests are broken or flaky at HEAD), please open an issue at https://github.com/llvm/llvm-project/issues and add the `infrastructure` label."""
75+
),
4676
)
4777

4878
def test_no_failures(self):
@@ -70,8 +100,7 @@ def test_no_failures(self):
70100
# Foo
71101
72102
* 1 test passed"""
73-
),
74-
"success",
103+
)
75104
),
76105
)
77106

@@ -93,12 +122,6 @@ def test_no_failures_build_failed(self):
93122
)
94123
)
95124
],
96-
buildkite_info={
97-
"BUILDKITE_ORGANIZATION_SLUG": "organization_slug",
98-
"BUILDKITE_PIPELINE_SLUG": "pipeline_slug",
99-
"BUILDKITE_BUILD_NUMBER": "build_number",
100-
"BUILDKITE_JOB_ID": "job_id",
101-
},
102125
),
103126
(
104127
dedent(
@@ -109,11 +132,10 @@ def test_no_failures_build_failed(self):
109132
110133
All tests passed but another part of the build **failed**.
111134
112-
[Download](https://buildkite.com/organizations/organization_slug/pipelines/pipeline_slug/builds/build_number/jobs/job_id/download.txt) the build's log file to see the details.
135+
Download the build's log file to see the details.
113136
114137
If these failures are unrelated to your changes (for example tests are broken or flaky at HEAD), please open an issue at https://github.com/llvm/llvm-project/issues and add the `infrastructure` label."""
115-
),
116-
"error",
138+
)
117139
),
118140
)
119141

@@ -174,14 +196,12 @@ def test_report_single_file_single_testsuite(self):
174196
</details>
175197
176198
If these failures are unrelated to your changes (for example tests are broken or flaky at HEAD), please open an issue at https://github.com/llvm/llvm-project/issues and add the `infrastructure` label."""
177-
),
178-
"error",
199+
)
179200
),
180201
)
181202

182-
MULTI_SUITE_OUTPUT = (
183-
dedent(
184-
"""\
203+
MULTI_SUITE_OUTPUT = dedent(
204+
"""\
185205
# ABC and DEF
186206
187207
* 1 test passed
@@ -210,8 +230,6 @@ def test_report_single_file_single_testsuite(self):
210230
</details>
211231
212232
If these failures are unrelated to your changes (for example tests are broken or flaky at HEAD), please open an issue at https://github.com/llvm/llvm-project/issues and add the `infrastructure` label."""
213-
),
214-
"error",
215233
)
216234

217235
def test_report_single_file_multiple_testsuites(self):
@@ -320,8 +338,7 @@ def test_report_dont_list_failures(self):
320338
Failed tests and their output was too large to report. Download the build's log file to see the details.
321339
322340
If these failures are unrelated to your changes (for example tests are broken or flaky at HEAD), please open an issue at https://github.com/llvm/llvm-project/issues and add the `infrastructure` label."""
323-
),
324-
"error",
341+
)
325342
),
326343
)
327344

@@ -346,12 +363,6 @@ def test_report_dont_list_failures_link_to_log(self):
346363
)
347364
],
348365
list_failures=False,
349-
buildkite_info={
350-
"BUILDKITE_ORGANIZATION_SLUG": "organization_slug",
351-
"BUILDKITE_PIPELINE_SLUG": "pipeline_slug",
352-
"BUILDKITE_BUILD_NUMBER": "build_number",
353-
"BUILDKITE_JOB_ID": "job_id",
354-
},
355366
),
356367
(
357368
dedent(
@@ -360,11 +371,10 @@ def test_report_dont_list_failures_link_to_log(self):
360371
361372
* 1 test failed
362373
363-
Failed tests and their output was too large to report. [Download](https://buildkite.com/organizations/organization_slug/pipelines/pipeline_slug/builds/build_number/jobs/job_id/download.txt) the build's log file to see the details.
374+
Failed tests and their output was too large to report. Download the build's log file to see the details.
364375
365376
If these failures are unrelated to your changes (for example tests are broken or flaky at HEAD), please open an issue at https://github.com/llvm/llvm-project/issues and add the `infrastructure` label."""
366-
),
367-
"error",
377+
)
368378
),
369379
)
370380

@@ -403,7 +413,6 @@ def test_report_size_limit(self):
403413
Failed tests and their output was too large to report. Download the build's log file to see the details.
404414
405415
If these failures are unrelated to your changes (for example tests are broken or flaky at HEAD), please open an issue at https://github.com/llvm/llvm-project/issues and add the `infrastructure` label."""
406-
),
407-
"error",
416+
)
408417
),
409418
)

clang-tools-extra/clangd/test/lit.cfg.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
import lit.llvm
22

33
lit.llvm.initialize(lit_config, config)
4-
lit.llvm.llvm_config.use_clang([], [], required=False)
4+
lit.llvm.llvm_config.clang_setup()
55
lit.llvm.llvm_config.use_default_substitutions()
66

77
config.name = "Clangd"

clang-tools-extra/test/lit.cfg.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,7 @@
4242
config.test_exec_root = os.path.join(config.clang_tools_binary_dir, "test")
4343

4444
# Tools need the same environment setup as clang (we don't need clang itself).
45-
llvm_config.use_clang(required=False)
45+
llvm_config.clang_setup()
4646

4747
if config.clang_tidy_staticanalyzer:
4848
config.available_features.add("static-analyzer")

clang/docs/ReleaseNotes.rst

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -928,13 +928,17 @@ Bug Fixes to C++ Support
928928
- Fixed a crash when constant evaluating some explicit object member assignment operators. (#GH142835)
929929
- Fixed an access checking bug when substituting into concepts (#GH115838)
930930
- Fix a bug where private access specifier of overloaded function not respected. (#GH107629)
931+
- Correctly handles calling an explicit object member function template overload set
932+
through its address (``(&Foo::bar<baz>)()``).
931933
- Correctly handle allocations in the condition of a ``if constexpr``.(#GH120197) (#GH134820)
932934
- Fixed a crash when handling invalid member using-declaration in C++20+ mode. (#GH63254)
935+
- Fixed parsing of lambda expressions that appear after ``*`` or ``&`` in contexts where a declaration can appear. (#GH63880)
933936
- Fix name lookup in lambda appearing in the body of a requires expression. (#GH147650)
934937
- Fix a crash when trying to instantiate an ambiguous specialization. (#GH51866)
935938
- Improved handling of variables with ``consteval`` constructors, to
936939
consistently treat the initializer as manifestly constant-evaluated.
937940
(#GH135281)
941+
- Fix a crash in the presence of invalid base classes. (#GH147186)
938942

939943
Bug Fixes to AST Handling
940944
^^^^^^^^^^^^^^^^^^^^^^^^^
@@ -1235,6 +1239,7 @@ OpenMP Support
12351239
- Fixed mapping of arrays of structs containing nested structs with user defined
12361240
mappers, by using compiler-generated default mappers for the outer structs for
12371241
such maps.
1242+
- Deprecation warning has been emitted for deprecated delimited form of ``declare target``.
12381243

12391244
Improvements
12401245
^^^^^^^^^^^^

clang/include/clang/Basic/DiagnosticParseKinds.td

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1574,6 +1574,9 @@ def err_omp_declare_target_multiple : Error<
15741574
"%0 appears multiple times in clauses on the same declare target directive">;
15751575
def err_omp_declare_target_indirect_device_type: Error<
15761576
"only 'device_type(any)' clause is allowed with indirect clause">;
1577+
def warn_omp_deprecated_declare_target_delimited_form :
1578+
Warning<"the delimited form of '#pragma omp declare target' without clauses is deprecated; use '#pragma omp begin declare target' instead">,
1579+
InGroup<Deprecated>;
15771580
def err_omp_expected_clause: Error<
15781581
"expected at least one clause on '#pragma omp %0' directive">;
15791582
def err_omp_mapper_illegal_identifier : Error<

clang/include/clang/Lex/TokenLexer.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -65,7 +65,7 @@ class TokenLexer {
6565

6666
/// The offset of the macro expansion in the
6767
/// "source location address space".
68-
unsigned MacroStartSLocOffset;
68+
SourceLocation::UIntTy MacroStartSLocOffset;
6969

7070
/// Location of the macro definition.
7171
SourceLocation MacroDefStart;

clang/include/clang/Sema/Sema.h

Lines changed: 1 addition & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -12501,6 +12501,7 @@ class Sema final : public SemaBase {
1250112501
sema::TemplateDeductionInfo &Info,
1250212502
SmallVectorImpl<OriginalCallArg> const *OriginalCallArgs,
1250312503
bool PartialOverloading, bool PartialOrdering,
12504+
bool ForOverloadSetAddressResolution,
1250412505
llvm::function_ref<bool(bool)> CheckNonDependent =
1250512506
[](bool /*OnlyInitializeNonUserDefinedConversions*/) {
1250612507
return false;
@@ -13318,18 +13319,6 @@ class Sema final : public SemaBase {
1331813319
/// \param ForDefaultArgumentSubstitution indicates we should continue looking
1331913320
/// when encountering a specialized member function template, rather than
1332013321
/// returning immediately.
13321-
void getTemplateInstantiationArgs(
13322-
MultiLevelTemplateArgumentList &Result, const NamedDecl *D,
13323-
const DeclContext *DC = nullptr, bool Final = false,
13324-
std::optional<ArrayRef<TemplateArgument>> Innermost = std::nullopt,
13325-
bool RelativeToPrimary = false, const FunctionDecl *Pattern = nullptr,
13326-
bool ForConstraintInstantiation = false,
13327-
bool SkipForSpecialization = false,
13328-
bool ForDefaultArgumentSubstitution = false);
13329-
13330-
/// This creates a new \p MultiLevelTemplateArgumentList and invokes the other
13331-
/// overload with it as the first parameter. Prefer this overload in most
13332-
/// situations.
1333313322
MultiLevelTemplateArgumentList getTemplateInstantiationArgs(
1333413323
const NamedDecl *D, const DeclContext *DC = nullptr, bool Final = false,
1333513324
std::optional<ArrayRef<TemplateArgument>> Innermost = std::nullopt,

0 commit comments

Comments
 (0)