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

Matheus Izvekov via All-commits all-commits at lists.llvm.org
Wed Jun 16 16:57:01 PDT 2021


  Branch: refs/heads/main
  Home:   https://github.com/llvm/llvm-project
  Commit: 12c90e2e25dfd1d38250055efc21acb42d158912
      https://github.com/llvm/llvm-project/commit/12c90e2e25dfd1d38250055efc21acb42d158912
  Author: Matheus Izvekov <mizvekov at gmail.com>
  Date:   2021-06-17 (Thu, 17 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
    A clang/test/SemaObjCXX/block-capture.mm

  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