dotnet / LLVMSharp

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

Add a proper managed wrapper for LLVMSharp #137

Closed tannergooding closed 4 years ago

tannergooding commented 4 years ago

This adds a proper managed wrapper that loosely mirrors the LLVM object-oriented API surface available in C++.

tannergooding commented 4 years ago

CC. @mjsabby as an FYI

tannergooding commented 4 years ago

Still quite a bit more to expose before it is useable by itself (without falling back to invoking methods off Handle), but this shows the general design and exposes a good set of APIs.

tannergooding commented 4 years ago

There were some places I thought you'd make them structs, like Value or Class, but this is after all supposed to feel like a more managed API so it seems alright.

I've tried to mirror how LLVM handles them. Most of these are handles in the C and are exclusively passed around in the C++ API as T*. They often also have a inheritance hierarchy which means that class is necessary and appropriate.

tannergooding commented 4 years ago

Going to merge this and work on continuing with the rest of the surface area.