@@ -2659,6 +2659,7 @@ class alignas(TypeAlignment) Type : public ExtQualsTypeCommonBase {
26592659#include " clang/Basic/HLSLIntangibleTypes.def"
26602660 bool isHLSLSpecificType () const ; // Any HLSL specific type
26612661 bool isHLSLIntangibleType () const ; // Any HLSL intangible type
2662+ bool isHLSLAttributedResourceType () const ;
26622663
26632664 // / Determines if this type, which must satisfy
26642665 // / isObjCLifetimeType(), is implicitly __unsafe_unretained rather
@@ -6180,6 +6181,14 @@ class HLSLAttributedResourceType : public Type, public llvm::FoldingSetNode {
61806181 : ResourceClass(ResourceClass), IsROV(IsROV), RawBuffer(RawBuffer) {}
61816182
61826183 Attributes () : Attributes(llvm::dxil::ResourceClass::UAV, false , false ) {}
6184+
6185+ friend bool operator ==(const Attributes &LHS, const Attributes &RHS) {
6186+ return std::tie (LHS.ResourceClass , LHS.IsROV , LHS.RawBuffer ) ==
6187+ std::tie (RHS.ResourceClass , RHS.IsROV , RHS.RawBuffer );
6188+ }
6189+ friend bool operator !=(const Attributes &LHS, const Attributes &RHS) {
6190+ return !(LHS == RHS);
6191+ }
61836192 };
61846193
61856194private:
@@ -6189,18 +6198,19 @@ class HLSLAttributedResourceType : public Type, public llvm::FoldingSetNode {
61896198 QualType ContainedType;
61906199 const Attributes Attrs;
61916200
6192- HLSLAttributedResourceType (QualType Canon , QualType Wrapped ,
6193- QualType Contained, const Attributes &Attrs)
6194- : Type(HLSLAttributedResource, Canon , Wrapped->getDependence ()),
6201+ HLSLAttributedResourceType (QualType Wrapped , QualType Contained ,
6202+ const Attributes &Attrs)
6203+ : Type(HLSLAttributedResource, QualType() , Wrapped->getDependence ()),
61956204 WrappedType(Wrapped), ContainedType(Contained), Attrs(Attrs) {}
61966205
61976206public:
61986207 QualType getWrappedType () const { return WrappedType; }
61996208 QualType getContainedType () const { return ContainedType; }
6209+ bool hasContainedType () const { return !ContainedType.isNull (); }
62006210 const Attributes &getAttrs () const { return Attrs; }
62016211
6202- bool isSugared () const { return true ; }
6203- QualType desugar () const { return getWrappedType ( ); }
6212+ bool isSugared () const { return false ; }
6213+ QualType desugar () const { return QualType ( this , 0 ); }
62046214
62056215 void Profile (llvm::FoldingSetNodeID &ID) {
62066216 Profile (ID, WrappedType, ContainedType, Attrs);
@@ -8344,17 +8354,19 @@ inline bool Type::isOpenCLSpecificType() const {
83448354 }
83458355#include " clang/Basic/HLSLIntangibleTypes.def"
83468356
8347- inline bool Type::isHLSLSpecificType () const {
8357+ inline bool Type::isHLSLIntangibleType () const {
83488358#define HLSL_INTANGIBLE_TYPE (Name, Id, SingletonId ) is##Id##Type() ||
83498359 return
83508360#include " clang/Basic/HLSLIntangibleTypes.def"
8351- false ; // end boolean or operation
8361+ isHLSLAttributedResourceType ();
83528362}
83538363
8354- inline bool Type::isHLSLIntangibleType () const {
8355- // All HLSL specific types are currently intangible type as well, but that
8356- // might change in the future.
8357- return isHLSLSpecificType ();
8364+ inline bool Type::isHLSLSpecificType () const {
8365+ return isHLSLIntangibleType () || isa<HLSLAttributedResourceType>(this );
8366+ }
8367+
8368+ inline bool Type::isHLSLAttributedResourceType () const {
8369+ return isa<HLSLAttributedResourceType>(this );
83588370}
83598371
83608372inline bool Type::isTemplateTypeParmType () const {
0 commit comments