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



_______________________________________________
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

Reply via email to