[PATCH] D154951: [clang][Interp] __builtin_bit_cast, Take 2

Aaron Ballman via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Fri Aug 4 04:53:32 PDT 2023


aaron.ballman added inline comments.


================
Comment at: clang/lib/AST/Interp/InterpBitcast.cpp:71
+/// All offsets are in bytes.
+struct ByteTracker {
+  std::vector<bool> Initialized;
----------------
tbaeder wrote:
> aaron.ballman wrote:
> > Don't we need to track this at the *bit* level instead of the *byte* level? e.g., padding bits in structures, anonymous bit-fields, `bool`, `_BitInt`, etc?
> I actually started doing it in bits, but later realized that I can't use that since I have little support for bitfields and the current interpreter doesn't support bitcasts between bitfields. (That's why it's still `IndeterminateBits` down in `BitcastBuffer`).
I think we have to do it at the bit level if we want to conform to the standard, so perhaps the best path forward is to work on bitfield support first, then come back to bitcast?


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D154951



More information about the cfe-commits mailing list