@@ -353,36 +353,57 @@ class DeclSpec {
353
353
354
354
private:
355
355
// storage-class-specifier
356
- /* SCS*/ unsigned StorageClassSpec : 3 ;
357
- /* TSCS*/ unsigned ThreadStorageClassSpec : 2 ;
356
+ LLVM_PREFERRED_TYPE (SCS)
357
+ unsigned StorageClassSpec : 3 ;
358
+ LLVM_PREFERRED_TYPE (TSCS)
359
+ unsigned ThreadStorageClassSpec : 2 ;
360
+ LLVM_PREFERRED_TYPE (bool )
358
361
unsigned SCS_extern_in_linkage_spec : 1 ;
359
362
360
363
// type-specifier
361
- /* TypeSpecifierWidth*/ unsigned TypeSpecWidth : 2 ;
362
- /* TSC*/ unsigned TypeSpecComplex : 2 ;
363
- /* TSS*/ unsigned TypeSpecSign : 2 ;
364
- /* TST*/ unsigned TypeSpecType : 7 ;
364
+ LLVM_PREFERRED_TYPE (TypeSpecifierWidth)
365
+ unsigned TypeSpecWidth : 2 ;
366
+ LLVM_PREFERRED_TYPE (TSC)
367
+ unsigned TypeSpecComplex : 2 ;
368
+ LLVM_PREFERRED_TYPE (TypeSpecifierSign)
369
+ unsigned TypeSpecSign : 2 ;
370
+ LLVM_PREFERRED_TYPE (TST)
371
+ unsigned TypeSpecType : 7 ;
372
+ LLVM_PREFERRED_TYPE (bool )
365
373
unsigned TypeAltiVecVector : 1 ;
374
+ LLVM_PREFERRED_TYPE (bool )
366
375
unsigned TypeAltiVecPixel : 1 ;
376
+ LLVM_PREFERRED_TYPE (bool )
367
377
unsigned TypeAltiVecBool : 1 ;
378
+ LLVM_PREFERRED_TYPE (bool )
368
379
unsigned TypeSpecOwned : 1 ;
380
+ LLVM_PREFERRED_TYPE (bool )
369
381
unsigned TypeSpecPipe : 1 ;
382
+ LLVM_PREFERRED_TYPE (bool )
370
383
unsigned TypeSpecSat : 1 ;
384
+ LLVM_PREFERRED_TYPE (bool )
371
385
unsigned ConstrainedAuto : 1 ;
372
386
373
387
// type-qualifiers
388
+ LLVM_PREFERRED_TYPE (TQ)
374
389
unsigned TypeQualifiers : 5 ; // Bitwise OR of TQ.
375
390
376
391
// function-specifier
392
+ LLVM_PREFERRED_TYPE (bool )
377
393
unsigned FS_inline_specified : 1 ;
394
+ LLVM_PREFERRED_TYPE (bool )
378
395
unsigned FS_forceinline_specified: 1 ;
396
+ LLVM_PREFERRED_TYPE (bool )
379
397
unsigned FS_virtual_specified : 1 ;
398
+ LLVM_PREFERRED_TYPE (bool )
380
399
unsigned FS_noreturn_specified : 1 ;
381
400
382
401
// friend-specifier
402
+ LLVM_PREFERRED_TYPE (bool )
383
403
unsigned Friend_specified : 1 ;
384
404
385
405
// constexpr-specifier
406
+ LLVM_PREFERRED_TYPE (ConstexprSpecKind)
386
407
unsigned ConstexprSpecifier : 2 ;
387
408
388
409
union {
@@ -1246,6 +1267,7 @@ struct DeclaratorChunk {
1246
1267
1247
1268
struct PointerTypeInfo {
1248
1269
// / The type qualifiers: const/volatile/restrict/unaligned/atomic.
1270
+ LLVM_PREFERRED_TYPE (DeclSpec::TQ)
1249
1271
unsigned TypeQuals : 5 ;
1250
1272
1251
1273
// / The location of the const-qualifier, if any.
@@ -1279,12 +1301,15 @@ struct DeclaratorChunk {
1279
1301
struct ArrayTypeInfo {
1280
1302
// / The type qualifiers for the array:
1281
1303
// / const/volatile/restrict/__unaligned/_Atomic.
1304
+ LLVM_PREFERRED_TYPE (DeclSpec::TQ)
1282
1305
unsigned TypeQuals : 5 ;
1283
1306
1284
1307
// / True if this dimension included the 'static' keyword.
1308
+ LLVM_PREFERRED_TYPE (bool )
1285
1309
unsigned hasStatic : 1 ;
1286
1310
1287
1311
// / True if this dimension was [*]. In this case, NumElts is null.
1312
+ LLVM_PREFERRED_TYPE (bool )
1288
1313
unsigned isStar : 1 ;
1289
1314
1290
1315
// / This is the size of the array, or null if [] or [*] was specified.
@@ -1331,28 +1356,35 @@ struct DeclaratorChunk {
1331
1356
// / hasPrototype - This is true if the function had at least one typed
1332
1357
// / parameter. If the function is () or (a,b,c), then it has no prototype,
1333
1358
// / and is treated as a K&R-style function.
1359
+ LLVM_PREFERRED_TYPE (bool )
1334
1360
unsigned hasPrototype : 1 ;
1335
1361
1336
1362
// / isVariadic - If this function has a prototype, and if that
1337
1363
// / proto ends with ',...)', this is true. When true, EllipsisLoc
1338
1364
// / contains the location of the ellipsis.
1365
+ LLVM_PREFERRED_TYPE (bool )
1339
1366
unsigned isVariadic : 1 ;
1340
1367
1341
1368
// / Can this declaration be a constructor-style initializer?
1369
+ LLVM_PREFERRED_TYPE (bool )
1342
1370
unsigned isAmbiguous : 1 ;
1343
1371
1344
1372
// / Whether the ref-qualifier (if any) is an lvalue reference.
1345
1373
// / Otherwise, it's an rvalue reference.
1374
+ LLVM_PREFERRED_TYPE (bool )
1346
1375
unsigned RefQualifierIsLValueRef : 1 ;
1347
1376
1348
1377
// / ExceptionSpecType - An ExceptionSpecificationType value.
1378
+ LLVM_PREFERRED_TYPE (ExceptionSpecificationType)
1349
1379
unsigned ExceptionSpecType : 4 ;
1350
1380
1351
1381
// / DeleteParams - If this is true, we need to delete[] Params.
1382
+ LLVM_PREFERRED_TYPE (bool )
1352
1383
unsigned DeleteParams : 1 ;
1353
1384
1354
1385
// / HasTrailingReturnType - If this is true, a trailing return type was
1355
1386
// / specified.
1387
+ LLVM_PREFERRED_TYPE (bool )
1356
1388
unsigned HasTrailingReturnType : 1 ;
1357
1389
1358
1390
// / The location of the left parenthesis in the source.
@@ -1567,6 +1599,7 @@ struct DeclaratorChunk {
1567
1599
struct BlockPointerTypeInfo {
1568
1600
// / For now, sema will catch these as invalid.
1569
1601
// / The type qualifiers: const/volatile/restrict/__unaligned/_Atomic.
1602
+ LLVM_PREFERRED_TYPE (DeclSpec::TQ)
1570
1603
unsigned TypeQuals : 5 ;
1571
1604
1572
1605
void destroy () {
@@ -1575,6 +1608,7 @@ struct DeclaratorChunk {
1575
1608
1576
1609
struct MemberPointerTypeInfo {
1577
1610
// / The type qualifiers: const/volatile/restrict/__unaligned/_Atomic.
1611
+ LLVM_PREFERRED_TYPE (DeclSpec::TQ)
1578
1612
unsigned TypeQuals : 5 ;
1579
1613
// / Location of the '*' token.
1580
1614
SourceLocation StarLoc;
@@ -1767,6 +1801,7 @@ class DecompositionDeclarator {
1767
1801
// / The bindings.
1768
1802
Binding *Bindings;
1769
1803
unsigned NumBindings : 31 ;
1804
+ LLVM_PREFERRED_TYPE (bool )
1770
1805
unsigned DeleteBindings : 1 ;
1771
1806
1772
1807
friend class Declarator ;
@@ -1883,33 +1918,42 @@ class Declarator {
1883
1918
SmallVector<DeclaratorChunk, 8 > DeclTypeInfo;
1884
1919
1885
1920
// / InvalidType - Set by Sema::GetTypeForDeclarator().
1921
+ LLVM_PREFERRED_TYPE (bool )
1886
1922
unsigned InvalidType : 1 ;
1887
1923
1888
1924
// / GroupingParens - Set by Parser::ParseParenDeclarator().
1925
+ LLVM_PREFERRED_TYPE (bool )
1889
1926
unsigned GroupingParens : 1 ;
1890
1927
1891
1928
// / FunctionDefinition - Is this Declarator for a function or member
1892
1929
// / definition and, if so, what kind?
1893
1930
// /
1894
1931
// / Actually a FunctionDefinitionKind.
1932
+ LLVM_PREFERRED_TYPE (FunctionDefinitionKind)
1895
1933
unsigned FunctionDefinition : 2 ;
1896
1934
1897
1935
// / Is this Declarator a redeclaration?
1936
+ LLVM_PREFERRED_TYPE (bool )
1898
1937
unsigned Redeclaration : 1 ;
1899
1938
1900
1939
// / true if the declaration is preceded by \c __extension__.
1940
+ LLVM_PREFERRED_TYPE (bool )
1901
1941
unsigned Extension : 1 ;
1902
1942
1903
1943
// / Indicates whether this is an Objective-C instance variable.
1944
+ LLVM_PREFERRED_TYPE (bool )
1904
1945
unsigned ObjCIvar : 1 ;
1905
1946
1906
1947
// / Indicates whether this is an Objective-C 'weak' property.
1948
+ LLVM_PREFERRED_TYPE (bool )
1907
1949
unsigned ObjCWeakProperty : 1 ;
1908
1950
1909
1951
// / Indicates whether the InlineParams / InlineBindings storage has been used.
1952
+ LLVM_PREFERRED_TYPE (bool )
1910
1953
unsigned InlineStorageUsed : 1 ;
1911
1954
1912
1955
// / Indicates whether this declarator has an initializer.
1956
+ LLVM_PREFERRED_TYPE (bool )
1913
1957
unsigned HasInitializer : 1 ;
1914
1958
1915
1959
// / Attributes attached to the declarator.
0 commit comments