Skip to content

Commit c6e8e55

Browse files
bogneryuxuanchen1997
authored andcommitted
[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.
1 parent 3853a98 commit c6e8e55

File tree

5 files changed

+2
-28
lines changed

5 files changed

+2
-28
lines changed

clang/include/clang/Sema/HLSLExternalSemaSource.h

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,6 @@ class Sema;
2323
class HLSLExternalSemaSource : public ExternalSemaSource {
2424
Sema *SemaPtr = nullptr;
2525
NamespaceDecl *HLSLNamespace = nullptr;
26-
CXXRecordDecl *ResourceDecl = nullptr;
2726

2827
using CompletionFunction = std::function<void(CXXRecordDecl *)>;
2928
llvm::DenseMap<CXXRecordDecl *, CompletionFunction> Completions;

clang/lib/Sema/HLSLExternalSemaSource.cpp

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -482,12 +482,6 @@ void HLSLExternalSemaSource::defineHLSLVectorAlias() {
482482

483483
void HLSLExternalSemaSource::defineTrivialHLSLTypes() {
484484
defineHLSLVectorAlias();
485-
486-
ResourceDecl = BuiltinTypeDeclBuilder(*SemaPtr, HLSLNamespace, "Resource")
487-
.startDefinition()
488-
.addHandleMember(AccessSpecifier::AS_public)
489-
.completeDefinition()
490-
.Record;
491485
}
492486

493487
/// Set up common members and attributes for buffer types

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

Lines changed: 2 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
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
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
33

44

55
// This test tests two different AST generations. The "EMPTY" test mode verifies
@@ -25,10 +25,6 @@ RWBuffer<float> Buffer;
2525

2626
#endif
2727

28-
// CHECK: CXXRecordDecl 0x{{[0-9A-Fa-f]+}} <<invalid sloc>> <invalid sloc> implicit <undeserialized declarations> class Resource definition
29-
// CHECK: FinalAttr 0x{{[0-9A-Fa-f]+}} <<invalid sloc>> Implicit final
30-
// CHECK-NEXT: FieldDecl 0x{{[0-9A-Fa-f]+}} <<invalid sloc>> <invalid sloc> implicit h 'void *'
31-
3228
// CHECK: ClassTemplateDecl 0x{{[0-9A-Fa-f]+}} <<invalid sloc>> <invalid sloc> implicit RWBuffer
3329
// CHECK-NEXT: TemplateTypeParmDecl 0x{{[0-9A-Fa-f]+}} <<invalid sloc>> <invalid sloc> class depth 0 index 0 element_type
3430
// CHECK-NEXT: CXXRecordDecl 0x{{[0-9A-Fa-f]+}} <<invalid sloc>> <invalid sloc> implicit class RWBuffer definition

clang/test/AST/HLSL/ResourceStruct.hlsl

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

clang/test/SemaHLSL/BuiltIns/RWBuffers.hlsl

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,5 @@
11
// RUN: %clang_cc1 -triple dxil-pc-shadermodel6.0-compute -x hlsl -fsyntax-only -verify %s
22

3-
Resource ResourceDescriptorHeap[5];
43
typedef vector<float, 3> float3;
54

65
RWBuffer<float3> Buffer;

0 commit comments

Comments
 (0)