[LLVMdev] CLR or C++/CLI interface to IR building API

Scott Graham sgraham at gmail.com
Tue Aug 12 18:24:59 PDT 2008


On Tue, Aug 12, 2008 at 5:51 PM, Gordon Henriksen
<gordonhenriksen at me.com> wrote:
> On Aug 12, 2008, at 19:38, Scott Graham wrote:
>
> LLVM has C bindings which you should be able to P/Invoke
> straightforwardly. A rational managed API could be built atop these.
> Visit include/llvm-c in the source tree. These were specifically
> designed for use via FFIs like P/Invoke.

Thanks Gordon, I'll see what I can do with llvm-c.

If we decide to go this way (it'll be a relatively large change from
generating text I expect), I'll try to make sure things are kept
separate so the bindings can be contributed back.

> I wouldn't really advise trying to P/Invoke LLVM's C++ APIs directly,
> either.

Good to know, I'd started writing proxy "ref class" classes, but it
was starting to get a bit icky with multiple inheritance and abstract
bases. I think the straight C version makes more sense.

thanks,
scott



More information about the llvm-dev mailing list