[llvm-commits] [PATCH] Allow inline when calling returns_twice

Joerg Sonnenberger joerg at britannica.bec.de
Wed Dec 14 04:59:28 PST 2011


On Wed, Dec 14, 2011 at 09:43:18AM +0100, Duncan Sands wrote:
> Hi Joerg,
> 
> > I hit a case in NetBSD that LLVM currently doesn't allow. The RUMP
> > framework basically wants to wrap vfork(2) and for that purpose, the
> > wrapper naturally has to be inline to work. At the moment, this can't
> > work with LLVM, since calling a returns_twice function explicitly
> > disables inlining. I want to turn this off, if the function itself is
> > also marked with that attribute. Reasoning is that the behavior
> > discussed in the comment (volatile for local variables) is already
> > needed in that case, so it doesn't change anything.
> 
> alternatively, how about inlining "returns_twice" functions if they are
> marked "always_inline"?  Presumably the NetBSD function is marked "always
> inline" since it has to be inlined.  And if someone marks a returns_twice
> function always_inline I think it's fair to assume that they know what
> they are doing.

That's a bit more restrictive. Question is, does it buy us anything?

Joerg



More information about the llvm-commits mailing list