================ @@ -6168,10 +6168,19 @@ class HLSLAttributedResourceType : public Type, public llvm::FoldingSetNode { struct Attributes { // Data gathered from HLSL resource attributes llvm::dxil::ResourceClass ResourceClass; + + LLVM_PREFERRED_TYPE(bool) uint8_t IsROV : 1; - Attributes(llvm::dxil::ResourceClass ResourceClass, bool IsROV) - : ResourceClass(ResourceClass), IsROV(IsROV) {} - Attributes() : ResourceClass(llvm::dxil::ResourceClass::UAV), IsROV(0) {} + + LLVM_PREFERRED_TYPE(bool) + uint8_t RawBuffer : 1; + + Attributes(llvm::dxil::ResourceClass ResourceClass, bool IsROV, + bool RawBuffer) + : ResourceClass(ResourceClass), IsROV(IsROV), RawBuffer(RawBuffer) {} + Attributes() + : ResourceClass(llvm::dxil::ResourceClass::UAV), IsROV(false), + RawBuffer(false) {} ---------------- damyanp wrote:
Actually, IMO we don't need the default constructor at all - as far as I can tell it's only used in one place in SemaHLSL.cpp and it'd be pretty trivial to remove it. Then we can be sure that any time someone has constructed one of these Attributes they've specified all the values we care about. https://github.com/llvm/llvm-project/pull/107954 _______________________________________________ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits