This allows LLVM to be safely loaded and unloaded as a shared library
without leaking memory:
Consider the scenario where shared library Foo links against LLVM as
a shared library, and Foo may be loaded and unloaded multiple times
in the same process. Should Foo call llvm_shutdown or not? If it does
not, and LLVM is also loaded and unloaded multiple times, then
memory is leaked. If it does call llvm_shutdown and LLVM *isn't*
also unloaded, the state of LLVM's global statics is corrupted because
while the ManagedStatics may be re-initialized, *other* global
constructors aren't re-run.
Keep in mind that Foo itself may use ManagedStatic. If Foo is unloaded
but LLVM isn't, those statics should be destroyed.
The safe solution is to skip llvm_shutdown() altogether and destroy
managed statics from their destructor.
LLD relies on being able to call _exit() and still get some side-effects
of managed static destructors. We make this expectation much more
explicit.