Skip to content

Commit 554a940

Browse files
committed
Remove redudent isResourceRecordType and update test.
1 parent 8848330 commit 554a940

File tree

2 files changed

+3
-6
lines changed

2 files changed

+3
-6
lines changed

clang/lib/CodeGen/CGHLSLRuntime.cpp

Lines changed: 1 addition & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -85,16 +85,11 @@ llvm::Triple::ArchType CGHLSLRuntime::getArch() {
8585
return CGM.getTarget().getTriple().getArch();
8686
}
8787

88-
// Returns true if the type is an HLSL resource class
89-
static bool isResourceRecordType(const clang::Type *Ty) {
90-
return HLSLAttributedResourceType::findHandleTypeOnResource(Ty) != nullptr;
91-
}
92-
9388
// Returns true if the type is an HLSL resource class or an array of them
9489
static bool isResourceRecordTypeOrArrayOf(const clang::Type *Ty) {
9590
while (const ConstantArrayType *CAT = dyn_cast<ConstantArrayType>(Ty))
9691
Ty = CAT->getArrayElementTypeNoTypeQual();
97-
return isResourceRecordType(Ty);
92+
return CGHLSLRuntime::isResourceRecordType(Ty);
9893
}
9994

10095
// Emits constant global variables for buffer constants declarations

clang/test/CodeGenHLSL/builtins/RWBuffer-constructor-opt.hlsl

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,9 @@ RWBuffer<float> Buf : register(u5, space3);
77
[shader("compute")]
88
[numthreads(1, 1, 1)]
99
void main() {
10+
// CHECK-NOT: resource.handlefrombinding
1011
// CHECK: define void @main()
1112
// CHECK-NEXT: entry:
1213
// CHECK-NEXT: ret void
14+
// CHECK-NOT: resource.handlefrombinding
1315
}

0 commit comments

Comments
 (0)