[clang] [clang] Stub out gcc_struct attribute (PR #71148)
Aaron Ballman via cfe-commits
cfe-commits at lists.llvm.org
Wed Nov 15 10:50:28 PST 2023
================
@@ -7482,3 +7482,26 @@ generation of the other destruction cases, optimizing the above `foo.destroy` to
}];
}
+
+def MSStructDocs : Documentation {
+ let Category = DocCatDecl;
+ let Content = [{
+The ``ms_struct`` and ``gcc_struct`` attributes request the compiler to enter a
+special record layout compatibility mode which mimics the layout of Microsoft or
+Itanium C++ ABI respectively. Obviously, if the current C++ ABI matches the
+requested ABI, the attribute does nothing. However, if it does not, annotated
+structure or class is laid out in a special compatibility mode, which slightly
+changes offsets for fields and bit-fields. The intention is to match the layout
+of the requested ABI for structures which only use C features.
+
+Note that the default behavior can be controlled by ``-mms-bitfields`` and
+``-mno-ms-bitfields`` switches and via ``#pragma ms_struct``.
+ }];
+}
+
+def GCCStructDocs : Documentation {
+ let Category = DocCatDecl;
+ let Content = [{
+See ms_struct_.
+ }];
+}
----------------
AaronBallman wrote:
```suggestion
```
https://github.com/llvm/llvm-project/pull/71148
More information about the cfe-commits
mailing list