================ @@ -2407,6 +2407,53 @@ class ASTReader bool isProcessingUpdateRecords() { return ProcessingUpdateRecords; } }; +/// A simple helper class to unpack an integer to bits and consuming +/// the bits in order. +class BitsUnpacker { + constexpr static uint32_t BitsIndexUpbound = 32; + +public: + BitsUnpacker(uint32_t V) { updateValue(V); } + BitsUnpacker(const BitsUnpacker &) = delete; + BitsUnpacker(BitsUnpacker &&) = delete; + BitsUnpacker operator=(const BitsUnpacker &) = delete; + BitsUnpacker operator=(BitsUnpacker &&) = delete; + ~BitsUnpacker() { +#ifndef NDEBUG + while (isValid()) + assert(!getNextBit() && "There are bits failed to read!"); ---------------- vgvassilev wrote:
```suggestion assert(!getNextBit() && "There are unprocessed bits!"); ``` Is that the analog of `hasUnconsumedValues`? If so, we could probably mirror it here, too. 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