[PATCH] D73675: Avoid many std::tie/tuple instantiations in ASTImporter

Reid Kleckner via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Tue Feb 4 15:37:07 PST 2020


rnk marked an inline comment as done.
rnk added a comment.

Regarding the `Error Err; ... return std::move(Err);` pattern, I think it needs to be written like this for now. At the very least, NRVO is not possible because of the Expected conversion, so std::move is not a pessimization.

Thanks for the review!



================
Comment at: clang/lib/AST/ASTImporter.cpp:1168
+  Error Err = Error::success();
+  QualType ToElementType = T->getElementType();
+  Expr *ToSizeExpr = T->getSizeExpr();
----------------
martong wrote:
> shafik wrote:
> > Should this group be using `importChecked` as well?
> Yes, this is a good catch!
Thanks, I fixed this and the one below. I did some regexes to try to find other instances based on this pattern, but I didn't find any more. Hopefully I haven't introduced new bugs. :)


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D73675





More information about the cfe-commits mailing list