[all-commits] [llvm/llvm-project] 65b34b: [clang][pr55896]:co_yield/co_await thread-safety

Nathan Sidwell via All-commits all-commits at lists.llvm.org
Thu Jun 9 04:42:37 PDT 2022


  Branch: refs/heads/main
  Home:   https://github.com/llvm/llvm-project
  Commit: 65b34b78f8dafbfd97836af3165e73c5b316c6b5
      https://github.com/llvm/llvm-project/commit/65b34b78f8dafbfd97836af3165e73c5b316c6b5
  Author: Nathan Sidwell <nathan at acm.org>
  Date:   2022-06-09 (Thu, 09 Jun 2022)

  Changed paths:
    M clang/lib/Analysis/CFG.cpp
    M clang/test/SemaCXX/thread-safety-coro.cpp

  Log Message:
  -----------
  [clang][pr55896]:co_yield/co_await thread-safety

co_await and co_yield are represented by (classes derived from)
CoroutineSuspendExpr.  That has a number of child nodes, not all of
which are used for code-generation.  In particular the operand is
represented multiple times, and, like the problem with co_return
(55406) it must only be emitted in the CFG exactly once.  The operand
also appears inside OpaqueValueExprs, but that's ok.

This adds a visitor for SuspendExprs to emit the required children in
the correct order.  Note that this CFG is pre-coro xform.  We don't
have initial or final suspend points.

Reviewed By: bruno

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




More information about the All-commits mailing list