Skip to content

Commit 381039a

Browse files
authored
Merge branch 'main' into flang_builtin-mods
2 parents 376bbcf + dc3c5a5 commit 381039a

File tree

60 files changed

+2654
-1517
lines changed

Some content is hidden

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

60 files changed

+2654
-1517
lines changed

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>

clang/docs/LibASTMatchersReference.html

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -4222,7 +4222,7 @@ <h2 id="narrowing-matchers">Narrowing Matchers</h2>
42224222
</pre></td></tr>
42234223

42244224

4225-
<tr><td>Matcher&lt;<a href="https://clang.llvm.org/doxygen/classclang_1_1Decl.html">Decl</a>&gt;</td><td class="name" onclick="toggle('isExpandedFromMacro0')"><a name="isExpandedFromMacro0Anchor">isExpandedFromMacro</a></td><td>std::string MacroName</td></tr>
4225+
<tr><td>Matcher&lt;<a href="https://clang.llvm.org/doxygen/classclang_1_1Decl.html">Decl</a>&gt;</td><td class="name" onclick="toggle('isExpandedFromMacro0')"><a name="isExpandedFromMacro0Anchor">isExpandedFromMacro</a></td><td>StringRef MacroName</td></tr>
42264226
<tr><td colspan="4" class="doc" id="isExpandedFromMacro0"><pre>Matches statements that are (transitively) expanded from the named macro.
42274227
Does not match if only part of the statement is expanded from that macro or
42284228
if different parts of the statement are expanded from different
@@ -5643,7 +5643,7 @@ <h2 id="narrowing-matchers">Narrowing Matchers</h2>
56435643
</pre></td></tr>
56445644

56455645

5646-
<tr><td>Matcher&lt;<a href="https://clang.llvm.org/doxygen/classclang_1_1Stmt.html">Stmt</a>&gt;</td><td class="name" onclick="toggle('isExpandedFromMacro1')"><a name="isExpandedFromMacro1Anchor">isExpandedFromMacro</a></td><td>std::string MacroName</td></tr>
5646+
<tr><td>Matcher&lt;<a href="https://clang.llvm.org/doxygen/classclang_1_1Stmt.html">Stmt</a>&gt;</td><td class="name" onclick="toggle('isExpandedFromMacro1')"><a name="isExpandedFromMacro1Anchor">isExpandedFromMacro</a></td><td>StringRef MacroName</td></tr>
56475647
<tr><td colspan="4" class="doc" id="isExpandedFromMacro1"><pre>Matches statements that are (transitively) expanded from the named macro.
56485648
Does not match if only part of the statement is expanded from that macro or
56495649
if different parts of the statement are expanded from different
@@ -5843,7 +5843,7 @@ <h2 id="narrowing-matchers">Narrowing Matchers</h2>
58435843
</pre></td></tr>
58445844

58455845

5846-
<tr><td>Matcher&lt;<a href="https://clang.llvm.org/doxygen/classclang_1_1TypeLoc.html">TypeLoc</a>&gt;</td><td class="name" onclick="toggle('isExpandedFromMacro2')"><a name="isExpandedFromMacro2Anchor">isExpandedFromMacro</a></td><td>std::string MacroName</td></tr>
5846+
<tr><td>Matcher&lt;<a href="https://clang.llvm.org/doxygen/classclang_1_1TypeLoc.html">TypeLoc</a>&gt;</td><td class="name" onclick="toggle('isExpandedFromMacro2')"><a name="isExpandedFromMacro2Anchor">isExpandedFromMacro</a></td><td>StringRef MacroName</td></tr>
58475847
<tr><td colspan="4" class="doc" id="isExpandedFromMacro2"><pre>Matches statements that are (transitively) expanded from the named macro.
58485848
Does not match if only part of the statement is expanded from that macro or
58495849
if different parts of the statement are expanded from different

clang/include/clang/ASTMatchers/ASTMatchers.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -330,7 +330,7 @@ AST_POLYMORPHIC_MATCHER_REGEX(isExpansionInFileMatching,
330330
/// appearances of the macro.
331331
AST_POLYMORPHIC_MATCHER_P(isExpandedFromMacro,
332332
AST_POLYMORPHIC_SUPPORTED_TYPES(Decl, Stmt, TypeLoc),
333-
std::string, MacroName) {
333+
StringRef, MacroName) {
334334
// Verifies that the statement' beginning and ending are both expanded from
335335
// the same instance of the given macro.
336336
auto& Context = Finder->getASTContext();

0 commit comments

Comments
 (0)