[PATCH] D41039: Add support for attribute "trivial_abi"
Akira Hatanaka via Phabricator via cfe-commits
cfe-commits at lists.llvm.org
Thu Jan 4 13:13:56 PST 2018
ahatanak updated this revision to Diff 128642.
ahatanak added a comment.
I've only fixed the places where the bits to track the triviality of special functions are set or reset, so this is still a WIP. I'll update the patch again later today, but let me know if anyone has any feedback in the meantime.
A couple of comments and questions about this patch:
- CXXRecordDecl and FunctionDecl still have the flags that keep track of the triviality of special functions for calls. I don't think we can avoid using them even under the new simpler rules? I also had to add "DeclaredNonTrivialSpecialMembersForCall" since ItaniumCXXABI::passClassIndirect needs to know whether a struct has a non-trivial destructor or copy constructor (I plan to make changes to passClassIndirect later so that hasNonTrivial*ForCalls methods are called there).
- If a struct annotated with "trivial_abi" turns out to be ill-formed (because it has virtual bases, virtual functions, or __weak pointers), the attribute is dropped after all the members explicitly declared in the struct are seen. The triviality bits for user-provided special functions are set or reset only after we know whether "trivial_abi" has to be dropped or not. Currently, a diagnostic is printed if the struct becomes ill-formed because of the attribute, but it is possible to make changes to suppress them or make them more user-friendly.
-------------- next part --------------
A non-text attachment was scrubbed...
Size: 44200 bytes
Desc: not available
More information about the cfe-commits