patch: use AssignmentMemcpyizer for implicitly-defined move assignment operator

Nick Lewycky nlewycky at google.com
Mon Sep 9 20:51:40 PDT 2013


The implicit definition provided for the move assignment operator doesn't
take advantage of the memcpy'izer like the copy assignment operator does.

It turns out that the AssignmentMemcpyizer will work perfectly with no
changes. The decision for whether a field is memcpy'able is the same for
copy and move assignment, and in the case where something isn't memcpy'able
it falls back to generic EmitStmt on the synthesized AST, which will be
calling the member's move-assignment or copy-assignment operator as
appropriate.

(What about move constructors? Those are CXXConstructorDecl's and end up in
EmitConstructorBody as appropriate.)

Patch attached, please review!

Nick
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/cfe-commits/attachments/20130909/5ac7bfd1/attachment.html>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: move-assignment-1.patch
Type: application/octet-stream
Size: 1490 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/cfe-commits/attachments/20130909/5ac7bfd1/attachment.obj>


More information about the cfe-commits mailing list