Skip to content

Commit a07dbf1

Browse files
committed
[clang][NFC] Annotate PrettyPrinter.h with preferred_type
1 parent c032225 commit a07dbf1

File tree

1 file changed

+38
-0
lines changed

1 file changed

+38
-0
lines changed

clang/include/clang/AST/PrettyPrinter.h

Lines changed: 38 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -106,6 +106,7 @@ struct PrintingPolicy {
106106
/// declaration for "x", so that we will print "int *x"; it will be
107107
/// \c true when we print "y", so that we suppress printing the
108108
/// "const int" type specifier and instead only print the "*y".
109+
LLVM_PREFERRED_TYPE(bool)
109110
unsigned SuppressSpecifiers : 1;
110111

111112
/// Whether type printing should skip printing the tag keyword.
@@ -116,6 +117,7 @@ struct PrintingPolicy {
116117
/// \code
117118
/// struct Geometry::Point;
118119
/// \endcode
120+
LLVM_PREFERRED_TYPE(bool)
119121
unsigned SuppressTagKeyword : 1;
120122

121123
/// When true, include the body of a tag definition.
@@ -126,22 +128,27 @@ struct PrintingPolicy {
126128
/// \code
127129
/// typedef struct { int x, y; } Point;
128130
/// \endcode
131+
LLVM_PREFERRED_TYPE(bool)
129132
unsigned IncludeTagDefinition : 1;
130133

131134
/// Suppresses printing of scope specifiers.
135+
LLVM_PREFERRED_TYPE(bool)
132136
unsigned SuppressScope : 1;
133137

134138
/// Suppress printing parts of scope specifiers that are never
135139
/// written, e.g., for anonymous namespaces.
140+
LLVM_PREFERRED_TYPE(bool)
136141
unsigned SuppressUnwrittenScope : 1;
137142

138143
/// Suppress printing parts of scope specifiers that correspond
139144
/// to inline namespaces, where the name is unambiguous with the specifier
140145
/// removed.
146+
LLVM_PREFERRED_TYPE(bool)
141147
unsigned SuppressInlineNamespace : 1;
142148

143149
/// Ignore qualifiers and tag keywords as specified by elaborated type sugar,
144150
/// instead letting the underlying type print as normal.
151+
LLVM_PREFERRED_TYPE(bool)
145152
unsigned SuppressElaboration : 1;
146153

147154
/// Suppress printing of variable initializers.
@@ -155,6 +162,7 @@ struct PrintingPolicy {
155162
///
156163
/// SuppressInitializers will be true when printing "auto x", so that the
157164
/// internal initializer constructed for x will not be printed.
165+
LLVM_PREFERRED_TYPE(bool)
158166
unsigned SuppressInitializers : 1;
159167

160168
/// Whether we should print the sizes of constant array expressions as written
@@ -173,81 +181,101 @@ struct PrintingPolicy {
173181
/// int a[104];
174182
/// char a[9] = "A string";
175183
/// \endcode
184+
LLVM_PREFERRED_TYPE(bool)
176185
unsigned ConstantArraySizeAsWritten : 1;
177186

178187
/// When printing an anonymous tag name, also print the location of that
179188
/// entity (e.g., "enum <anonymous at t.h:10:5>"). Otherwise, just prints
180189
/// "(anonymous)" for the name.
190+
LLVM_PREFERRED_TYPE(bool)
181191
unsigned AnonymousTagLocations : 1;
182192

183193
/// When true, suppress printing of the __strong lifetime qualifier in ARC.
194+
LLVM_PREFERRED_TYPE(bool)
184195
unsigned SuppressStrongLifetime : 1;
185196

186197
/// When true, suppress printing of lifetime qualifier in ARC.
198+
LLVM_PREFERRED_TYPE(bool)
187199
unsigned SuppressLifetimeQualifiers : 1;
188200

189201
/// When true, suppresses printing template arguments in names of C++
190202
/// constructors.
203+
LLVM_PREFERRED_TYPE(bool)
191204
unsigned SuppressTemplateArgsInCXXConstructors : 1;
192205

193206
/// When true, attempt to suppress template arguments that match the default
194207
/// argument for the parameter.
208+
LLVM_PREFERRED_TYPE(bool)
195209
unsigned SuppressDefaultTemplateArgs : 1;
196210

197211
/// Whether we can use 'bool' rather than '_Bool' (even if the language
198212
/// doesn't actually have 'bool', because, e.g., it is defined as a macro).
213+
LLVM_PREFERRED_TYPE(bool)
199214
unsigned Bool : 1;
200215

201216
/// Whether we should use 'nullptr' rather than '0' as a null pointer
202217
/// constant.
218+
LLVM_PREFERRED_TYPE(bool)
203219
unsigned Nullptr : 1;
204220

205221
/// Whether 'nullptr_t' is in namespace 'std' or not.
222+
LLVM_PREFERRED_TYPE(bool)
206223
unsigned NullptrTypeInNamespace : 1;
207224

208225
/// Whether we can use 'restrict' rather than '__restrict'.
226+
LLVM_PREFERRED_TYPE(bool)
209227
unsigned Restrict : 1;
210228

211229
/// Whether we can use 'alignof' rather than '__alignof'.
230+
LLVM_PREFERRED_TYPE(bool)
212231
unsigned Alignof : 1;
213232

214233
/// Whether we can use '_Alignof' rather than '__alignof'.
234+
LLVM_PREFERRED_TYPE(bool)
215235
unsigned UnderscoreAlignof : 1;
216236

217237
/// Whether we should use '(void)' rather than '()' for a function prototype
218238
/// with zero parameters.
239+
LLVM_PREFERRED_TYPE(bool)
219240
unsigned UseVoidForZeroParams : 1;
220241

221242
/// Whether nested templates must be closed like 'a\<b\<c\> \>' rather than
222243
/// 'a\<b\<c\>\>'.
244+
LLVM_PREFERRED_TYPE(bool)
223245
unsigned SplitTemplateClosers : 1;
224246

225247
/// Provide a 'terse' output.
226248
///
227249
/// For example, in this mode we don't print function bodies, class members,
228250
/// declarations inside namespaces etc. Effectively, this should print
229251
/// only the requested declaration.
252+
LLVM_PREFERRED_TYPE(bool)
230253
unsigned TerseOutput : 1;
231254

232255
/// When true, do certain refinement needed for producing proper declaration
233256
/// tag; such as, do not print attributes attached to the declaration.
234257
///
258+
LLVM_PREFERRED_TYPE(bool)
235259
unsigned PolishForDeclaration : 1;
236260

237261
/// When true, print the half-precision floating-point type as 'half'
238262
/// instead of '__fp16'
263+
LLVM_PREFERRED_TYPE(bool)
239264
unsigned Half : 1;
240265

241266
/// When true, print the built-in wchar_t type as __wchar_t. For use in
242267
/// Microsoft mode when wchar_t is not available.
268+
LLVM_PREFERRED_TYPE(bool)
243269
unsigned MSWChar : 1;
244270

245271
/// When true, include newlines after statements like "break", etc.
272+
LLVM_PREFERRED_TYPE(bool)
246273
unsigned IncludeNewlines : 1;
247274

248275
/// Use whitespace and punctuation like MSVC does. In particular, this prints
249276
/// anonymous namespaces as `anonymous namespace' and does not insert spaces
250277
/// after template arguments.
278+
LLVM_PREFERRED_TYPE(bool)
251279
unsigned MSVCFormatting : 1;
252280

253281
/// Whether we should print the constant expressions as written in the
@@ -266,42 +294,52 @@ struct PrintingPolicy {
266294
/// 0x10
267295
/// 2.5e3
268296
/// \endcode
297+
LLVM_PREFERRED_TYPE(bool)
269298
unsigned ConstantsAsWritten : 1;
270299

271300
/// When true, don't print the implicit 'self' or 'this' expressions.
301+
LLVM_PREFERRED_TYPE(bool)
272302
unsigned SuppressImplicitBase : 1;
273303

274304
/// When true, print the fully qualified name of function declarations.
275305
/// This is the opposite of SuppressScope and thus overrules it.
306+
LLVM_PREFERRED_TYPE(bool)
276307
unsigned FullyQualifiedName : 1;
277308

278309
/// Whether to print types as written or canonically.
310+
LLVM_PREFERRED_TYPE(bool)
279311
unsigned PrintCanonicalTypes : 1;
280312

281313
/// Whether to print an InjectedClassNameType with template arguments or as
282314
/// written. When a template argument is unnamed, printing it results in
283315
/// invalid C++ code.
316+
LLVM_PREFERRED_TYPE(bool)
284317
unsigned PrintInjectedClassNameWithArguments : 1;
285318

286319
/// Whether to use C++ template preferred_name attributes when printing
287320
/// templates.
321+
LLVM_PREFERRED_TYPE(bool)
288322
unsigned UsePreferredNames : 1;
289323

290324
/// Whether to use type suffixes (eg: 1U) on integral non-type template
291325
/// parameters.
326+
LLVM_PREFERRED_TYPE(bool)
292327
unsigned AlwaysIncludeTypeForTemplateArgument : 1;
293328

294329
/// Whether to strip underscores when printing reserved parameter names.
295330
/// e.g. std::vector<class _Tp> becomes std::vector<class Tp>.
296331
/// This only affects parameter names, and so describes a compatible API.
332+
LLVM_PREFERRED_TYPE(bool)
297333
unsigned CleanUglifiedParameters : 1;
298334

299335
/// Whether to print the entire array initializers, especially on non-type
300336
/// template parameters, no matter how many elements there are.
337+
LLVM_PREFERRED_TYPE(bool)
301338
unsigned EntireContentsOfLargeArray : 1;
302339

303340
/// Whether to print enumerator non-type template parameters with a matching
304341
/// enumerator name or via cast of an integer.
342+
LLVM_PREFERRED_TYPE(bool)
305343
unsigned UseEnumerators : 1;
306344

307345
/// Callbacks to use to allow the behavior of printing to be customized.

0 commit comments

Comments
 (0)