[PATCH] D41039: Add support for attribute "trivial_abi"

Akira Hatanaka via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Fri Jan 5 10:21:11 PST 2018


ahatanak marked an inline comment as done.
ahatanak added inline comments.


================
Comment at: include/clang/Basic/AttrDocs.td:2261
+- The class or its subobjects have Objective-C pointer type members and ARC is
+  enabled.
+  }];
----------------
rjmccall wrote:
> I think the right list of exceptions is:
> 
>   - The class directly declares a virtual base or virtual methods.
>   - The class has a base class that is non-trivial for the purposes of calls.
>   - The class has a non-static data member whose type is non-trivial for the purposes of calls, which includes:
>     - classes that are non-trivial for the purposes of calls
>     - __weak-qualified types in Objective-C++
>     - arrays of any of the above
> 
> I don't see why __strong types would be affected.  We've talked about changing the C++ ABI for structs containing __strong members as part of the __strong-pointers-in-structs feature, but that's not even implicated here because there's an attribute which did not previously exist, so there's no established ABI.
I realized I hadn't taken care of arrays of non-trivial structs. I fixed it in checkIllFormedTrivialABIStruct and added a test case to test/SemaObjCXX/attr-trivial-abi.mm.


https://reviews.llvm.org/D41039





More information about the cfe-commits mailing list