[PATCH] D151128: [clangd] Show size, offset and padding for bit fields on hover

SR_team via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Tue May 23 10:32:42 PDT 2023


SR_team added a comment.

In D151128#4365218 <https://reviews.llvm.org/D151128#4365218>, @sammccall wrote:

> I do see the appeal of making this work for bitfields, but I think silently rounding offset/size/padding to whole bytes is pretty misleading.
> For bitfields we'd really need to talk about layout at a bit level.
> But we don't want to talk about regular fields in bits (I think?!)
> And having a mixture seems like it's going to be pretty complicated both in implementation and for users, for a smallish feature.
>
> I don't see a great sweet-spot design, maybe you/others have ideas (or can explain why the rounding behavior in this patch is reasonable.

We can store this fields in bits, and show in bytes on hover, when it's possible, and in bits, when showing in bytes impossible. Would such an implementation be good?


CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D151128/new/

https://reviews.llvm.org/D151128



More information about the cfe-commits mailing list