Skip to content

Commit 4c5d7dd

Browse files
authored
merge main into amd-staging (#645)
2 parents 8ea233f + 0410a9a commit 4c5d7dd

File tree

443 files changed

+82999
-89650
lines changed

Some content is hidden

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

443 files changed

+82999
-89650
lines changed

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -97,8 +97,8 @@
9797
</li>
9898
{{/Records}}
9999
</ul>
100-
{{/HasRecords}}
101100
</section>
101+
{{/HasRecords}}
102102
</div>
103103
</div>
104104
</main>

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/ReleaseNotes.rst

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -933,6 +933,9 @@ AST Matchers
933933

934934
- ``hasConditionVariableStatement`` now supports ``for`` loop, ``while`` loop
935935
and ``switch`` statements.
936+
- Fixed detection of explicit parameter lists in ``LambdaExpr``. (#GH168452)
937+
- Added ``hasExplicitParameters`` for ``LambdaExpr`` as an output attribute to
938+
AST JSON dumps.
936939

937940
clang-format
938941
------------

clang/docs/TypeSanitizer.rst

Lines changed: 11 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -20,9 +20,9 @@ code is build with ``-fno-strict-aliasing``, sacrificing performance.
2020
TypeSanitizer is built to catch when these strict aliasing rules have been violated, helping
2121
users find where such bugs originate in their code despite the code looking valid at first glance.
2222

23-
As TypeSanitizer is still experimental, it can currently have a large impact on runtime speed,
24-
memory use, and code size. It also has a large compile-time overhead. Work is being done to
25-
reduce these impacts.
23+
Typical memory overhead introduced by TypeSanitizer is about **8x**. Runtime slowdown varies greatly
24+
depending on how often the instrumented code relies on type aliasing. In the best case slowdown is
25+
**2x-3x**.
2626

2727
The TypeSanitizer Algorithm
2828
===========================
@@ -128,6 +128,14 @@ references to LLVM IR specific terms.
128128
Sanitizer features
129129
==================
130130

131+
Instrumentation code inlining
132+
------------------------------
133+
134+
By default TypeSanitizer inserts instrumentation through function calls. This may lead to a reduction in
135+
runtime performance. ``-fno-sanitize-type-outline-instrumentation`` (default: ``false``) forces all
136+
code instrumentation to be inlined. This will increase the size of the generated code and compiler
137+
overhead, but may improve the runtime performance of the resulting code.
138+
131139
``__has_feature(type_sanitizer)``
132140
------------------------------------
133141

@@ -179,10 +187,6 @@ Limitations
179187
shadow memory for each byte of user memory.
180188
* There are transformation passes which run before TypeSanitizer. If these
181189
passes optimize out an aliasing violation, TypeSanitizer cannot catch it.
182-
* Currently, all instrumentation is inlined. This can result in a **15x**
183-
(on average) increase in generated file size, and **3x** to **7x** increase
184-
in compile time. In some documented cases this can cause the compiler to hang.
185-
There are plans to improve this in the future.
186190
* Codebases that use unions and struct-initialized variables can see incorrect
187191
results, as TypeSanitizer doesn't yet instrument these reliably.
188192
* Since Clang & LLVM's TBAA system is used to generate the checks used by the

clang/docs/UsersManual.rst

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2277,6 +2277,15 @@ are listed below.
22772277

22782278
See :doc: `AddressSanitizer` for more details.
22792279

2280+
.. option:: -f[no-]sanitize-type-outline-instrumentation
2281+
2282+
Controls how type sanitizer code is generated. If enabled will always use
2283+
a function call instead of inlining the code. Turning this option off may
2284+
result in better run-time performance, but will increase binary size and
2285+
compilation overhead.
2286+
2287+
See :doc: `TypeSanitizer` for more details.
2288+
22802289
.. option:: -f[no-]sanitize-stats
22812290

22822291
Enable simple statistics gathering for the enabled sanitizers.

clang/include/clang/AST/ExprCXX.h

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -978,8 +978,7 @@ class MSPropertyRefExpr : public Expr {
978978
}
979979

980980
const_child_range children() const {
981-
auto Children = const_cast<MSPropertyRefExpr *>(this)->children();
982-
return const_child_range(Children.begin(), Children.end());
981+
return const_cast<MSPropertyRefExpr *>(this)->children();
983982
}
984983

985984
static bool classof(const Stmt *T) {
@@ -1741,8 +1740,7 @@ class CXXConstructExpr : public Expr {
17411740
}
17421741

17431742
const_child_range children() const {
1744-
auto Children = const_cast<CXXConstructExpr *>(this)->children();
1745-
return const_child_range(Children.begin(), Children.end());
1743+
return const_cast<CXXConstructExpr *>(this)->children();
17461744
}
17471745
};
17481746

clang/include/clang/AST/ExprObjC.h

Lines changed: 3 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -247,8 +247,7 @@ class ObjCArrayLiteral final
247247
}
248248

249249
const_child_range children() const {
250-
auto Children = const_cast<ObjCArrayLiteral *>(this)->children();
251-
return const_child_range(Children.begin(), Children.end());
250+
return const_cast<ObjCArrayLiteral *>(this)->children();
252251
}
253252

254253
static bool classof(const Stmt *T) {
@@ -394,8 +393,7 @@ class ObjCDictionaryLiteral final
394393
}
395394

396395
const_child_range children() const {
397-
auto Children = const_cast<ObjCDictionaryLiteral *>(this)->children();
398-
return const_child_range(Children.begin(), Children.end());
396+
return const_cast<ObjCDictionaryLiteral *>(this)->children();
399397
}
400398

401399
static bool classof(const Stmt *T) {
@@ -790,8 +788,7 @@ class ObjCPropertyRefExpr : public Expr {
790788
}
791789

792790
const_child_range children() const {
793-
auto Children = const_cast<ObjCPropertyRefExpr *>(this)->children();
794-
return const_child_range(Children.begin(), Children.end());
791+
return const_cast<ObjCPropertyRefExpr *>(this)->children();
795792
}
796793

797794
static bool classof(const Stmt *T) {

clang/include/clang/AST/JSONNodeDumper.h

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -315,6 +315,7 @@ class JSONNodeDumper
315315
void VisitRequiresExpr(const RequiresExpr *RE);
316316
void VisitCXXDefaultArgExpr(const CXXDefaultArgExpr *Node);
317317
void VisitCXXDefaultInitExpr(const CXXDefaultInitExpr *Node);
318+
void VisitLambdaExpr(const LambdaExpr *LE);
318319

319320
void VisitObjCEncodeExpr(const ObjCEncodeExpr *OEE);
320321
void VisitObjCMessageExpr(const ObjCMessageExpr *OME);

clang/include/clang/AST/OpenACCClause.h

Lines changed: 3 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -51,8 +51,7 @@ class OpenACCClause {
5151

5252
child_range children();
5353
const_child_range children() const {
54-
auto Children = const_cast<OpenACCClause *>(this)->children();
55-
return const_child_range(Children.begin(), Children.end());
54+
return const_cast<OpenACCClause *>(this)->children();
5655
}
5756

5857
virtual ~OpenACCClause() = default;
@@ -474,8 +473,7 @@ class OpenACCSelfClause final
474473
}
475474

476475
const_child_range children() const {
477-
child_range Children = const_cast<OpenACCSelfClause *>(this)->children();
478-
return const_child_range(Children.begin(), Children.end());
476+
return const_cast<OpenACCSelfClause *>(this)->children();
479477
}
480478

481479
static OpenACCSelfClause *Create(const ASTContext &C, SourceLocation BeginLoc,
@@ -523,9 +521,7 @@ class OpenACCClauseWithExprs : public OpenACCClauseWithParams {
523521
}
524522

525523
const_child_range children() const {
526-
child_range Children =
527-
const_cast<OpenACCClauseWithExprs *>(this)->children();
528-
return const_child_range(Children.begin(), Children.end());
524+
return const_cast<OpenACCClauseWithExprs *>(this)->children();
529525
}
530526
};
531527

0 commit comments

Comments
 (0)