dotnet / LLVMSharp

LLVM bindings for .NET Standard written in C# using ClangSharp
MIT License
838 stars 95 forks source link

Add missing unmanaged wrappers related to attributes #218

Closed mrahhal closed 1 year ago

mrahhal commented 1 year ago

This adds some missing unmanaged wrappers for attributes. Will try and follow up with working on the managed wrappers.

Related to https://github.com/dotnet/LLVMSharp/issues/217.

mrahhal commented 1 year ago

What's the status of this repo in terms of maintenance? I'm finding a lot of missing apis (even unmanaged ones, not using the managed wrapper at all yet), in addition to the samples being extremely outdated.

Would like to know as I'm wondering if I should put in the work to contribute these and wait for PR reviews and merges, or just fork the project and do some ad-hoc patching instead to be honest so I can continue with what I'm doing.

tannergooding commented 1 year ago

What's the status of this repo in terms of maintenance?

Sorry for the delay, I'm normally fairly pro-active on getting PRs reviewed/merged. But we're currently locking down the .NET 8 release (I'm on the .NET Libraries team) and so I've been a bit pre-occupied.

I should be able to get to this shortly.

I'm finding a lot of missing apis (even unmanaged ones, not using the managed wrapper at all yet), in addition to the samples being extremely outdated.

All unmanaged APIs should be exposed, they are generated directly from the header files. Do you have an example of an unmanaged API that is missing?

Higher level abstractions (that is the safe wrappers exposed as instance methods or the OOP surface that more closely mirrors LLVM C++ API) may not all be there yet and are a WIP.

mrahhal commented 1 year ago

Thanks for replying! And very understood.

All unmanaged APIs should be exposed, they are generated directly from the header files. Do you have an example of an unmanaged API that is missing?

I wasn't clear enough, I meant in the unmanaged Ref structs. (which this PR applies to) Yes the bindings themselves are all there as far as I can tell. I am able to at least use the bindings directly, but mentioned this since even without the managed wrappers, the Ref structs are still much less awkward to work with than the bindings.

I did a skim of the managed wrappers, and indeed only the very beginning is there. I have some code in progress relating to these as well that I'll try and send patches for later if that's ok. (I can see there are some work done in managed wrappers, but even the central wrappers such as Module/Context are missing lots of important parts too)

tannergooding commented 1 year ago

I wasn't clear enough, I meant in the unmanaged *Ref structs. (which this PR applies to)

Ah, I see. Yes, these are still lacking.

ClangSharp has "everything" here and is basically where I want to get LLVMSharp. I just ended up being particularly busy in .NET 7/8 with Generic Math and then AVX-512 support being added and so haven't had nearly as much time as I've desired to finish the support out.

I have some code in progress relating to these as well that I'll try and send patches for later if that's ok.

Sounds great to me. Contributions are more than welcome and will help get the repo to where we want it to be 😄