HomePhabricator

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

Authored by mizvekov on Mar 18 2021, 7:32 PM.

Description

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

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

Details

Committed
mizvekovJun 16 2021, 4:56 PM
Reviewer
Quuxplusone
Differential Revision
D99696: [clang] NRVO: Improvements and handling of more cases.
Parents
rGb5e22e6d4207: Migrate MLIR test passes to the new registration API
Branches
Unknown
Tags
Unknown