[cfe-dev] Microsoft ABI Support vs. ms_struct & Removing -mms-bitfields

Warren Hunt whunt at google.com
Fri Aug 30 13:36:26 PDT 2013


Now that I'm putting finishing touches on the Microsoft Record Layout patch
(http://llvm-reviews.chandlerc.com/D1026) there are some subtle issues that
are cropping up with respect to compatibility with the ms_struct
pragma/mms-bitfields flag.

The issues is that behavior of ms_struct/mms-bitfields is to use the
Itanium layout rules for everything except alignment of long long,
bitfields and bitfield padding.  This results in something that is Win32
ABI compatible for standard layout C++ structures but not otherwise.

It would be a maintenance win if we could remove all Microsoft related
layout code from the Itanium builder and simply use the Microsoft builder
when ms_struct or mms-bitfields is set.

Does anyone object to making mms-bitfields/ms_struct mean "use Microsoft
record layout" so we can deprecate the hybrid code?

When using mms-bitfields/ms_struct should we throw an error if the record
is not standard layout?
Can we get rid of mms-bitfields in favor of ms_struct?  Is anyone using
mms-bitfields?  Because mms-bitfields is global, it applies to the entire
#include chain for a TU and can cause system structs etc to be laid out
incorrectly and potentially silently break standard library
interfaces/linking to TUs that don't have mms-bitfields, etc.

-Warren
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/cfe-dev/attachments/20130830/4e8fe868/attachment.html>


More information about the cfe-dev mailing list