In response to a DConf 2017 request regarding this, llvm-d again
supports dynamic loading.
The API is essentially the same as is was for llvm 1.x, though
you have to enable it with D versions.
- Single shared library only (e.g. libLLVM-X.Y.Z.so)
- Switch from (dynamic/static) linking to dynamic loading by
setting the D version LLVM_Load.
- Use LLVM.load / LLVM.unload for manual control over which
shared library to use
- Additionally set D version LLVM_Autoload to try to load a
platform appropriate default shared library for LLVM
- As compile time introspection is used to generate function
pointers dynamic loading has increased compilation time.
Special thanks to everyone who provided feedback on how to
optimize the cost for the dynamic introspection