LLVM-C Patch : LLVMConvertModuleToC

LLVMConvertModuleToC Patch to LLVM-C

LLVMConvertModuleToCPatch (3 KB)

*shrug* One of the things about the C API is that it's a "support forever" sort
of thing. Is this kind of thing a big enough use case that we want to have
an API specifically for it?

-eric

I don't see why not.
C is a worthy language, one that I think we should fully support.
And by just providing some minor features really limits its usefulness.
Right now, at this very instance it isn't usable. Except as a stepping stone to the bigger framework.

But thats just my 2 cents.

- Filip

I don't have any particular objections so I'll apply this and the other unless someone
complains in the next few days :slight_smile:

-eric

Been thinking more about this. It seems to violate the idea of thin wrappers around the C++ APIs. This mostly seems to be an entire program as a C function instead of a wrapper. I think if you want to abstract out the functionality of this into C functions it might be more applicable.

Also, no iostream and the indenting really doesn't follow the coding standards :slight_smile:

-eric

I could extract all the functionality into wrapper methods. So that it would be possible to create such a thing in C.
But without considering the coding standards (it comes directly out of my repository), why would you object against this?
It seemed logical to me, to be able to create code in C, and then generate C out of it. This would be useful in things like a new flex/bison.
And combining modules is something that seemed a primitive to me.

- Filip

I could extract all the functionality into wrapper methods. So that it would be possible to create such a thing in C.
But without considering the coding standards (it comes directly out of my repository), why would you object against this?

Because nothing else works that way and I don't see expanding the C API to include various bits of random functionality that could be gotten by just wrapping the proper C++ calls.

It seemed logical to me, to be able to create code in C, and then generate C out of it. This would be useful in things like a new flex/bison.

Ur?

And combining modules is something that seemed a primitive to me.

Why not just wrap the Linker interface?

-eric

And combining modules is something that seemed a primitive to me.

Why not just wrap the Linker interface?

To be more specific, why not just wrap certain specific Linker calls instead of another big function that does a huge amount of work?

-eric

Done, and I will make an opensource project on github for my methods.
From now on I will only push the bear minimum for what I need to complete my tasks.
Sorry for the misunderstanding.

- Filip

LLVMLinkerRef.diff (3.22 KB)

Done, and I will make an opensource project on github for my methods.
From now on I will only push the bear minimum for what I need to complete my tasks.
Sorry for the misunderstanding.

No misunderstanding at all, I definitely appreciate the work and having larger C based projects is definitely interesting, but we try to keep the wrapping at the bare minimum to work for larger flexibility :slight_smile:

Thanks for everything!

-eric

One issue with this: putting bindings like this into VMCore won't work, because it will cause circular library dependencies. All of LLVM's libraries are layered, so we need to make sure to add the bindings to the appropriate layer.

-Chris