[PATCH] D35056: GCC ABI incompatibility when passing object with trivial copy ctor, trivial dtor, and non-trivial move ctor

John McCall via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Wed Aug 2 22:36:41 PDT 2017


rjmccall added inline comments.


================
Comment at: lib/CodeGen/CGCXXABI.cpp:43
   if (RD->hasNonTrivialDestructor())
     return false;
 
----------------
v.g.vassilev wrote:
> rjmccall wrote:
> > Does canPassInRegisters() not subsume all of these earlier checks?
> No, if I remove them here I get a lot of test failures. I cannot move them (yet?) in Sema, because I need to call `Sema::CheckCompletedCXXClass` in `Sema::ActOnFields` to compute the triviality of the decl. Only then it would be safe move these checks in `CanPassInRegisters`.
I feel it's pretty unfortunate to name a property "canPassInRegisters" when it actually means something quite different.  People will expect this to mean what it says.


https://reviews.llvm.org/D35056





More information about the cfe-commits mailing list