efriedma added a comment.

You can't, in general, check whether a type is stored in a no_unique_address 
field.  Consider the following; the bad store is in the constructor S2, but the 
relevant no_unique_address attribute doesn't even show up until the definition 
of S3.

  struct S {};
  S f();
  struct S2 : public S { S2();};
  S2::S2() : S(f()) {}
  struct S3 { int x; [[no_unique_address]] S2 y; S3(); };
  S3::S3() : x(1), y() {}

So we have to suppress all stores of empty types, whether or not we see a 
no_unique_address attribute.

Given that, I don't think the isDummy field is necessary; the important part is 
just whether the type is empty, and you can derive that directly from the type 
itself.


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D157332

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

Reply via email to