Skip to content

Commit 3031de4

Browse files
author
Jenkins
committed
merge main into amd-staging
Change-Id: If08e97e367bc0971d2cfd96536833a00b38197a3
2 parents 00095be + 887ed6d commit 3031de4

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

55 files changed

+1463
-462
lines changed

clang/include/clang/APINotes/Types.h

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -55,16 +55,20 @@ class CommonEntityInfo {
5555
std::string UnavailableMsg;
5656

5757
/// Whether this entity is marked unavailable.
58+
LLVM_PREFERRED_TYPE(bool)
5859
unsigned Unavailable : 1;
5960

6061
/// Whether this entity is marked unavailable in Swift.
62+
LLVM_PREFERRED_TYPE(bool)
6163
unsigned UnavailableInSwift : 1;
6264

6365
private:
6466
/// Whether SwiftPrivate was specified.
67+
LLVM_PREFERRED_TYPE(bool)
6568
unsigned SwiftPrivateSpecified : 1;
6669

6770
/// Whether this entity is considered "private" to a Swift overlay.
71+
LLVM_PREFERRED_TYPE(bool)
6872
unsigned SwiftPrivate : 1;
6973

7074
public:
@@ -191,18 +195,25 @@ inline bool operator!=(const CommonTypeInfo &LHS, const CommonTypeInfo &RHS) {
191195
/// Describes API notes data for an Objective-C class or protocol.
192196
class ObjCContextInfo : public CommonTypeInfo {
193197
/// Whether this class has a default nullability.
198+
LLVM_PREFERRED_TYPE(bool)
194199
unsigned HasDefaultNullability : 1;
195200

196201
/// The default nullability.
202+
LLVM_PREFERRED_TYPE(NullabilityKind)
197203
unsigned DefaultNullability : 2;
198204

199205
/// Whether this class has designated initializers recorded.
206+
LLVM_PREFERRED_TYPE(bool)
200207
unsigned HasDesignatedInits : 1;
201208

209+
LLVM_PREFERRED_TYPE(bool)
202210
unsigned SwiftImportAsNonGenericSpecified : 1;
211+
LLVM_PREFERRED_TYPE(bool)
203212
unsigned SwiftImportAsNonGeneric : 1;
204213

214+
LLVM_PREFERRED_TYPE(bool)
205215
unsigned SwiftObjCMembersSpecified : 1;
216+
LLVM_PREFERRED_TYPE(bool)
206217
unsigned SwiftObjCMembers : 1;
207218

208219
public:
@@ -298,10 +309,12 @@ inline bool operator!=(const ObjCContextInfo &LHS, const ObjCContextInfo &RHS) {
298309
/// API notes for a variable/property.
299310
class VariableInfo : public CommonEntityInfo {
300311
/// Whether this property has been audited for nullability.
312+
LLVM_PREFERRED_TYPE(bool)
301313
unsigned NullabilityAudited : 1;
302314

303315
/// The kind of nullability for this property. Only valid if the nullability
304316
/// has been audited.
317+
LLVM_PREFERRED_TYPE(NullabilityKind)
305318
unsigned Nullable : 2;
306319

307320
/// The C type of the variable, as a string.
@@ -352,7 +365,9 @@ inline bool operator!=(const VariableInfo &LHS, const VariableInfo &RHS) {
352365

353366
/// Describes API notes data for an Objective-C property.
354367
class ObjCPropertyInfo : public VariableInfo {
368+
LLVM_PREFERRED_TYPE(bool)
355369
unsigned SwiftImportAsAccessorsSpecified : 1;
370+
LLVM_PREFERRED_TYPE(bool)
356371
unsigned SwiftImportAsAccessors : 1;
357372

358373
public:
@@ -409,9 +424,11 @@ inline bool operator!=(const ObjCPropertyInfo &LHS,
409424
/// Describes a function or method parameter.
410425
class ParamInfo : public VariableInfo {
411426
/// Whether noescape was specified.
427+
LLVM_PREFERRED_TYPE(bool)
412428
unsigned NoEscapeSpecified : 1;
413429

414430
/// Whether the this parameter has the 'noescape' attribute.
431+
LLVM_PREFERRED_TYPE(bool)
415432
unsigned NoEscape : 1;
416433

417434
/// A biased RetainCountConventionKind, where 0 means "unspecified".
@@ -488,6 +505,7 @@ class FunctionInfo : public CommonEntityInfo {
488505
// unknown nullability.
489506

490507
/// Whether the signature has been audited with respect to nullability.
508+
LLVM_PREFERRED_TYPE(bool)
491509
unsigned NullabilityAudited : 1;
492510

493511
/// Number of types whose nullability is encoded with the NullabilityPayload.
@@ -597,9 +615,11 @@ inline bool operator!=(const FunctionInfo &LHS, const FunctionInfo &RHS) {
597615
class ObjCMethodInfo : public FunctionInfo {
598616
public:
599617
/// Whether this is a designated initializer of its class.
618+
LLVM_PREFERRED_TYPE(bool)
600619
unsigned DesignatedInit : 1;
601620

602621
/// Whether this is a required initializer.
622+
LLVM_PREFERRED_TYPE(bool)
603623
unsigned RequiredInit : 1;
604624

605625
ObjCMethodInfo() : DesignatedInit(false), RequiredInit(false) {}
@@ -650,7 +670,9 @@ class EnumConstantInfo : public CommonEntityInfo {
650670

651671
/// Describes API notes data for a tag.
652672
class TagInfo : public CommonTypeInfo {
673+
LLVM_PREFERRED_TYPE(bool)
653674
unsigned HasFlagEnum : 1;
675+
LLVM_PREFERRED_TYPE(bool)
654676
unsigned IsFlagEnum : 1;
655677

656678
public:

clang/include/clang/AST/CommentCommandTraits.h

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -50,52 +50,65 @@ struct CommandInfo {
5050
unsigned NumArgs : 4;
5151

5252
/// True if this command is a inline command (of any kind).
53+
LLVM_PREFERRED_TYPE(bool)
5354
unsigned IsInlineCommand : 1;
5455

5556
/// True if this command is a block command (of any kind).
57+
LLVM_PREFERRED_TYPE(bool)
5658
unsigned IsBlockCommand : 1;
5759

5860
/// True if this command is introducing a brief documentation
5961
/// paragraph (\or an alias).
62+
LLVM_PREFERRED_TYPE(bool)
6063
unsigned IsBriefCommand : 1;
6164

6265
/// True if this command is \\returns or an alias.
66+
LLVM_PREFERRED_TYPE(bool)
6367
unsigned IsReturnsCommand : 1;
6468

6569
/// True if this command is introducing documentation for a function
6670
/// parameter (\\param or an alias).
71+
LLVM_PREFERRED_TYPE(bool)
6772
unsigned IsParamCommand : 1;
6873

6974
/// True if this command is introducing documentation for
7075
/// a template parameter (\\tparam or an alias).
76+
LLVM_PREFERRED_TYPE(bool)
7177
unsigned IsTParamCommand : 1;
7278

7379
/// True if this command is \\throws or an alias.
80+
LLVM_PREFERRED_TYPE(bool)
7481
unsigned IsThrowsCommand : 1;
7582

7683
/// True if this command is \\deprecated or an alias.
84+
LLVM_PREFERRED_TYPE(bool)
7785
unsigned IsDeprecatedCommand : 1;
7886

7987
/// True if this is a \\headerfile-like command.
88+
LLVM_PREFERRED_TYPE(bool)
8089
unsigned IsHeaderfileCommand : 1;
8190

8291
/// True if we don't want to warn about this command being passed an empty
8392
/// paragraph. Meaningful only for block commands.
93+
LLVM_PREFERRED_TYPE(bool)
8494
unsigned IsEmptyParagraphAllowed : 1;
8595

8696
/// True if this command is a verbatim-like block command.
8797
///
8898
/// A verbatim-like block command eats every character (except line starting
8999
/// decorations) until matching end command is seen or comment end is hit.
100+
LLVM_PREFERRED_TYPE(bool)
90101
unsigned IsVerbatimBlockCommand : 1;
91102

92103
/// True if this command is an end command for a verbatim-like block.
104+
LLVM_PREFERRED_TYPE(bool)
93105
unsigned IsVerbatimBlockEndCommand : 1;
94106

95107
/// True if this command is a verbatim line command.
96108
///
97109
/// A verbatim-like line command eats everything until a newline is seen or
98110
/// comment end is hit.
111+
LLVM_PREFERRED_TYPE(bool)
99112
unsigned IsVerbatimLineCommand : 1;
100113

101114
/// True if this command contains a declaration for the entity being
@@ -105,20 +118,25 @@ struct CommandInfo {
105118
/// \code
106119
/// \fn void f(int a);
107120
/// \endcode
121+
LLVM_PREFERRED_TYPE(bool)
108122
unsigned IsDeclarationCommand : 1;
109123

110124
/// True if verbatim-like line command is a function declaration.
125+
LLVM_PREFERRED_TYPE(bool)
111126
unsigned IsFunctionDeclarationCommand : 1;
112127

113128
/// True if block command is further describing a container API; such
114129
/// as \@coclass, \@classdesign, etc.
130+
LLVM_PREFERRED_TYPE(bool)
115131
unsigned IsRecordLikeDetailCommand : 1;
116132

117133
/// True if block command is a container API; such as \@interface.
134+
LLVM_PREFERRED_TYPE(bool)
118135
unsigned IsRecordLikeDeclarationCommand : 1;
119136

120137
/// True if this command is unknown. This \c CommandInfo object was
121138
/// created during parsing.
139+
LLVM_PREFERRED_TYPE(bool)
122140
unsigned IsUnknownCommand : 1;
123141
};
124142

clang/include/clang/AST/StmtOpenMP.h

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2974,6 +2974,7 @@ class OMPAtomicDirective : public OMPExecutableDirective {
29742974
/// This field is 1 for the first form of the expression and 0 for the
29752975
/// second. Required for correct codegen of non-associative operations (like
29762976
/// << or >>).
2977+
LLVM_PREFERRED_TYPE(bool)
29772978
uint8_t IsXLHSInRHSPart : 1;
29782979
/// Used for 'atomic update' or 'atomic capture' constructs. They may
29792980
/// have atomic expressions of forms:
@@ -2983,9 +2984,11 @@ class OMPAtomicDirective : public OMPExecutableDirective {
29832984
/// \endcode
29842985
/// This field is 1 for the first(postfix) form of the expression and 0
29852986
/// otherwise.
2987+
LLVM_PREFERRED_TYPE(bool)
29862988
uint8_t IsPostfixUpdate : 1;
29872989
/// 1 if 'v' is updated only when the condition is false (compare capture
29882990
/// only).
2991+
LLVM_PREFERRED_TYPE(bool)
29892992
uint8_t IsFailOnly : 1;
29902993
} Flags;
29912994

clang/include/clang/Analysis/CFG.h

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -879,6 +879,7 @@ class CFGBlock {
879879
///
880880
/// Optimization Note: This bit could be profitably folded with Terminator's
881881
/// storage if the memory usage of CFGBlock becomes an issue.
882+
LLVM_PREFERRED_TYPE(bool)
882883
unsigned HasNoReturnElement : 1;
883884

884885
/// The parent CFG that owns this CFGBlock.
@@ -1007,7 +1008,9 @@ class CFGBlock {
10071008

10081009
class FilterOptions {
10091010
public:
1011+
LLVM_PREFERRED_TYPE(bool)
10101012
unsigned IgnoreNullPredecessors : 1;
1013+
LLVM_PREFERRED_TYPE(bool)
10111014
unsigned IgnoreDefaultsWithCoveredEnums : 1;
10121015

10131016
FilterOptions()

clang/include/clang/Basic/LangOptions.h

Lines changed: 24 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -30,27 +30,6 @@
3030

3131
namespace clang {
3232

33-
/// Bitfields of LangOptions, split out from LangOptions in order to ensure that
34-
/// this large collection of bitfields is a trivial class type.
35-
class LangOptionsBase {
36-
friend class CompilerInvocation;
37-
friend class CompilerInvocationBase;
38-
39-
public:
40-
// Define simple language options (with no accessors).
41-
#define LANGOPT(Name, Bits, Default, Description) unsigned Name : Bits;
42-
#define ENUM_LANGOPT(Name, Type, Bits, Default, Description)
43-
#include "clang/Basic/LangOptions.def"
44-
45-
protected:
46-
// Define language options of enumeration type. These are private, and will
47-
// have accessors (below).
48-
#define LANGOPT(Name, Bits, Default, Description)
49-
#define ENUM_LANGOPT(Name, Type, Bits, Default, Description) \
50-
unsigned Name : Bits;
51-
#include "clang/Basic/LangOptions.def"
52-
};
53-
5433
/// In the Microsoft ABI, this controls the placement of virtual displacement
5534
/// members used to implement virtual inheritance.
5635
enum class MSVtorDispMode { Never, ForVBaseOverride, ForVFTable };
@@ -78,9 +57,12 @@ enum class ShaderStage {
7857
Invalid,
7958
};
8059

81-
/// Keeps track of the various options that can be
82-
/// enabled, which controls the dialect of C or C++ that is accepted.
83-
class LangOptions : public LangOptionsBase {
60+
/// Bitfields of LangOptions, split out from LangOptions in order to ensure that
61+
/// this large collection of bitfields is a trivial class type.
62+
class LangOptionsBase {
63+
friend class CompilerInvocation;
64+
friend class CompilerInvocationBase;
65+
8466
public:
8567
using Visibility = clang::Visibility;
8668
using RoundingMode = llvm::RoundingMode;
@@ -416,6 +398,24 @@ class LangOptions : public LangOptionsBase {
416398

417399
enum ComplexRangeKind { CX_Full, CX_Limited, CX_Fortran, CX_None };
418400

401+
// Define simple language options (with no accessors).
402+
#define LANGOPT(Name, Bits, Default, Description) unsigned Name : Bits;
403+
#define ENUM_LANGOPT(Name, Type, Bits, Default, Description)
404+
#include "clang/Basic/LangOptions.def"
405+
406+
protected:
407+
// Define language options of enumeration type. These are private, and will
408+
// have accessors (below).
409+
#define LANGOPT(Name, Bits, Default, Description)
410+
#define ENUM_LANGOPT(Name, Type, Bits, Default, Description) \
411+
LLVM_PREFERRED_TYPE(Type) \
412+
unsigned Name : Bits;
413+
#include "clang/Basic/LangOptions.def"
414+
};
415+
416+
/// Keeps track of the various options that can be
417+
/// enabled, which controls the dialect of C or C++ that is accepted.
418+
class LangOptions : public LangOptionsBase {
419419
public:
420420
/// The used language standard.
421421
LangStandard::Kind LangStd;

clang/include/clang/Basic/Visibility.h

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -51,8 +51,11 @@ inline Visibility minVisibility(Visibility L, Visibility R) {
5151
}
5252

5353
class LinkageInfo {
54+
LLVM_PREFERRED_TYPE(Linkage)
5455
uint8_t linkage_ : 3;
56+
LLVM_PREFERRED_TYPE(Visibility)
5557
uint8_t visibility_ : 2;
58+
LLVM_PREFERRED_TYPE(bool)
5659
uint8_t explicit_ : 1;
5760

5861
void setVisibility(Visibility V, bool E) { visibility_ = V; explicit_ = E; }

clang/include/clang/CodeGen/CGFunctionInfo.h

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -564,35 +564,45 @@ class CGFunctionInfo final
564564
unsigned EffectiveCallingConvention : 8;
565565

566566
/// The clang::CallingConv that this was originally created with.
567+
LLVM_PREFERRED_TYPE(CallingConv)
567568
unsigned ASTCallingConvention : 6;
568569

569570
/// Whether this is an instance method.
571+
LLVM_PREFERRED_TYPE(bool)
570572
unsigned InstanceMethod : 1;
571573

572574
/// Whether this is a chain call.
575+
LLVM_PREFERRED_TYPE(bool)
573576
unsigned ChainCall : 1;
574577

575578
/// Whether this function is called by forwarding arguments.
576579
/// This doesn't support inalloca or varargs.
580+
LLVM_PREFERRED_TYPE(bool)
577581
unsigned DelegateCall : 1;
578582

579583
/// Whether this function is a CMSE nonsecure call
584+
LLVM_PREFERRED_TYPE(bool)
580585
unsigned CmseNSCall : 1;
581586

582587
/// Whether this function is noreturn.
588+
LLVM_PREFERRED_TYPE(bool)
583589
unsigned NoReturn : 1;
584590

585591
/// Whether this function is returns-retained.
592+
LLVM_PREFERRED_TYPE(bool)
586593
unsigned ReturnsRetained : 1;
587594

588595
/// Whether this function saved caller registers.
596+
LLVM_PREFERRED_TYPE(bool)
589597
unsigned NoCallerSavedRegs : 1;
590598

591599
/// How many arguments to pass inreg.
600+
LLVM_PREFERRED_TYPE(bool)
592601
unsigned HasRegParm : 1;
593602
unsigned RegParm : 3;
594603

595604
/// Whether this function has nocf_check attribute.
605+
LLVM_PREFERRED_TYPE(bool)
596606
unsigned NoCfCheck : 1;
597607

598608
/// Log 2 of the maximum vector width.
@@ -604,6 +614,7 @@ class CGFunctionInfo final
604614
/// passing non-trivial types with inalloca. Not part of the profile.
605615
llvm::StructType *ArgStruct;
606616
unsigned ArgStructAlign : 31;
617+
LLVM_PREFERRED_TYPE(bool)
607618
unsigned HasExtParameterInfos : 1;
608619

609620
unsigned NumArgs;

0 commit comments

Comments
 (0)