@@ -27,6 +27,8 @@ class TemplateParameterList;
27
27
28
28
namespace comments {
29
29
class FullComment ;
30
+ enum class InlineCommandRenderKind ;
31
+ enum class ParamCommandPassDirection ;
30
32
31
33
// / Describes the syntax that was used in a documentation command.
32
34
// /
@@ -72,41 +74,50 @@ class Comment {
72
74
friend class Comment ;
73
75
74
76
// / Type of this AST node.
77
+ LLVM_PREFERRED_TYPE (CommentKind)
75
78
unsigned Kind : 8 ;
76
79
};
77
80
enum { NumCommentBits = 8 };
78
81
79
82
class InlineContentCommentBitfields {
80
83
friend class InlineContentComment ;
81
84
85
+ LLVM_PREFERRED_TYPE (CommentBitfields)
82
86
unsigned : NumCommentBits;
83
87
84
88
// / True if there is a newline after this inline content node.
85
89
// / (There is no separate AST node for a newline.)
90
+ LLVM_PREFERRED_TYPE (bool )
86
91
unsigned HasTrailingNewline : 1 ;
87
92
};
88
93
enum { NumInlineContentCommentBits = NumCommentBits + 1 };
89
94
90
95
class TextCommentBitfields {
91
96
friend class TextComment ;
92
97
98
+ LLVM_PREFERRED_TYPE (InlineContentCommentBitfields)
93
99
unsigned : NumInlineContentCommentBits;
94
100
95
101
// / True if \c IsWhitespace field contains a valid value.
102
+ LLVM_PREFERRED_TYPE (bool )
96
103
mutable unsigned IsWhitespaceValid : 1 ;
97
104
98
105
// / True if this comment AST node contains only whitespace.
106
+ LLVM_PREFERRED_TYPE (bool )
99
107
mutable unsigned IsWhitespace : 1 ;
100
108
};
101
109
enum { NumTextCommentBits = NumInlineContentCommentBits + 2 };
102
110
103
111
class InlineCommandCommentBitfields {
104
112
friend class InlineCommandComment ;
105
113
114
+ LLVM_PREFERRED_TYPE (InlineContentCommentBitfields)
106
115
unsigned : NumInlineContentCommentBits;
107
116
117
+ LLVM_PREFERRED_TYPE (InlineCommandRenderKind)
108
118
unsigned RenderKind : 3 ;
109
119
120
+ LLVM_PREFERRED_TYPE (CommandTraits::KnownCommandIDs)
110
121
unsigned CommandID : CommandInfo::NumCommandIDBits;
111
122
};
112
123
enum { NumInlineCommandCommentBits = NumInlineContentCommentBits + 3 +
@@ -115,46 +126,56 @@ class Comment {
115
126
class HTMLTagCommentBitfields {
116
127
friend class HTMLTagComment ;
117
128
129
+ LLVM_PREFERRED_TYPE (InlineContentCommentBitfields)
118
130
unsigned : NumInlineContentCommentBits;
119
131
120
132
// / True if we found that this tag is malformed in some way.
133
+ LLVM_PREFERRED_TYPE (bool )
121
134
unsigned IsMalformed : 1 ;
122
135
};
123
136
enum { NumHTMLTagCommentBits = NumInlineContentCommentBits + 1 };
124
137
125
138
class HTMLStartTagCommentBitfields {
126
139
friend class HTMLStartTagComment ;
127
140
141
+ LLVM_PREFERRED_TYPE (HTMLTagCommentBitfields)
128
142
unsigned : NumHTMLTagCommentBits;
129
143
130
144
// / True if this tag is self-closing (e. g., <br />). This is based on tag
131
145
// / spelling in comment (plain <br> would not set this flag).
146
+ LLVM_PREFERRED_TYPE (bool )
132
147
unsigned IsSelfClosing : 1 ;
133
148
};
134
149
enum { NumHTMLStartTagCommentBits = NumHTMLTagCommentBits + 1 };
135
150
136
151
class ParagraphCommentBitfields {
137
152
friend class ParagraphComment ;
138
153
154
+ LLVM_PREFERRED_TYPE (CommentBitfields)
139
155
unsigned : NumCommentBits;
140
156
141
157
// / True if \c IsWhitespace field contains a valid value.
158
+ LLVM_PREFERRED_TYPE (bool )
142
159
mutable unsigned IsWhitespaceValid : 1 ;
143
160
144
161
// / True if this comment AST node contains only whitespace.
162
+ LLVM_PREFERRED_TYPE (bool )
145
163
mutable unsigned IsWhitespace : 1 ;
146
164
};
147
165
enum { NumParagraphCommentBits = NumCommentBits + 2 };
148
166
149
167
class BlockCommandCommentBitfields {
150
168
friend class BlockCommandComment ;
151
169
170
+ LLVM_PREFERRED_TYPE (CommentBitfields)
152
171
unsigned : NumCommentBits;
153
172
173
+ LLVM_PREFERRED_TYPE (CommandTraits::KnownCommandIDs)
154
174
unsigned CommandID : CommandInfo::NumCommandIDBits;
155
175
156
176
// / Describes the syntax that was used in a documentation command.
157
177
// / Contains values from CommandMarkerKind enum.
178
+ LLVM_PREFERRED_TYPE (CommandMarkerKind)
158
179
unsigned CommandMarker : 1 ;
159
180
};
160
181
enum { NumBlockCommandCommentBits = NumCommentBits +
@@ -163,12 +184,15 @@ class Comment {
163
184
class ParamCommandCommentBitfields {
164
185
friend class ParamCommandComment ;
165
186
187
+ LLVM_PREFERRED_TYPE (BlockCommandCommentBitfields)
166
188
unsigned : NumBlockCommandCommentBits;
167
189
168
- // / Parameter passing direction, see ParamCommandComment::PassDirection.
190
+ // / Parameter passing direction.
191
+ LLVM_PREFERRED_TYPE (ParamCommandPassDirection)
169
192
unsigned Direction : 2 ;
170
193
171
194
// / True if direction was specified explicitly in the comment.
195
+ LLVM_PREFERRED_TYPE (bool )
172
196
unsigned IsDirectionExplicit : 1 ;
173
197
};
174
198
enum { NumParamCommandCommentBits = NumBlockCommandCommentBits + 3 };
@@ -299,7 +323,13 @@ class TextComment : public InlineContentComment {
299
323
300
324
// / The most appropriate rendering mode for this command, chosen on command
301
325
// / semantics in Doxygen.
302
- enum InlineCommandRenderKind { Normal, Bold, Monospaced, Emphasized, Anchor };
326
+ enum class InlineCommandRenderKind {
327
+ Normal,
328
+ Bold,
329
+ Monospaced,
330
+ Emphasized,
331
+ Anchor
332
+ };
303
333
304
334
// / A command with word-like arguments that is considered inline content.
305
335
class InlineCommandComment : public InlineContentComment {
@@ -1005,28 +1035,35 @@ struct DeclInfo {
1005
1035
};
1006
1036
1007
1037
// / If false, only \c CommentDecl is valid.
1038
+ LLVM_PREFERRED_TYPE (bool )
1008
1039
unsigned IsFilled : 1 ;
1009
1040
1010
1041
// / Simplified kind of \c CommentDecl, see \c DeclKind enum.
1042
+ LLVM_PREFERRED_TYPE (DeclKind)
1011
1043
unsigned Kind : 3 ;
1012
1044
1013
1045
// / Is \c CommentDecl a template declaration.
1046
+ LLVM_PREFERRED_TYPE (TemplateDeclKind)
1014
1047
unsigned TemplateKind : 2 ;
1015
1048
1016
1049
// / Is \c CommentDecl an ObjCMethodDecl.
1050
+ LLVM_PREFERRED_TYPE (bool )
1017
1051
unsigned IsObjCMethod : 1 ;
1018
1052
1019
1053
// / Is \c CommentDecl a non-static member function of C++ class or
1020
1054
// / instance method of ObjC class.
1021
1055
// / Can be true only if \c IsFunctionDecl is true.
1056
+ LLVM_PREFERRED_TYPE (bool )
1022
1057
unsigned IsInstanceMethod : 1 ;
1023
1058
1024
1059
// / Is \c CommentDecl a static member function of C++ class or
1025
1060
// / class method of ObjC class.
1026
1061
// / Can be true only if \c IsFunctionDecl is true.
1062
+ LLVM_PREFERRED_TYPE (bool )
1027
1063
unsigned IsClassMethod : 1 ;
1028
1064
1029
1065
// / Is \c CommentDecl something we consider a "function" that's variadic.
1066
+ LLVM_PREFERRED_TYPE (bool )
1030
1067
unsigned IsVariadic : 1 ;
1031
1068
1032
1069
void fill ();
0 commit comments