TheDan64 / inkwell

It's a New Kind of Wrapper for Exposing LLVM (Safely)
https://thedan64.github.io/inkwell/
Apache License 2.0
2.22k stars 217 forks source link

Add set_opaque_pointers to Context #489

Open Derppening opened 2 months ago

Derppening commented 2 months ago

Is your feature request related to a problem? Please describe.

468 introduced opaque pointers, and in the PR opaque pointers are enabled by default with no opt-out mechanism.

Describe the solution you'd like Add Context::set_opaque_pointers by using LLVMContextSetOpaquePointers in LLVM's C bindings, which is present in LLVM 15, LLVM 16.

Describe possible drawbacks to your solution Since opaque pointers are enabled by default since LLVM 15, there should be no drawbacks as the default already utilizes opaque pointers; Users will need to explicitly opt-in to the legacy behavior by invoking the function.

Describe alternatives you've considered None. Forcing LLVM 15/16 users to use opaque pointers may be an alternative as it is recommended for users to migrate over anyways, but there may be users that use LLVM 15 where the status of opaque pointers is (source):

LLVM 15: Opaque pointers are enabled by default. Typed pointers are still supported.