Advertisement
Guest User

Untitled

a guest
Nov 20th, 2019
109
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 0.62 KB | None | 0 0
  1.   /// Make use of the padding bits by allowing derived class to store data here.
  2.   /// NOTE: Derived classes are expected to initialize the bitfields.
  3.   LLVM_PACKED(union Bits {
  4.     Bits() : raw() {}
  5.     // Raw bits (to zero-init the union)
  6.     char raw[7];
  7.     // NamedDecl bits
  8.     struct {
  9.       bool illegalRedeclaration : 1;
  10.       union {
  11.         // VarDecl bits
  12.         struct {
  13.           bool isMutable : 1;
  14.         } varDecl;
  15.         // FuncDecl bits
  16.         struct {
  17.           bool bodyChecked : 1;
  18.         } funcDecl;
  19.       };
  20.     } namedDecl;
  21.   });
  22.   static_assert(sizeof(Bits) == 7, "Bits is too large!");
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement