@@ -513,7 +513,7 @@ def AbiTag : Attr {
513
513
}
514
514
515
515
def AddressSpace : TypeAttr {
516
- let Spellings = [GNU <"address_space">];
516
+ let Spellings = [Clang <"address_space">];
517
517
let Args = [IntArgument<"AddressSpace">];
518
518
let Documentation = [Undocumented];
519
519
}
@@ -545,6 +545,9 @@ def AlignValue : Attr {
545
545
// the future (and a corresponding C++ attribute), but this can be done
546
546
// later once we decide if we also want them to have slightly-different
547
547
// semantics than Intel's align_value.
548
+ //
549
+ // Does not get a [[]] spelling because the attribute is not exposed as such
550
+ // by Intel.
548
551
GNU<"align_value">
549
552
// Intel's compiler on Windows also supports:
550
553
// , Declspec<"align_value">
@@ -593,12 +596,15 @@ def TLSModel : InheritableAttr {
593
596
}
594
597
595
598
def AnalyzerNoReturn : InheritableAttr {
599
+ // TODO: should this attribute be exposed with a [[]] spelling under the clang
600
+ // vendor namespace, or should it use a vendor namespace specific to the
601
+ // analyzer?
596
602
let Spellings = [GNU<"analyzer_noreturn">];
597
603
let Documentation = [Undocumented];
598
604
}
599
605
600
606
def Annotate : InheritableParamAttr {
601
- let Spellings = [GNU <"annotate">];
607
+ let Spellings = [Clang <"annotate">];
602
608
let Args = [StringArgument<"Annotation">];
603
609
// Ensure that the annotate attribute can be used with
604
610
// '#pragma clang attribute' even though it has no subject list.
@@ -640,6 +646,8 @@ def AsmLabel : InheritableAttr {
640
646
}
641
647
642
648
def Availability : InheritableAttr {
649
+ // TODO: does not have a [[]] spelling because it requires custom parsing
650
+ // support.
643
651
let Spellings = [GNU<"availability">];
644
652
let Args = [IdentifierArgument<"platform">, VersionArgument<"introduced">,
645
653
VersionArgument<"deprecated">, VersionArgument<"obsoleted">,
@@ -700,12 +708,13 @@ def ExternalSourceSymbol : InheritableAttr {
700
708
}
701
709
702
710
def Blocks : InheritableAttr {
703
- let Spellings = [GNU <"blocks">];
711
+ let Spellings = [Clang <"blocks">];
704
712
let Args = [EnumArgument<"Type", "BlockType", ["byref"], ["ByRef"]>];
705
713
let Documentation = [Undocumented];
706
714
}
707
715
708
716
def Bounded : IgnoredAttr {
717
+ // Does not have a [[]] spelling because the attribute is ignored.
709
718
let Spellings = [GNU<"bounded">];
710
719
}
711
720
@@ -727,7 +736,7 @@ def CDecl : InheritableAttr {
727
736
// cf_returns_retained attributes. It is generally applied by
728
737
// '#pragma clang arc_cf_code_audited' rather than explicitly.
729
738
def CFAuditedTransfer : InheritableAttr {
730
- let Spellings = [GNU <"cf_audited_transfer">];
739
+ let Spellings = [Clang <"cf_audited_transfer">];
731
740
let Subjects = SubjectList<[Function], ErrorDiag>;
732
741
let Documentation = [Undocumented];
733
742
}
@@ -736,25 +745,25 @@ def CFAuditedTransfer : InheritableAttr {
736
745
// It indicates that the function has unknown or unautomatable
737
746
// transfer semantics.
738
747
def CFUnknownTransfer : InheritableAttr {
739
- let Spellings = [GNU <"cf_unknown_transfer">];
748
+ let Spellings = [Clang <"cf_unknown_transfer">];
740
749
let Subjects = SubjectList<[Function], ErrorDiag>;
741
750
let Documentation = [Undocumented];
742
751
}
743
752
744
753
def CFReturnsRetained : InheritableAttr {
745
- let Spellings = [GNU <"cf_returns_retained">];
754
+ let Spellings = [Clang <"cf_returns_retained">];
746
755
// let Subjects = SubjectList<[ObjCMethod, ObjCProperty, Function]>;
747
756
let Documentation = [Undocumented];
748
757
}
749
758
750
759
def CFReturnsNotRetained : InheritableAttr {
751
- let Spellings = [GNU <"cf_returns_not_retained">];
760
+ let Spellings = [Clang <"cf_returns_not_retained">];
752
761
// let Subjects = SubjectList<[ObjCMethod, ObjCProperty, Function]>;
753
762
let Documentation = [Undocumented];
754
763
}
755
764
756
765
def CFConsumed : InheritableParamAttr {
757
- let Spellings = [GNU <"cf_consumed">];
766
+ let Spellings = [Clang <"cf_consumed">];
758
767
let Subjects = SubjectList<[ParmVar]>;
759
768
let Documentation = [Undocumented];
760
769
}
@@ -790,8 +799,8 @@ def Constructor : InheritableAttr {
790
799
let Documentation = [Undocumented];
791
800
}
792
801
793
- // CUDA attributes are spelled __attribute__((attr)) or __declspec(__attr__).
794
-
802
+ // CUDA attributes are spelled __attribute__((attr)) or __declspec(__attr__),
803
+ // and they do not receive a [[]] spelling.
795
804
def CUDAConstant : InheritableAttr {
796
805
let Spellings = [GNU<"constant">, Declspec<"__constant__">];
797
806
let Subjects = SubjectList<[Var]>;
@@ -875,11 +884,13 @@ def C11NoReturn : InheritableAttr {
875
884
}
876
885
877
886
def CXX11NoReturn : InheritableAttr {
878
- let Spellings = [CXX11<"","noreturn", 200809>];
887
+ let Spellings = [CXX11<"", "noreturn", 200809>];
879
888
let Subjects = SubjectList<[Function], ErrorDiag>;
880
889
let Documentation = [CXX11NoReturnDocs];
881
890
}
882
891
892
+ // Similar to CUDA, OpenCL attributes do not receive a [[]] spelling because
893
+ // the specification does not expose them with one currently.
883
894
def OpenCLKernel : InheritableAttr {
884
895
let Spellings = [Keyword<"__kernel">, Keyword<"kernel">];
885
896
let Subjects = SubjectList<[Function], ErrorDiag>;
@@ -988,6 +999,9 @@ def AllocSize : InheritableAttr {
988
999
}
989
1000
990
1001
def EnableIf : InheritableAttr {
1002
+ // Does not have a [[]] spelling because this attribute requires the ability
1003
+ // to parse function arguments but the attribute is not written in the type
1004
+ // position.
991
1005
let Spellings = [GNU<"enable_if">];
992
1006
let Subjects = SubjectList<[Function]>;
993
1007
let Args = [ExprArgument<"Cond">, StringArgument<"Message">];
@@ -996,6 +1010,7 @@ def EnableIf : InheritableAttr {
996
1010
}
997
1011
998
1012
def ExtVectorType : Attr {
1013
+ // This is an OpenCL-related attribute and does not receive a [[]] spelling.
999
1014
let Spellings = [GNU<"ext_vector_type">];
1000
1015
let Subjects = SubjectList<[TypedefName], ErrorDiag>;
1001
1016
let Args = [ExprArgument<"NumElements">];
@@ -1030,13 +1045,13 @@ def Final : InheritableAttr {
1030
1045
}
1031
1046
1032
1047
def MinSize : InheritableAttr {
1033
- let Spellings = [GNU <"minsize">];
1048
+ let Spellings = [Clang <"minsize">];
1034
1049
let Subjects = SubjectList<[Function, ObjCMethod], ErrorDiag>;
1035
1050
let Documentation = [Undocumented];
1036
1051
}
1037
1052
1038
1053
def FlagEnum : InheritableAttr {
1039
- let Spellings = [GNU <"flag_enum">];
1054
+ let Spellings = [Clang <"flag_enum">];
1040
1055
let Subjects = SubjectList<[Enum]>;
1041
1056
let Documentation = [FlagEnumDocs];
1042
1057
}
@@ -1085,7 +1100,7 @@ def Hot : InheritableAttr {
1085
1100
}
1086
1101
1087
1102
def IBAction : InheritableAttr {
1088
- let Spellings = [GNU <"ibaction">];
1103
+ let Spellings = [Clang <"ibaction">];
1089
1104
let Subjects = SubjectList<[ObjCInstanceMethod]>;
1090
1105
// An AST node is created for this attribute, but is not used by other parts
1091
1106
// of the compiler. However, this node needs to exist in the AST because
@@ -1094,13 +1109,13 @@ def IBAction : InheritableAttr {
1094
1109
}
1095
1110
1096
1111
def IBOutlet : InheritableAttr {
1097
- let Spellings = [GNU <"iboutlet">];
1112
+ let Spellings = [Clang <"iboutlet">];
1098
1113
// let Subjects = [ObjCIvar, ObjCProperty];
1099
1114
let Documentation = [Undocumented];
1100
1115
}
1101
1116
1102
1117
def IBOutletCollection : InheritableAttr {
1103
- let Spellings = [GNU <"iboutletcollection">];
1118
+ let Spellings = [Clang <"iboutletcollection">];
1104
1119
let Args = [TypeArgument<"Interface", 1>];
1105
1120
// let Subjects = [ObjCIvar, ObjCProperty];
1106
1121
let Documentation = [Undocumented];
@@ -1210,13 +1225,13 @@ def Naked : InheritableAttr {
1210
1225
}
1211
1226
1212
1227
def NeonPolyVectorType : TypeAttr {
1213
- let Spellings = [GNU <"neon_polyvector_type">];
1228
+ let Spellings = [Clang <"neon_polyvector_type">];
1214
1229
let Args = [IntArgument<"NumElements">];
1215
1230
let Documentation = [Undocumented];
1216
1231
}
1217
1232
1218
1233
def NeonVectorType : TypeAttr {
1219
- let Spellings = [GNU <"neon_vector_type">];
1234
+ let Spellings = [Clang <"neon_vector_type">];
1220
1235
let Args = [IntArgument<"NumElements">];
1221
1236
let Documentation = [Undocumented];
1222
1237
}
@@ -1299,28 +1314,28 @@ def NoMicroMips : InheritableAttr, TargetSpecificAttr<TargetMips32> {
1299
1314
// this should be rejected on non-kernels.
1300
1315
1301
1316
def AMDGPUFlatWorkGroupSize : InheritableAttr {
1302
- let Spellings = [GNU <"amdgpu_flat_work_group_size">];
1317
+ let Spellings = [Clang <"amdgpu_flat_work_group_size">];
1303
1318
let Args = [UnsignedArgument<"Min">, UnsignedArgument<"Max">];
1304
1319
let Documentation = [AMDGPUFlatWorkGroupSizeDocs];
1305
1320
let Subjects = SubjectList<[Function], ErrorDiag, "kernel functions">;
1306
1321
}
1307
1322
1308
1323
def AMDGPUWavesPerEU : InheritableAttr {
1309
- let Spellings = [GNU <"amdgpu_waves_per_eu">];
1324
+ let Spellings = [Clang <"amdgpu_waves_per_eu">];
1310
1325
let Args = [UnsignedArgument<"Min">, UnsignedArgument<"Max", 1>];
1311
1326
let Documentation = [AMDGPUWavesPerEUDocs];
1312
1327
let Subjects = SubjectList<[Function], ErrorDiag, "kernel functions">;
1313
1328
}
1314
1329
1315
1330
def AMDGPUNumSGPR : InheritableAttr {
1316
- let Spellings = [GNU <"amdgpu_num_sgpr">];
1331
+ let Spellings = [Clang <"amdgpu_num_sgpr">];
1317
1332
let Args = [UnsignedArgument<"NumSGPR">];
1318
1333
let Documentation = [AMDGPUNumSGPRNumVGPRDocs];
1319
1334
let Subjects = SubjectList<[Function], ErrorDiag, "kernel functions">;
1320
1335
}
1321
1336
1322
1337
def AMDGPUNumVGPR : InheritableAttr {
1323
- let Spellings = [GNU <"amdgpu_num_vgpr">];
1338
+ let Spellings = [Clang <"amdgpu_num_vgpr">];
1324
1339
let Args = [UnsignedArgument<"NumVGPR">];
1325
1340
let Documentation = [AMDGPUNumSGPRNumVGPRDocs];
1326
1341
let Subjects = SubjectList<[Function], ErrorDiag, "kernel functions">;
@@ -1360,7 +1375,7 @@ def ReturnsNonNull : InheritableAttr {
1360
1375
// pass_object_size(N) indicates that the parameter should have
1361
1376
// __builtin_object_size with Type=N evaluated on the parameter at the callsite.
1362
1377
def PassObjectSize : InheritableParamAttr {
1363
- let Spellings = [GNU <"pass_object_size">];
1378
+ let Spellings = [Clang <"pass_object_size">];
1364
1379
let Args = [IntArgument<"Type">];
1365
1380
let Subjects = SubjectList<[ParmVar]>;
1366
1381
let Documentation = [PassObjectSizeDocs];
@@ -1433,26 +1448,29 @@ def NoThrow : InheritableAttr {
1433
1448
1434
1449
def NvWeak : IgnoredAttr {
1435
1450
// No Declspec spelling of this attribute; the CUDA headers use
1436
- // __attribute__((nv_weak)) unconditionally.
1451
+ // __attribute__((nv_weak)) unconditionally. Does not receive an [[]]
1452
+ // spelling because it is a CUDA attribute.
1437
1453
let Spellings = [GNU<"nv_weak">];
1438
1454
let LangOpts = [CUDA];
1439
1455
}
1440
1456
1441
1457
def ObjCBridge : InheritableAttr {
1442
- let Spellings = [GNU <"objc_bridge">];
1458
+ let Spellings = [Clang <"objc_bridge">];
1443
1459
let Subjects = SubjectList<[Record, TypedefName], ErrorDiag>;
1444
1460
let Args = [IdentifierArgument<"BridgedType">];
1445
1461
let Documentation = [Undocumented];
1446
1462
}
1447
1463
1448
1464
def ObjCBridgeMutable : InheritableAttr {
1449
- let Spellings = [GNU <"objc_bridge_mutable">];
1465
+ let Spellings = [Clang <"objc_bridge_mutable">];
1450
1466
let Subjects = SubjectList<[Record], ErrorDiag>;
1451
1467
let Args = [IdentifierArgument<"BridgedType">];
1452
1468
let Documentation = [Undocumented];
1453
1469
}
1454
1470
1455
1471
def ObjCBridgeRelated : InheritableAttr {
1472
+ // TODO: this attribute does not have a [[]] spelling because it requires
1473
+ // custom parsing support.
1456
1474
let Spellings = [GNU<"objc_bridge_related">];
1457
1475
let Subjects = SubjectList<[Record], ErrorDiag>;
1458
1476
let Args = [IdentifierArgument<"RelatedClass">,
@@ -1463,43 +1481,43 @@ def ObjCBridgeRelated : InheritableAttr {
1463
1481
}
1464
1482
1465
1483
def NSReturnsRetained : InheritableAttr {
1466
- let Spellings = [GNU <"ns_returns_retained">];
1484
+ let Spellings = [Clang <"ns_returns_retained">];
1467
1485
// let Subjects = SubjectList<[ObjCMethod, ObjCProperty, Function]>;
1468
1486
let Documentation = [Undocumented];
1469
1487
}
1470
1488
1471
1489
def NSReturnsNotRetained : InheritableAttr {
1472
- let Spellings = [GNU <"ns_returns_not_retained">];
1490
+ let Spellings = [Clang <"ns_returns_not_retained">];
1473
1491
// let Subjects = SubjectList<[ObjCMethod, ObjCProperty, Function]>;
1474
1492
let Documentation = [Undocumented];
1475
1493
}
1476
1494
1477
1495
def NSReturnsAutoreleased : InheritableAttr {
1478
- let Spellings = [GNU <"ns_returns_autoreleased">];
1496
+ let Spellings = [Clang <"ns_returns_autoreleased">];
1479
1497
// let Subjects = SubjectList<[ObjCMethod, ObjCProperty, Function]>;
1480
1498
let Documentation = [Undocumented];
1481
1499
}
1482
1500
1483
1501
def NSConsumesSelf : InheritableAttr {
1484
- let Spellings = [GNU <"ns_consumes_self">];
1502
+ let Spellings = [Clang <"ns_consumes_self">];
1485
1503
let Subjects = SubjectList<[ObjCMethod]>;
1486
1504
let Documentation = [Undocumented];
1487
1505
}
1488
1506
1489
1507
def NSConsumed : InheritableParamAttr {
1490
- let Spellings = [GNU <"ns_consumed">];
1508
+ let Spellings = [Clang <"ns_consumed">];
1491
1509
let Subjects = SubjectList<[ParmVar]>;
1492
1510
let Documentation = [Undocumented];
1493
1511
}
1494
1512
1495
1513
def ObjCException : InheritableAttr {
1496
- let Spellings = [GNU <"objc_exception">];
1514
+ let Spellings = [Clang <"objc_exception">];
1497
1515
let Subjects = SubjectList<[ObjCInterface], ErrorDiag>;
1498
1516
let Documentation = [Undocumented];
1499
1517
}
1500
1518
1501
1519
def ObjCMethodFamily : InheritableAttr {
1502
- let Spellings = [GNU <"objc_method_family">];
1520
+ let Spellings = [Clang <"objc_method_family">];
1503
1521
let Subjects = SubjectList<[ObjCMethod], ErrorDiag>;
1504
1522
let Args = [EnumArgument<"Family", "FamilyKind",
1505
1523
["none", "alloc", "copy", "init", "mutableCopy", "new"],
@@ -1509,72 +1527,72 @@ def ObjCMethodFamily : InheritableAttr {
1509
1527
}
1510
1528
1511
1529
def ObjCNSObject : InheritableAttr {
1512
- let Spellings = [GNU <"NSObject">];
1530
+ let Spellings = [Clang <"NSObject">];
1513
1531
let Documentation = [Undocumented];
1514
1532
}
1515
1533
1516
1534
def ObjCIndependentClass : InheritableAttr {
1517
- let Spellings = [GNU <"objc_independent_class">];
1535
+ let Spellings = [Clang <"objc_independent_class">];
1518
1536
let Documentation = [Undocumented];
1519
1537
}
1520
1538
1521
1539
def ObjCPreciseLifetime : InheritableAttr {
1522
- let Spellings = [GNU <"objc_precise_lifetime">];
1540
+ let Spellings = [Clang <"objc_precise_lifetime">];
1523
1541
let Subjects = SubjectList<[Var], ErrorDiag>;
1524
1542
let Documentation = [Undocumented];
1525
1543
}
1526
1544
1527
1545
def ObjCReturnsInnerPointer : InheritableAttr {
1528
- let Spellings = [GNU <"objc_returns_inner_pointer">];
1546
+ let Spellings = [Clang <"objc_returns_inner_pointer">];
1529
1547
let Subjects = SubjectList<[ObjCMethod, ObjCProperty], ErrorDiag>;
1530
1548
let Documentation = [Undocumented];
1531
1549
}
1532
1550
1533
1551
def ObjCRequiresSuper : InheritableAttr {
1534
- let Spellings = [GNU <"objc_requires_super">];
1552
+ let Spellings = [Clang <"objc_requires_super">];
1535
1553
let Subjects = SubjectList<[ObjCMethod], ErrorDiag>;
1536
1554
let Documentation = [ObjCRequiresSuperDocs];
1537
1555
}
1538
1556
1539
1557
def ObjCRootClass : InheritableAttr {
1540
- let Spellings = [GNU <"objc_root_class">];
1558
+ let Spellings = [Clang <"objc_root_class">];
1541
1559
let Subjects = SubjectList<[ObjCInterface], ErrorDiag>;
1542
1560
let Documentation = [Undocumented];
1543
1561
}
1544
1562
1545
1563
def ObjCSubclassingRestricted : InheritableAttr {
1546
- let Spellings = [GNU <"objc_subclassing_restricted">];
1564
+ let Spellings = [Clang <"objc_subclassing_restricted">];
1547
1565
let Subjects = SubjectList<[ObjCInterface], ErrorDiag>;
1548
1566
let Documentation = [ObjCSubclassingRestrictedDocs];
1549
1567
}
1550
1568
1551
1569
def ObjCExplicitProtocolImpl : InheritableAttr {
1552
- let Spellings = [GNU <"objc_protocol_requires_explicit_implementation">];
1570
+ let Spellings = [Clang <"objc_protocol_requires_explicit_implementation">];
1553
1571
let Subjects = SubjectList<[ObjCProtocol], ErrorDiag>;
1554
1572
let Documentation = [Undocumented];
1555
1573
}
1556
1574
1557
1575
def ObjCDesignatedInitializer : Attr {
1558
- let Spellings = [GNU <"objc_designated_initializer">];
1576
+ let Spellings = [Clang <"objc_designated_initializer">];
1559
1577
let Subjects = SubjectList<[ObjCInterfaceDeclInitMethod], ErrorDiag>;
1560
1578
let Documentation = [Undocumented];
1561
1579
}
1562
1580
1563
1581
def ObjCRuntimeName : Attr {
1564
- let Spellings = [GNU <"objc_runtime_name">];
1582
+ let Spellings = [Clang <"objc_runtime_name">];
1565
1583
let Subjects = SubjectList<[ObjCInterface, ObjCProtocol], ErrorDiag>;
1566
1584
let Args = [StringArgument<"MetadataName">];
1567
1585
let Documentation = [ObjCRuntimeNameDocs];
1568
1586
}
1569
1587
1570
1588
def ObjCRuntimeVisible : Attr {
1571
- let Spellings = [GNU <"objc_runtime_visible">];
1589
+ let Spellings = [Clang <"objc_runtime_visible">];
1572
1590
let Subjects = SubjectList<[ObjCInterface], ErrorDiag>;
1573
1591
let Documentation = [ObjCRuntimeVisibleDocs];
1574
1592
}
1575
1593
1576
1594
def ObjCBoxable : Attr {
1577
- let Spellings = [GNU <"objc_boxable">];
1595
+ let Spellings = [Clang <"objc_boxable">];
1578
1596
let Subjects = SubjectList<[Record], ErrorDiag>;
1579
1597
let Documentation = [ObjCBoxableDocs];
1580
1598
}
@@ -1586,7 +1604,7 @@ def OptimizeNone : InheritableAttr {
1586
1604
}
1587
1605
1588
1606
def Overloadable : Attr {
1589
- let Spellings = [GNU <"overloadable">];
1607
+ let Spellings = [Clang <"overloadable">];
1590
1608
let Subjects = SubjectList<[Function], ErrorDiag>;
1591
1609
let Documentation = [OverloadableDocs];
1592
1610
}
@@ -1598,11 +1616,11 @@ def Override : InheritableAttr {
1598
1616
}
1599
1617
1600
1618
def Ownership : InheritableAttr {
1601
- let Spellings = [GNU <"ownership_holds">, GNU <"ownership_returns">,
1602
- GNU <"ownership_takes">];
1603
- let Accessors = [Accessor<"isHolds", [GNU <"ownership_holds">]>,
1604
- Accessor<"isReturns", [GNU <"ownership_returns">]>,
1605
- Accessor<"isTakes", [GNU <"ownership_takes">]>];
1619
+ let Spellings = [Clang <"ownership_holds">, Clang <"ownership_returns">,
1620
+ Clang <"ownership_takes">];
1621
+ let Accessors = [Accessor<"isHolds", [Clang <"ownership_holds">]>,
1622
+ Accessor<"isReturns", [Clang <"ownership_returns">]>,
1623
+ Accessor<"isTakes", [Clang <"ownership_takes">]>];
1606
1624
let AdditionalMembers = [{
1607
1625
enum OwnershipKind { Holds, Returns, Takes };
1608
1626
OwnershipKind getOwnKind() const {
@@ -1623,7 +1641,7 @@ def Packed : InheritableAttr {
1623
1641
}
1624
1642
1625
1643
def IntelOclBicc : InheritableAttr {
1626
- let Spellings = [GNU <"intel_ocl_bicc">];
1644
+ let Spellings = [Clang <"intel_ocl_bicc">];
1627
1645
// let Subjects = [Function, ObjCMethod];
1628
1646
let Documentation = [Undocumented];
1629
1647
}
@@ -1649,6 +1667,7 @@ def Regparm : TypeAttr {
1649
1667
}
1650
1668
1651
1669
def ReqdWorkGroupSize : InheritableAttr {
1670
+ // Does not have a [[]] spelling because it is an OpenCL-related attribute.
1652
1671
let Spellings = [GNU<"reqd_work_group_size">];
1653
1672
let Args = [UnsignedArgument<"XDim">, UnsignedArgument<"YDim">,
1654
1673
UnsignedArgument<"ZDim">];
@@ -1664,6 +1683,7 @@ def RequireConstantInit : InheritableAttr {
1664
1683
}
1665
1684
1666
1685
def WorkGroupSizeHint : InheritableAttr {
1686
+ // Does not have a [[]] spelling because it is an OpenCL-related attribute.
1667
1687
let Spellings = [GNU<"work_group_size_hint">];
1668
1688
let Args = [UnsignedArgument<"XDim">,
1669
1689
UnsignedArgument<"YDim">,
@@ -1734,23 +1754,23 @@ def StdCall : InheritableAttr {
1734
1754
}
1735
1755
1736
1756
def SwiftCall : InheritableAttr {
1737
- let Spellings = [GNU <"swiftcall">];
1757
+ let Spellings = [Clang <"swiftcall">];
1738
1758
// let Subjects = SubjectList<[Function]>;
1739
1759
let Documentation = [SwiftCallDocs];
1740
1760
}
1741
1761
1742
1762
def SwiftContext : ParameterABIAttr {
1743
- let Spellings = [GNU <"swift_context">];
1763
+ let Spellings = [Clang <"swift_context">];
1744
1764
let Documentation = [SwiftContextDocs];
1745
1765
}
1746
1766
1747
1767
def SwiftErrorResult : ParameterABIAttr {
1748
- let Spellings = [GNU <"swift_error_result">];
1768
+ let Spellings = [Clang <"swift_error_result">];
1749
1769
let Documentation = [SwiftErrorResultDocs];
1750
1770
}
1751
1771
1752
1772
def SwiftIndirectResult : ParameterABIAttr {
1753
- let Spellings = [GNU <"swift_indirect_result">];
1773
+ let Spellings = [Clang <"swift_indirect_result">];
1754
1774
let Documentation = [SwiftIndirectResultDocs];
1755
1775
}
1756
1776
@@ -1774,25 +1794,25 @@ def ThisCall : InheritableAttr {
1774
1794
}
1775
1795
1776
1796
def VectorCall : InheritableAttr {
1777
- let Spellings = [GNU <"vectorcall">, Keyword<"__vectorcall">,
1797
+ let Spellings = [Clang <"vectorcall">, Keyword<"__vectorcall">,
1778
1798
Keyword<"_vectorcall">];
1779
1799
// let Subjects = [Function, ObjCMethod];
1780
1800
let Documentation = [VectorCallDocs];
1781
1801
}
1782
1802
1783
1803
def Pascal : InheritableAttr {
1784
- let Spellings = [GNU <"pascal">, Keyword<"__pascal">, Keyword<"_pascal">];
1804
+ let Spellings = [Clang <"pascal">, Keyword<"__pascal">, Keyword<"_pascal">];
1785
1805
// let Subjects = [Function, ObjCMethod];
1786
1806
let Documentation = [Undocumented];
1787
1807
}
1788
1808
1789
1809
def PreserveMost : InheritableAttr {
1790
- let Spellings = [GNU <"preserve_most">];
1810
+ let Spellings = [Clang <"preserve_most">];
1791
1811
let Documentation = [PreserveMostDocs];
1792
1812
}
1793
1813
1794
1814
def PreserveAll : InheritableAttr {
1795
- let Spellings = [GNU <"preserve_all">];
1815
+ let Spellings = [Clang <"preserve_all">];
1796
1816
let Documentation = [PreserveAllDocs];
1797
1817
}
1798
1818
@@ -1853,7 +1873,7 @@ def TransparentUnion : InheritableAttr {
1853
1873
}
1854
1874
1855
1875
def Unavailable : InheritableAttr {
1856
- let Spellings = [GNU <"unavailable">];
1876
+ let Spellings = [Clang <"unavailable">];
1857
1877
let Args = [StringArgument<"Message", 1>,
1858
1878
EnumArgument<"ImplicitReason", "ImplicitReason",
1859
1879
["", "", "", ""],
@@ -1867,6 +1887,9 @@ def Unavailable : InheritableAttr {
1867
1887
}
1868
1888
1869
1889
def DiagnoseIf : InheritableAttr {
1890
+ // Does not have a [[]] spelling because this attribute requires the ability
1891
+ // to parse function arguments but the attribute is not written in the type
1892
+ // position.
1870
1893
let Spellings = [GNU<"diagnose_if">];
1871
1894
let Subjects = SubjectList<[Function, ObjCMethod, ObjCProperty]>;
1872
1895
let Args = [ExprArgument<"Cond">, StringArgument<"Message">,
@@ -1887,26 +1910,26 @@ def DiagnoseIf : InheritableAttr {
1887
1910
}
1888
1911
1889
1912
def ArcWeakrefUnavailable : InheritableAttr {
1890
- let Spellings = [GNU <"objc_arc_weak_reference_unavailable">];
1913
+ let Spellings = [Clang <"objc_arc_weak_reference_unavailable">];
1891
1914
let Subjects = SubjectList<[ObjCInterface], ErrorDiag>;
1892
1915
let Documentation = [Undocumented];
1893
1916
}
1894
1917
1895
1918
def ObjCGC : TypeAttr {
1896
- let Spellings = [GNU <"objc_gc">];
1919
+ let Spellings = [Clang <"objc_gc">];
1897
1920
let Args = [IdentifierArgument<"Kind">];
1898
1921
let Documentation = [Undocumented];
1899
1922
}
1900
1923
1901
1924
def ObjCOwnership : InheritableAttr {
1902
- let Spellings = [GNU <"objc_ownership">];
1925
+ let Spellings = [Clang <"objc_ownership">];
1903
1926
let Args = [IdentifierArgument<"Kind">];
1904
1927
let ASTNode = 0;
1905
1928
let Documentation = [Undocumented];
1906
1929
}
1907
1930
1908
1931
def ObjCRequiresPropertyDefs : InheritableAttr {
1909
- let Spellings = [GNU <"objc_requires_property_definitions">];
1932
+ let Spellings = [Clang <"objc_requires_property_definitions">];
1910
1933
let Subjects = SubjectList<[ObjCInterface], ErrorDiag>;
1911
1934
let Documentation = [Undocumented];
1912
1935
}
@@ -1941,6 +1964,7 @@ def VectorSize : TypeAttr {
1941
1964
}
1942
1965
1943
1966
def VecTypeHint : InheritableAttr {
1967
+ // Does not have a [[]] spelling because it is an OpenCL-related attribute.
1944
1968
let Spellings = [GNU<"vec_type_hint">];
1945
1969
let Args = [TypeArgument<"TypeHint">];
1946
1970
let Subjects = SubjectList<[Function], ErrorDiag>;
@@ -1968,7 +1992,7 @@ def TypeVisibility : InheritableAttr {
1968
1992
}
1969
1993
1970
1994
def VecReturn : InheritableAttr {
1971
- let Spellings = [GNU <"vecreturn">];
1995
+ let Spellings = [Clang <"vecreturn">];
1972
1996
let Subjects = SubjectList<[CXXRecord], ErrorDiag>;
1973
1997
let Documentation = [Undocumented];
1974
1998
}
@@ -1994,7 +2018,7 @@ def Weak : InheritableAttr {
1994
2018
}
1995
2019
1996
2020
def WeakImport : InheritableAttr {
1997
- let Spellings = [GNU <"weak_import">];
2021
+ let Spellings = [Clang <"weak_import">];
1998
2022
let Documentation = [Undocumented];
1999
2023
}
2000
2024
@@ -2007,7 +2031,7 @@ def WeakRef : InheritableAttr {
2007
2031
}
2008
2032
2009
2033
def LTOVisibilityPublic : InheritableAttr {
2010
- let Spellings = [CXX11<"clang", "lto_visibility_public">];
2034
+ let Spellings = [Clang< "lto_visibility_public">];
2011
2035
let Subjects = SubjectList<[Record]>;
2012
2036
let Documentation = [LTOVisibilityDocs];
2013
2037
}
@@ -2060,23 +2084,27 @@ def NoSanitizeSpecific : InheritableAttr {
2060
2084
let Spellings = [GCC<"no_address_safety_analysis">,
2061
2085
GCC<"no_sanitize_address">,
2062
2086
GCC<"no_sanitize_thread">,
2063
- GNU <"no_sanitize_memory">];
2087
+ Clang <"no_sanitize_memory">];
2064
2088
let Subjects = SubjectList<[Function, GlobalVar], ErrorDiag>;
2065
2089
let Documentation = [NoSanitizeAddressDocs, NoSanitizeThreadDocs,
2066
2090
NoSanitizeMemoryDocs];
2067
2091
let ASTNode = 0;
2068
2092
}
2069
2093
2070
2094
// C/C++ Thread safety attributes (e.g. for deadlock, data race checking)
2071
-
2095
+ // Not all of these attributes will be given a [[]] spelling. The attributes
2096
+ // which require access to function parameter names cannot use the [[]] spelling
2097
+ // because they are not written in the type position. Some attributes are given
2098
+ // an updated captability-based name and the older name will only be supported
2099
+ // under the GNU-style spelling.
2072
2100
def GuardedVar : InheritableAttr {
2073
- let Spellings = [GNU <"guarded_var">];
2101
+ let Spellings = [Clang <"guarded_var">];
2074
2102
let Subjects = SubjectList<[Field, SharedVar]>;
2075
2103
let Documentation = [Undocumented];
2076
2104
}
2077
2105
2078
2106
def PtGuardedVar : InheritableAttr {
2079
- let Spellings = [GNU <"pt_guarded_var">];
2107
+ let Spellings = [Clang <"pt_guarded_var">];
2080
2108
let Subjects = SubjectList<[Field, SharedVar]>;
2081
2109
let Documentation = [Undocumented];
2082
2110
}
@@ -2089,7 +2117,7 @@ def Lockable : InheritableAttr {
2089
2117
}
2090
2118
2091
2119
def ScopedLockable : InheritableAttr {
2092
- let Spellings = [GNU <"scoped_lockable">];
2120
+ let Spellings = [Clang <"scoped_lockable">];
2093
2121
let Subjects = SubjectList<[Record]>;
2094
2122
let Documentation = [Undocumented];
2095
2123
}
@@ -2157,7 +2185,7 @@ def ReleaseCapability : InheritableAttr {
2157
2185
let Spellings = [Clang<"release_capability">,
2158
2186
Clang<"release_shared_capability">,
2159
2187
Clang<"release_generic_capability">,
2160
- GNU <"unlock_function">];
2188
+ Clang <"unlock_function">];
2161
2189
let Subjects = SubjectList<[Function]>;
2162
2190
let LateParsed = 1;
2163
2191
let TemplateDependent = 1;
@@ -2168,28 +2196,28 @@ def ReleaseCapability : InheritableAttr {
2168
2196
[Clang<"release_shared_capability">]>,
2169
2197
Accessor<"isGeneric",
2170
2198
[Clang<"release_generic_capability">,
2171
- GNU <"unlock_function">]>];
2199
+ Clang <"unlock_function">]>];
2172
2200
let Documentation = [ReleaseCapabilityDocs];
2173
2201
}
2174
2202
2175
2203
def RequiresCapability : InheritableAttr {
2176
2204
let Spellings = [Clang<"requires_capability">,
2177
- GNU <"exclusive_locks_required">,
2205
+ Clang <"exclusive_locks_required">,
2178
2206
Clang<"requires_shared_capability">,
2179
- GNU <"shared_locks_required">];
2207
+ Clang <"shared_locks_required">];
2180
2208
let Args = [VariadicExprArgument<"Args">];
2181
2209
let LateParsed = 1;
2182
2210
let TemplateDependent = 1;
2183
2211
let ParseArgumentsAsUnevaluated = 1;
2184
2212
let DuplicatesAllowedWhileMerging = 1;
2185
2213
let Subjects = SubjectList<[Function]>;
2186
2214
let Accessors = [Accessor<"isShared", [Clang<"requires_shared_capability">,
2187
- GNU <"shared_locks_required">]>];
2215
+ Clang <"shared_locks_required">]>];
2188
2216
let Documentation = [Undocumented];
2189
2217
}
2190
2218
2191
2219
def NoThreadSafetyAnalysis : InheritableAttr {
2192
- let Spellings = [GNU <"no_thread_safety_analysis">];
2220
+ let Spellings = [Clang <"no_thread_safety_analysis">];
2193
2221
let Subjects = SubjectList<[Function]>;
2194
2222
let Documentation = [Undocumented];
2195
2223
}
@@ -2310,7 +2338,7 @@ def LocksExcluded : InheritableAttr {
2310
2338
// C/C++ consumed attributes.
2311
2339
2312
2340
def Consumable : InheritableAttr {
2313
- let Spellings = [GNU <"consumable">];
2341
+ let Spellings = [Clang <"consumable">];
2314
2342
let Subjects = SubjectList<[CXXRecord]>;
2315
2343
let Args = [EnumArgument<"DefaultState", "ConsumedState",
2316
2344
["unknown", "consumed", "unconsumed"],
@@ -2319,19 +2347,19 @@ def Consumable : InheritableAttr {
2319
2347
}
2320
2348
2321
2349
def ConsumableAutoCast : InheritableAttr {
2322
- let Spellings = [GNU <"consumable_auto_cast_state">];
2350
+ let Spellings = [Clang <"consumable_auto_cast_state">];
2323
2351
let Subjects = SubjectList<[CXXRecord]>;
2324
2352
let Documentation = [Undocumented];
2325
2353
}
2326
2354
2327
2355
def ConsumableSetOnRead : InheritableAttr {
2328
- let Spellings = [GNU <"consumable_set_state_on_read">];
2356
+ let Spellings = [Clang <"consumable_set_state_on_read">];
2329
2357
let Subjects = SubjectList<[CXXRecord]>;
2330
2358
let Documentation = [Undocumented];
2331
2359
}
2332
2360
2333
2361
def CallableWhen : InheritableAttr {
2334
- let Spellings = [GNU <"callable_when">];
2362
+ let Spellings = [Clang <"callable_when">];
2335
2363
let Subjects = SubjectList<[CXXMethod]>;
2336
2364
let Args = [VariadicEnumArgument<"CallableStates", "ConsumedState",
2337
2365
["unknown", "consumed", "unconsumed"],
@@ -2340,7 +2368,7 @@ def CallableWhen : InheritableAttr {
2340
2368
}
2341
2369
2342
2370
def ParamTypestate : InheritableAttr {
2343
- let Spellings = [GNU <"param_typestate">];
2371
+ let Spellings = [Clang <"param_typestate">];
2344
2372
let Subjects = SubjectList<[ParmVar]>;
2345
2373
let Args = [EnumArgument<"ParamState", "ConsumedState",
2346
2374
["unknown", "consumed", "unconsumed"],
@@ -2349,7 +2377,7 @@ def ParamTypestate : InheritableAttr {
2349
2377
}
2350
2378
2351
2379
def ReturnTypestate : InheritableAttr {
2352
- let Spellings = [GNU <"return_typestate">];
2380
+ let Spellings = [Clang <"return_typestate">];
2353
2381
let Subjects = SubjectList<[Function, ParmVar]>;
2354
2382
let Args = [EnumArgument<"State", "ConsumedState",
2355
2383
["unknown", "consumed", "unconsumed"],
@@ -2358,7 +2386,7 @@ def ReturnTypestate : InheritableAttr {
2358
2386
}
2359
2387
2360
2388
def SetTypestate : InheritableAttr {
2361
- let Spellings = [GNU <"set_typestate">];
2389
+ let Spellings = [Clang <"set_typestate">];
2362
2390
let Subjects = SubjectList<[CXXMethod]>;
2363
2391
let Args = [EnumArgument<"NewState", "ConsumedState",
2364
2392
["unknown", "consumed", "unconsumed"],
@@ -2367,7 +2395,7 @@ def SetTypestate : InheritableAttr {
2367
2395
}
2368
2396
2369
2397
def TestTypestate : InheritableAttr {
2370
- let Spellings = [GNU <"test_typestate">];
2398
+ let Spellings = [Clang <"test_typestate">];
2371
2399
let Subjects = SubjectList<[CXXMethod]>;
2372
2400
let Args = [EnumArgument<"TestState", "ConsumedState",
2373
2401
["consumed", "unconsumed"],
0 commit comments