Skip to content

Commit 869ddc5

Browse files
committed
cr feedback - update itanium mangling of flags, do not compare wrapped type
1 parent 7710bfb commit 869ddc5

File tree

2 files changed

+11
-8
lines changed

2 files changed

+11
-8
lines changed

clang/lib/AST/ASTContext.cpp

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -11544,10 +11544,12 @@ QualType ASTContext::mergeTypes(QualType LHS, QualType RHS, bool OfBlockPointer,
1154411544
LHS->castAs<HLSLAttributedResourceType>();
1154511545
const HLSLAttributedResourceType *RHSTy =
1154611546
RHS->castAs<HLSLAttributedResourceType>();
11547+
assert(LHSTy->getWrappedType() == RHSTy->getWrappedType() &&
11548+
LHSTy->getWrappedType()->isHLSLResourceType() &&
11549+
"HLSLAttributedResourceType should always wrap __hlsl_resource_t");
1154711550

11548-
if (LHSTy->getWrappedType() == RHSTy->getWrappedType() &&
11549-
LHSTy->getContainedType() == RHSTy->getContainedType() &&
11550-
LHSTy->getAttrs() == RHSTy->getAttrs())
11551+
if (LHSTy->getAttrs() == RHSTy->getAttrs() &&
11552+
LHSTy->getContainedType() == RHSTy->getContainedType())
1155111553
return LHS;
1155211554
return {};
1155311555
}

clang/lib/AST/ItaniumMangle.cpp

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -4510,14 +4510,15 @@ void CXXNameMangler::mangleType(const HLSLAttributedResourceType *T) {
45104510
Str += "_s";
45114511
break;
45124512
}
4513-
mangleVendorQualifier(Str);
45144513
if (Attrs.IsROV)
4515-
mangleVendorQualifier("_ROV");
4514+
Str += "_ROV";
45164515
if (Attrs.RawBuffer)
4517-
mangleVendorQualifier("_Raw");
4516+
Str += "_Raw";
4517+
if (T->hasContainedType())
4518+
Str += "_CT";
4519+
mangleVendorQualifier(Str);
45184520

4519-
if (!T->hasContainedType()) {
4520-
mangleVendorQualifier("__CT");
4521+
if (T->hasContainedType()) {
45214522
mangleType(T->getContainedType());
45224523
}
45234524
mangleType(T->getWrappedType());

0 commit comments

Comments
 (0)