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

Duncan Sands baldrick at free.fr
Wed Dec 14 05:09:21 PST 2011


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?

your scheme seemed to be making a bunch of assumptions about how people use
"returns_twice" functions.  If you are confident that those assumptions are
valid then, sure, go ahead with your scheme.

Ciao, Duncan.



More information about the llvm-commits mailing list