[all-commits] [llvm/llvm-project] fec5ff: [Clang] [P2025] Analyze only potential scopes for ...

Roman Rusyaev via All-commits all-commits at lists.llvm.org
Tue Jul 26 03:57:40 PDT 2022


  Branch: refs/heads/main
  Home:   https://github.com/llvm/llvm-project
  Commit: fec5ff2a3230ac9214891879e97b67dd6db833ed
      https://github.com/llvm/llvm-project/commit/fec5ff2a3230ac9214891879e97b67dd6db833ed
  Author: Roman Rusyaev <rusyaev.rm at gmail.com>
  Date:   2022-07-26 (Tue, 26 Jul 2022)

  Changed paths:
    M clang/docs/ReleaseNotes.rst
    M clang/include/clang/Sema/Scope.h
    M clang/lib/Sema/Scope.cpp
    M clang/lib/Sema/SemaDecl.cpp
    M clang/lib/Sema/SemaStmt.cpp
    M clang/test/CodeGenCXX/nrvo.cpp

  Log Message:
  -----------
  [Clang] [P2025] Analyze only potential scopes for NRVO

Before the patch we calculated the NRVO candidate looking at the
variable's whole enclosing scope. The research in [P2025] shows that
looking at the variable's potential scope is better and covers more
cases where NRVO would be safe and desirable.

Many thanks to @Izaron for the original implementation.

Reviewed By: ChuanqiXu

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




More information about the All-commits mailing list