[PATCH] D99893: [WIP] Replace std::forward & std::move by cast expressions during Sema

Richard Smith - zygoloid via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Tue Apr 6 16:35:27 PDT 2021


rsmith added a comment.

In D99893#2672563 <https://reviews.llvm.org/D99893#2672563>, @cor3ntin wrote:

> This would solve some of the issues (perfect code-gen / no body instantiation), but the declarations are still instantiated of course.
> And I have a few folks asking me whether I could get rid of it. Unfortunately, I think the goals of preserving the AST as is today and getting rid of these template instantiations are contradictory.

Do you know how much of the cost here is instantiating the function declaration, and how much is instantiating `std::remove_reference`? I imagine we could make the latter cheaper by adding a `__remove_reference` builtin and changing libc++'s `forward` and `move` to use it if that's worthwhile.


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D99893



More information about the cfe-commits mailing list