llvmorg-github-actions[bot] wrote:
<!--LLVM PR SUMMARY COMMENT--> @llvm/pr-subscribers-clang Author: Timm Baeder (tbaederr) <details> <summary>Changes</summary> We need to query those a lot and we can save them in the padding bytes of `Record::Field`. --- Full diff: https://github.com/llvm/llvm-project/pull/221392.diff 1 Files Affected: - (modified) clang/lib/AST/ByteCode/Record.h (+8-3) ``````````diff 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. `````````` </details> https://github.com/llvm/llvm-project/pull/221392 _______________________________________________ cfe-commits mailing list [email protected] https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits
