HomePhabricator

Revert "[clang] NRVO: Improvements and handling of more cases."

Authored by hans on Jun 14 2021, 7:39 AM.

Description

Revert "[clang] NRVO: Improvements and handling of more cases."

This change caused build errors related to move-only __block variables,
see discussion on https://reviews.llvm.org/D99696

This expands NRVO propagation for more cases:

Parse analysis improvement:

  • Lambdas and Blocks with dependent return type can have their variables marked as NRVO Candidates.

Variable instantiation improvements:

  • Fixes crash when instantiating NRVO variables in Blocks.
  • Functions, Lambdas, and Blocks which have auto return type have their variables' NRVO status propagated. For Blocks with non-auto return type, as a limitation, this propagation does not consider the actual return type.

This also implements exclusion of VarDecls which are references to
dependent types.

Signed-off-by: Matheus Izvekov <mizvekov@gmail.com>

Reviewed By: Quuxplusone

Differential Revision: https://reviews.llvm.org/D99696

This also reverts the follow-on change which was hard to tease apart
form the one above:

"[clang] Implement P2266 Simpler implicit move"

This Implements P2266 Simpler implicit move.

Signed-off-by: Matheus Izvekov <mizvekov@gmail.com>

Reviewed By: Quuxplusone

Differential Revision: https://reviews.llvm.org/D99005

This reverts commits 1e50c3d785f4563873ab1ce86559f2a1285b5678 and
bf20631782183cd19e0bb7219e908c2bbb01a75f.