[PATCH] D79719: [AIX] Implement AIX special alignment rule about double/long double

Hubert Tong via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Fri Jul 3 08:02:16 PDT 2020


hubert.reinterpretcast added inline comments.


================
Comment at: clang/lib/AST/RecordLayoutBuilder.cpp:1871
 
+  // AIX ABI has this special rule that in aggregates, the first member of
+  // floating point data type(or aggregate type contains floating point data
----------------
Suggestion:
```
  // The AIX `power` alignment rules apply the natural alignment of the
  // "first member" if it is of a floating-point data type (or is an aggregate
  // whose recursively "first" member or element is such a type). The alignment
  // associated with these types for subsequent members use an alignment value
  // where the floating-point data type is considered to have 4-byte alignment.
  //
  // For the purposes of the foregoing: vtable pointers, non-empty base classes,
  // and zero-width bit-fields count as prior members; members of empty class
  // types marked `no_unique_address` are not considered to be prior members.
```

This fixes a number of issues with the comment, including:

  - The meaning of "first member" is unclear and the intended meaning is unlikely to be understood from common meanings of the term.
  - The recursive application of the rule was not captured (the relationship is not merely "contains").
  - The statement about 4-byte alignment needed to take stricter alignment due to other factors into account.



Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D79719/new/

https://reviews.llvm.org/D79719





More information about the cfe-commits mailing list