[LLVMdev] LLVM C bindings

Gordon Henriksen gordonhenriksen at me.com
Mon Feb 16 10:39:02 PST 2009


On Feb 16, 2009, at 12:24, Corrado Zoccolo wrote:

> I find the C bindings for LLVM very useful, since they allow to  
> invoke LLVM from a wider set of software tools (i.e. llvm-py uses it  
> to export llvm to python).
> Unfortunately, it seems that llvm-c interface lacks major  
> functionalities, e.g. getting a pointer to a jit-ted function.

Enhancements to the bindings are welcomed. If you have a patch to add  
desired functionality, please submit it.

> It is easy to write a small c++ wrapper to expose the functionality  
> that one wants (llvm-py does it for the many optimization passes not  
> available through c binding), but I wonder if it is possible to have  
> a simpler & cleaner solution, i.e. automatically generating C  
> bindings from c++ classes.

If you have a successful generated binding, you're welcome to publish  
and/or submit it. I think a degree of editorial discretion in the  
bindings is advisable, but completeness might outweigh that  
consideration.

> Or am I missing some obvious way to have the aforementioned  
> functionality in C without writing wrappers?

Nope.

— Gordon





More information about the llvm-dev mailing list