================ @@ -556,46 +562,120 @@ void SemaHLSL::handleShaderAttr(Decl *D, const ParsedAttr &AL) { D->addAttr(NewAttr); } -void SemaHLSL::handleResourceClassAttr(Decl *D, const ParsedAttr &AL) { - if (!AL.isArgIdent(0)) { - Diag(AL.getLoc(), diag::err_attribute_argument_type) - << AL << AANT_ArgumentIdentifier; - return; - } +bool clang::CreateHLSLAttributedResourceType( + Sema &S, QualType Wrapped, llvm::SmallVector<const Attr *> &AttrList, + QualType &ResType) { + assert(AttrList.size() && "expected list of resource attributes"); - IdentifierLoc *Loc = AL.getArgAsIdent(0); - StringRef Identifier = Loc->Ident->getName(); - SourceLocation ArgLoc = Loc->Loc; + QualType Contained = QualType(); + HLSLAttributedResourceType::Attributes ResAttrs = {}; - // Validate. - llvm::dxil::ResourceClass RC; - if (!HLSLResourceClassAttr::ConvertStrToResourceClass(Identifier, RC)) { - Diag(ArgLoc, diag::warn_attribute_type_not_supported) - << "ResourceClass" << Identifier; - return; + bool hasResourceClass = false; + for (auto *Attr : AttrList) { ---------------- bogner wrote:
`auto` doesn't save us anything here, other than making this a bit confusing by having a variable with the same name as a type. `for (const Attr *A : AttrList)` would be better. https://github.com/llvm/llvm-project/pull/107160 _______________________________________________ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits