aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJustin Bogner <mail@justinbogner.com>2024-07-16 10:36:21 -0700
committerGitHub <noreply@github.com>2024-07-16 10:36:21 -0700
commitd269071d8524595fe65258e384411d1c0ae15df5 (patch)
treee96721a0222b94f59a2bf278521e6361acc2432e
parent6464dd21b50bb5f22a5beae1377fec501b38e764 (diff)
downloadllvm-d269071d8524595fe65258e384411d1c0ae15df5.zip
llvm-d269071d8524595fe65258e384411d1c0ae15df5.tar.gz
llvm-d269071d8524595fe65258e384411d1c0ae15df5.tar.bz2
[HLSL] Remove hlsl::Resource (#98938)
This was added in an effort to support resource types before we created the HLSLResource builtin type, but it isn't needed.
-rw-r--r--clang/include/clang/Sema/HLSLExternalSemaSource.h1
-rw-r--r--clang/lib/Sema/HLSLExternalSemaSource.cpp6
-rw-r--r--clang/test/AST/HLSL/RWBuffer-AST.hlsl8
-rw-r--r--clang/test/AST/HLSL/ResourceStruct.hlsl14
-rw-r--r--clang/test/SemaHLSL/BuiltIns/RWBuffers.hlsl1
5 files changed, 2 insertions, 28 deletions
diff --git a/clang/include/clang/Sema/HLSLExternalSemaSource.h b/clang/include/clang/Sema/HLSLExternalSemaSource.h
index c0bfff3..3c7495e 100644
--- a/clang/include/clang/Sema/HLSLExternalSemaSource.h
+++ b/clang/include/clang/Sema/HLSLExternalSemaSource.h
@@ -23,7 +23,6 @@ class Sema;
class HLSLExternalSemaSource : public ExternalSemaSource {
Sema *SemaPtr = nullptr;
NamespaceDecl *HLSLNamespace = nullptr;
- CXXRecordDecl *ResourceDecl = nullptr;
using CompletionFunction = std::function<void(CXXRecordDecl *)>;
llvm::DenseMap<CXXRecordDecl *, CompletionFunction> Completions;
diff --git a/clang/lib/Sema/HLSLExternalSemaSource.cpp b/clang/lib/Sema/HLSLExternalSemaSource.cpp
index 7fcf575..ca88d138 100644
--- a/clang/lib/Sema/HLSLExternalSemaSource.cpp
+++ b/clang/lib/Sema/HLSLExternalSemaSource.cpp
@@ -482,12 +482,6 @@ void HLSLExternalSemaSource::defineHLSLVectorAlias() {
void HLSLExternalSemaSource::defineTrivialHLSLTypes() {
defineHLSLVectorAlias();
-
- ResourceDecl = BuiltinTypeDeclBuilder(*SemaPtr, HLSLNamespace, "Resource")
- .startDefinition()
- .addHandleMember(AccessSpecifier::AS_public)
- .completeDefinition()
- .Record;
}
/// Set up common members and attributes for buffer types
diff --git a/clang/test/AST/HLSL/RWBuffer-AST.hlsl b/clang/test/AST/HLSL/RWBuffer-AST.hlsl
index cb66a70..e95acb8 100644
--- a/clang/test/AST/HLSL/RWBuffer-AST.hlsl
+++ b/clang/test/AST/HLSL/RWBuffer-AST.hlsl
@@ -1,5 +1,5 @@
-// RUN: %clang_cc1 -triple dxil-pc-shadermodel6.0-library -x hlsl -ast-dump -DEMPTY %s | FileCheck -check-prefix=EMPTY %s
-// RUN: %clang_cc1 -triple dxil-pc-shadermodel6.0-library -x hlsl -ast-dump %s | FileCheck %s
+// RUN: %clang_cc1 -triple dxil-pc-shadermodel6.0-library -x hlsl -ast-dump -DEMPTY %s | FileCheck -check-prefix=EMPTY %s
+// RUN: %clang_cc1 -triple dxil-pc-shadermodel6.0-library -x hlsl -ast-dump %s | FileCheck %s
// This test tests two different AST generations. The "EMPTY" test mode verifies
@@ -25,10 +25,6 @@ RWBuffer<float> Buffer;
#endif
-// CHECK: CXXRecordDecl 0x{{[0-9A-Fa-f]+}} <<invalid sloc>> <invalid sloc> implicit <undeserialized declarations> class Resource definition
-// CHECK: FinalAttr 0x{{[0-9A-Fa-f]+}} <<invalid sloc>> Implicit final
-// CHECK-NEXT: FieldDecl 0x{{[0-9A-Fa-f]+}} <<invalid sloc>> <invalid sloc> implicit h 'void *'
-
// CHECK: ClassTemplateDecl 0x{{[0-9A-Fa-f]+}} <<invalid sloc>> <invalid sloc> implicit RWBuffer
// CHECK-NEXT: TemplateTypeParmDecl 0x{{[0-9A-Fa-f]+}} <<invalid sloc>> <invalid sloc> class depth 0 index 0 element_type
// CHECK-NEXT: CXXRecordDecl 0x{{[0-9A-Fa-f]+}} <<invalid sloc>> <invalid sloc> implicit class RWBuffer definition
diff --git a/clang/test/AST/HLSL/ResourceStruct.hlsl b/clang/test/AST/HLSL/ResourceStruct.hlsl
deleted file mode 100644
index 04b3b93..0000000
--- a/clang/test/AST/HLSL/ResourceStruct.hlsl
+++ /dev/null
@@ -1,14 +0,0 @@
-// RUN: %clang_cc1 -triple dxil-pc-shadermodel6.3-library -x hlsl -ast-dump %s | FileCheck %s
-
-// CHECK: NamespaceDecl {{.*}} implicit hlsl
-// CHECK: CXXRecordDecl 0x{{[0-9A-Fa-f]+}} <<invalid sloc>> <invalid sloc> implicit <undeserialized declarations> class Resource definition
-// CHECK-NEXT: DefinitionData
-// CHECK-NEXT: DefaultConstructor exists trivial needs_implicit
-// CHECK-NEXT: CopyConstructor simple trivial has_const_param needs_implicit implicit_has_const_param
-// CHECK-NEXT: MoveConstructor exists simple trivial needs_implicit
-// CHECK-NEXT: CopyAssignment simple trivial has_const_param needs_implicit implicit_has_const_param
-// CHECK-NEXT: MoveAssignment exists simple trivial needs_implicit
-// CHECK-NEXT: Destructor simple irrelevant trivial needs_implicit
-// CHECK-NEXT: FinalAttr 0x{{[0-9A-Fa-f]+}} <<invalid sloc>> Implicit final
-// CHECK-NEXT: FieldDecl 0x{{[0-9A-Fa-f]+}} <<invalid sloc>> <invalid sloc>
-// implicit h 'void *'
diff --git a/clang/test/SemaHLSL/BuiltIns/RWBuffers.hlsl b/clang/test/SemaHLSL/BuiltIns/RWBuffers.hlsl
index fecf3b7..774309c 100644
--- a/clang/test/SemaHLSL/BuiltIns/RWBuffers.hlsl
+++ b/clang/test/SemaHLSL/BuiltIns/RWBuffers.hlsl
@@ -1,6 +1,5 @@
// RUN: %clang_cc1 -triple dxil-pc-shadermodel6.0-compute -x hlsl -fsyntax-only -verify %s
-Resource ResourceDescriptorHeap[5];
typedef vector<float, 3> float3;
RWBuffer<float3> Buffer;