@@ -2662,6 +2662,7 @@ class alignas(TypeAlignment) Type : public ExtQualsTypeCommonBase {
2662
2662
#include " clang/Basic/HLSLIntangibleTypes.def"
2663
2663
bool isHLSLSpecificType () const ; // Any HLSL specific type
2664
2664
bool isHLSLIntangibleType () const ; // Any HLSL intangible type
2665
+ bool isHLSLAttributedResourceType () const ;
2665
2666
2666
2667
// / Determines if this type, which must satisfy
2667
2668
// / isObjCLifetimeType(), is implicitly __unsafe_unretained rather
@@ -6270,6 +6271,14 @@ class HLSLAttributedResourceType : public Type, public llvm::FoldingSetNode {
6270
6271
: ResourceClass(ResourceClass), IsROV(IsROV), RawBuffer(RawBuffer) {}
6271
6272
6272
6273
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
+ }
6273
6282
};
6274
6283
6275
6284
private:
@@ -6279,20 +6288,21 @@ class HLSLAttributedResourceType : public Type, public llvm::FoldingSetNode {
6279
6288
QualType ContainedType;
6280
6289
const Attributes Attrs;
6281
6290
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() ,
6285
6294
Contained.isNull() ? TypeDependence::None
6286
6295
: Contained->getDependence ()),
6287
6296
WrappedType(Wrapped), ContainedType(Contained), Attrs(Attrs) {}
6288
6297
6289
6298
public:
6290
6299
QualType getWrappedType () const { return WrappedType; }
6291
6300
QualType getContainedType () const { return ContainedType; }
6301
+ bool hasContainedType () const { return !ContainedType.isNull (); }
6292
6302
const Attributes &getAttrs () const { return Attrs; }
6293
6303
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 ); }
6296
6306
6297
6307
void Profile (llvm::FoldingSetNodeID &ID) {
6298
6308
Profile (ID, WrappedType, ContainedType, Attrs);
@@ -8436,17 +8446,19 @@ inline bool Type::isOpenCLSpecificType() const {
8436
8446
}
8437
8447
#include " clang/Basic/HLSLIntangibleTypes.def"
8438
8448
8439
- inline bool Type::isHLSLSpecificType () const {
8449
+ inline bool Type::isHLSLIntangibleType () const {
8440
8450
#define HLSL_INTANGIBLE_TYPE (Name, Id, SingletonId ) is##Id##Type() ||
8441
8451
return
8442
8452
#include " clang/Basic/HLSLIntangibleTypes.def"
8443
- false ; // end boolean or operation
8453
+ isHLSLAttributedResourceType ();
8444
8454
}
8445
8455
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 );
8450
8462
}
8451
8463
8452
8464
inline bool Type::isTemplateTypeParmType () const {
0 commit comments