[PATCH] D129119: Add llvm::llvm_fast_shutdown()

Eli Friedman via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Tue Jul 5 12:53:14 PDT 2022


efriedma added a comment.

Context: https://discourse.llvm.org/t/making-llvm-play-nice-r-when-used-as-a-shared-library-in-a-plugin-setting .

The constraints here are the following:

- Instead of relying on users calling llvm_shutdown() before unloading LLVM, we want to rely on the native `__cxa_atexit` or equivalent functionality.
- We want to avoid global constructors.

The only way to completely avoid global constructors is to avoid global variables with runtime constructors or destructors.  There isn't any way portable way to retrofit ManagedStatic to work the way we want. So we need to get rid of it.  (In theory, I guess we could make ManagedStatic call __cxa_atexit, but it's hard to generalize that.)


Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D129119/new/

https://reviews.llvm.org/D129119



More information about the llvm-commits mailing list