@@ -566,6 +566,14 @@ class Attr {
566
566
// attribute may be documented under multiple categories, more than one
567
567
// Documentation entry may be listed.
568
568
list<Documentation> Documentation;
569
+ // The SYCL specification allows attributes on lambdas as a nonconforming
570
+ // extension to C++. The attributes are written in the type position but will
571
+ // be applied to the generated function declaration rather than type. Setting
572
+ // this bit to 1 opts an attribute into this nonconforming extension. New
573
+ // attributes should not set this bit unless the attribute is required by the
574
+ // SYCL specification. This bit only applies to the [[]] spelling of an
575
+ // attribute and has no effect on any other spellings.
576
+ bit SupportsNonconformingLambdaSyntax = 0;
569
577
}
570
578
571
579
/// A type attribute is not processed on a declaration or a statement.
@@ -1186,6 +1194,7 @@ def SYCLSimd : InheritableAttr {
1186
1194
let Subjects = SubjectList<[Function]>;
1187
1195
let LangOpts = [SYCLExplicitSIMD];
1188
1196
let Documentation = [SYCLSimdDocs];
1197
+ let SupportsNonconformingLambdaSyntax = 1;
1189
1198
}
1190
1199
1191
1200
// Available in SYCL explicit SIMD extension. Binds a file scope private
@@ -1258,11 +1267,12 @@ def SYCLRequiresDecomposition : InheritableAttr {
1258
1267
}
1259
1268
1260
1269
def SYCLIntelKernelArgsRestrict : InheritableAttr {
1261
- let Spellings = [ CXX11<"intel", "kernel_args_restrict"> ];
1270
+ let Spellings = [CXX11<"intel", "kernel_args_restrict">];
1262
1271
let Subjects = SubjectList<[Function], ErrorDiag>;
1263
- let LangOpts = [ SYCLIsDevice, SYCLIsHost ];
1264
- let Documentation = [ SYCLIntelKernelArgsRestrictDocs ];
1272
+ let LangOpts = [SYCLIsDevice, SYCLIsHost];
1273
+ let Documentation = [SYCLIntelKernelArgsRestrictDocs];
1265
1274
let SimpleHandler = 1;
1275
+ let SupportsNonconformingLambdaSyntax = 1;
1266
1276
}
1267
1277
1268
1278
def SYCLIntelNumSimdWorkItems : InheritableAttr {
@@ -1272,13 +1282,15 @@ def SYCLIntelNumSimdWorkItems : InheritableAttr {
1272
1282
let LangOpts = [SYCLIsDevice, SYCLIsHost];
1273
1283
let Subjects = SubjectList<[Function], ErrorDiag>;
1274
1284
let Documentation = [SYCLIntelNumSimdWorkItemsAttrDocs];
1285
+ let SupportsNonconformingLambdaSyntax = 1;
1275
1286
}
1276
1287
1277
1288
def SYCLIntelUseStallEnableClusters : InheritableAttr {
1278
1289
let Spellings = [CXX11<"intel","use_stall_enable_clusters">];
1279
1290
let LangOpts = [SYCLIsHost, SYCLIsDevice];
1280
1291
let Subjects = SubjectList<[Function], ErrorDiag>;
1281
1292
let Documentation = [SYCLIntelUseStallEnableClustersAttrDocs];
1293
+ let SupportsNonconformingLambdaSyntax = 1;
1282
1294
}
1283
1295
1284
1296
def SYCLIntelSchedulerTargetFmaxMhz : InheritableAttr {
@@ -1288,6 +1300,7 @@ def SYCLIntelSchedulerTargetFmaxMhz : InheritableAttr {
1288
1300
let LangOpts = [SYCLIsDevice, SYCLIsHost];
1289
1301
let Subjects = SubjectList<[Function], ErrorDiag>;
1290
1302
let Documentation = [SYCLIntelSchedulerTargetFmaxMhzAttrDocs];
1303
+ let SupportsNonconformingLambdaSyntax = 1;
1291
1304
}
1292
1305
1293
1306
def SYCLIntelMaxWorkGroupSize : InheritableAttr {
@@ -1313,6 +1326,7 @@ def SYCLIntelMaxWorkGroupSize : InheritableAttr {
1313
1326
}
1314
1327
}];
1315
1328
let Documentation = [SYCLIntelMaxWorkGroupSizeAttrDocs];
1329
+ let SupportsNonconformingLambdaSyntax = 1;
1316
1330
}
1317
1331
1318
1332
def SYCLIntelMaxGlobalWorkDim : InheritableAttr {
@@ -1322,6 +1336,7 @@ def SYCLIntelMaxGlobalWorkDim : InheritableAttr {
1322
1336
let LangOpts = [SYCLIsDevice, SYCLIsHost];
1323
1337
let Subjects = SubjectList<[Function], ErrorDiag>;
1324
1338
let Documentation = [SYCLIntelMaxGlobalWorkDimAttrDocs];
1339
+ let SupportsNonconformingLambdaSyntax = 1;
1325
1340
}
1326
1341
1327
1342
def SYCLIntelNoGlobalWorkOffset : InheritableAttr {
@@ -1331,6 +1346,7 @@ def SYCLIntelNoGlobalWorkOffset : InheritableAttr {
1331
1346
let LangOpts = [SYCLIsDevice, SilentlyIgnoreSYCLIsHost];
1332
1347
let Subjects = SubjectList<[Function], ErrorDiag>;
1333
1348
let Documentation = [SYCLIntelNoGlobalWorkOffsetAttrDocs];
1349
+ let SupportsNonconformingLambdaSyntax = 1;
1334
1350
}
1335
1351
1336
1352
def SYCLIntelLoopFuse : InheritableAttr {
@@ -1342,6 +1358,7 @@ def SYCLIntelLoopFuse : InheritableAttr {
1342
1358
let Accessors = [Accessor<"isIndependent",
1343
1359
[CXX11<"intel", "loop_fuse_independent">]>];
1344
1360
let Documentation = [SYCLIntelLoopFuseDocs];
1361
+ let SupportsNonconformingLambdaSyntax = 1;
1345
1362
}
1346
1363
1347
1364
def C11NoReturn : InheritableAttr {
@@ -1404,6 +1421,7 @@ def IntelReqdSubGroupSize: InheritableAttr {
1404
1421
let Subjects = SubjectList<[Function], ErrorDiag>;
1405
1422
let Documentation = [IntelReqdSubGroupSizeDocs];
1406
1423
let LangOpts = [OpenCL, SYCLIsDevice, SilentlyIgnoreSYCLIsHost];
1424
+ let SupportsNonconformingLambdaSyntax = 1;
1407
1425
}
1408
1426
1409
1427
// This attribute is both a type attribute, and a declaration attribute (for
@@ -2808,6 +2826,7 @@ def ReqdWorkGroupSize : InheritableAttr {
2808
2826
}
2809
2827
}];
2810
2828
let Documentation = [ReqdWorkGroupSizeAttrDocs];
2829
+ let SupportsNonconformingLambdaSyntax = 1;
2811
2830
}
2812
2831
2813
2832
def WorkGroupSizeHint : InheritableAttr {
0 commit comments