Skip to content

Commit 9dd6cdf

Browse files
committed
Change the underlying StmtBitField type to uint64_t, fix windows
failures. So that the sizeof(Stmt) can stay with 8 bytes.
1 parent e63c988 commit 9dd6cdf

File tree

1 file changed

+53
-53
lines changed

1 file changed

+53
-53
lines changed

clang/include/clang/AST/Stmt.h

Lines changed: 53 additions & 53 deletions
Original file line numberDiff line numberDiff line change
@@ -128,15 +128,15 @@ class alignas(void *) Stmt {
128128
friend class NullStmt;
129129

130130
LLVM_PREFERRED_TYPE(StmtBitfields)
131-
unsigned : NumStmtBits;
131+
uint64_t : NumStmtBits;
132132

133133
/// True if the null statement was preceded by an empty macro, e.g:
134134
/// @code
135135
/// #define CALL(x)
136136
/// CALL(0);
137137
/// @endcode
138138
LLVM_PREFERRED_TYPE(bool)
139-
unsigned HasLeadingEmptyMacro : 1;
139+
uint64_t HasLeadingEmptyMacro : 1;
140140

141141
/// The location of the semi-colon.Add commentMore actions
142142
LLVM_PREFERRED_TYPE(SourceLocation)
@@ -154,15 +154,15 @@ class alignas(void *) Stmt {
154154
/// floating-point features.
155155
LLVM_PREFERRED_TYPE(bool)
156156
unsigned HasFPFeatures : 1;
157-
157+
158158
unsigned NumStmts;
159159
};
160160

161161
class LabelStmtBitfields {
162162
friend class LabelStmt;
163163

164164
LLVM_PREFERRED_TYPE(StmtBitfields)
165-
unsigned : NumStmtBits;
165+
uint64_t : NumStmtBits;
166166

167167
LLVM_PREFERRED_TYPE(SourceLocation)
168168
uint64_t IdentLoc : SourceLocation::Bits;
@@ -184,23 +184,23 @@ class alignas(void *) Stmt {
184184
friend class IfStmt;
185185

186186
LLVM_PREFERRED_TYPE(StmtBitfields)
187-
unsigned : NumStmtBits;
187+
uint64_t : NumStmtBits;
188188

189189
/// Whether this is a constexpr if, or a consteval if, or neither.
190190
LLVM_PREFERRED_TYPE(IfStatementKind)
191-
unsigned Kind : 3;
191+
uint64_t Kind : 3;
192192

193193
/// True if this if statement has storage for an else statement.
194194
LLVM_PREFERRED_TYPE(bool)
195-
unsigned HasElse : 1;
195+
uint64_t HasElse : 1;
196196

197197
/// True if this if statement has storage for a variable declaration.
198198
LLVM_PREFERRED_TYPE(bool)
199-
unsigned HasVar : 1;
199+
uint64_t HasVar : 1;
200200

201201
/// True if this if statement has storage for an init statement.
202202
LLVM_PREFERRED_TYPE(bool)
203-
unsigned HasInit : 1;
203+
uint64_t HasInit : 1;
204204

205205
/// The location of the "if"
206206
LLVM_PREFERRED_TYPE(SourceLocation)
@@ -211,21 +211,21 @@ class alignas(void *) Stmt {
211211
friend class SwitchStmt;
212212

213213
LLVM_PREFERRED_TYPE(StmtBitfields)
214-
unsigned : NumStmtBits;
214+
uint64_t : NumStmtBits;
215215

216216
/// True if the SwitchStmt has storage for an init statement.
217217
LLVM_PREFERRED_TYPE(bool)
218-
unsigned HasInit : 1;
218+
uint64_t HasInit : 1;
219219

220220
/// True if the SwitchStmt has storage for a condition variable.
221221
LLVM_PREFERRED_TYPE(bool)
222-
unsigned HasVar : 1;
222+
uint64_t HasVar : 1;
223223

224224
/// If the SwitchStmt is a switch on an enum value, records whether all
225225
/// the enum values were covered by CaseStmts. The coverage information
226226
/// value is meant to be a hint for possible clients.
227227
LLVM_PREFERRED_TYPE(bool)
228-
unsigned AllEnumCasesCovered : 1;
228+
uint64_t AllEnumCasesCovered : 1;
229229

230230
/// The location of the "switch".
231231
LLVM_PREFERRED_TYPE(SourceLocation)
@@ -237,11 +237,11 @@ class alignas(void *) Stmt {
237237
friend class WhileStmt;
238238

239239
LLVM_PREFERRED_TYPE(StmtBitfields)
240-
unsigned : NumStmtBits;
240+
uint64_t : NumStmtBits;
241241

242242
/// True if the WhileStmt has storage for a condition variable.
243243
LLVM_PREFERRED_TYPE(bool)
244-
unsigned HasVar : 1;
244+
uint64_t HasVar : 1;
245245

246246
/// The location of the "while"
247247
LLVM_PREFERRED_TYPE(SourceLocation)
@@ -252,7 +252,7 @@ class alignas(void *) Stmt {
252252
friend class DoStmt;
253253

254254
LLVM_PREFERRED_TYPE(StmtBitfields)
255-
unsigned : NumStmtBits;
255+
uint64_t : NumStmtBits;
256256

257257
/// The location of the "do"
258258
LLVM_PREFERRED_TYPE(SourceLocation)
@@ -263,7 +263,7 @@ class alignas(void *) Stmt {
263263
friend class ForStmt;
264264

265265
LLVM_PREFERRED_TYPE(StmtBitfields)
266-
unsigned : NumStmtBits;
266+
uint64_t : NumStmtBits;
267267

268268
/// The location of the "for"
269269
LLVM_PREFERRED_TYPE(SourceLocation)
@@ -275,7 +275,7 @@ class alignas(void *) Stmt {
275275
friend class IndirectGotoStmt;
276276

277277
LLVM_PREFERRED_TYPE(StmtBitfields)
278-
unsigned : NumStmtBits;
278+
uint64_t : NumStmtBits;
279279

280280
/// The location of the "goto"
281281
LLVM_PREFERRED_TYPE(SourceLocation)
@@ -286,7 +286,7 @@ class alignas(void *) Stmt {
286286
friend class ContinueStmt;
287287

288288
LLVM_PREFERRED_TYPE(StmtBitfields)
289-
unsigned : NumStmtBits;
289+
uint64_t : NumStmtBits;
290290

291291
/// The location of the "continue"
292292
LLVM_PREFERRED_TYPE(SourceLocation)
@@ -297,7 +297,7 @@ class alignas(void *) Stmt {
297297
friend class BreakStmt;
298298

299299
LLVM_PREFERRED_TYPE(StmtBitfields)
300-
unsigned : NumStmtBits;
300+
uint64_t : NumStmtBits;
301301

302302
/// The location of the "break"
303303
LLVM_PREFERRED_TYPE(SourceLocation)
@@ -308,11 +308,11 @@ class alignas(void *) Stmt {
308308
friend class ReturnStmt;
309309

310310
LLVM_PREFERRED_TYPE(StmtBitfields)
311-
unsigned : NumStmtBits;
311+
uint64_t : NumStmtBits;
312312

313313
/// True if this ReturnStmt has storage for an NRVO candidate.
314314
LLVM_PREFERRED_TYPE(bool)
315-
unsigned HasNRVOCandidate : 1;
315+
uint64_t HasNRVOCandidate : 1;
316316

317317
/// The location of the "return"
318318
LLVM_PREFERRED_TYPE(SourceLocation)
@@ -324,12 +324,12 @@ class alignas(void *) Stmt {
324324
friend class CaseStmt;
325325

326326
LLVM_PREFERRED_TYPE(StmtBitfields)
327-
unsigned : NumStmtBits;
327+
uint64_t : NumStmtBits;
328328

329329
/// Used by CaseStmt to store whether it is a case statement
330330
/// of the form case LHS ... RHS (a GNU extension).
331331
LLVM_PREFERRED_TYPE(bool)
332-
unsigned CaseStmtIsGNURange : 1;
332+
uint64_t CaseStmtIsGNURange : 1;
333333

334334
/// The location of the "case" or "default" keyword.
335335
LLVM_PREFERRED_TYPE(SourceLocation)
@@ -547,7 +547,7 @@ class alignas(void *) Stmt {
547547
friend class MatrixSubscriptExpr;
548548

549549
LLVM_PREFERRED_TYPE(ExprBitfields)
550-
unsigned : NumExprBits;
550+
uint64_t : NumExprBits;
551551

552552
LLVM_PREFERRED_TYPE(SourceLocation)
553553
uint64_t RBracketLoc : SourceLocation::Bits;
@@ -701,7 +701,7 @@ class alignas(void *) Stmt {
701701
friend class GenericSelectionExpr;
702702

703703
LLVM_PREFERRED_TYPE(ExprBitfields)
704-
unsigned : NumExprBits;
704+
uint64_t : NumExprBits;
705705

706706
/// The location of the "_Generic"
707707
LLVM_PREFERRED_TYPE(SourceLocation)
@@ -807,11 +807,11 @@ class alignas(void *) Stmt {
807807
friend class CXXBoolLiteralExpr;
808808

809809
LLVM_PREFERRED_TYPE(ExprBitfields)
810-
unsigned : NumExprBits;
810+
uint64_t : NumExprBits;
811811

812812
/// The value of the boolean literal.
813813
LLVM_PREFERRED_TYPE(bool)
814-
unsigned Value : 1;
814+
uint64_t Value : 1;
815815

816816
/// The location of the boolean ligeral
817817
LLVM_PREFERRED_TYPE(SourceLocation)
@@ -822,7 +822,7 @@ class alignas(void *) Stmt {
822822
friend class CXXNullPtrLiteralExpr;
823823

824824
LLVM_PREFERRED_TYPE(ExprBitfields)
825-
unsigned : NumExprBits;
825+
uint64_t : NumExprBits;
826826

827827
/// The location of the null pointer literal.
828828
LLVM_PREFERRED_TYPE(SourceLocation)
@@ -833,16 +833,16 @@ class alignas(void *) Stmt {
833833
friend class CXXThisExpr;
834834

835835
LLVM_PREFERRED_TYPE(ExprBitfields)
836-
unsigned : NumExprBits;
836+
uint64_t : NumExprBits;
837837

838838
/// Whether this is an implicit "this".
839839
LLVM_PREFERRED_TYPE(bool)
840-
unsigned IsImplicit : 1;
840+
uint64_t IsImplicit : 1;
841841

842842
/// Whether there is a lambda with an explicit object parameter that
843843
/// captures this "this" by copy.
844844
LLVM_PREFERRED_TYPE(bool)
845-
unsigned CapturedByCopyInLambdaWithExplicitObjectParameter : 1;
845+
uint64_t CapturedByCopyInLambdaWithExplicitObjectParameter : 1;
846846

847847
/// The location of the "this"
848848
LLVM_PREFERRED_TYPE(SourceLocation)
@@ -854,11 +854,11 @@ class alignas(void *) Stmt {
854854
friend class CXXThrowExpr;
855855

856856
LLVM_PREFERRED_TYPE(ExprBitfields)
857-
unsigned : NumExprBits;
857+
uint64_t : NumExprBits;
858858

859859
/// Whether the thrown variable (if any) is in scope.
860860
LLVM_PREFERRED_TYPE(bool)
861-
unsigned IsThrownVariableInScope : 1;
861+
uint64_t IsThrownVariableInScope : 1;
862862

863863
/// The location of the "throw"
864864
LLVM_PREFERRED_TYPE(SourceLocation)
@@ -870,11 +870,11 @@ class alignas(void *) Stmt {
870870
friend class CXXDefaultArgExpr;
871871

872872
LLVM_PREFERRED_TYPE(ExprBitfields)
873-
unsigned : NumExprBits;
873+
uint64_t : NumExprBits;
874874

875875
/// Whether this CXXDefaultArgExpr rewrote its argument and stores a copy.
876876
LLVM_PREFERRED_TYPE(bool)
877-
unsigned HasRewrittenInit : 1;
877+
uint64_t HasRewrittenInit : 1;
878878

879879
/// The location where the default argument expression was used.
880880
LLVM_PREFERRED_TYPE(SourceLocation)
@@ -886,12 +886,12 @@ class alignas(void *) Stmt {
886886
friend class CXXDefaultInitExpr;
887887

888888
LLVM_PREFERRED_TYPE(ExprBitfields)
889-
unsigned : NumExprBits;
889+
uint64_t : NumExprBits;
890890

891891
/// Whether this CXXDefaultInitExprBitfields rewrote its argument and stores
892892
/// a copy.
893893
LLVM_PREFERRED_TYPE(bool)
894-
unsigned HasRewrittenInit : 1;
894+
uint64_t HasRewrittenInit : 1;
895895

896896
/// The location where the default initializer expression was used.
897897
LLVM_PREFERRED_TYPE(SourceLocation)
@@ -903,7 +903,7 @@ class alignas(void *) Stmt {
903903
friend class CXXScalarValueInitExpr;
904904

905905
LLVM_PREFERRED_TYPE(ExprBitfields)
906-
unsigned : NumExprBits;
906+
uint64_t : NumExprBits;
907907

908908
/// The location where the default initializer expression was used.
909909
LLVM_PREFERRED_TYPE(SourceLocation)
@@ -961,26 +961,26 @@ class alignas(void *) Stmt {
961961
friend class CXXDeleteExpr;
962962

963963
LLVM_PREFERRED_TYPE(ExprBitfields)
964-
unsigned : NumExprBits;
964+
uint64_t : NumExprBits;
965965

966966
/// Is this a forced global delete, i.e. "::delete"?
967967
LLVM_PREFERRED_TYPE(bool)
968-
unsigned GlobalDelete : 1;
968+
uint64_t GlobalDelete : 1;
969969

970970
/// Is this the array form of delete, i.e. "delete[]"?
971971
LLVM_PREFERRED_TYPE(bool)
972-
unsigned ArrayForm : 1;
972+
uint64_t ArrayForm : 1;
973973

974974
/// ArrayFormAsWritten can be different from ArrayForm if 'delete' is
975975
/// applied to pointer-to-array type (ArrayFormAsWritten will be false
976976
/// while ArrayForm will be true).
977977
LLVM_PREFERRED_TYPE(bool)
978-
unsigned ArrayFormAsWritten : 1;
978+
uint64_t ArrayFormAsWritten : 1;
979979

980980
/// Does the usual deallocation function for the element type require
981981
/// a size_t argument?
982982
LLVM_PREFERRED_TYPE(bool)
983-
unsigned UsualArrayDeleteWantsSize : 1;
983+
uint64_t UsualArrayDeleteWantsSize : 1;
984984

985985
/// Location of the expression
986986
LLVM_PREFERRED_TYPE(SourceLocation)
@@ -1081,22 +1081,22 @@ class alignas(void *) Stmt {
10811081
friend class CXXDependentScopeMemberExpr;
10821082

10831083
LLVM_PREFERRED_TYPE(ExprBitfields)
1084-
unsigned : NumExprBits;
1084+
uint64_t : NumExprBits;
10851085

10861086
/// Whether this member expression used the '->' operator or
10871087
/// the '.' operator.
10881088
LLVM_PREFERRED_TYPE(bool)
1089-
unsigned IsArrow : 1;
1089+
uint64_t IsArrow : 1;
10901090

10911091
/// Whether this member expression has info for explicit template
10921092
/// keyword and arguments.
10931093
LLVM_PREFERRED_TYPE(bool)
1094-
unsigned HasTemplateKWAndArgsInfo : 1;
1094+
uint64_t HasTemplateKWAndArgsInfo : 1;
10951095

10961096
/// See getFirstQualifierFoundInScope() and the comment listing
10971097
/// the trailing objects.
10981098
LLVM_PREFERRED_TYPE(bool)
1099-
unsigned HasFirstQualifierFoundInScope : 1;
1099+
uint64_t HasFirstQualifierFoundInScope : 1;
11001100

11011101
/// The location of the '->' or '.' operator.
11021102
LLVM_PREFERRED_TYPE(SourceLocation)
@@ -1177,7 +1177,7 @@ class alignas(void *) Stmt {
11771177
friend class SubstNonTypeTemplateParmExpr;
11781178

11791179
LLVM_PREFERRED_TYPE(ExprBitfields)
1180-
unsigned : NumExprBits;
1180+
uint64_t : NumExprBits;
11811181

11821182
/// The location of the non-type template parameter reference.
11831183
LLVM_PREFERRED_TYPE(SourceLocation)
@@ -1216,10 +1216,10 @@ class alignas(void *) Stmt {
12161216
friend class RequiresExpr;
12171217

12181218
LLVM_PREFERRED_TYPE(ExprBitfields)
1219-
unsigned : NumExprBits;
1219+
uint64_t : NumExprBits;
12201220

12211221
LLVM_PREFERRED_TYPE(bool)
1222-
unsigned IsSatisfied : 1;
1222+
uint64_t IsSatisfied : 1;
12231223

12241224
LLVM_PREFERRED_TYPE(SourceLocation)
12251225
uint64_t RequiresKWLoc : SourceLocation::Bits;
@@ -1307,12 +1307,12 @@ class alignas(void *) Stmt {
13071307
friend class OpaqueValueExpr;
13081308

13091309
LLVM_PREFERRED_TYPE(ExprBitfields)
1310-
unsigned : NumExprBits;
1310+
uint64_t : NumExprBits;
13111311

13121312
/// The OVE is a unique semantic reference to its source expression if this
13131313
/// bit is set to true.
13141314
LLVM_PREFERRED_TYPE(bool)
1315-
unsigned IsUnique : 1;
1315+
uint64_t IsUnique : 1;
13161316

13171317
/// The location of the non-type template parameter reference.
13181318
LLVM_PREFERRED_TYPE(SourceLocation)

0 commit comments

Comments
 (0)