[all-commits] [llvm/llvm-project] df477d: [Coroutine][Sema] Tighten the lifetime of symmetri...

Xun Li via All-commits all-commits at lists.llvm.org
Fri Sep 11 13:36:00 PDT 2020


  Branch: refs/heads/master
  Home:   https://github.com/llvm/llvm-project
  Commit: df477db5f9e0ea2a4890040b65002d93e33209b0
      https://github.com/llvm/llvm-project/commit/df477db5f9e0ea2a4890040b65002d93e33209b0
  Author: Xun Li <xun at fb.com>
  Date:   2020-09-11 (Fri, 11 Sep 2020)

  Changed paths:
    M clang/lib/Sema/SemaCoroutine.cpp
    M clang/test/CodeGenCoroutines/Inputs/coroutine.h
    A clang/test/CodeGenCoroutines/coro-semmetric-transfer.cpp

  Log Message:
  -----------
  [Coroutine][Sema] Tighten the lifetime of symmetric transfer returned handle

In generating the code for symmetric transfer, a temporary object is created to store the returned handle from await_suspend() call of the awaiter. Previously this temp won't be cleaned up until very later, which ends up causing this temp to be spilled to the heap. However, we know that this temp will no longer be needed after the coro_resume call. We can clean it up right after.

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




More information about the All-commits mailing list