This is an archive of the discontinued LLVM Phabricator instance.

[clang][CodeGen] Fix wrong memcpy size of no_unique_address in FieldMemcpyizer
ClosedPublic

Authored by zsrkmyn on Nov 25 2019, 7:03 AM.

Details

Summary

When generating ctor, FieldMemcpyizer wrongly treated zero-sized class members
as what should be copied, and generated wrong memcpy size under some special
circumstances. This patch tries to fix it.

Diff Detail

Event Timeline

zsrkmyn created this revision.Nov 25 2019, 7:03 AM
Herald added a project: Restricted Project. · View Herald TranscriptNov 25 2019, 7:03 AM
Herald added a subscriber: cfe-commits. · View Herald Transcript
This revision is now accepted and ready to land.Nov 25 2019, 4:33 PM
MaskRay accepted this revision.Nov 25 2019, 5:03 PM
MaskRay added inline comments.
clang/test/CodeGenCXX/no-unique-address-2.cpp
18

{ on the same line of call()

zsrkmyn updated this revision to Diff 230991.Nov 25 2019, 5:41 PM

Thanks for reviewing! Would you mind helping me commit this patch? Thanks :-D

This revision was automatically updated to reflect the committed changes.