This revision was landed with ongoing or failed builds.
This revision was automatically updated to reflect the committed changes.
Closed by commit rG28f7087c9163: [CodeGen][ObjC] Call synthesized copy
constructor/assignment operator (authored by ahatanak).
Repository:
rG LLVM Github Monorepo
rjmccall accepted this revision.
rjmccall added a comment.
This revision is now accepted and ready to land.
LGTM
Repository:
rG LLVM Github Monorepo
CHANGES SINCE LAST ACTION
https://reviews.llvm.org/D131701/new/
https://reviews.llvm.org/D131701
ahatanak updated this revision to Diff 457720.
ahatanak added a comment.
Deactivate the cleanup that was pushed in `EmitParmDecl`.
Repository:
rG LLVM Github Monorepo
CHANGES SINCE LAST ACTION
https://reviews.llvm.org/D131701/new/
https://reviews.llvm.org/D131701
Files:
rjmccall added a comment.
Can we check for the right conditions when emitting the setter body and just
deactivate the cleanup?
Repository:
rG LLVM Github Monorepo
CHANGES SINCE LAST ACTION
https://reviews.llvm.org/D131701/new/
https://reviews.llvm.org/D131701
ahatanak updated this revision to Diff 457620.
ahatanak added a comment.
Call the move assignment operator in the setter instead of calling the copy
assignment operator and the destructor.
Repository:
rG LLVM Github Monorepo
CHANGES SINCE LAST ACTION
https://reviews.llvm.org/D131701/new/
ahatanak added inline comments.
Comment at: clang/lib/CodeGen/CGObjC.cpp:1429
+ GetAddrOfLocalVar(*setterMethod->param_begin()), ivar->getType());
+ callCStructCopyAssignmentOperator(Dst, Src);
+} else {
rjmccall wrote:
> When the method takes
rjmccall added inline comments.
Comment at: clang/lib/CodeGen/CGObjC.cpp:1429
+ GetAddrOfLocalVar(*setterMethod->param_begin()), ivar->getType());
+ callCStructCopyAssignmentOperator(Dst, Src);
+} else {
When the method takes the structure by
ahatanak added a comment.
There is another bug where an object isn't destructed when a non-trivial C
struct property is set. I plan to send a patch that fixes the bug after this.
Repository:
rG LLVM Github Monorepo
CHANGES SINCE LAST ACTION
https://reviews.llvm.org/D131701/new/
ahatanak created this revision.
ahatanak added a reviewer: rjmccall.
ahatanak added a project: clang.
Herald added a project: All.
ahatanak requested review of this revision.
This fixes a bug where the getter/setter functions were doing a trivial copy
instead of calling the synthesized functions