[LLVMdev] Having JIT resolve extern "C" functions declared in executible

Bill Wendling isanbard at gmail.com
Sat Aug 22 15:40:36 PDT 2009


I think you might have to provide an empty list if your function  
doesn't take parameters. Maybe using an irbuilder would help?

-bw

On Aug 22, 2009, at 2:13 PM, Renato Golin <rengolin at systemcall.org>  
wrote:

> 2009/7/4 Albert Graef <Dr.Graef at t-online.de>:
>> This is all I ever needed to interface to C functions using LLVM.  
>> It's
>> really easy. Of course you still need a prototype of the external
>> function (function definition without body) in your IR, but that's  
>> it.
>
> Hi Albert,
>
> I'm having a similar problem and I found I can't declare the function
> and use it, most likely because my syntax is wrong.
>
> I have the function extern'd and am creating only the signature on the
> IR code (attached). The idea is that it creates something like this:
>
> My variable is DoubleTy and the expected parameter is also, but I'm
> getting this error:
>
> Assertion `(0 == FTy->getNumParams() || FTy->getParamType(0) ==
> Actual->getType()) && "Calling a function with a bad signature!"'
>
> cheers,
> --renato
>
> Reclaim your digital rights, eliminate DRM, learn more at
> http://www.defectivebydesign.org/what_is_drm
> <extern.cpp>
> _______________________________________________
> LLVM Developers mailing list
> LLVMdev at cs.uiuc.edu         http://llvm.cs.uiuc.edu
> http://lists.cs.uiuc.edu/mailman/listinfo/llvmdev



More information about the llvm-dev mailing list