[all-commits] [llvm/llvm-project] 54225c: [Coroutines] Fix premature conversion of return ob...

Bruno Cardoso Lopes via All-commits all-commits at lists.llvm.org
Thu Mar 9 14:19:11 PST 2023


  Branch: refs/heads/main
  Home:   https://github.com/llvm/llvm-project
  Commit: 54225c457a336b1609c6d064b2b606a9238a28b9
      https://github.com/llvm/llvm-project/commit/54225c457a336b1609c6d064b2b606a9238a28b9
  Author: Bruno Cardoso Lopes <bruno.cardoso at gmail.com>
  Date:   2023-03-09 (Thu, 09 Mar 2023)

  Changed paths:
    M clang/include/clang/AST/StmtCXX.h
    M clang/lib/AST/StmtCXX.cpp
    M clang/lib/CodeGen/CGCoroutine.cpp
    M clang/lib/Sema/SemaCoroutine.cpp
    M clang/lib/Sema/TreeTransform.h
    M clang/test/CodeGenCoroutines/coro-gro.cpp
    M clang/test/CodeGenCoroutines/pr59221.cpp
    M clang/test/SemaCXX/coroutine-no-move-ctor.cpp
    M clang/test/SemaCXX/coroutines.cpp
    M clang/test/SemaCXX/warn-throw-out-noexcept-coro.cpp

  Log Message:
  -----------
  [Coroutines] Fix premature conversion of return object

Fix https://github.com/llvm/llvm-project/issues/56532

Effectively, this reverts behavior introduced in https://reviews.llvm.org/D117087,
which did two things:

1. Change delayed to early conversion of return object.
2. Introduced RVO possibilities because of early conversion.

This patches fixes (1) and removes (2). I already worked on a follow up for (2)
in a separated patch. I believe it's important to split these two because if the RVO
causes any problems we can explore reverting (2) while maintaining (1).

Notes on some testcase changes:
- `pr59221.cpp` changed to `-O1` so we can check that the front-end honors
  the value checked for. Sounds like `-O3` without RVO is more likely
  to work with LLVM optimizations...
- Comment out delete members `coroutine-no-move-ctor.cpp` since behavior
  now requires copies again.

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




More information about the All-commits mailing list