@@ -2662,6 +2662,7 @@ class alignas(TypeAlignment) Type : public ExtQualsTypeCommonBase {
26622662#include " clang/Basic/HLSLIntangibleTypes.def"
26632663 bool isHLSLSpecificType () const ; // Any HLSL specific type
26642664 bool isHLSLIntangibleType () const ; // Any HLSL intangible type
2665+ bool isHLSLAttributedResourceType () const ;
26652666
26662667 // / Determines if this type, which must satisfy
26672668 // / isObjCLifetimeType(), is implicitly __unsafe_unretained rather
@@ -6270,6 +6271,14 @@ class HLSLAttributedResourceType : public Type, public llvm::FoldingSetNode {
62706271 : ResourceClass(ResourceClass), IsROV(IsROV), RawBuffer(RawBuffer) {}
62716272
62726273 Attributes () : Attributes(llvm::dxil::ResourceClass::UAV, false , false ) {}
6274+
6275+ friend bool operator ==(const Attributes &LHS, const Attributes &RHS) {
6276+ return std::tie (LHS.ResourceClass , LHS.IsROV , LHS.RawBuffer ) ==
6277+ std::tie (RHS.ResourceClass , RHS.IsROV , RHS.RawBuffer );
6278+ }
6279+ friend bool operator !=(const Attributes &LHS, const Attributes &RHS) {
6280+ return !(LHS == RHS);
6281+ }
62736282 };
62746283
62756284private:
@@ -6279,20 +6288,21 @@ class HLSLAttributedResourceType : public Type, public llvm::FoldingSetNode {
62796288 QualType ContainedType;
62806289 const Attributes Attrs;
62816290
6282- HLSLAttributedResourceType (QualType Canon , QualType Wrapped ,
6283- QualType Contained, const Attributes &Attrs)
6284- : Type(HLSLAttributedResource, Canon ,
6291+ HLSLAttributedResourceType (QualType Wrapped , QualType Contained ,
6292+ const Attributes &Attrs)
6293+ : Type(HLSLAttributedResource, QualType() ,
62856294 Contained.isNull() ? TypeDependence::None
62866295 : Contained->getDependence ()),
62876296 WrappedType(Wrapped), ContainedType(Contained), Attrs(Attrs) {}
62886297
62896298public:
62906299 QualType getWrappedType () const { return WrappedType; }
62916300 QualType getContainedType () const { return ContainedType; }
6301+ bool hasContainedType () const { return !ContainedType.isNull (); }
62926302 const Attributes &getAttrs () const { return Attrs; }
62936303
6294- bool isSugared () const { return true ; }
6295- QualType desugar () const { return getWrappedType ( ); }
6304+ bool isSugared () const { return false ; }
6305+ QualType desugar () const { return QualType ( this , 0 ); }
62966306
62976307 void Profile (llvm::FoldingSetNodeID &ID) {
62986308 Profile (ID, WrappedType, ContainedType, Attrs);
@@ -8436,17 +8446,19 @@ inline bool Type::isOpenCLSpecificType() const {
84368446 }
84378447#include " clang/Basic/HLSLIntangibleTypes.def"
84388448
8439- inline bool Type::isHLSLSpecificType () const {
8449+ inline bool Type::isHLSLIntangibleType () const {
84408450#define HLSL_INTANGIBLE_TYPE (Name, Id, SingletonId ) is##Id##Type() ||
84418451 return
84428452#include " clang/Basic/HLSLIntangibleTypes.def"
8443- false ; // end boolean or operation
8453+ isHLSLAttributedResourceType ();
84448454}
84458455
8446- inline bool Type::isHLSLIntangibleType () const {
8447- // All HLSL specific types are currently intangible type as well, but that
8448- // might change in the future.
8449- return isHLSLSpecificType ();
8456+ inline bool Type::isHLSLSpecificType () const {
8457+ return isHLSLIntangibleType () || isa<HLSLAttributedResourceType>(this );
8458+ }
8459+
8460+ inline bool Type::isHLSLAttributedResourceType () const {
8461+ return isa<HLSLAttributedResourceType>(this );
84508462}
84518463
84528464inline bool Type::isTemplateTypeParmType () const {
0 commit comments