[PATCH] D99517: Implemented [[clang::musttail]] attribute for guaranteed tail calls.

Josh Haberman via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Tue Jul 6 08:22:06 PDT 2021


haberman added a comment.

@theraven: Can you post a minimal repro of your case? I don't follow your distinction between "caller" and "enclosing function."

Regarding `noreturn` and `always_inline`: maybe the rules for `musttail` could be relaxed in cases like the one you mention, but it would require changing the backend (LLVM). Here I changed the front-end only and used LLVM's existing `musttail` support, which meant accepting its existing limitations <https://llvm.org/docs/LangRef.html#id327>.

I would love to see an exception for `always_inline`: my use case would benefit greatly from this. In my own project I had to change a bunch of `always_inline` functions to macros to work around this rule. Unfortunately this is complicated by the fact that `always_inline` does not actually guarantee that inlining occurs <https://clang.llvm.org/docs/AttributeReference.html#always-inline-force-inline>.


Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D99517/new/

https://reviews.llvm.org/D99517



More information about the cfe-commits mailing list