Skip to content

Commit 4797437

Browse files
authored
[clang][NFC] Increase NumStmtBits by 1 as we are approaching the limit (#120341)
We have already hit the limit of NumStmtBits downstream after 010d011, which adds 4 new StmtNodes.
1 parent 1fcb6a9 commit 4797437

File tree

1 file changed

+13
-2
lines changed

1 file changed

+13
-2
lines changed

clang/include/clang/AST/Stmt.h

Lines changed: 13 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -109,16 +109,27 @@ class alignas(void *) Stmt {
109109

110110
//===--- Statement bitfields classes ---===//
111111

112+
enum { NumStmtBits = 9 };
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+
llvm::isInt<NumStmtBits>(StmtClass::LAST##Class), \
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+
112124
class StmtBitfields {
113125
friend class ASTStmtReader;
114126
friend class ASTStmtWriter;
115127
friend class Stmt;
116128

117129
/// The statement class.
118130
LLVM_PREFERRED_TYPE(StmtClass)
119-
unsigned sClass : 8;
131+
unsigned sClass : NumStmtBits;
120132
};
121-
enum { NumStmtBits = 8 };
122133

123134
class NullStmtBitfields {
124135
friend class ASTStmtReader;

0 commit comments

Comments
 (0)