[PATCH] D39562: [CodeGen][ObjC] Fix an assertion failure caused by copy elision

Akira Hatanaka via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Fri Mar 2 21:31:49 PST 2018


ahatanak updated this revision to Diff 136895.
ahatanak added a comment.

Add a flag to OpaqeuValueExpr that indicates whether it is a unique reference to its subexpression. If the flag is set, IRGen will avoid binding the OVE and copying the result to the destination and instead just visit the OVE's sub-expression.

The flag is set only when the PseudoObjectExpr is an assignment and the RHS is an rvalue of a C++ class type, which is sufficient to fix the assertion failure this patch is trying to fix.


https://reviews.llvm.org/D39562

Files:
  include/clang/AST/Expr.h
  lib/CodeGen/CGExpr.cpp
  lib/CodeGen/CGExprAgg.cpp
  lib/CodeGen/CodeGenFunction.h
  lib/Sema/SemaPseudoObject.cpp
  test/CodeGenObjCXX/property-dot-copy-elision.mm
  test/CodeGenObjCXX/property-objects.mm

-------------- next part --------------
A non-text attachment was scrubbed...
Name: D39562.136895.patch
Type: text/x-patch
Size: 6004 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/cfe-commits/attachments/20180303/60b0a35c/attachment.bin>


More information about the cfe-commits mailing list