[clang] [llvm] [Clang] C++20 Coroutines: Introduce Frontend Attribute [[clang::coro_await_elidable]] (PR #99282)
Chuanqi Xu via llvm-commits
llvm-commits at lists.llvm.org
Wed Aug 7 19:09:43 PDT 2024
================
@@ -8119,6 +8119,35 @@ but do not pass them to the underlying coroutine or pass them by value.
}];
}
+def CoroAwaitElidableDoc : Documentation {
+ let Category = DocCatDecl;
+ let Content = [{
+The ``[[clang::coro_await_elidable]]`` is a class attribute which can be applied
+to a coroutine return type.
+
+When a coroutine function that returns such a type calls another coroutine function,
+the compiler performs heap allocation elision when the call to the coroutine function
+is immediately co_awaited as a prvalue.
----------------
ChuanqiXu9 wrote:
What I am concerning is, actually we don't care if it is prvalue or not at all. What we really want is to find the CallInst. The prvalue catagory doesn't be involved in the design. It is just, the idea of `prvalue` can help us to implement this. So I think the concept of prvalue is better to be an implementation details but not the interface.
And on the other hand, in my mind, this should be meant to be related with parsers. So I am fine with that.
https://github.com/llvm/llvm-project/pull/99282
More information about the llvm-commits
mailing list