[PATCH] D147714: [Attr] Introduce [[clang::nonportable_musttail]] as less strict version of [[clang::musttail]]

Dávid Bolvanský via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Fri Apr 7 06:20:20 PDT 2023


xbolva00 added a subscriber: jacobsa.
xbolva00 added a comment.

>> Could we instead encode the platform specific tail-call rules in Sema? We definitely have attributes that differ in behavior between platforms, and this seems like a perfect candidate.

But then you break promise of musttail that code with musttail will work on any target supported by LLVM.

Plus, while we can relax frontend checks (based on target info), it is true that current LLVM LangRef says that there must be a  match between prototypes.

>> Higher-level question: are we sure there's enough evidence this will be used in practice to warrant adding it to Clang?

Originally mentioned as request for CTRE project, I have use cases as well, @jacobsa (Github issue) mentioned it:

> Personally I would like the semantics "give me an error if this can't be a tail call on this target", not the semantics "give me an error if this can't be a tail call on all targets clang supports". I suspect most people would be looking for the former, since most people care about nearly none of the supported targets by volume.

I agree with that.


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

https://reviews.llvm.org/D147714



More information about the cfe-commits mailing list