================ @@ -617,24 +617,27 @@ void ASTDeclReader::VisitDecl(Decl *D) { Reader.getContext()); } D->setLocation(ThisDeclLoc); - D->InvalidDecl = Record.readInt(); - if (Record.readInt()) { // hasAttrs + + uint64_t DeclBits = Record.readInt(); + D->InvalidDecl = DeclBits & 0x1; + D->setImplicit(DeclBits & (1 << 2)); + D->Used = (DeclBits >> 3) & 0x1; + IsDeclMarkedUsed |= D->Used; + D->setReferenced(DeclBits & (1 << 4)); + D->setTopLevelDeclInObjCContainer(DeclBits & (1 << 5)); + D->setAccess((AccessSpecifier)((DeclBits >> 6) & 0x3)); + D->FromASTFile = true; + auto ModuleOwnership = (Decl::ModuleOwnershipKind)((DeclBits >> 8) & 0x7); ---------------- vgvassilev wrote:
That looks more readable to me. In the case of `ModuleOwnershipKind` can we use the bit size either with `sizeof` or via `NextInContextAndBits`? If we use `sizeof` this could look like: `auto ModuleOwnership = Bits.getNextBit<Decl::ModuleOwnershipKind>());` but we will likely read/write 8 bits instead of 3 in this case... https://github.com/llvm/llvm-project/pull/69287 _______________________________________________ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits