Skip to content

Commit 4034e2f

Browse files
authored
Merge branch 'main' into users/ojhunt/P2719
2 parents 80154c2 + 38b0e1c commit 4034e2f

File tree

770 files changed

+128645
-135183
lines changed

Some content is hidden

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

770 files changed

+128645
-135183
lines changed

bolt/lib/Rewrite/PseudoProbeRewriter.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -127,8 +127,8 @@ void PseudoProbeRewriter::parsePseudoProbe(bool ProfiledOnly) {
127127

128128
StringRef Contents = PseudoProbeDescSection->getContents();
129129
if (!ProbeDecoder.buildGUID2FuncDescMap(
130-
reinterpret_cast<const uint8_t *>(Contents.data()),
131-
Contents.size())) {
130+
reinterpret_cast<const uint8_t *>(Contents.data()), Contents.size(),
131+
/*IsMMapped*/ true)) {
132132
errs() << "BOLT-WARNING: fail in building GUID2FuncDescMap\n";
133133
return;
134134
}

clang-tools-extra/clang-tidy/bugprone/ThrowKeywordMissingCheck.cpp

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -15,9 +15,6 @@ using namespace clang::ast_matchers;
1515
namespace clang::tidy::bugprone {
1616

1717
void ThrowKeywordMissingCheck::registerMatchers(MatchFinder *Finder) {
18-
auto CtorInitializerList =
19-
cxxConstructorDecl(hasAnyConstructorInitializer(anything()));
20-
2118
Finder->addMatcher(
2219
cxxConstructExpr(
2320
hasType(cxxRecordDecl(
@@ -27,7 +24,7 @@ void ThrowKeywordMissingCheck::registerMatchers(MatchFinder *Finder) {
2724
stmt(anyOf(cxxThrowExpr(), callExpr(), returnStmt()))),
2825
hasAncestor(decl(anyOf(varDecl(), fieldDecl()))),
2926
hasAncestor(expr(cxxNewExpr(hasAnyPlacementArg(anything())))),
30-
allOf(hasAncestor(CtorInitializerList),
27+
allOf(hasAncestor(cxxConstructorDecl()),
3128
unless(hasAncestor(cxxCatchStmt()))))))
3229
.bind("temporary-exception-not-thrown"),
3330
this);

clang-tools-extra/docs/ReleaseNotes.rst

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -177,6 +177,10 @@ Changes in existing checks
177177
usages of ``sizeof()``, ``alignof()``, and ``offsetof()`` when adding or
178178
subtracting from a pointer directly or when used to scale a numeric value.
179179

180+
- Improved :doc:`bugprone-throw-keyword-missing
181+
<clang-tidy/checks/bugprone/throw-keyword-missing>` by fixing a false positive
182+
when using non-static member initializers and a constructor.
183+
180184
- Improved :doc:`bugprone-unchecked-optional-access
181185
<clang-tidy/checks/bugprone/unchecked-optional-access>` to support
182186
`bsl::optional` and `bdlb::NullableValue` from

clang-tools-extra/test/clang-tidy/checkers/bugprone/throw-keyword-missing.cpp

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -139,6 +139,15 @@ CtorInitializerListTest::CtorInitializerListTest(float) try : exc(RegularExcepti
139139
RegularException();
140140
}
141141

142+
namespace GH115055 {
143+
class CtorInitializerListTest2 {
144+
public:
145+
CtorInitializerListTest2() {}
146+
private:
147+
RegularException exc{};
148+
};
149+
} // namespace GH115055
150+
142151
RegularException funcReturningExceptionTest(int i) {
143152
return RegularException();
144153
}

clang/lib/Headers/amxavx512intrin.h

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@
1212

1313
#ifndef __AMX_AVX512INTRIN_H
1414
#define __AMX_AVX512INTRIN_H
15-
#ifdef __x86_64__
15+
#if defined(__x86_64__) && defined(__SSE2__)
1616

1717
#define __DEFAULT_FN_ATTRS_AVX512 \
1818
__attribute__((__always_inline__, __nodebug__, \
@@ -378,5 +378,5 @@ static __m512i __tile_movrow(__tile1024i src0, unsigned src1) {
378378
return (__m512i)_tile_movrow_internal(src0.row, src0.col, src0.tile, src1);
379379
}
380380

381-
#endif // __x86_64__
381+
#endif // __x86_64__ && __SSE2__
382382
#endif // __AMX_AVX512INTRIN_H

clang/lib/Sema/HLSLExternalSemaSource.cpp

Lines changed: 26 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -502,8 +502,8 @@ void HLSLExternalSemaSource::defineHLSLTypesWithForwardDeclarations() {
502502
.addSimpleTemplateParams(*SemaPtr, {"element_type"})
503503
.Record;
504504
onCompletion(Decl, [this](CXXRecordDecl *Decl) {
505-
setupBufferType(Decl, *SemaPtr, ResourceClass::SRV,
506-
ResourceKind::TypedBuffer, /*IsROV=*/false,
505+
setupBufferType(Decl, *SemaPtr, ResourceClass::SRV, ResourceKind::RawBuffer,
506+
/*IsROV=*/false,
507507
/*RawBuffer=*/true)
508508
.addArraySubscriptOperators()
509509
.completeDefinition();
@@ -513,13 +513,35 @@ void HLSLExternalSemaSource::defineHLSLTypesWithForwardDeclarations() {
513513
.addSimpleTemplateParams(*SemaPtr, {"element_type"})
514514
.Record;
515515
onCompletion(Decl, [this](CXXRecordDecl *Decl) {
516-
setupBufferType(Decl, *SemaPtr, ResourceClass::UAV,
517-
ResourceKind::TypedBuffer, /*IsROV=*/false,
516+
setupBufferType(Decl, *SemaPtr, ResourceClass::UAV, ResourceKind::RawBuffer,
517+
/*IsROV=*/false,
518518
/*RawBuffer=*/true)
519519
.addArraySubscriptOperators()
520520
.completeDefinition();
521521
});
522522

523+
Decl =
524+
BuiltinTypeDeclBuilder(*SemaPtr, HLSLNamespace, "AppendStructuredBuffer")
525+
.addSimpleTemplateParams(*SemaPtr, {"element_type"})
526+
.Record;
527+
onCompletion(Decl, [this](CXXRecordDecl *Decl) {
528+
setupBufferType(Decl, *SemaPtr, ResourceClass::UAV, ResourceKind::RawBuffer,
529+
/*IsROV=*/false,
530+
/*RawBuffer=*/true)
531+
.completeDefinition();
532+
});
533+
534+
Decl =
535+
BuiltinTypeDeclBuilder(*SemaPtr, HLSLNamespace, "ConsumeStructuredBuffer")
536+
.addSimpleTemplateParams(*SemaPtr, {"element_type"})
537+
.Record;
538+
onCompletion(Decl, [this](CXXRecordDecl *Decl) {
539+
setupBufferType(Decl, *SemaPtr, ResourceClass::UAV, ResourceKind::RawBuffer,
540+
/*IsROV=*/false,
541+
/*RawBuffer=*/true)
542+
.completeDefinition();
543+
});
544+
523545
Decl = BuiltinTypeDeclBuilder(*SemaPtr, HLSLNamespace,
524546
"RasterizerOrderedStructuredBuffer")
525547
.addSimpleTemplateParams(*SemaPtr, {"element_type"})
Lines changed: 50 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,50 @@
1+
// RUN: %clang_cc1 -triple dxil-pc-shadermodel6.0-library -x hlsl -ast-dump -DEMPTY %s | FileCheck -check-prefix=EMPTY %s
2+
// RUN: %clang_cc1 -triple dxil-pc-shadermodel6.0-library -x hlsl -ast-dump %s | FileCheck %s
3+
4+
5+
// This test tests two different AST generations. The "EMPTY" test mode verifies
6+
// the AST generated by forward declaration of the HLSL types which happens on
7+
// initializing the HLSL external AST with an AST Context.
8+
9+
// The non-empty mode has a use that requires the AppendStructuredBuffer type be complete,
10+
// which results in the AST being populated by the external AST source. That
11+
// case covers the full implementation of the template declaration and the
12+
// instantiated specialization.
13+
14+
// EMPTY: ClassTemplateDecl 0x{{[0-9A-Fa-f]+}} <<invalid sloc>> <invalid sloc> implicit AppendStructuredBuffer
15+
// EMPTY-NEXT: TemplateTypeParmDecl 0x{{[0-9A-Fa-f]+}} <<invalid sloc>> <invalid sloc> class depth 0 index 0 element_type
16+
// EMPTY-NEXT: CXXRecordDecl 0x{{[0-9A-Fa-f]+}} <<invalid sloc>> <invalid sloc> implicit <undeserialized declarations> class AppendStructuredBuffer
17+
// EMPTY-NEXT: FinalAttr 0x{{[0-9A-Fa-f]+}} <<invalid sloc>> Implicit final
18+
19+
// There should be no more occurrences of AppendStructuredBuffer
20+
// EMPTY-NOT: {{[^[:alnum:]]}}AppendStructuredBuffer
21+
22+
#ifndef EMPTY
23+
24+
AppendStructuredBuffer<int> Buffer;
25+
26+
#endif
27+
28+
// CHECK: ClassTemplateDecl 0x{{[0-9A-Fa-f]+}} <<invalid sloc>> <invalid sloc> implicit AppendStructuredBuffer
29+
// CHECK-NEXT: TemplateTypeParmDecl 0x{{[0-9A-Fa-f]+}} <<invalid sloc>> <invalid sloc> class depth 0 index 0 element_type
30+
// CHECK-NEXT: CXXRecordDecl 0x{{[0-9A-Fa-f]+}} <<invalid sloc>> <invalid sloc> implicit class AppendStructuredBuffer definition
31+
32+
// CHECK: FinalAttr 0x{{[0-9A-Fa-f]+}} <<invalid sloc>> Implicit final
33+
// CHECK-NEXT: FieldDecl 0x{{[0-9A-Fa-f]+}} <<invalid sloc>> <invalid sloc> implicit h '__hlsl_resource_t
34+
// CHECK-SAME{LITERAL}: [[hlsl::resource_class(UAV)]]
35+
// CHECK-SAME{LITERAL}: [[hlsl::raw_buffer]]
36+
// CHECK-SAME{LITERAL}: [[hlsl::contained_type(element_type)]]
37+
// CHECK-NEXT: HLSLResourceAttr 0x{{[0-9A-Fa-f]+}} <<invalid sloc>> Implicit RawBuffer
38+
39+
// CHECK-NOT: CXXMethodDecl 0x{{[0-9A-Fa-f]+}} <<invalid sloc>> <invalid sloc> operator[] 'element_type &const (unsigned int) const'
40+
// CHECK-NOT: CXXMethodDecl 0x{{[0-9A-Fa-f]+}} <<invalid sloc>> <invalid sloc> operator[] 'element_type &(unsigned int)'
41+
42+
// CHECK: ClassTemplateSpecializationDecl 0x{{[0-9A-Fa-f]+}} <<invalid sloc>> <invalid sloc> class AppendStructuredBuffer definition
43+
// CHECK: TemplateArgument type 'int'
44+
// CHECK-NEXT: BuiltinType 0x{{[0-9A-Fa-f]+}} 'int'
45+
// CHECK-NEXT: FinalAttr 0x{{[0-9A-Fa-f]+}} <<invalid sloc>> Implicit final
46+
// CHECK-NEXT: FieldDecl 0x{{[0-9A-Fa-f]+}} <<invalid sloc>> <invalid sloc> implicit h '__hlsl_resource_t
47+
// CHECK-SAME{LITERAL}: [[hlsl::resource_class(UAV)]]
48+
// CHECK-SAME{LITERAL}: [[hlsl::raw_buffer]]
49+
// CHECK-SAME{LITERAL}: [[hlsl::contained_type(int)]]
50+
// CHECK-NEXT: HLSLResourceAttr 0x{{[0-9A-Fa-f]+}} <<invalid sloc>> Implicit RawBuffer
Lines changed: 51 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,51 @@
1+
// RUN: %clang_cc1 -triple dxil-pc-shadermodel6.0-library -x hlsl -ast-dump -DEMPTY %s | FileCheck -check-prefix=EMPTY %s
2+
// RUN: %clang_cc1 -triple dxil-pc-shadermodel6.0-library -x hlsl -ast-dump %s | FileCheck %s
3+
4+
5+
// This test tests two different AST generations. The "EMPTY" test mode verifies
6+
// the AST generated by forward declaration of the HLSL types which happens on
7+
// initializing the HLSL external AST with an AST Context.
8+
9+
// The non-empty mode has a use that requires the ConsumeStructuredBuffer type be complete,
10+
// which results in the AST being populated by the external AST source. That
11+
// case covers the full implementation of the template declaration and the
12+
// instantiated specialization.
13+
14+
// EMPTY: ClassTemplateDecl 0x{{[0-9A-Fa-f]+}} <<invalid sloc>> <invalid sloc> implicit ConsumeStructuredBuffer
15+
// EMPTY-NEXT: TemplateTypeParmDecl 0x{{[0-9A-Fa-f]+}} <<invalid sloc>> <invalid sloc> class depth 0 index 0 element_type
16+
// EMPTY-NEXT: CXXRecordDecl 0x{{[0-9A-Fa-f]+}} <<invalid sloc>> <invalid sloc> implicit <undeserialized declarations> class ConsumeStructuredBuffer
17+
// EMPTY-NEXT: FinalAttr 0x{{[0-9A-Fa-f]+}} <<invalid sloc>> Implicit final
18+
19+
// There should be no more occurrences of ConsumeStructuredBuffer
20+
// EMPTY-NOT: {{[^[:alnum:]]}}ConsumeStructuredBuffer
21+
22+
#ifndef EMPTY
23+
24+
ConsumeStructuredBuffer<int> Buffer;
25+
26+
#endif
27+
28+
// CHECK: ClassTemplateDecl 0x{{[0-9A-Fa-f]+}} <<invalid sloc>> <invalid sloc> implicit ConsumeStructuredBuffer
29+
// CHECK-NEXT: TemplateTypeParmDecl 0x{{[0-9A-Fa-f]+}} <<invalid sloc>> <invalid sloc> class depth 0 index 0 element_type
30+
// CHECK-NEXT: CXXRecordDecl 0x{{[0-9A-Fa-f]+}} <<invalid sloc>> <invalid sloc> implicit class ConsumeStructuredBuffer definition
31+
32+
// CHECK: FinalAttr 0x{{[0-9A-Fa-f]+}} <<invalid sloc>> Implicit final
33+
// CHECK-NEXT: FieldDecl 0x{{[0-9A-Fa-f]+}} <<invalid sloc>> <invalid sloc> implicit h '__hlsl_resource_t
34+
// CHECK-SAME{LITERAL}: [[hlsl::resource_class(UAV)]]
35+
// CHECK-SAME{LITERAL}: [[hlsl::raw_buffer]]
36+
// CHECK-SAME{LITERAL}: [[hlsl::contained_type(element_type)]]
37+
// CHECK-NEXT: HLSLResourceAttr 0x{{[0-9A-Fa-f]+}} <<invalid sloc>> Implicit RawBuffer
38+
39+
// CHECK-NOT: CXXMethodDecl 0x{{[0-9A-Fa-f]+}} <<invalid sloc>> <invalid sloc> operator[] 'element_type &const (unsigned int) const'
40+
// CHECK-NOT: CXXMethodDecl 0x{{[0-9A-Fa-f]+}} <<invalid sloc>> <invalid sloc> operator[] 'element_type &(unsigned int)'
41+
42+
// CHECK: ClassTemplateSpecializationDecl 0x{{[0-9A-Fa-f]+}} <<invalid sloc>> <invalid sloc> class ConsumeStructuredBuffer definition
43+
44+
// CHECK: TemplateArgument type 'int'
45+
// CHECK-NEXT: BuiltinType 0x{{[0-9A-Fa-f]+}} 'int'
46+
// CHECK-NEXT: FinalAttr 0x{{[0-9A-Fa-f]+}} <<invalid sloc>> Implicit final
47+
// CHECK-NEXT: FieldDecl 0x{{[0-9A-Fa-f]+}} <<invalid sloc>> <invalid sloc> implicit h '__hlsl_resource_t
48+
// CHECK-SAME{LITERAL}: [[hlsl::resource_class(UAV)]]
49+
// CHECK-SAME{LITERAL}: [[hlsl::raw_buffer]]
50+
// CHECK-SAME{LITERAL}: [[hlsl::contained_type(int)]]
51+
// CHECK-NEXT: HLSLResourceAttr 0x{{[0-9A-Fa-f]+}} <<invalid sloc>> Implicit RawBuffer

clang/test/AST/HLSL/RWStructuredBuffer-AST.hlsl

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,7 @@ RWStructuredBuffer<int> Buffer;
3434
// CHECK-SAME{LITERAL}: [[hlsl::resource_class(UAV)]]
3535
// CHECK-SAME{LITERAL}: [[hlsl::raw_buffer]]
3636
// CHECK-SAME{LITERAL}: [[hlsl::contained_type(element_type)]]
37-
// CHECK-NEXT: HLSLResourceAttr 0x{{[0-9A-Fa-f]+}} <<invalid sloc>> Implicit TypedBuffer
37+
// CHECK-NEXT: HLSLResourceAttr 0x{{[0-9A-Fa-f]+}} <<invalid sloc>> Implicit RawBuffer
3838

3939
// CHECK: CXXMethodDecl 0x{{[0-9A-Fa-f]+}} <<invalid sloc>> <invalid sloc> operator[] 'element_type &const (unsigned int) const'
4040
// CHECK-NEXT: ParmVarDecl 0x{{[0-9A-Fa-f]+}} <<invalid sloc>> <invalid sloc> Idx 'unsigned int'
@@ -61,4 +61,4 @@ RWStructuredBuffer<int> Buffer;
6161
// CHECK-SAME{LITERAL}: [[hlsl::resource_class(UAV)]]
6262
// CHECK-SAME{LITERAL}: [[hlsl::raw_buffer]]
6363
// CHECK-SAME{LITERAL}: [[hlsl::contained_type(int)]]
64-
// CHECK-NEXT: HLSLResourceAttr 0x{{[0-9A-Fa-f]+}} <<invalid sloc>> Implicit TypedBuffer
64+
// CHECK-NEXT: HLSLResourceAttr 0x{{[0-9A-Fa-f]+}} <<invalid sloc>> Implicit RawBuffer

clang/test/AST/HLSL/StructuredBuffer-AST.hlsl

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,7 @@ StructuredBuffer<float> Buffer;
3434
// CHECK-SAME{LITERAL}: [[hlsl::resource_class(SRV)]]
3535
// CHECK-SAME{LITERAL}: [[hlsl::raw_buffer]]
3636
// CHECK-SAME{LITERAL}: [[hlsl::contained_type(element_type)]]
37-
// CHECK-NEXT: HLSLResourceAttr 0x{{[0-9A-Fa-f]+}} <<invalid sloc>> Implicit TypedBuffer
37+
// CHECK-NEXT: HLSLResourceAttr 0x{{[0-9A-Fa-f]+}} <<invalid sloc>> Implicit RawBuffer
3838

3939
// CHECK: CXXMethodDecl 0x{{[0-9A-Fa-f]+}} <<invalid sloc>> <invalid sloc> operator[] 'element_type &const (unsigned int) const'
4040
// CHECK-NEXT: ParmVarDecl 0x{{[0-9A-Fa-f]+}} <<invalid sloc>> <invalid sloc> Idx 'unsigned int'
@@ -61,4 +61,4 @@ StructuredBuffer<float> Buffer;
6161
// CHECK-SAME{LITERAL}: [[hlsl::resource_class(SRV)]]
6262
// CHECK-SAME{LITERAL}: [[hlsl::raw_buffer]]
6363
// CHECK-SAME{LITERAL}: [[hlsl::contained_type(float)]]
64-
// CHECK-NEXT: HLSLResourceAttr 0x{{[0-9A-Fa-f]+}} <<invalid sloc>> Implicit TypedBuffer
64+
// CHECK-NEXT: HLSLResourceAttr 0x{{[0-9A-Fa-f]+}} <<invalid sloc>> Implicit RawBuffer

0 commit comments

Comments
 (0)