Skip to content

Commit 00095be

Browse files
author
Jenkins
committed
merge main into amd-staging
Change-Id: Icca86e4b549a37f2a5e817e7acdfc874fb43a702
2 parents e93b766 + d70b1c1 commit 00095be

File tree

26 files changed

+771
-107
lines changed

26 files changed

+771
-107
lines changed

clang/include/clang/Sema/DeclSpec.h

Lines changed: 50 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -353,36 +353,57 @@ class DeclSpec {
353353

354354
private:
355355
// 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)
358361
unsigned SCS_extern_in_linkage_spec : 1;
359362

360363
// 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)
365373
unsigned TypeAltiVecVector : 1;
374+
LLVM_PREFERRED_TYPE(bool)
366375
unsigned TypeAltiVecPixel : 1;
376+
LLVM_PREFERRED_TYPE(bool)
367377
unsigned TypeAltiVecBool : 1;
378+
LLVM_PREFERRED_TYPE(bool)
368379
unsigned TypeSpecOwned : 1;
380+
LLVM_PREFERRED_TYPE(bool)
369381
unsigned TypeSpecPipe : 1;
382+
LLVM_PREFERRED_TYPE(bool)
370383
unsigned TypeSpecSat : 1;
384+
LLVM_PREFERRED_TYPE(bool)
371385
unsigned ConstrainedAuto : 1;
372386

373387
// type-qualifiers
388+
LLVM_PREFERRED_TYPE(TQ)
374389
unsigned TypeQualifiers : 5; // Bitwise OR of TQ.
375390

376391
// function-specifier
392+
LLVM_PREFERRED_TYPE(bool)
377393
unsigned FS_inline_specified : 1;
394+
LLVM_PREFERRED_TYPE(bool)
378395
unsigned FS_forceinline_specified: 1;
396+
LLVM_PREFERRED_TYPE(bool)
379397
unsigned FS_virtual_specified : 1;
398+
LLVM_PREFERRED_TYPE(bool)
380399
unsigned FS_noreturn_specified : 1;
381400

382401
// friend-specifier
402+
LLVM_PREFERRED_TYPE(bool)
383403
unsigned Friend_specified : 1;
384404

385405
// constexpr-specifier
406+
LLVM_PREFERRED_TYPE(ConstexprSpecKind)
386407
unsigned ConstexprSpecifier : 2;
387408

388409
union {
@@ -1246,6 +1267,7 @@ struct DeclaratorChunk {
12461267

12471268
struct PointerTypeInfo {
12481269
/// The type qualifiers: const/volatile/restrict/unaligned/atomic.
1270+
LLVM_PREFERRED_TYPE(DeclSpec::TQ)
12491271
unsigned TypeQuals : 5;
12501272

12511273
/// The location of the const-qualifier, if any.
@@ -1279,12 +1301,15 @@ struct DeclaratorChunk {
12791301
struct ArrayTypeInfo {
12801302
/// The type qualifiers for the array:
12811303
/// const/volatile/restrict/__unaligned/_Atomic.
1304+
LLVM_PREFERRED_TYPE(DeclSpec::TQ)
12821305
unsigned TypeQuals : 5;
12831306

12841307
/// True if this dimension included the 'static' keyword.
1308+
LLVM_PREFERRED_TYPE(bool)
12851309
unsigned hasStatic : 1;
12861310

12871311
/// True if this dimension was [*]. In this case, NumElts is null.
1312+
LLVM_PREFERRED_TYPE(bool)
12881313
unsigned isStar : 1;
12891314

12901315
/// This is the size of the array, or null if [] or [*] was specified.
@@ -1331,28 +1356,35 @@ struct DeclaratorChunk {
13311356
/// hasPrototype - This is true if the function had at least one typed
13321357
/// parameter. If the function is () or (a,b,c), then it has no prototype,
13331358
/// and is treated as a K&R-style function.
1359+
LLVM_PREFERRED_TYPE(bool)
13341360
unsigned hasPrototype : 1;
13351361

13361362
/// isVariadic - If this function has a prototype, and if that
13371363
/// proto ends with ',...)', this is true. When true, EllipsisLoc
13381364
/// contains the location of the ellipsis.
1365+
LLVM_PREFERRED_TYPE(bool)
13391366
unsigned isVariadic : 1;
13401367

13411368
/// Can this declaration be a constructor-style initializer?
1369+
LLVM_PREFERRED_TYPE(bool)
13421370
unsigned isAmbiguous : 1;
13431371

13441372
/// Whether the ref-qualifier (if any) is an lvalue reference.
13451373
/// Otherwise, it's an rvalue reference.
1374+
LLVM_PREFERRED_TYPE(bool)
13461375
unsigned RefQualifierIsLValueRef : 1;
13471376

13481377
/// ExceptionSpecType - An ExceptionSpecificationType value.
1378+
LLVM_PREFERRED_TYPE(ExceptionSpecificationType)
13491379
unsigned ExceptionSpecType : 4;
13501380

13511381
/// DeleteParams - If this is true, we need to delete[] Params.
1382+
LLVM_PREFERRED_TYPE(bool)
13521383
unsigned DeleteParams : 1;
13531384

13541385
/// HasTrailingReturnType - If this is true, a trailing return type was
13551386
/// specified.
1387+
LLVM_PREFERRED_TYPE(bool)
13561388
unsigned HasTrailingReturnType : 1;
13571389

13581390
/// The location of the left parenthesis in the source.
@@ -1567,6 +1599,7 @@ struct DeclaratorChunk {
15671599
struct BlockPointerTypeInfo {
15681600
/// For now, sema will catch these as invalid.
15691601
/// The type qualifiers: const/volatile/restrict/__unaligned/_Atomic.
1602+
LLVM_PREFERRED_TYPE(DeclSpec::TQ)
15701603
unsigned TypeQuals : 5;
15711604

15721605
void destroy() {
@@ -1575,6 +1608,7 @@ struct DeclaratorChunk {
15751608

15761609
struct MemberPointerTypeInfo {
15771610
/// The type qualifiers: const/volatile/restrict/__unaligned/_Atomic.
1611+
LLVM_PREFERRED_TYPE(DeclSpec::TQ)
15781612
unsigned TypeQuals : 5;
15791613
/// Location of the '*' token.
15801614
SourceLocation StarLoc;
@@ -1767,6 +1801,7 @@ class DecompositionDeclarator {
17671801
/// The bindings.
17681802
Binding *Bindings;
17691803
unsigned NumBindings : 31;
1804+
LLVM_PREFERRED_TYPE(bool)
17701805
unsigned DeleteBindings : 1;
17711806

17721807
friend class Declarator;
@@ -1883,33 +1918,42 @@ class Declarator {
18831918
SmallVector<DeclaratorChunk, 8> DeclTypeInfo;
18841919

18851920
/// InvalidType - Set by Sema::GetTypeForDeclarator().
1921+
LLVM_PREFERRED_TYPE(bool)
18861922
unsigned InvalidType : 1;
18871923

18881924
/// GroupingParens - Set by Parser::ParseParenDeclarator().
1925+
LLVM_PREFERRED_TYPE(bool)
18891926
unsigned GroupingParens : 1;
18901927

18911928
/// FunctionDefinition - Is this Declarator for a function or member
18921929
/// definition and, if so, what kind?
18931930
///
18941931
/// Actually a FunctionDefinitionKind.
1932+
LLVM_PREFERRED_TYPE(FunctionDefinitionKind)
18951933
unsigned FunctionDefinition : 2;
18961934

18971935
/// Is this Declarator a redeclaration?
1936+
LLVM_PREFERRED_TYPE(bool)
18981937
unsigned Redeclaration : 1;
18991938

19001939
/// true if the declaration is preceded by \c __extension__.
1940+
LLVM_PREFERRED_TYPE(bool)
19011941
unsigned Extension : 1;
19021942

19031943
/// Indicates whether this is an Objective-C instance variable.
1944+
LLVM_PREFERRED_TYPE(bool)
19041945
unsigned ObjCIvar : 1;
19051946

19061947
/// Indicates whether this is an Objective-C 'weak' property.
1948+
LLVM_PREFERRED_TYPE(bool)
19071949
unsigned ObjCWeakProperty : 1;
19081950

19091951
/// Indicates whether the InlineParams / InlineBindings storage has been used.
1952+
LLVM_PREFERRED_TYPE(bool)
19101953
unsigned InlineStorageUsed : 1;
19111954

19121955
/// Indicates whether this declarator has an initializer.
1956+
LLVM_PREFERRED_TYPE(bool)
19131957
unsigned HasInitializer : 1;
19141958

19151959
/// Attributes attached to the declarator.

clang/include/clang/Sema/Overload.h

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -278,40 +278,50 @@ class Sema;
278278
/// Whether this is the deprecated conversion of a
279279
/// string literal to a pointer to non-const character data
280280
/// (C++ 4.2p2).
281+
LLVM_PREFERRED_TYPE(bool)
281282
unsigned DeprecatedStringLiteralToCharPtr : 1;
282283

283284
/// Whether the qualification conversion involves a change in the
284285
/// Objective-C lifetime (for automatic reference counting).
286+
LLVM_PREFERRED_TYPE(bool)
285287
unsigned QualificationIncludesObjCLifetime : 1;
286288

287289
/// IncompatibleObjC - Whether this is an Objective-C conversion
288290
/// that we should warn about (if we actually use it).
291+
LLVM_PREFERRED_TYPE(bool)
289292
unsigned IncompatibleObjC : 1;
290293

291294
/// ReferenceBinding - True when this is a reference binding
292295
/// (C++ [over.ics.ref]).
296+
LLVM_PREFERRED_TYPE(bool)
293297
unsigned ReferenceBinding : 1;
294298

295299
/// DirectBinding - True when this is a reference binding that is a
296300
/// direct binding (C++ [dcl.init.ref]).
301+
LLVM_PREFERRED_TYPE(bool)
297302
unsigned DirectBinding : 1;
298303

299304
/// Whether this is an lvalue reference binding (otherwise, it's
300305
/// an rvalue reference binding).
306+
LLVM_PREFERRED_TYPE(bool)
301307
unsigned IsLvalueReference : 1;
302308

303309
/// Whether we're binding to a function lvalue.
310+
LLVM_PREFERRED_TYPE(bool)
304311
unsigned BindsToFunctionLvalue : 1;
305312

306313
/// Whether we're binding to an rvalue.
314+
LLVM_PREFERRED_TYPE(bool)
307315
unsigned BindsToRvalue : 1;
308316

309317
/// Whether this binds an implicit object argument to a
310318
/// non-static member function without a ref-qualifier.
319+
LLVM_PREFERRED_TYPE(bool)
311320
unsigned BindsImplicitObjectArgumentWithoutRefQualifier : 1;
312321

313322
/// Whether this binds a reference to an object with a different
314323
/// Objective-C lifetime qualifier.
324+
LLVM_PREFERRED_TYPE(bool)
315325
unsigned ObjCLifetimeConversionBinding : 1;
316326

317327
/// FromType - The type that this conversion is converting
@@ -541,9 +551,11 @@ class Sema;
541551
};
542552

543553
/// ConversionKind - The kind of implicit conversion sequence.
554+
LLVM_PREFERRED_TYPE(Kind)
544555
unsigned ConversionKind : 31;
545556

546557
// Whether the initializer list was of an incomplete array.
558+
LLVM_PREFERRED_TYPE(bool)
547559
unsigned InitializerListOfIncompleteArray : 1;
548560

549561
/// When initializing an array or std::initializer_list from an
@@ -878,6 +890,7 @@ class Sema;
878890
CallExpr::ADLCallKind IsADLCandidate : 1;
879891

880892
/// Whether this is a rewritten candidate, and if so, of what kind?
893+
LLVM_PREFERRED_TYPE(OverloadCandidateRewriteKind)
881894
unsigned RewriteKind : 2;
882895

883896
/// FailureKind - The reason why this candidate is not viable.

clang/include/clang/Sema/ParsedAttr.h

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -82,7 +82,9 @@ struct AvailabilityData {
8282

8383
struct TypeTagForDatatypeData {
8484
ParsedType MatchingCType;
85+
LLVM_PREFERRED_TYPE(bool)
8586
unsigned LayoutCompatible : 1;
87+
LLVM_PREFERRED_TYPE(bool)
8688
unsigned MustBeNull : 1;
8789
};
8890
struct PropertyData {
@@ -149,33 +151,41 @@ class ParsedAttr final
149151
unsigned NumArgs : 16;
150152

151153
/// True if already diagnosed as invalid.
154+
LLVM_PREFERRED_TYPE(bool)
152155
mutable unsigned Invalid : 1;
153156

154157
/// True if this attribute was used as a type attribute.
158+
LLVM_PREFERRED_TYPE(bool)
155159
mutable unsigned UsedAsTypeAttr : 1;
156160

157161
/// True if this has the extra information associated with an
158162
/// availability attribute.
163+
LLVM_PREFERRED_TYPE(bool)
159164
unsigned IsAvailability : 1;
160165

161166
/// True if this has extra information associated with a
162167
/// type_tag_for_datatype attribute.
168+
LLVM_PREFERRED_TYPE(bool)
163169
unsigned IsTypeTagForDatatype : 1;
164170

165171
/// True if this has extra information associated with a
166172
/// Microsoft __delcspec(property) attribute.
173+
LLVM_PREFERRED_TYPE(bool)
167174
unsigned IsProperty : 1;
168175

169176
/// True if this has a ParsedType
177+
LLVM_PREFERRED_TYPE(bool)
170178
unsigned HasParsedType : 1;
171179

172180
/// True if the processing cache is valid.
181+
LLVM_PREFERRED_TYPE(bool)
173182
mutable unsigned HasProcessingCache : 1;
174183

175184
/// A cached value.
176185
mutable unsigned ProcessingCache : 8;
177186

178187
/// True if the attribute is specified using '#pragma clang attribute'.
188+
LLVM_PREFERRED_TYPE(bool)
179189
mutable unsigned IsPragmaClangAttribute : 1;
180190

181191
/// The location of the 'unavailable' keyword in an

0 commit comments

Comments
 (0)