@@ -5204,16 +5204,7 @@ static void handleCallConvAttr(Sema &S, Decl *D, const ParsedAttr &AL) {
52045204static void handleDeviceKernelAttr (Sema &S, Decl *D, const ParsedAttr &AL) {
52055205 const auto *FD = dyn_cast_or_null<FunctionDecl>(D);
52065206 bool IsFunctionTemplate = FD && FD->getDescribedFunctionTemplate ();
5207- if (S.getLangOpts ().SYCLIsDevice ) {
5208- if (!IsFunctionTemplate) {
5209- S.Diag (AL.getLoc (), diag::warn_attribute_wrong_decl_type_str)
5210- << AL << AL.isRegularKeywordAttribute () << " function templates" ;
5211- } else {
5212- S.SYCL ().handleKernelAttr (D, AL);
5213- }
5214- } else if (DeviceKernelAttr::isSYCLSpelling (AL)) {
5215- S.Diag (AL.getLoc (), diag::warn_attribute_ignored) << AL;
5216- } else if (S.getASTContext ().getTargetInfo ().getTriple ().isNVPTX ()) {
5207+ if (S.getASTContext ().getTargetInfo ().getTriple ().isNVPTX ()) {
52175208 handleGlobalAttr (S, D, AL);
52185209 } else {
52195210 // OpenCL C++ will throw a more specific error.
@@ -7100,6 +7091,9 @@ ProcessDeclAttribute(Sema &S, Scope *scope, Decl *D, const ParsedAttr &AL,
71007091 case ParsedAttr::AT_EnumExtensibility:
71017092 handleEnumExtensibilityAttr (S, D, AL);
71027093 break ;
7094+ case ParsedAttr::AT_SYCLKernel:
7095+ S.SYCL ().handleKernelAttr (D, AL);
7096+ break ;
71037097 case ParsedAttr::AT_SYCLExternal:
71047098 handleSimpleAttribute<SYCLExternalAttr>(S, D, AL);
71057099 break ;
0 commit comments