llvm-project
6dfef470 - [clang] Treat unnamed bitfields as padding in `__builtin_clear_padding` (#201102)

Commit
72 days ago
[clang] Treat unnamed bitfields as padding in `__builtin_clear_padding` (#201102) Currently Clang's implementation of `__builtin_clear_padding` diverges from GCC in its treatment of unnamed bitfields. GCC treats them as padding (which seems correct since they can't be named and wouldn't be part of the value representation of an object, though I'm not sure what the standard has to say about this). [Gobdolt](https://godbolt.org/z/e9Mo91dhh) GCC trunk: ``` pre-clear bytes: ff ff ff ff post-clear bytes: 01 00 00 80 ``` Clang trunk: ``` pre-clear bytes: ff ff ff ff post-clear bytes: ff ff ff ff ``` Note how we cleared the padding with GCC. This patch skips marking unnamed bitfields as "occupied". The rest of the machinery works out-of-the-box.
Author
Parents
Loading