lua-users home
lua-l archive

[Date Prev][Date Next][Thread Prev][Thread Next] [Date Index] [Thread Index]


BTW, when I say "you can't do that" regarding "you still clean up the
stack frame, push on the return values, and jump", I meant that you
can't do it manually with LLVM. It does it for you if you ask nicely
:-).
—Pierre-Yves


On Tue, Mar 24, 2015 at 12:33 AM, Dibyendu Majumdar
<mobile@majumdar.org.uk> wrote:
> On 21 March 2015 at 22:03, Pierre-Yves Gérardy <pygy79@gmail.com> wrote:
>> The trouble is that you can't do that with LLVM.
>>
>> It does support TCO, though, at the expense of easy C interop (you
>> have to use incompatible calling conventions which breaks the ABI). As
>> long as you don't want to mix C and Lua/Ravi code, FFI-style, you
>> should be fine.
>>
>> http://llvm.org/docs/CodeGenerator.html#tail-call-optimization
>> http://llvm.org/docs/LangRef.html#calling-conventions
>
> Thanks ... I will look into this.
>