[PATCH] D62801: Add "willreturn" function attribute
Mehdi AMINI via Phabricator via llvm-commits
llvm-commits at lists.llvm.org
Thu Jun 27 09:10:51 PDT 2019
mehdi_amini added inline comments.
================
Comment at: llvm/docs/LangRef.rst:1479
+ This produces undefined behavior at runtime if the function never comes back
+ to the call site.
``nounwind``
----------------
uenoku wrote:
> jdoerfert wrote:
> > jdoerfert wrote:
> > > You should allow exceptions here, I think. That would make `will-return` and orthogonal to `nounwind` (aka. no-throw).
> > >
> > > We can also think about removing the hypen, idk what is best.
> > >
> > >
> > One idea to phrase it would be:
> >
> > "the function will, after a finite amount of time, stop executing without ending execution of the program."
> >
> > Or:
> >
> > "either exhibit undefined behavior or comes back and continues execution at a point in the existing call stack that includes the current invocation."
> I prefer willreturn. I renamed it.
> "comes back and continues execution at a point in the existing call stack that includes the current invocation."
This sentence is not clear to me: what does "comes back" mean does not seem well defined. Also I don't understand: "at a point in the existing call stack that includes the current invocation", I assume you're trying to allow exceptions, but then the point at which the control would resume would *not* include the current invocation since it could be higher in the call stack.
(And I think that it should be "come back" instead of "comes back").
Repository:
rL LLVM
CHANGES SINCE LAST ACTION
https://reviews.llvm.org/D62801/new/
https://reviews.llvm.org/D62801
More information about the llvm-commits
mailing list