[all-commits] [llvm/llvm-project] 667fbc: [clang] NRVO: Improvements and handling of more ca...

Matheus Izvekov via All-commits all-commits at lists.llvm.org
Thu Jun 10 14:03:15 PDT 2021


  Branch: refs/heads/main
  Home:   https://github.com/llvm/llvm-project
  Commit: 667fbcdd0b2ee5e78f5ce9789b862e3bbca94644
      https://github.com/llvm/llvm-project/commit/667fbcdd0b2ee5e78f5ce9789b862e3bbca94644
  Author: Matheus Izvekov <mizvekov at gmail.com>
  Date:   2021-06-10 (Thu, 10 Jun 2021)

  Changed paths:
    M clang/include/clang/Sema/Sema.h
    M clang/lib/Sema/Sema.cpp
    M clang/lib/Sema/SemaCoroutine.cpp
    M clang/lib/Sema/SemaExprCXX.cpp
    M clang/lib/Sema/SemaStmt.cpp
    M clang/lib/Sema/SemaTemplateInstantiateDecl.cpp
    M clang/test/CodeGen/nrvo-tracking.cpp

  Log Message:
  -----------
  [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 at gmail.com>

Reviewed By: Quuxplusone

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




More information about the All-commits mailing list