Skip to content

Commit 3394056

Browse files
committed
Merge remote-tracking branch 'origin/main' into pr/sink-postisel
2 parents 96af1ff + 56dcfbe commit 3394056

File tree

77 files changed

+1979
-551
lines changed

Some content is hidden

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

77 files changed

+1979
-551
lines changed

clang/docs/ReleaseNotes.rst

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -745,6 +745,8 @@ AST Matchers
745745

746746
- Fixed a crash when traverse lambda expr with invalid captures. (#GH106444)
747747

748+
- Fixed ``isInstantiated`` and ``isInTemplateInstantiation`` to also match for variable templates. (#GH110666)
749+
748750
- Ensure ``hasName`` matches template specializations across inline namespaces,
749751
making `matchesNodeFullSlow` and `matchesNodeFullFast` consistent.
750752

clang/docs/index.rst

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -93,7 +93,6 @@ Using Clang Tools
9393
ClangCheck
9494
ClangFormat
9595
ClangFormatStyleOptions
96-
ClangFormattedStatus
9796
ClangLinkerWrapper
9897
ClangNVLinkWrapper
9998
ClangOffloadBundler

clang/include/clang/ASTMatchers/ASTMatchers.h

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -6750,7 +6750,8 @@ AST_POLYMORPHIC_MATCHER(isTemplateInstantiation,
67506750
/// matches 'A(int) {...};' and 'A(unsigned) {...}'.
67516751
AST_MATCHER_FUNCTION(internal::Matcher<Decl>, isInstantiated) {
67526752
auto IsInstantiation = decl(anyOf(cxxRecordDecl(isTemplateInstantiation()),
6753-
functionDecl(isTemplateInstantiation())));
6753+
functionDecl(isTemplateInstantiation()),
6754+
varDecl(isTemplateInstantiation())));
67546755
return decl(anyOf(IsInstantiation, hasAncestor(IsInstantiation)));
67556756
}
67566757

@@ -6769,9 +6770,9 @@ AST_MATCHER_FUNCTION(internal::Matcher<Decl>, isInstantiated) {
67696770
/// will NOT match j += 42; as it's shared between the template definition and
67706771
/// instantiation.
67716772
AST_MATCHER_FUNCTION(internal::Matcher<Stmt>, isInTemplateInstantiation) {
6772-
return stmt(
6773-
hasAncestor(decl(anyOf(cxxRecordDecl(isTemplateInstantiation()),
6774-
functionDecl(isTemplateInstantiation())))));
6773+
return stmt(hasAncestor(decl(anyOf(cxxRecordDecl(isTemplateInstantiation()),
6774+
functionDecl(isTemplateInstantiation()),
6775+
varDecl(isTemplateInstantiation())))));
67756776
}
67766777

67776778
/// Matches explicit template specializations of function, class, or

clang/lib/CodeGen/CGHLSLRuntime.cpp

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -306,6 +306,16 @@ void CGHLSLRuntime::annotateHLSLResource(const VarDecl *D, GlobalVariable *GV) {
306306
continue;
307307

308308
llvm::hlsl::ResourceClass RC = AttrResType->getAttrs().ResourceClass;
309+
if (RC == llvm::hlsl::ResourceClass::UAV ||
310+
RC == llvm::hlsl::ResourceClass::SRV)
311+
// UAVs and SRVs have already been converted to use LLVM target types,
312+
// we can disable generating of these resource annotations. This will
313+
// enable progress on structured buffers with user defined types this
314+
// resource annotations code does not handle and it crashes.
315+
// This whole function is going to be removed as soon as cbuffers are
316+
// converted to target types (llvm/llvm-project #114126).
317+
return;
318+
309319
bool IsROV = AttrResType->getAttrs().IsROV;
310320
llvm::hlsl::ResourceKind RK = HLSLResAttr->getResourceKind();
311321
llvm::hlsl::ElementType ET = calculateElementType(CGM.getContext(), Ty);

clang/test/CodeGenHLSL/builtins/RWBuffer-annotations.hlsl

Lines changed: 0 additions & 24 deletions
This file was deleted.

clang/test/CodeGenHLSL/builtins/RWBuffer-elementtype.hlsl

Lines changed: 0 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -54,17 +54,3 @@ void main(int GI : SV_GroupIndex) {
5454
BufF16x2[GI] = 0;
5555
BufF32x3[GI] = 0;
5656
}
57-
58-
// CHECK: !{{[0-9]+}} = !{ptr @BufI16, i32 10, i32 2,
59-
// CHECK: !{{[0-9]+}} = !{ptr @BufU16, i32 10, i32 3,
60-
// CHECK: !{{[0-9]+}} = !{ptr @BufI32, i32 10, i32 4,
61-
// CHECK: !{{[0-9]+}} = !{ptr @BufU32, i32 10, i32 5,
62-
// CHECK: !{{[0-9]+}} = !{ptr @BufI64, i32 10, i32 6,
63-
// CHECK: !{{[0-9]+}} = !{ptr @BufU64, i32 10, i32 7,
64-
// CHECK: !{{[0-9]+}} = !{ptr @BufF16, i32 10, i32 8,
65-
// CHECK: !{{[0-9]+}} = !{ptr @BufF32, i32 10, i32 9,
66-
// CHECK: !{{[0-9]+}} = !{ptr @BufF64, i32 10, i32 10,
67-
// CHECK: !{{[0-9]+}} = !{ptr @BufI16x4, i32 10, i32 2,
68-
// CHECK: !{{[0-9]+}} = !{ptr @BufU32x3, i32 10, i32 5,
69-
// CHECK: !{{[0-9]+}} = !{ptr @BufF16x2, i32 10, i32 8,
70-
// CHECK: !{{[0-9]+}} = !{ptr @BufF32x3, i32 10, i32 9,

clang/test/CodeGenHLSL/builtins/RWStructuredBuffer-elementtype.hlsl

Lines changed: 0 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -54,17 +54,3 @@ void main(int GI : SV_GroupIndex) {
5454
BufF16x2[GI] = 0;
5555
BufF32x3[GI] = 0;
5656
}
57-
58-
// CHECK: !{{[0-9]+}} = !{ptr @BufI16, i32 10, i32 2,
59-
// CHECK: !{{[0-9]+}} = !{ptr @BufU16, i32 10, i32 3,
60-
// CHECK: !{{[0-9]+}} = !{ptr @BufI32, i32 10, i32 4,
61-
// CHECK: !{{[0-9]+}} = !{ptr @BufU32, i32 10, i32 5,
62-
// CHECK: !{{[0-9]+}} = !{ptr @BufI64, i32 10, i32 6,
63-
// CHECK: !{{[0-9]+}} = !{ptr @BufU64, i32 10, i32 7,
64-
// CHECK: !{{[0-9]+}} = !{ptr @BufF16, i32 10, i32 8,
65-
// CHECK: !{{[0-9]+}} = !{ptr @BufF32, i32 10, i32 9,
66-
// CHECK: !{{[0-9]+}} = !{ptr @BufF64, i32 10, i32 10,
67-
// CHECK: !{{[0-9]+}} = !{ptr @BufI16x4, i32 10, i32 2,
68-
// CHECK: !{{[0-9]+}} = !{ptr @BufU32x3, i32 10, i32 5,
69-
// CHECK: !{{[0-9]+}} = !{ptr @BufF16x2, i32 10, i32 8,
70-
// CHECK: !{{[0-9]+}} = !{ptr @BufF32x3, i32 10, i32 9,

clang/test/CodeGenHLSL/builtins/RasterizerOrderedBuffer-annotations.hlsl

Lines changed: 0 additions & 20 deletions
This file was deleted.

clang/test/CodeGenHLSL/builtins/StructuredBuffer-annotations.hlsl

Lines changed: 0 additions & 22 deletions
This file was deleted.

clang/test/CodeGenHLSL/builtins/StructuredBuffer-elementtype.hlsl

Lines changed: 0 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -54,17 +54,3 @@ void main(int GI : SV_GroupIndex) {
5454
half2 v12 = BufF16x2[GI];
5555
float3 v13 = BufF32x3[GI];
5656
}
57-
58-
// CHECK: !{{[0-9]+}} = !{ptr @BufI16, i32 10, i32 2,
59-
// CHECK: !{{[0-9]+}} = !{ptr @BufU16, i32 10, i32 3,
60-
// CHECK: !{{[0-9]+}} = !{ptr @BufI32, i32 10, i32 4,
61-
// CHECK: !{{[0-9]+}} = !{ptr @BufU32, i32 10, i32 5,
62-
// CHECK: !{{[0-9]+}} = !{ptr @BufI64, i32 10, i32 6,
63-
// CHECK: !{{[0-9]+}} = !{ptr @BufU64, i32 10, i32 7,
64-
// CHECK: !{{[0-9]+}} = !{ptr @BufF16, i32 10, i32 8,
65-
// CHECK: !{{[0-9]+}} = !{ptr @BufF32, i32 10, i32 9,
66-
// CHECK: !{{[0-9]+}} = !{ptr @BufF64, i32 10, i32 10,
67-
// CHECK: !{{[0-9]+}} = !{ptr @BufI16x4, i32 10, i32 2,
68-
// CHECK: !{{[0-9]+}} = !{ptr @BufU32x3, i32 10, i32 5,
69-
// CHECK: !{{[0-9]+}} = !{ptr @BufF16x2, i32 10, i32 8,
70-
// CHECK: !{{[0-9]+}} = !{ptr @BufF32x3, i32 10, i32 9,

0 commit comments

Comments
 (0)