[fpc-devel] Enable LLVM?

Jonas Maebe jonas.maebe at elis.ugent.be
Tue Jul 14 10:58:44 CEST 2015


Adriaan van Os wrote:
> Jonas Maebe wrote:
>> d) trampolines for interface methods
>
> Ehw, trampolines. They requires executable stacks.

No, they don't.

> Is there a
> possibility to pass activation frames instead or apply lambda/lifting ?

Trampolines for interface methods are generated at compile time are are 
of the form:

self:=self-offset(objectself,intfvmt);
branch(interfacemethod); // can either be a direct or indirect branch

This cannot be expressed in LLVM IR. The above can in principle be 
replaced by a tail call that passes on all arguments (although LLVM 
won't generate an actual tail call, because it only supports tail calls 
for functions using the C fastcall calling convention) because FPC does 
not support C-style varargs functions (in which case "calling through 
passing the caller arguments" again could not be expressed), but since 
inline assembly needs to be supported anyway, it's probably easier to 
just generate assembler for them and call that.


Jonas



More information about the fpc-devel mailing list