================
@@ -7334,6 +7334,81 @@ static void handleHLSLShaderAttr(Sema &S, Decl *D, const
ParsedAttr &AL) {
D->addAttr(NewAttr);
}
+static void DiagnoseHLSLResourceRegType(Sema &S, SourceLocation &ArgLoc,
+ Decl *D, StringRef &Slot) {
+ // Samplers, UAVs, and SRVs are VarDecl types
+ VarDecl *SamplerUAVOrSRV = dyn_cast<VarDecl>(D);
+ // Cbuffers and Tbuffers are HLSLBufferDecl types
+ HLSLBufferDecl *CBufferOrTBuffer = dyn_cast<HLSLBufferDecl>(D);
+ if (!SamplerUAVOrSRV && !CBufferOrTBuffer)
+ return;
+
+ llvm::hlsl::ResourceClass DeclResourceClass;
+ StringRef varTy = "";
+ if (SamplerUAVOrSRV) {
+ const Type *Ty =
SamplerUAVOrSRV->getType()->getPointeeOrArrayElementType();
+ if (!Ty)
+ llvm_unreachable("Resource class should have an element type.");
----------------
bogner wrote:
I probably just read too many RFCs, but it'd be better to use "must" rather
than "should" in this message.
https://github.com/llvm/llvm-project/pull/87578
_______________________________________________
cfe-commits mailing list
[email protected]
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits