@@ -19,10 +19,19 @@ def DocCatType : DocumentationCategory<"Type Attributes">;
19
19
def DocCatStmt : DocumentationCategory<"Statement Attributes">;
20
20
def DocCatDecl : DocumentationCategory<"Declaration Attributes">;
21
21
22
- // Attributes listed under the Undocumented category do not generate any public
23
- // documentation. Ideally, this category should be used for internal-only
24
- // attributes which contain no spellings.
25
- def DocCatUndocumented : DocumentationCategory<"Undocumented">;
22
+ // This category is for attributes which have not yet been properly documented,
23
+ // but should be.
24
+ def DocCatUndocumented : DocumentationCategory<"Undocumented"> {
25
+ let Content = [{
26
+ This section lists attributes which are recognized by Clang, but which are
27
+ currently missing documentation.
28
+ }];
29
+ }
30
+
31
+ // Attributes listed under the InternalOnly category do not generate any entry
32
+ // in the documentation. This category should be used only when we _want_
33
+ // to not document the attribute, e.g. if the attribute has no spellings.
34
+ def DocCatInternalOnly : DocumentationCategory<"InternalOnly">;
26
35
27
36
class DocDeprecated<string replacement = ""> {
28
37
// If the Replacement field is empty, no replacement will be listed with the
@@ -48,11 +57,17 @@ class Documentation {
48
57
DocDeprecated Deprecated;
49
58
}
50
59
51
- // Specifies that the attribute is explicitly undocumented. This can be a
52
- // helpful placeholder for the attribute while working on the implementation,
53
- // but should not be used once feature work has been completed.
60
+ // Specifies that the attribute is explicitly omitted from the documentation,
61
+ // because it is not intended to be user-facing.
62
+ def InternalOnly : Documentation {
63
+ let Category = DocCatInternalOnly;
64
+ }
65
+
66
+ // Specifies that the attribute is undocumented, but that it _should_ have
67
+ // documentation.
54
68
def Undocumented : Documentation {
55
69
let Category = DocCatUndocumented;
70
+ let Content = "No documentation.";
56
71
}
57
72
58
73
include "clang/Basic/AttrDocs.td"
@@ -626,7 +641,7 @@ class IgnoredAttr : Attr {
626
641
let Ignored = 1;
627
642
let ASTNode = 0;
628
643
let SemaHandler = 0;
629
- let Documentation = [Undocumented ];
644
+ let Documentation = [InternalOnly ];
630
645
}
631
646
632
647
//
@@ -706,14 +721,14 @@ def AlignMac68k : InheritableAttr {
706
721
// This attribute has no spellings as it is only ever created implicitly.
707
722
let Spellings = [];
708
723
let SemaHandler = 0;
709
- let Documentation = [Undocumented ];
724
+ let Documentation = [InternalOnly ];
710
725
}
711
726
712
727
def AlignNatural : InheritableAttr {
713
728
// This attribute has no spellings as it is only ever created implicitly.
714
729
let Spellings = [];
715
730
let SemaHandler = 0;
716
- let Documentation = [Undocumented ];
731
+ let Documentation = [InternalOnly ];
717
732
}
718
733
719
734
def AlwaysInline : DeclOrStmtAttr {
@@ -1188,7 +1203,7 @@ def CUDAInvalidTarget : InheritableAttr {
1188
1203
let Spellings = [];
1189
1204
let Subjects = SubjectList<[Function]>;
1190
1205
let LangOpts = [CUDA];
1191
- let Documentation = [Undocumented ];
1206
+ let Documentation = [InternalOnly ];
1192
1207
}
1193
1208
1194
1209
def CUDALaunchBounds : InheritableAttr {
@@ -1440,7 +1455,9 @@ def Final : InheritableAttr {
1440
1455
let Spellings = [Keyword<"final">, Keyword<"sealed">];
1441
1456
let Accessors = [Accessor<"isSpelledAsSealed", [Keyword<"sealed">]>];
1442
1457
let SemaHandler = 0;
1443
- let Documentation = [Undocumented];
1458
+ // Omitted from docs, since this is language syntax, not an attribute, as far
1459
+ // as users are concerned.
1460
+ let Documentation = [InternalOnly];
1444
1461
}
1445
1462
1446
1463
def MinSize : InheritableAttr {
@@ -1502,8 +1519,6 @@ def GNUInline : InheritableAttr {
1502
1519
def Hot : InheritableAttr {
1503
1520
let Spellings = [GCC<"hot">];
1504
1521
let Subjects = SubjectList<[Function]>;
1505
- // An AST node is created for this attribute, but not actually used beyond
1506
- // semantic checking for mutual exclusion with the Cold attribute.
1507
1522
let Documentation = [Undocumented];
1508
1523
let SimpleHandler = 1;
1509
1524
}
@@ -1582,7 +1597,7 @@ def MaxFieldAlignment : InheritableAttr {
1582
1597
let Spellings = [];
1583
1598
let Args = [UnsignedArgument<"Alignment">];
1584
1599
let SemaHandler = 0;
1585
- let Documentation = [Undocumented ];
1600
+ let Documentation = [InternalOnly ];
1586
1601
}
1587
1602
1588
1603
def MayAlias : InheritableAttr {
@@ -1994,7 +2009,7 @@ def TypeNullUnspecified : TypeAttr {
1994
2009
// qualifier is as an ObjCOwnership attribute with Kind == "none".
1995
2010
def ObjCInertUnsafeUnretained : TypeAttr {
1996
2011
let Spellings = [Keyword<"__unsafe_unretained">];
1997
- let Documentation = [Undocumented ];
2012
+ let Documentation = [InternalOnly ];
1998
2013
}
1999
2014
2000
2015
def ObjCKindOf : TypeAttr {
@@ -2278,7 +2293,9 @@ def Overloadable : Attr {
2278
2293
def Override : InheritableAttr {
2279
2294
let Spellings = [Keyword<"override">];
2280
2295
let SemaHandler = 0;
2281
- let Documentation = [Undocumented];
2296
+ // Omitted from docs, since this is language syntax, not an attribute, as far
2297
+ // as users are concerned.
2298
+ let Documentation = [InternalOnly];
2282
2299
}
2283
2300
2284
2301
def Ownership : InheritableAttr {
@@ -2467,47 +2484,47 @@ def PragmaClangBSSSection : InheritableAttr {
2467
2484
let Spellings = [];
2468
2485
let Args = [StringArgument<"Name">];
2469
2486
let Subjects = SubjectList<[GlobalVar], ErrorDiag>;
2470
- let Documentation = [Undocumented ];
2487
+ let Documentation = [InternalOnly ];
2471
2488
}
2472
2489
2473
2490
def PragmaClangDataSection : InheritableAttr {
2474
2491
// This attribute has no spellings as it is only ever created implicitly.
2475
2492
let Spellings = [];
2476
2493
let Args = [StringArgument<"Name">];
2477
2494
let Subjects = SubjectList<[GlobalVar], ErrorDiag>;
2478
- let Documentation = [Undocumented ];
2495
+ let Documentation = [InternalOnly ];
2479
2496
}
2480
2497
2481
2498
def PragmaClangRodataSection : InheritableAttr {
2482
2499
// This attribute has no spellings as it is only ever created implicitly.
2483
2500
let Spellings = [];
2484
2501
let Args = [StringArgument<"Name">];
2485
2502
let Subjects = SubjectList<[GlobalVar], ErrorDiag>;
2486
- let Documentation = [Undocumented ];
2503
+ let Documentation = [InternalOnly ];
2487
2504
}
2488
2505
2489
2506
def PragmaClangRelroSection : InheritableAttr {
2490
2507
// This attribute has no spellings as it is only ever created implicitly.
2491
2508
let Spellings = [];
2492
2509
let Args = [StringArgument<"Name">];
2493
2510
let Subjects = SubjectList<[GlobalVar], ErrorDiag>;
2494
- let Documentation = [Undocumented ];
2511
+ let Documentation = [InternalOnly ];
2495
2512
}
2496
2513
2497
2514
def StrictFP : InheritableAttr {
2498
2515
// This attribute has no spellings as it is only ever created implicitly.
2499
2516
// Function uses strict floating point operations.
2500
2517
let Spellings = [];
2501
2518
let Subjects = SubjectList<[Function]>;
2502
- let Documentation = [Undocumented ];
2519
+ let Documentation = [InternalOnly ];
2503
2520
}
2504
2521
2505
2522
def PragmaClangTextSection : InheritableAttr {
2506
2523
// This attribute has no spellings as it is only ever created implicitly.
2507
2524
let Spellings = [];
2508
2525
let Args = [StringArgument<"Name">];
2509
2526
let Subjects = SubjectList<[Function], ErrorDiag>;
2510
- let Documentation = [Undocumented ];
2527
+ let Documentation = [InternalOnly ];
2511
2528
}
2512
2529
2513
2530
def Sentinel : InheritableAttr {
@@ -3496,7 +3513,7 @@ def DLLExportStaticLocal : InheritableAttr, TargetSpecificAttr<TargetHasDLLImpor
3496
3513
// the function has local static variables, the function is dllexported too.
3497
3514
let Spellings = [];
3498
3515
let Subjects = SubjectList<[Function]>;
3499
- let Documentation = [Undocumented ];
3516
+ let Documentation = [InternalOnly ];
3500
3517
}
3501
3518
3502
3519
def DLLImport : InheritableAttr, TargetSpecificAttr<TargetHasDLLImportExport> {
@@ -3522,7 +3539,7 @@ def DLLImportStaticLocal : InheritableAttr, TargetSpecificAttr<TargetHasDLLImpor
3522
3539
// attribute is used to determine whether the variables are imported or not.
3523
3540
let Spellings = [];
3524
3541
let Subjects = SubjectList<[Function]>;
3525
- let Documentation = [Undocumented ];
3542
+ let Documentation = [InternalOnly ];
3526
3543
}
3527
3544
3528
3545
def SelectAny : InheritableAttr {
@@ -3588,7 +3605,7 @@ def MSVtorDisp : InheritableAttr {
3588
3605
let AdditionalMembers = [{
3589
3606
MSVtorDispMode getVtorDispMode() const { return MSVtorDispMode(vdm); }
3590
3607
}];
3591
- let Documentation = [Undocumented ];
3608
+ let Documentation = [InternalOnly ];
3592
3609
}
3593
3610
3594
3611
def InitSeg : Attr {
@@ -3680,29 +3697,29 @@ def CapturedRecord : InheritableAttr {
3680
3697
// This attribute has no spellings as it is only ever created implicitly.
3681
3698
let Spellings = [];
3682
3699
let SemaHandler = 0;
3683
- let Documentation = [Undocumented ];
3700
+ let Documentation = [InternalOnly ];
3684
3701
}
3685
3702
3686
3703
def OMPThreadPrivateDecl : InheritableAttr {
3687
3704
// This attribute has no spellings as it is only ever created implicitly.
3688
3705
let Spellings = [];
3689
3706
let SemaHandler = 0;
3690
- let Documentation = [Undocumented ];
3707
+ let Documentation = [InternalOnly ];
3691
3708
}
3692
3709
3693
3710
def OMPCaptureNoInit : InheritableAttr {
3694
3711
// This attribute has no spellings as it is only ever created implicitly.
3695
3712
let Spellings = [];
3696
3713
let SemaHandler = 0;
3697
- let Documentation = [Undocumented ];
3714
+ let Documentation = [InternalOnly ];
3698
3715
}
3699
3716
3700
3717
def OMPCaptureKind : Attr {
3701
3718
// This attribute has no spellings as it is only ever created implicitly.
3702
3719
let Spellings = [];
3703
3720
let SemaHandler = 0;
3704
3721
let Args = [UnsignedArgument<"CaptureKindVal">];
3705
- let Documentation = [Undocumented ];
3722
+ let Documentation = [InternalOnly ];
3706
3723
let AdditionalMembers = [{
3707
3724
llvm::omp::Clause getCaptureKind() const {
3708
3725
return static_cast<llvm::omp::Clause>(getCaptureKindVal());
@@ -3715,7 +3732,7 @@ def OMPReferencedVar : Attr {
3715
3732
let Spellings = [];
3716
3733
let SemaHandler = 0;
3717
3734
let Args = [ExprArgument<"Ref">];
3718
- let Documentation = [Undocumented ];
3735
+ let Documentation = [InternalOnly ];
3719
3736
}
3720
3737
3721
3738
def OMPDeclareSimdDecl : Attr {
@@ -3788,7 +3805,7 @@ def OMPAllocateDecl : InheritableAttr {
3788
3805
ExprArgument<"Allocator">,
3789
3806
ExprArgument<"Alignment">
3790
3807
];
3791
- let Documentation = [Undocumented ];
3808
+ let Documentation = [InternalOnly ];
3792
3809
}
3793
3810
3794
3811
def OMPDeclareVariant : InheritableAttr {
@@ -3945,7 +3962,7 @@ def Builtin : InheritableAttr {
3945
3962
let Args = [UnsignedArgument<"ID">];
3946
3963
let Subjects = SubjectList<[Function]>;
3947
3964
let SemaHandler = 0;
3948
- let Documentation = [Undocumented ];
3965
+ let Documentation = [InternalOnly ];
3949
3966
}
3950
3967
3951
3968
def EnforceTCB : InheritableAttr {
0 commit comments