[clang] [clang] Add clang::debug_info_type attribute for bitfields (PR #69104)

David Blaikie via cfe-commits cfe-commits at lists.llvm.org
Mon Oct 16 11:26:26 PDT 2023


dwblaikie wrote:

> Wouldn't it be better to go the other way around? i.e. have a `[[clang::compressed_bitfield]]` (or whatever) which influences the ABI, so it's possible to do stuff like
> 
> ```c++
> [[clang::compressed_bitfield]] bool IsSomething : 1;
> [[clang::compressed_bitfield]] MyEnum Whatever : 3;
> [[clang::compressed_bitfield]] int MoreStuff : 4;
> ```
> 
> which the current approach doesn't allow.

The issue is that MSVC wouldn't know/recognize/implement this attribute - so clang couldn't do that without breaking ABI compatibility with MSVC.

https://github.com/llvm/llvm-project/pull/69104


More information about the cfe-commits mailing list