<div dir="ltr">At present, if a class contains any Non-POD members we perform element-wise copies for each field when generating the implicit copy-constructor and implicit copy-assignment operator (with an optimization for array members).<div>
<br></div><div style>This patch changes this behavior - adjacent POD members will be memcpy'd, with Non-POD members output as usual.</div><div style><br></div><div style>This is an initial implementation that I'd like to get in tree. Obvious deficiencies are:</div>
<div style><br></div><div style>It punts entirely when LangOpts.getGC != None.</div><div style>It doesn't handle inner classes/unions.</div><div style>It doesn't attach any TBAA info, even when all members are the same type.</div>
<div style>It isn't particularly smart about when it falls back on element-wise copies (at the moment it emits a memcpy any time it finds more than one POD field).</div><div style><br></div><div style>These should all be easy to test and remedy once the code's in tree though.</div>
<div style><br></div><div style>Does anybody see any problems with this?</div><div style>Style comments?</div><div style><br></div><div style>Feedback much appreciated.</div><div style><br></div><div style>- Lang.</div></div>