[LLVMdev] Dynamic (JIT) type resolution

Chris Lattner sabre at nondot.org
Wed Nov 7 09:52:39 PST 2007

On Wed, 7 Nov 2007, Nicolas Geoffray wrote:
> Thanks BGB, but at this point I can handle it ;-). The problem is not
> how in theory (patch the caller), but how in the LLVM code generation
> process. There are three steps for that:
> 1) How to represent the stub in the IR? An intrinsic? An external field
> with a ghost linkage?

Probably an intrinsic.  The trick is making it general purpose, not 
language specific.

> 2) At which point in LLVM do we know we won't have any optimization, so
> that the field operation is next to the stub call?

You'll probably want to do this late in the code generator.

> 3) Make LLVM think the stub call is not a real call, so that
> callee-saved registers do not get clobbered.

LLVM supports calling convetions like "coldcc".  The idea of coldcc is 
that the function is compiled to not clobber callee-save registers. 
However, in practice, no current code generators do anything special with 
it, it's compiled like fastcc or ccc.



More information about the llvm-dev mailing list