@@ -137,7 +137,6 @@ static void diagnoseBadTypeAttribute(Sema &S, const ParsedAttr &attr,
137137 case ParsedAttr::AT_VectorCall: \
138138 case ParsedAttr::AT_AArch64VectorPcs: \
139139 case ParsedAttr::AT_AArch64SVEPcs: \
140- case ParsedAttr::AT_DeviceKernel: \
141140 case ParsedAttr::AT_MSABI: \
142141 case ParsedAttr::AT_SysVABI: \
143142 case ParsedAttr::AT_Pcs: \
@@ -3848,7 +3847,8 @@ static CallingConv getCCForDeclaratorChunk(
38483847 }
38493848 }
38503849 }
3851- for (const ParsedAttr &AL : D.getDeclSpec ().getAttributes ()) {
3850+ for (const ParsedAttr &AL : llvm::concat<ParsedAttr>(
3851+ D.getDeclSpec ().getAttributes (), D.getAttributes ())) {
38523852 if (AL.getKind () == ParsedAttr::AT_DeviceKernel) {
38533853 CC = CC_DeviceKernel;
38543854 break ;
@@ -7672,8 +7672,6 @@ static Attr *getCCTypeAttr(ASTContext &Ctx, ParsedAttr &Attr) {
76727672 return createSimpleAttr<AArch64SVEPcsAttr>(Ctx, Attr);
76737673 case ParsedAttr::AT_ArmStreaming:
76747674 return createSimpleAttr<ArmStreamingAttr>(Ctx, Attr);
7675- case ParsedAttr::AT_DeviceKernel:
7676- return createSimpleAttr<DeviceKernelAttr>(Ctx, Attr);
76777675 case ParsedAttr::AT_Pcs: {
76787676 // The attribute may have had a fixit applied where we treated an
76797677 // identifier as a string literal. The contents of the string are valid,
@@ -9750,16 +9748,6 @@ static void HandleHLSLParamModifierAttr(TypeProcessingState &State,
97509748 }
97519749}
97529750
9753- static bool isMultiSubjectAttrAllowedOnType (const ParsedAttr &Attr) {
9754- // The DeviceKernel attribute is shared for many targets, and
9755- // it is only allowed to be a type attribute with the AMDGPU
9756- // spelling, so skip processing the attr as a type attr
9757- // unless it has that spelling.
9758- if (Attr.getKind () != ParsedAttr::AT_DeviceKernel)
9759- return true ;
9760- return DeviceKernelAttr::isAMDGPUSpelling (Attr);
9761- }
9762-
97639751static void processTypeAttrs (TypeProcessingState &state, QualType &type,
97649752 TypeAttrLocation TAL,
97659753 const ParsedAttributesView &attrs,
@@ -10029,8 +10017,6 @@ static void processTypeAttrs(TypeProcessingState &state, QualType &type,
1002910017 break ;
1003010018 [[fallthrough]];
1003110019 FUNCTION_TYPE_ATTRS_CASELIST:
10032- if (!isMultiSubjectAttrAllowedOnType (attr))
10033- break ;
1003410020
1003510021 attr.setUsedAsTypeAttr ();
1003610022
0 commit comments