================ @@ -112,17 +113,13 @@ struct BuiltinTypeDeclBuilder { Ty = Record->getASTContext().getPointerType( QualType(TTD->getTypeForDecl(), 0)); } - return addMemberVariable("h", Ty, Access); - } - - BuiltinTypeDeclBuilder &annotateHLSLResource(ResourceClass RC, - ResourceKind RK, bool IsROV) { - if (Record->isCompleteDefinition()) - return *this; - Record->addAttr( - HLSLResourceClassAttr::CreateImplicit(Record->getASTContext(), RC)); - Record->addAttr( - HLSLResourceAttr::CreateImplicit(Record->getASTContext(), RK, IsROV)); + // add handle member + addMemberVariable("h", Ty, Access); + // add resource attributes to handle + auto *FD = Fields["h"]; ---------------- damyanp wrote:
This feels a bit clunky. Would it be possible to maybe have addMemberVariable take a list attributes to add? I think that this case here is actually the only one that uses addMemberVariable. This may be moot, since I suspect we're not all that far from being able to move all of this to hlsl.h? https://github.com/llvm/llvm-project/pull/101433 _______________________________________________ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits