Skip to content

Commit e00e9a3

Browse files
authored
[HLSL] Add HLSLAttributedResourceType (#106181)
Introducing `HLSLAttributedResourceType` - a new type that is similar to `AttributedType` but with additional data specific to HLSL resources. `AttributeType` currently only stores an attribute kind and no additional data from the type attribute parameters. This does not really work for HLSL resources since its type attributes contain non-boolean values that need to be retained as well. For example: ``` template <typename T> class RWBuffer { __hlsl_resource_t [[hlsl::resource_class(uav)]] [[hlsl::is_rov]] handle; }; ``` The data `HLSLAttributedResourceType` needs to eventually store are: - resource class (SRV, UAV, CBuffer, Sampler) - texture dimension(1-3) - flags is_rov, is_array, is_feedback and is_multisample - contained type All of these values except contained type will be stored in `HLSLAttributedResourceType::Attributes` struct and accessed individually via the fields. There is also `Data` alias that covers all of these values as a `unsigned` which is used for hashing and the AST type serialization. During type attribute processing all HLSL type attributes will be validated and collected by SemaHLSL (by `SemaHLSL::handleResourceTypeAttr`) and in the end combined into a single `HLSLAttributedResourceType` instance (in `SemaHLSL::ProcessResourceTypeAttributes`). `SemaHLSL` will also need to short-term store the `TypeLoc` information for the new type that will be grabbed by `TypeSpecLocFiller` soon after the type is created. Part 1/2 of #104861
1 parent e004566 commit e00e9a3

26 files changed

+274
-2
lines changed

clang/include/clang-c/Index.h

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2980,8 +2980,9 @@ enum CXTypeKind {
29802980
CXType_Atomic = 177,
29812981
CXType_BTFTagAttributed = 178,
29822982

2983-
// HLSL Intangible Types
2984-
CXType_HLSLResource = 179
2983+
// HLSL Types
2984+
CXType_HLSLResource = 179,
2985+
CXType_HLSLAttributedResource = 180
29852986
};
29862987

29872988
/**

clang/include/clang/AST/ASTContext.h

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -254,6 +254,7 @@ class ASTContext : public RefCountedBase<ASTContext> {
254254
mutable llvm::ContextualFoldingSet<DependentBitIntType, ASTContext &>
255255
DependentBitIntTypes;
256256
llvm::FoldingSet<BTFTagAttributedType> BTFTagAttributedTypes;
257+
llvm::FoldingSet<HLSLAttributedResourceType> HLSLAttributedResourceTypes;
257258

258259
mutable llvm::FoldingSet<CountAttributedType> CountAttributedTypes;
259260

@@ -1671,6 +1672,10 @@ class ASTContext : public RefCountedBase<ASTContext> {
16711672
QualType getBTFTagAttributedType(const BTFTypeTagAttr *BTFAttr,
16721673
QualType Wrapped);
16731674

1675+
QualType getHLSLAttributedResourceType(
1676+
QualType Wrapped, QualType Contained,
1677+
const HLSLAttributedResourceType::Attributes &Attrs);
1678+
16741679
QualType
16751680
getSubstTemplateTypeParmType(QualType Replacement, Decl *AssociatedDecl,
16761681
unsigned Index,

clang/include/clang/AST/ASTNodeTraverser.h

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -439,6 +439,11 @@ class ASTNodeTraverser
439439
void VisitBTFTagAttributedType(const BTFTagAttributedType *T) {
440440
Visit(T->getWrappedType());
441441
}
442+
void VisitHLSLAttributedResourceType(const HLSLAttributedResourceType *T) {
443+
QualType Contained = T->getContainedType();
444+
if (!Contained.isNull())
445+
Visit(Contained);
446+
}
442447
void VisitSubstTemplateTypeParmType(const SubstTemplateTypeParmType *) {}
443448
void
444449
VisitSubstTemplateTypeParmPackType(const SubstTemplateTypeParmPackType *T) {

clang/include/clang/AST/RecursiveASTVisitor.h

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1146,6 +1146,9 @@ DEF_TRAVERSE_TYPE(CountAttributedType, {
11461146
DEF_TRAVERSE_TYPE(BTFTagAttributedType,
11471147
{ TRY_TO(TraverseType(T->getWrappedType())); })
11481148

1149+
DEF_TRAVERSE_TYPE(HLSLAttributedResourceType,
1150+
{ TRY_TO(TraverseType(T->getWrappedType())); })
1151+
11491152
DEF_TRAVERSE_TYPE(ParenType, { TRY_TO(TraverseType(T->getInnerType())); })
11501153

11511154
DEF_TRAVERSE_TYPE(MacroQualifiedType,
@@ -1445,6 +1448,9 @@ DEF_TRAVERSE_TYPELOC(CountAttributedType,
14451448
DEF_TRAVERSE_TYPELOC(BTFTagAttributedType,
14461449
{ TRY_TO(TraverseTypeLoc(TL.getWrappedLoc())); })
14471450

1451+
DEF_TRAVERSE_TYPELOC(HLSLAttributedResourceType,
1452+
{ TRY_TO(TraverseTypeLoc(TL.getWrappedLoc())); })
1453+
14481454
DEF_TRAVERSE_TYPELOC(ElaboratedType, {
14491455
if (TL.getQualifierLoc()) {
14501456
TRY_TO(TraverseNestedNameSpecifierLoc(TL.getQualifierLoc()));

clang/include/clang/AST/Type.h

Lines changed: 51 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -44,6 +44,7 @@
4444
#include "llvm/ADT/iterator_range.h"
4545
#include "llvm/Support/Casting.h"
4646
#include "llvm/Support/Compiler.h"
47+
#include "llvm/Support/DXILABI.h"
4748
#include "llvm/Support/ErrorHandling.h"
4849
#include "llvm/Support/PointerLikeTypeTraits.h"
4950
#include "llvm/Support/TrailingObjects.h"
@@ -6156,6 +6157,54 @@ class BTFTagAttributedType : public Type, public llvm::FoldingSetNode {
61566157
}
61576158
};
61586159

6160+
class HLSLAttributedResourceType : public Type, public llvm::FoldingSetNode {
6161+
public:
6162+
struct Attributes {
6163+
// Data gathered from HLSL resource attributes
6164+
llvm::dxil::ResourceClass ResourceClass;
6165+
uint8_t IsROV : 1;
6166+
Attributes(llvm::dxil::ResourceClass ResourceClass, bool IsROV)
6167+
: ResourceClass(ResourceClass), IsROV(IsROV) {}
6168+
Attributes() : ResourceClass(llvm::dxil::ResourceClass::UAV), IsROV(0) {}
6169+
};
6170+
6171+
private:
6172+
friend class ASTContext; // ASTContext creates these
6173+
6174+
QualType WrappedType;
6175+
QualType ContainedType;
6176+
const Attributes Attrs;
6177+
6178+
HLSLAttributedResourceType(QualType Canon, QualType Wrapped,
6179+
QualType Contained, const Attributes &Attrs)
6180+
: Type(HLSLAttributedResource, Canon, Wrapped->getDependence()),
6181+
WrappedType(Wrapped), ContainedType(Contained), Attrs(Attrs) {}
6182+
6183+
public:
6184+
QualType getWrappedType() const { return WrappedType; }
6185+
QualType getContainedType() const { return ContainedType; }
6186+
const Attributes &getAttrs() const { return Attrs; }
6187+
6188+
bool isSugared() const { return true; }
6189+
QualType desugar() const { return getWrappedType(); }
6190+
6191+
void Profile(llvm::FoldingSetNodeID &ID) {
6192+
Profile(ID, WrappedType, ContainedType, Attrs);
6193+
}
6194+
6195+
static void Profile(llvm::FoldingSetNodeID &ID, QualType Wrapped,
6196+
QualType Contained, const Attributes &Attrs) {
6197+
ID.AddPointer(Wrapped.getAsOpaquePtr());
6198+
ID.AddPointer(Contained.getAsOpaquePtr());
6199+
ID.AddInteger(static_cast<uint32_t>(Attrs.ResourceClass));
6200+
ID.AddBoolean(Attrs.IsROV);
6201+
}
6202+
6203+
static bool classof(const Type *T) {
6204+
return T->getTypeClass() == HLSLAttributedResource;
6205+
}
6206+
};
6207+
61596208
class TemplateTypeParmType : public Type, public llvm::FoldingSetNode {
61606209
friend class ASTContext; // ASTContext creates these
61616210

@@ -8579,6 +8628,8 @@ template <typename T> const T *Type::getAsAdjusted() const {
85798628
Ty = A->getModifiedType().getTypePtr();
85808629
else if (const auto *A = dyn_cast<BTFTagAttributedType>(Ty))
85818630
Ty = A->getWrappedType().getTypePtr();
8631+
else if (const auto *A = dyn_cast<HLSLAttributedResourceType>(Ty))
8632+
Ty = A->getWrappedType().getTypePtr();
85828633
else if (const auto *E = dyn_cast<ElaboratedType>(Ty))
85838634
Ty = E->desugar().getTypePtr();
85848635
else if (const auto *P = dyn_cast<ParenType>(Ty))

clang/include/clang/AST/TypeLoc.h

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -940,6 +940,25 @@ class BTFTagAttributedTypeLoc
940940
QualType getInnerType() const { return getTypePtr()->getWrappedType(); }
941941
};
942942

943+
struct HLSLAttributedResourceLocInfo {
944+
SourceRange Range;
945+
};
946+
947+
/// Type source information for HLSL attributed resource type.
948+
class HLSLAttributedResourceTypeLoc
949+
: public ConcreteTypeLoc<UnqualTypeLoc, HLSLAttributedResourceTypeLoc,
950+
HLSLAttributedResourceType,
951+
HLSLAttributedResourceLocInfo> {
952+
public:
953+
TypeLoc getWrappedLoc() const { return getInnerTypeLoc(); }
954+
void setSourceRange(const SourceRange &R) { getLocalData()->Range = R; }
955+
SourceRange getLocalSourceRange() const { return getLocalData()->Range; }
956+
void initializeLocal(ASTContext &Context, SourceLocation loc) {
957+
setSourceRange(SourceRange());
958+
}
959+
QualType getInnerType() const { return getTypePtr()->getWrappedType(); }
960+
};
961+
943962
struct ObjCObjectTypeLocInfo {
944963
SourceLocation TypeArgsLAngleLoc;
945964
SourceLocation TypeArgsRAngleLoc;
@@ -2690,6 +2709,8 @@ inline T TypeLoc::getAsAdjusted() const {
26902709
Cur = ATL.getModifiedLoc();
26912710
else if (auto ATL = Cur.getAs<BTFTagAttributedTypeLoc>())
26922711
Cur = ATL.getWrappedLoc();
2712+
else if (auto ATL = Cur.getAs<HLSLAttributedResourceTypeLoc>())
2713+
Cur = ATL.getWrappedLoc();
26932714
else if (auto ETL = Cur.getAs<ElaboratedTypeLoc>())
26942715
Cur = ETL.getNamedTypeLoc();
26952716
else if (auto ATL = Cur.getAs<AdjustedTypeLoc>())

clang/include/clang/AST/TypeProperties.td

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -687,6 +687,25 @@ let Class = BTFTagAttributedType in {
687687
}]>;
688688
}
689689

690+
let Class = HLSLAttributedResourceType in {
691+
def : Property<"resClass", UInt32> {
692+
let Read = [{ static_cast<uint32_t>(node->getAttrs().ResourceClass) }];
693+
}
694+
def : Property<"isROV", Bool> {
695+
let Read = [{ node->getAttrs().IsROV }];
696+
}
697+
def : Property<"wrappedTy", QualType> {
698+
let Read = [{ node->getWrappedType() }];
699+
}
700+
def : Property<"containedTy", QualType> {
701+
let Read = [{ node->getContainedType() }];
702+
}
703+
def : Creator<[{
704+
HLSLAttributedResourceType::Attributes attrs(static_cast<llvm::dxil::ResourceClass>(resClass), isROV);
705+
return ctx.getHLSLAttributedResourceType(wrappedTy, containedTy, attrs);
706+
}]>;
707+
}
708+
690709
let Class = DependentAddressSpaceType in {
691710
def : Property<"pointeeType", QualType> {
692711
let Read = [{ node->getPointeeType() }];

clang/include/clang/Basic/TypeNodes.td

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -93,6 +93,7 @@ def EnumType : TypeNode<TagType>, LeafType;
9393
def ElaboratedType : TypeNode<Type>, NeverCanonical;
9494
def AttributedType : TypeNode<Type>, NeverCanonical;
9595
def BTFTagAttributedType : TypeNode<Type>, NeverCanonical;
96+
def HLSLAttributedResourceType : TypeNode<Type>, NeverCanonical;
9697
def TemplateTypeParmType : TypeNode<Type>, AlwaysDependent, LeafType;
9798
def SubstTemplateTypeParmType : TypeNode<Type>, NeverCanonical;
9899
def SubstTemplateTypeParmPackType : TypeNode<Type>, AlwaysDependent;

clang/include/clang/Sema/SemaHLSL.h

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -59,8 +59,11 @@ class SemaHLSL : public SemaBase {
5959
void handleResourceClassAttr(Decl *D, const ParsedAttr &AL);
6060
void handleResourceBindingAttr(Decl *D, const ParsedAttr &AL);
6161
void handleParamModifierAttr(Decl *D, const ParsedAttr &AL);
62+
bool handleResourceTypeAttr(const ParsedAttr &AL);
6263

6364
bool CheckBuiltinFunctionCall(unsigned BuiltinID, CallExpr *TheCall);
65+
QualType ProcessResourceTypeAttributes(QualType Wrapped);
66+
SourceLocation TakeLocForHLSLAttribute(const HLSLAttributedResourceType *RT);
6467

6568
// HLSL Type trait implementations
6669
bool IsScalarizedLayoutCompatible(QualType T1, QualType T2) const;

clang/include/clang/Serialization/TypeBitCodes.def

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -67,5 +67,6 @@ TYPE_BIT_CODE(BTFTagAttributed, BTFTAG_ATTRIBUTED, 55)
6767
TYPE_BIT_CODE(PackIndexing, PACK_INDEXING, 56)
6868
TYPE_BIT_CODE(CountAttributed, COUNT_ATTRIBUTED, 57)
6969
TYPE_BIT_CODE(ArrayParameter, ARRAY_PARAMETER, 58)
70+
TYPE_BIT_CODE(HLSLAttributedResource, HLSLRESOURCE_ATTRIBUTED, 59)
7071

7172
#undef TYPE_BIT_CODE

clang/lib/AST/ASTContext.cpp

Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2406,6 +2406,10 @@ TypeInfo ASTContext::getTypeInfoImpl(const Type *T) const {
24062406
return getTypeInfo(
24072407
cast<BTFTagAttributedType>(T)->getWrappedType().getTypePtr());
24082408

2409+
case Type::HLSLAttributedResource:
2410+
return getTypeInfo(
2411+
cast<HLSLAttributedResourceType>(T)->getWrappedType().getTypePtr());
2412+
24092413
case Type::Atomic: {
24102414
// Start with the base type information.
24112415
TypeInfo Info = getTypeInfo(cast<AtomicType>(T)->getValueType());
@@ -5219,6 +5223,28 @@ QualType ASTContext::getBTFTagAttributedType(const BTFTypeTagAttr *BTFAttr,
52195223
return QualType(Ty, 0);
52205224
}
52215225

5226+
QualType ASTContext::getHLSLAttributedResourceType(
5227+
QualType Wrapped, QualType Contained,
5228+
const HLSLAttributedResourceType::Attributes &Attrs) {
5229+
5230+
llvm::FoldingSetNodeID ID;
5231+
HLSLAttributedResourceType::Profile(ID, Wrapped, Contained, Attrs);
5232+
5233+
void *InsertPos = nullptr;
5234+
HLSLAttributedResourceType *Ty =
5235+
HLSLAttributedResourceTypes.FindNodeOrInsertPos(ID, InsertPos);
5236+
if (Ty)
5237+
return QualType(Ty, 0);
5238+
5239+
QualType Canon = getCanonicalType(Wrapped);
5240+
Ty = new (*this, alignof(HLSLAttributedResourceType))
5241+
HLSLAttributedResourceType(Canon, Wrapped, Contained, Attrs);
5242+
5243+
Types.push_back(Ty);
5244+
HLSLAttributedResourceTypes.InsertNode(Ty, InsertPos);
5245+
5246+
return QualType(Ty, 0);
5247+
}
52225248
/// Retrieve a substitution-result type.
52235249
QualType ASTContext::getSubstTemplateTypeParmType(
52245250
QualType Replacement, Decl *AssociatedDecl, unsigned Index,
@@ -13584,6 +13610,7 @@ static QualType getCommonSugarTypeNode(ASTContext &Ctx, const Type *X,
1358413610
CANONICAL_TYPE(FunctionNoProto)
1358513611
CANONICAL_TYPE(FunctionProto)
1358613612
CANONICAL_TYPE(IncompleteArray)
13613+
CANONICAL_TYPE(HLSLAttributedResource)
1358713614
CANONICAL_TYPE(LValueReference)
1358813615
CANONICAL_TYPE(MemberPointer)
1358913616
CANONICAL_TYPE(ObjCInterface)

clang/lib/AST/ASTImporter.cpp

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1832,6 +1832,19 @@ ExpectedType clang::ASTNodeImporter::VisitBTFTagAttributedType(
18321832
ToWrappedType);
18331833
}
18341834

1835+
ExpectedType clang::ASTNodeImporter::VisitHLSLAttributedResourceType(
1836+
const clang::HLSLAttributedResourceType *T) {
1837+
Error Err = Error::success();
1838+
const HLSLAttributedResourceType::Attributes &ToAttrs = T->getAttrs();
1839+
QualType ToWrappedType = importChecked(Err, T->getWrappedType());
1840+
QualType ToContainedType = importChecked(Err, T->getContainedType());
1841+
if (Err)
1842+
return std::move(Err);
1843+
1844+
return Importer.getToContext().getHLSLAttributedResourceType(
1845+
ToWrappedType, ToContainedType, ToAttrs);
1846+
}
1847+
18351848
ExpectedType clang::ASTNodeImporter::VisitConstantMatrixType(
18361849
const clang::ConstantMatrixType *T) {
18371850
ExpectedType ToElementTypeOrErr = import(T->getElementType());

clang/lib/AST/ASTStructuralEquivalence.cpp

Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -799,6 +799,16 @@ static bool IsEquivalentExceptionSpec(StructuralEquivalenceContext &Context,
799799
return true;
800800
}
801801

802+
// Determine structural equivalence of two instances of
803+
// HLSLAttributedResourceType::Attributes
804+
static bool
805+
IsStructurallyEquivalent(StructuralEquivalenceContext &Context,
806+
const HLSLAttributedResourceType::Attributes &Attrs1,
807+
const HLSLAttributedResourceType::Attributes &Attrs2) {
808+
return std::tie(Attrs1.ResourceClass, Attrs1.IsROV) ==
809+
std::tie(Attrs2.ResourceClass, Attrs2.IsROV);
810+
}
811+
802812
/// Determine structural equivalence of two types.
803813
static bool IsStructurallyEquivalent(StructuralEquivalenceContext &Context,
804814
QualType T1, QualType T2) {
@@ -1093,6 +1103,21 @@ static bool IsStructurallyEquivalent(StructuralEquivalenceContext &Context,
10931103
return false;
10941104
break;
10951105

1106+
case Type::HLSLAttributedResource:
1107+
if (!IsStructurallyEquivalent(
1108+
Context, cast<HLSLAttributedResourceType>(T1)->getWrappedType(),
1109+
cast<HLSLAttributedResourceType>(T2)->getWrappedType()))
1110+
return false;
1111+
if (!IsStructurallyEquivalent(
1112+
Context, cast<HLSLAttributedResourceType>(T1)->getContainedType(),
1113+
cast<HLSLAttributedResourceType>(T2)->getContainedType()))
1114+
return false;
1115+
if (!IsStructurallyEquivalent(
1116+
Context, cast<HLSLAttributedResourceType>(T1)->getAttrs(),
1117+
cast<HLSLAttributedResourceType>(T2)->getAttrs()))
1118+
return false;
1119+
break;
1120+
10961121
case Type::Paren:
10971122
if (!IsStructurallyEquivalent(Context, cast<ParenType>(T1)->getInnerType(),
10981123
cast<ParenType>(T2)->getInnerType()))

clang/lib/AST/ItaniumMangle.cpp

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2419,6 +2419,7 @@ bool CXXNameMangler::mangleUnresolvedTypeOrSimpleId(QualType Ty,
24192419
case Type::Paren:
24202420
case Type::Attributed:
24212421
case Type::BTFTagAttributed:
2422+
case Type::HLSLAttributedResource:
24222423
case Type::Auto:
24232424
case Type::DeducedTemplateSpecialization:
24242425
case Type::PackExpansion:

clang/lib/AST/TypeLoc.cpp

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -726,6 +726,11 @@ namespace {
726726
return Visit(T.getWrappedLoc());
727727
}
728728

729+
TypeLoc
730+
VisitHLSLAttributedResourceTypeLoc(HLSLAttributedResourceTypeLoc T) {
731+
return Visit(T.getWrappedLoc());
732+
}
733+
729734
TypeLoc VisitMacroQualifiedTypeLoc(MacroQualifiedTypeLoc T) {
730735
return Visit(T.getInnerLoc());
731736
}

clang/lib/AST/TypePrinter.cpp

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -247,6 +247,7 @@ bool TypePrinter::canPrefixQualifiers(const Type *T,
247247
case Type::BitInt:
248248
case Type::DependentBitInt:
249249
case Type::BTFTagAttributed:
250+
case Type::HLSLAttributedResource:
250251
CanPrefixQualifiers = true;
251252
break;
252253

@@ -2048,6 +2049,23 @@ void TypePrinter::printBTFTagAttributedAfter(const BTFTagAttributedType *T,
20482049
printAfter(T->getWrappedType(), OS);
20492050
}
20502051

2052+
void TypePrinter::printHLSLAttributedResourceBefore(
2053+
const HLSLAttributedResourceType *T, raw_ostream &OS) {
2054+
printBefore(T->getWrappedType(), OS);
2055+
2056+
const HLSLAttributedResourceType::Attributes &Attrs = T->getAttrs();
2057+
OS << " [[hlsl::resource_class("
2058+
<< HLSLResourceClassAttr::ConvertResourceClassToStr(Attrs.ResourceClass)
2059+
<< ")]]";
2060+
if (Attrs.IsROV)
2061+
OS << " [[hlsl::is_rov()]]";
2062+
}
2063+
2064+
void TypePrinter::printHLSLAttributedResourceAfter(
2065+
const HLSLAttributedResourceType *T, raw_ostream &OS) {
2066+
printAfter(T->getWrappedType(), OS);
2067+
}
2068+
20512069
void TypePrinter::printObjCInterfaceBefore(const ObjCInterfaceType *T,
20522070
raw_ostream &OS) {
20532071
OS << T->getDecl()->getName();

clang/lib/CodeGen/CGDebugInfo.cpp

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3851,6 +3851,7 @@ llvm::DIType *CGDebugInfo::CreateTypeNode(QualType Ty, llvm::DIFile *Unit) {
38513851
case Type::Auto:
38523852
case Type::Attributed:
38533853
case Type::BTFTagAttributed:
3854+
case Type::HLSLAttributedResource:
38543855
case Type::Adjusted:
38553856
case Type::Decayed:
38563857
case Type::DeducedTemplateSpecialization:

clang/lib/CodeGen/CodeGenFunction.cpp

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2493,6 +2493,7 @@ void CodeGenFunction::EmitVariablyModifiedType(QualType type) {
24932493
case Type::UnaryTransform:
24942494
case Type::Attributed:
24952495
case Type::BTFTagAttributed:
2496+
case Type::HLSLAttributedResource:
24962497
case Type::SubstTemplateTypeParm:
24972498
case Type::MacroQualified:
24982499
case Type::CountAttributed:

0 commit comments

Comments
 (0)