Revert "[clang] NRVO: Improvements and handling of more cases."
authorHans Wennborg <hans@chromium.org>
Mon, 14 Jun 2021 14:39:32 +0000 (16:39 +0200)
committerHans Wennborg <hans@chromium.org>
Mon, 14 Jun 2021 14:46:58 +0000 (16:46 +0200)
commitc60dd3b2626a4d9eefd9f82f9a406b0d28d3fd72
treebf8dbe9d4e1058f1ce6d1be3fa197d3a8b248278
parentbfd451a0ca9bc6cd448c39bcf6fb06e1c1742637
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 [[http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2021/p2266r1.html|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.
20 files changed:
clang/include/clang/Sema/Sema.h
clang/lib/Sema/Sema.cpp
clang/lib/Sema/SemaCoroutine.cpp
clang/lib/Sema/SemaExprCXX.cpp
clang/lib/Sema/SemaStmt.cpp
clang/lib/Sema/SemaTemplateInstantiateDecl.cpp
clang/lib/Sema/SemaType.cpp
clang/test/CXX/class/class.init/class.copy.elision/p3.cpp
clang/test/CXX/dcl.dcl/dcl.spec/dcl.type/dcl.spec.auto/p7-cxx14.cpp
clang/test/CXX/drs/dr3xx.cpp
clang/test/CXX/expr/expr.prim/expr.prim.lambda/p4-cxx14.cpp
clang/test/CXX/temp/temp.decls/temp.mem/p5.cpp
clang/test/CodeGen/nrvo-tracking.cpp
clang/test/SemaCXX/constant-expression-cxx11.cpp
clang/test/SemaCXX/constant-expression-cxx14.cpp
clang/test/SemaCXX/coroutine-rvo.cpp
clang/test/SemaCXX/coroutines.cpp
clang/test/SemaCXX/deduced-return-type-cxx14.cpp
clang/test/SemaCXX/return-stack-addr.cpp
clang/test/SemaCXX/warn-return-std-move.cpp