@@ -109,16 +109,27 @@ class alignas(void *) Stmt {
109
109
110
110
// ===--- Statement bitfields classes ---===//
111
111
112
+ enum { NumStmtBits = 10 };
113
+
114
+ #define STMT (CLASS, PARENT )
115
+ #define STMT_RANGE (BASE, FIRST, LAST )
116
+ #define LAST_STMT_RANGE (BASE, FIRST, LAST ) \
117
+ static_assert ( \
118
+ StmtClass::LAST##Class < (1 << NumStmtBits), \
119
+ " The number of 'StmtClass'es is strictly bounded under two to " \
120
+ " the power of 'NumStmtBits'" );
121
+ #define ABSTRACT_STMT (STMT )
122
+ #include " clang/AST/StmtNodes.inc"
123
+
112
124
class StmtBitfields {
113
125
friend class ASTStmtReader ;
114
126
friend class ASTStmtWriter ;
115
127
friend class Stmt ;
116
128
117
129
// / The statement class.
118
130
LLVM_PREFERRED_TYPE (StmtClass)
119
- unsigned sClass : 8 ;
131
+ unsigned sClass : NumStmtBits ;
120
132
};
121
- enum { NumStmtBits = 8 };
122
133
123
134
class NullStmtBitfields {
124
135
friend class ASTStmtReader ;
@@ -564,8 +575,8 @@ class alignas(void *) Stmt {
564
575
// / True if the call expression is a must-elide call to a coroutine.
565
576
unsigned IsCoroElideSafe : 1 ;
566
577
567
- // / Padding used to align OffsetToTrailingObjects to a byte multiple.
568
- unsigned : 24 - 4 - NumExprBits;
578
+ static_assert (NumExprBits == 20 ,
579
+ " No extra padding needed when NumExprBits is exactly 20. " ) ;
569
580
570
581
// / The offset in bytes from the this pointer to the start of the
571
582
// / trailing objects belonging to CallExpr. Intentionally byte sized
0 commit comments