[PATCH] D145852: [Clang][AST] Fix __has_unique_object_representations computation for unnamed bitfields.

Vlad Serebrennikov via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Sat Mar 11 09:50:40 PST 2023


Endill accepted this revision.
Endill added a comment.
This revision is now accepted and ready to land.

LGTM
I got confused at first why this fix is done in a function named `getSubobjectSizeInBits`, and why do we calculate size to produce a boolean value in the end. Then I realized that this function returns number of bits of value representation, or `std::nullopt` if there are any padding bits, and we take advantage of the latter to implement `hasUniqueObjectRepresentations`. I guess I'm either missing some context or that function could be named better (not in this patch, of course).


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D145852



More information about the cfe-commits mailing list