[llvm] [Coroutines] Create C++ noop coroutine with default function attributes (PR #134878)
Eli Friedman via llvm-commits
llvm-commits at lists.llvm.org
Thu Apr 24 18:19:40 PDT 2025
https://github.com/efriedma-quic commented:
The cases where Function::createWithDefaultAttr is really necessary are cases where it isn't possible to set appropriate per-function attributes. Lowering is generating the function from scratch, so it has to work "everywhere", even if we don't have access to the full set of target flags from the frontend. Like during LTO.
We really don't want to generate code this way if we can avoid it: we don't get any debug info, the assumed target is the bare minimum for the triple, we're skipping over all the normal ABI handling for the type. So... I'd prefer not to add new code depending on the "default-attrs" infrastructure if we can avoid it, but I guess it isn't a big deal in this context.
Really, why aren't we generating this in the frontend? I don't see the benefit to having a special "no-op coroutine", as opposed to just generating a coroutine that's a no-op.
-------
On a related note, what's going on with the calling-convention stuff? Passing around function pointers to CallingConv::Fast functions makes me very concerned: CallingConv::Fast does not have a stable ABI.
https://github.com/llvm/llvm-project/pull/134878
More information about the llvm-commits
mailing list