[PATCH] D58514: Avoid needlessly copying blocks that initialize or are assigned to local auto variables to the heap

John McCall via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Mon Feb 25 21:39:11 PST 2019


rjmccall added a comment.

Okay, one last minor request, then LGTM.



================
Comment at: lib/CodeGen/CGObjC.cpp:2953
+  return asImpl().visitExpr(e);
+}
+
----------------
Oh, I'd forgotten this wasn't a normal expression visitor.  Well, okay, this isn't too bad.


================
Comment at: lib/Sema/SemaExpr.cpp:12461
+      if (auto *BE = dyn_cast<BlockExpr>(RHS.get()->IgnoreParens()))
+        if (auto *DRE = dyn_cast<DeclRefExpr>(LHS.get()))
+          if (auto *VD = dyn_cast<VarDecl>(DRE->getDecl()))
----------------
You should `IgnoreParens` on the LHS as well.  In general, you should always `IgnoreParens`.


Repository:
  rC Clang

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D58514/new/

https://reviews.llvm.org/D58514





More information about the cfe-commits mailing list