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

2022-04-15 Thread Corentin Jabot via Phabricator via cfe-commits
cor3ntin abandoned this revision. cor3ntin added a comment. Herald added a project: All. Richard committed a better approach so this is no longer needed Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D99893/new/ https://reviews.llvm.org/D99893

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

2021-04-06 Thread Richard Smith - zygoloid via Phabricator via cfe-commits
rsmith added a comment. In 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

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

2021-04-06 Thread Arthur O'Dwyer via Phabricator via cfe-commits
Quuxplusone added a comment. No matter how it works internally, I think that (nearer the end of the process) someone should insist that you add some Clang tests to verify e.g. Widget&& a = static_cast(Widget()); // is lifetime-extended, but Widget&& b = std::move(Widget()); //

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

2021-04-06 Thread Corentin Jabot via Phabricator via cfe-commits
cor3ntin added a comment. In D99893#2672258 , @rjmccall wrote: > Our builtin logic is capable of recognizing user declarations as builtins > without any sort of explicit annotation in source. That's how we recognize C > library builtins, for example.

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

2021-04-06 Thread John McCall via Phabricator via cfe-commits
rjmccall added a comment. Our builtin logic is capable of recognizing user declarations as builtins without any sort of explicit annotation in source. That's how we recognize C library builtins, for example. As Richard points out, that logic isn't really set up to do the right thing for

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

2021-04-06 Thread Corentin Jabot via Phabricator via cfe-commits
cor3ntin added a comment. > Treating a namespace-`std` function template as a builtin isn't entirely > novel; we already do this for MSVC's `std::_GetExceptionInfo` (though we > don't actually handle that properly: we're missing the "namespace `std`" > check, at least). Treating the builtin

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

2021-04-05 Thread Richard Smith - zygoloid via Phabricator via cfe-commits
rsmith added a comment. In D99893#2669441 , @rjmccall wrote: > I think a pattern-match in IRGen is probably a much more reasonable > alternative if the goal is primarily to avoid the code-generation overheads > at -O0 / optimization costs at -O. You'd

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

2021-04-05 Thread John McCall via Phabricator via cfe-commits
rjmccall added a comment. I think a pattern-match in IRGen is probably a much more reasonable alternative if the goal is primarily to avoid the code-generation overheads at -O0 / optimization costs at -O. You'd still have template instantiation overheads; I don't know how significant those

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

2021-04-05 Thread Roman Lebedev via Phabricator via cfe-commits
lebedev.ri added a comment. To be noted, this generally goes against the [current] spirit of the AST, those were calls in the source code, but they won't be represented as such any longer, which is likely not very expected by whatever tool that could be consuming the AST. Though, i'm not sure

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

2021-04-05 Thread Aaron Ballman via Phabricator via cfe-commits
aaron.ballman added reviewers: rsmith, Quuxplusone, rjmccall. aaron.ballman added a comment. Adding a few more reviewers for early feedback. Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D99893/new/ https://reviews.llvm.org/D99893