[PATCH] D79719: [AIX] Implement AIX special alignment rule about double/long double
Xiangling Liao via Phabricator via cfe-commits
cfe-commits at lists.llvm.org
Wed Jun 24 06:59:26 PDT 2020
Xiangling_L marked 2 inline comments as done.
Xiangling_L added inline comments.
================
Comment at: clang/lib/AST/RecordLayoutBuilder.cpp:1881
+ if (isAIXLayout(Context) && FieldOffset == CharUnits::Zero() &&
+ (IsUnion || NonOverlappingEmptyFieldFound)) {
+ FirstNonOverlappingEmptyFieldHandled = true;
----------------
jasonliu wrote:
> Xiangling_L wrote:
> > jasonliu wrote:
> > > Maybe it's a naive thought, but is it possible to replace `NonOverlappingEmptyFieldFound` with `IsOverlappingEmptyField && FieldOffsets.size() == 0`?
> > I don't think these two work the same. `NonOverlappingEmptyFieldFound` represents the 1st non-empty and non-overlapping field in the record. `IsOverlappingEmptyField && FieldOffsets.size() == 0` represents something opposite.
> You are right. I meant could we replace it with `!(IsOverlappingEmptyField && FieldOffsets.size() == 0)`?
I don't think so. The replacement does not work for the case:
```
struct A {
int : 0;
double d;
};
```
where __alignof(A) should be 4;
CHANGES SINCE LAST ACTION
https://reviews.llvm.org/D79719/new/
https://reviews.llvm.org/D79719
More information about the cfe-commits
mailing list