Endilll wrote:

> Does this issue not apply to other platforms?

As far as I understand, MS ABI forces compilers to insert padding between 
bitfields more often than Itanium. Probably because of that GCC and Clang are 
able to merge separate loads of bitfields into single load on Linux.

> I'd think maybe rather than adding an attribute to workaround MSVC's missing 
> support - code could #ifdef in a way that's ABI compatible, maybe? (though I 
> admit that's a subtle thing to get right & the cost for getting it wrong is 
> significant)

It's technically possible to `#ifdef` this for Linux, but it's not going to 
work on Windows, because we have to show the compiler that bitfields have the 
same type (for Clang it's usually `unsigned`). Otherwise we get bad layouts and 
bad codegen, which is an unacceptable regression.

Even if we focus on Linux, I'd rather pay with lots of boilerplate in LLDB 
formatter (lower estimate is 4 lines per every single bitfield), than litter 
Clang headers with `#ifdef`s for the sake of debuggers.

https://github.com/llvm/llvm-project/pull/69104
_______________________________________________
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

Reply via email to