Skip to content

Commit b5adde5

Browse files
committed
Merge remote-tracking branch 'official/main' into flang_builtin-mods
2 parents 4d6a94b + c2d659b commit b5adde5

File tree

233 files changed

+5294
-4175
lines changed

Some content is hidden

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

233 files changed

+5294
-4175
lines changed

.ci/premerge_advisor_explain.py

Lines changed: 30 additions & 32 deletions
Original file line numberDiff line numberDiff line change
@@ -79,16 +79,6 @@ def main(
7979
pr_number: The number of the PR associated with this run.
8080
return_code: The numerical return code of ninja/CMake.
8181
"""
82-
if return_code == 0:
83-
with open("comment", "w") as comment_file_handle:
84-
comment = get_comment(
85-
github_token,
86-
pr_number,
87-
":white_check_mark: With the latest revision this PR passed "
88-
"the premerge checks.",
89-
)
90-
if "id" in comment:
91-
json.dump([comment], comment_file_handle)
9282
junit_objects, ninja_logs = generate_test_report_lib.load_info_from_files(
9383
build_log_files
9484
)
@@ -105,34 +95,42 @@ def main(
10595
explanation_request["failures"].append(
10696
{"name": name, "message": failure_messsage}
10797
)
108-
else:
98+
elif return_code != 0:
10999
ninja_failures = generate_test_report_lib.find_failure_in_ninja_logs(ninja_logs)
110100
for name, failure_message in ninja_failures:
111101
explanation_request["failures"].append(
112102
{"name": name, "message": failure_message}
113103
)
114-
advisor_response = requests.get(
115-
PREMERGE_ADVISOR_URL, json=explanation_request, timeout=5
104+
comments = []
105+
advisor_explanations = []
106+
if return_code != 0:
107+
advisor_response = requests.get(
108+
PREMERGE_ADVISOR_URL, json=explanation_request, timeout=5
109+
)
110+
if advisor_response.status_code == 200:
111+
print(advisor_response.json())
112+
advisor_explanations = advisor_response.json()
113+
else:
114+
print(advisor_response.reason)
115+
comments.append(
116+
get_comment(
117+
github_token,
118+
pr_number,
119+
generate_test_report_lib.generate_report(
120+
generate_test_report_lib.compute_platform_title(),
121+
return_code,
122+
junit_objects,
123+
ninja_logs,
124+
failure_explanations_list=advisor_explanations,
125+
),
126+
)
116127
)
117-
if advisor_response.status_code == 200:
118-
print(advisor_response.json())
119-
comments = [
120-
get_comment(
121-
github_token,
122-
pr_number,
123-
generate_test_report_lib.generate_report(
124-
generate_test_report_lib.compute_platform_title(),
125-
return_code,
126-
junit_objects,
127-
ninja_logs,
128-
failure_explanations_list=advisor_response.json(),
129-
),
130-
)
131-
]
132-
with open("comments", "w") as comment_file_handle:
133-
json.dump(comments, comment_file_handle)
134-
else:
135-
print(advisor_response.reason)
128+
if return_code == 0 and "id" not in comments[0]:
129+
# If the job succeeds and there is not an existing comment, we
130+
# should not write one to reduce noise.
131+
comments = []
132+
with open("comments", "w") as comment_file_handle:
133+
json.dump(comments, comment_file_handle)
136134

137135

138136
if __name__ == "__main__":

clang-tools-extra/clang-doc/assets/class-template.mustache

Lines changed: 50 additions & 38 deletions
Original file line numberDiff line numberDiff line change
@@ -50,61 +50,71 @@
5050
<li class="sidebar-section">
5151
<a class="sidebar-item" href="#PublicMembers">Public Members</a>
5252
</li>
53-
<ul>
54-
{{#PublicMembers}}
55-
<li class="sidebar-item-container">
56-
<a class="sidebar-item" href="#{{Name}}">{{Name}}</a>
57-
</li>
58-
{{/PublicMembers}}
59-
</ul>
53+
<li>
54+
<ul>
55+
{{#PublicMembers}}
56+
<li class="sidebar-item-container">
57+
<a class="sidebar-item" href="#{{Name}}">{{Name}}</a>
58+
</li>
59+
{{/PublicMembers}}
60+
</ul>
61+
</li>
6062
{{/HasPublicMembers}}
6163
{{#ProtectedMembers}}
62-
<li class="sidebar-section">
63-
<a class="sidebar-item" href="#PublicMethods">Protected Members</a>
64-
</li>
64+
<li class="sidebar-section">
65+
<a class="sidebar-item" href="#PublicMethods">Protected Members</a>
66+
</li>
67+
<li>
6568
<ul>
6669
{{#Obj}}
6770
<li class="sidebar-item-container">
6871
<a class="sidebar-item" href="#{{Name}}">{{Name}}</a>
6972
</li>
7073
{{/Obj}}
7174
</ul>
75+
</li>
7276
{{/ProtectedMembers}}
7377
{{#HasPublicFunctions}}
7478
<li class="sidebar-section">
7579
<a class="sidebar-item" href="#PublicMethods">Public Method</a>
7680
</li>
77-
<ul>
78-
{{#PublicFunctions}}
79-
<li class="sidebar-item-container">
80-
<a class="sidebar-item" href="#{{USR}}">{{Name}}</a>
81-
</li>
82-
{{/PublicFunctions}}
83-
</ul>
81+
<li>
82+
<ul>
83+
{{#PublicFunctions}}
84+
<li class="sidebar-item-container">
85+
<a class="sidebar-item" href="#{{USR}}">{{Name}}</a>
86+
</li>
87+
{{/PublicFunctions}}
88+
</ul>
89+
</li>
8490
{{/HasPublicFunctions}}
8591
{{#ProtectedFunction}}
8692
<li class="sidebar-section">
8793
<a class="sidebar-item" href="#ProtectedFunction">Protected Method</a>
8894
</li>
89-
<ul>
90-
{{#Obj}}
91-
<li class="sidebar-item-container">
92-
<a class="sidebar-item" href="#{{ID}}">{{Name}}</a>
93-
</li>
94-
{{/Obj}}
95-
</ul>
95+
<li>
96+
<ul>
97+
{{#Obj}}
98+
<li class="sidebar-item-container">
99+
<a class="sidebar-item" href="#{{ID}}">{{Name}}</a>
100+
</li>
101+
{{/Obj}}
102+
</ul>
103+
</li>
96104
{{/ProtectedFunction}}
97105
{{#Enums}}
98106
<li class="sidebar-section">
99107
<a class="sidebar-item" href="#Enums">Enums</a>
100108
</li>
101-
<ul>
102-
{{#Obj}}
103-
<li class="sidebar-item-container">
104-
<a class="sidebar-item" href="#{{USR}}">{{EnumName}}</a>
105-
</li>
106-
{{/Obj}}
107-
</ul>
109+
<li>
110+
<ul>
111+
{{#Obj}}
112+
<li class="sidebar-item-container">
113+
<a class="sidebar-item" href="#{{USR}}">{{EnumName}}</a>
114+
</li>
115+
{{/Obj}}
116+
</ul>
117+
</li>
108118
{{/Enums}}
109119
{{#Typedef}}
110120
<li class="sidebar-section">Typedef</li>
@@ -113,13 +123,15 @@
113123
<li class="sidebar-section">
114124
<a class="sidebar-item" href="#Classes">Inner Classes</a>
115125
</li>
116-
<ul>
117-
{{#Links}}
118-
<li class="sidebar-item-container">
119-
<a class="sidebar-item" href="#{{ID}}">{{Name}}</a>
120-
</li>
121-
{{/Links}}
122-
</ul>
126+
<li>
127+
<ul>
128+
{{#Links}}
129+
<li class="sidebar-item-container">
130+
<a class="sidebar-item" href="#{{ID}}">{{Name}}</a>
131+
</li>
132+
{{/Links}}
133+
</ul>
134+
</li>
123135
{{/Record}}
124136
</ul>
125137
</div>

clang-tools-extra/clang-doc/assets/namespace-template.mustache

Lines changed: 19 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -50,25 +50,29 @@
5050
<li class="sidebar-section">
5151
<a class="sidebar-item" href="#Enums">Enums</a>
5252
</li>
53-
<ul>
54-
{{#Enums}}
55-
<li class="sidebar-item-container">
56-
<a class="sidebar-item" href="#{{USR}}">{{Name}}</a>
57-
</li>
58-
{{/Enums}}
59-
</ul>
53+
<li>
54+
<ul>
55+
{{#Enums}}
56+
<li class="sidebar-item-container">
57+
<a class="sidebar-item" href="#{{USR}}">{{Name}}</a>
58+
</li>
59+
{{/Enums}}
60+
</ul>
61+
</li>
6062
{{/HasEnums}}
6163
{{#HasRecords}}
6264
<li class="sidebar-section">
6365
<a class="sidebar-item" href="#Classes">Inner Classes</a>
6466
</li>
65-
<ul>
66-
{{#Records}}
67-
<li class="sidebar-item-container">
68-
<a class="sidebar-item" href="#{{USR}}">{{Name}}</a>
69-
</li>
70-
{{/Records}}
71-
</ul>
67+
<li>
68+
<ul>
69+
{{#Records}}
70+
<li class="sidebar-item-container">
71+
<a class="sidebar-item" href="#{{USR}}">{{Name}}</a>
72+
</li>
73+
{{/Records}}
74+
</ul>
75+
</li>
7276
{{/HasRecrods}}
7377
</ul>
7478
</div>
@@ -97,8 +101,8 @@
97101
</li>
98102
{{/Records}}
99103
</ul>
100-
{{/HasRecords}}
101104
</section>
105+
{{/HasRecords}}
102106
</div>
103107
</div>
104108
</main>

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

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@ Checks: >
99
-bugprone-narrowing-conversions,
1010
-bugprone-unchecked-optional-access,
1111
-bugprone-unused-return-value,
12+
misc-const-correctness,
1213
modernize-*,
1314
-modernize-avoid-c-arrays,
1415
-modernize-pass-by-value,

clang-tools-extra/clang-tidy/objc/AssertEqualsCheck.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@ void AssertEqualsCheck::registerMatchers(MatchFinder *Finder) {
2525
for (const auto &[CurrName, _] : NameMap) {
2626
Finder->addMatcher(
2727
binaryOperator(anyOf(hasOperatorName("!="), hasOperatorName("==")),
28-
isExpandedFromMacro(std::string(CurrName)),
28+
isExpandedFromMacro(CurrName),
2929
anyOf(hasLHS(hasType(qualType(
3030
hasCanonicalType(asString("NSString *"))))),
3131
hasRHS(hasType(qualType(

clang-tools-extra/clang-tidy/utils/ExceptionAnalyzer.cpp

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -600,13 +600,14 @@ ExceptionAnalyzer::throwsException(const Stmt *St,
600600
// whether the call itself throws.
601601
if (const auto *Call = dyn_cast<CallExpr>(St)) {
602602
if (const FunctionDecl *Func = Call->getDirectCallee()) {
603-
ExceptionInfo Excs =
603+
const ExceptionInfo Excs =
604604
throwsException(Func, Caught, CallStack, Call->getBeginLoc());
605605
Results.merge(Excs);
606606
}
607607
} else if (const auto *Construct = dyn_cast<CXXConstructExpr>(St)) {
608-
ExceptionInfo Excs = throwsException(Construct->getConstructor(), Caught,
609-
CallStack, Construct->getBeginLoc());
608+
const ExceptionInfo Excs =
609+
throwsException(Construct->getConstructor(), Caught, CallStack,
610+
Construct->getBeginLoc());
610611
Results.merge(Excs);
611612
}
612613
}

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

Lines changed: 14 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,25 @@
1+
import os
2+
13
import lit.llvm
24

35
lit.llvm.initialize(lit_config, config)
46
lit.llvm.llvm_config.use_default_substitutions()
57

8+
# TODO: Consolidate the logic for turning on the internal shell by default for all LLVM test suites.
9+
# See https://github.com/llvm/llvm-project/issues/106636 for more details.
10+
#
11+
# We prefer the lit internal shell which provides a better user experience on failures
12+
# and is faster unless the user explicitly disables it with LIT_USE_INTERNAL_SHELL=0
13+
# env var.
14+
use_lit_shell = True
15+
lit_shell_env = os.environ.get("LIT_USE_INTERNAL_SHELL")
16+
if lit_shell_env:
17+
use_lit_shell = lit.util.pythonize_bool(lit_shell_env)
18+
619
config.name = "ClangIncludeCleaner"
720
config.suffixes = [".test", ".c", ".cpp"]
821
config.excludes = ["Inputs"]
9-
config.test_format = lit.formats.ShTest(not lit.llvm.llvm_config.use_lit_shell)
22+
config.test_format = lit.formats.ShTest(not use_lit_shell)
1023
config.test_source_root = config.clang_include_cleaner_source_dir + "/test"
1124
config.test_exec_root = config.clang_include_cleaner_binary_dir + "/test"
1225

clang-tools-extra/test/clang-doc/mustache-index.cpp

Lines changed: 12 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -13,19 +13,21 @@ class Foo;
1313
// CHECK: <li class="sidebar-section">
1414
// CHECK-NEXT: <a class="sidebar-item" href="#Enums">Enums</a>
1515
// CHECK-NEXT: </li>
16-
// CHECK-NEXT: <ul>
17-
// CHECK-NEXT: <li class="sidebar-item-container">
18-
// CHECK-NEXT: <a class="sidebar-item" href="#{{[0-9A-F]*}}">Color</a>
19-
// CHECK-NEXT: </li>
20-
// CHECK-NEXT: </ul>
16+
// CHECK-NEXT: <li>
17+
// CHECK-NEXT: <ul>
18+
// CHECK-NEXT: <li class="sidebar-item-container">
19+
// CHECK-NEXT: <a class="sidebar-item" href="#{{[0-9A-F]*}}">Color</a>
20+
// CHECK-NEXT: </li>
21+
// CHECK-NEXT: </ul>
2122
// CHECK: <li class="sidebar-section">
2223
// CHECK-NEXT: <a class="sidebar-item" href="#Classes">Inner Classes</a>
2324
// CHECK-NEXT: </li>
24-
// CHECK-NEXT: <ul>
25-
// CHECK-NEXT: <li class="sidebar-item-container">
26-
// CHECK-NEXT: <a class="sidebar-item" href="#{{[0-9A-F]*}}">Foo</a>
27-
// CHECK-NEXT: </li>
28-
// CHECK-NEXT: </ul>
25+
// CHECK-NEXT: <li>
26+
// CHECK-NEXT: <ul>
27+
// CHECK-NEXT: <li class="sidebar-item-container">
28+
// CHECK-NEXT: <a class="sidebar-item" href="#{{[0-9A-F]*}}">Foo</a>
29+
// CHECK-NEXT: </li>
30+
// CHECK-NEXT: </ul>
2931

3032
// CHECK: <section id="Enums" class="section-container">
3133
// CHECK-NEXT: <h2>Enumerations</h2>

clang-tools-extra/test/clang-doc/mustache-separate-namespace.cpp

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
// RUN: rm -rf %t && mkdir -p %t
22
// RUN: clang-doc --format=mustache --output=%t --executor=standalone %s
33
// RUN: FileCheck %s < %t/html/MyNamespace/index.html
4+
// RUN: FileCheck %s < %t/html/GlobalNamespace/index.html --check-prefix=CHECK-GLOBAL
45

56
namespace MyNamespace {
67
class Foo;
@@ -13,3 +14,18 @@ namespace MyNamespace {
1314
// CHECK-NEXT: </a>
1415
// CHECK-NEXT: </li>
1516
// CHECK-NEXT: </ul>
17+
18+
// COM: Check that the empty global namespace doesn't contain tag mismatches.
19+
// CHECK-GLOBAL: <main>
20+
// CHECK-GLOBAL-NEXT: <div class="container">
21+
// CHECK-GLOBAL-NEXT: <div class="sidebar">
22+
// CHECK-GLOBAL-NEXT: <h2> </h2>
23+
// CHECK-GLOBAL-NEXT: <ul>
24+
// CHECK-GLOBAL-NEXT: </ul>
25+
// CHECK-GLOBAL-NEXT: </div>
26+
// CHECK-GLOBAL-NEXT: <div class="resizer" id="resizer"></div>
27+
// CHECK-GLOBAL-NEXT: <div class="content">
28+
// CHECK-GLOBAL-EMPTY:
29+
// CHECK-GLOBAL-NEXT: </div>
30+
// CHECK-GLOBAL-NEXT: </div>
31+
// CHECK-GLOBAL-NEXT: </main>

0 commit comments

Comments
 (0)