https://github.com/tbaederr created https://github.com/llvm/llvm-project/pull/221392
We need to query those a lot and we can save them in the padding bytes of `Record::Field`. >From ab9fcb20011fbbb64352572b5735a49c8b45dcd1 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Timm=20B=C3=A4der?= <[email protected]> Date: Fri, 4 Sep 2026 16:42:22 +0200 Subject: [PATCH] Field bools --- clang/lib/AST/ByteCode/Record.h | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) diff --git a/clang/lib/AST/ByteCode/Record.h b/clang/lib/AST/ByteCode/Record.h index 536bc319bde22..a32ac5d14bf81 100644 --- a/clang/lib/AST/ByteCode/Record.h +++ b/clang/lib/AST/ByteCode/Record.h @@ -29,16 +29,21 @@ class Record final { const FieldDecl *Decl; const Descriptor *Desc; unsigned Offset; + bool IsBitField; + bool IsUnnamedBitField; - bool isBitField() const { return Decl->isBitField(); } - bool isUnnamedBitField() const { return Decl->isUnnamedBitField(); } + bool isBitField() const { return IsBitField; } + bool isUnnamedBitField() const { return IsUnnamedBitField; } unsigned bitWidth() const { assert(isBitField()); return Decl->getBitWidthValue(); } Field(const FieldDecl *D, const Descriptor *Desc, unsigned Offset) - : Decl(D), Desc(Desc), Offset(Offset) {} + : Decl(D), Desc(Desc), Offset(Offset) { + IsBitField = Decl->isBitField(); + IsUnnamedBitField = IsBitField && Decl->isUnnamedBitField(); + } }; /// Describes a base class. _______________________________________________ cfe-commits mailing list [email protected] https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits
