rjmccall added a comment. I see, alright.
================ Comment at: lib/CodeGen/CGObjC.cpp:3215 + if (be->getBlockDecl()->canAvoidCopyToHeap()) + return value; + ---------------- Can this just be a case in `ARCRetainExprEmitter`? I think that should subsume both this and the logic in `EmitARCStoreStrong`. ================ Comment at: lib/Sema/SemaDecl.cpp:11262 + if (auto *E = dyn_cast<ExprWithCleanups>(Init)) + if (auto *BE = dyn_cast<BlockExpr>(E->getSubExpr())) + if (VDecl->hasLocalStorage()) ---------------- I won't insist that you look through arbitrary value-propagating expressions like commas and conditionals, but please do at least call `IgnoreParens()` here and in the assignment case. ================ Comment at: lib/Sema/SemaExpr.cpp:12466 + if (VD->hasLocalStorage() && getCurScope()->isDeclScope(VD)) + BE->getBlockDecl()->setCanAvoidCopyToHeap(); break; ---------------- Please check for a block-expression RHS first, it is far more likely to short-circuit this check than anything else. Also, I think the right place for this check is up with the calls to `DiagnoseSelfAssignment` and `DiagnoseSelfMove`. Repository: rC Clang CHANGES SINCE LAST ACTION https://reviews.llvm.org/D58514/new/ https://reviews.llvm.org/D58514 _______________________________________________ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits