[all-commits] [llvm/llvm-project] e39ba0: [C++20] [Coroutines] Warning for always_inline cor...

Chuanqi Xu via All-commits all-commits at lists.llvm.org
Mon Feb 7 19:44:28 PST 2022


  Branch: refs/heads/main
  Home:   https://github.com/llvm/llvm-project
  Commit: e39ba0461757339f7172f6bc3882f41116bb7c13
      https://github.com/llvm/llvm-project/commit/e39ba0461757339f7172f6bc3882f41116bb7c13
  Author: Chuanqi Xu <yedeng.yd at linux.alibaba.com>
  Date:   2022-02-08 (Tue, 08 Feb 2022)

  Changed paths:
    M clang/include/clang/Basic/AttrDocs.td
    M clang/include/clang/Basic/DiagnosticGroups.td
    M clang/include/clang/Basic/DiagnosticSemaKinds.td
    M clang/lib/Sema/SemaCoroutine.cpp
    M clang/test/SemaCXX/coroutines.cpp

  Log Message:
  -----------
  [C++20] [Coroutines] Warning for always_inline coroutine

See the discussion in https://reviews.llvm.org/D100282. The coroutine
marked always inline might not be inlined properly in current compiler
support. Since the coroutine would be splitted into pieces. And the call
to resume() and destroy() functions might be indirect call. Also the
ramp function wouldn't get inlined under O0 due to pipeline ordering
problems. It might be different to what users expects to. Emit a warning
to tell it.

This is what GCC does too: https://godbolt.org/z/7eajb1Gf8

Reviewed By: Quuxplusone

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




More information about the All-commits mailing list