Endilll wrote:

I find `llvm::Bitfield` API with all its explicit setters with explicit storage 
parameter clunky compared to language bit-fields. But that's minor. My major 
issue with this patch is that `uint64_t Storage;` is as opaque for debuggers as 
it gets. It would take so much work to correctly interpret its value when you 
work backwards from the field (extracting all those member types), that 
`LLVM_PREFERRED_TYPE(IdentifierInfoBits) uint64_t Storage`, where 
`IdentifierInfoBits` is a struct with current bit-fields, doesn't sound as bad 
to me as it should.

I see an improvement with consistent asserting that value we set fits the 
bit-field, but I'm not sold that this is the best way to go. For starters, we 
can again have an `IdentifierInfoBits` type which adds said assertions to every 
setter, but actual storage is still a bit-field with `LLVM_PREFERRED_TYPE` on 
it. Admittedly, this is more work and more boilerplate, but it provides the 
same improvement on assertions without compromising debugging experience.

https://github.com/llvm/llvm-project/pull/79366
_______________________________________________
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

Reply via email to