diff options
Diffstat (limited to 'llvm/lib/IR/PassRegistry.cpp')
| -rw-r--r-- | llvm/lib/IR/PassRegistry.cpp | 10 |
1 files changed, 2 insertions, 8 deletions
diff --git a/llvm/lib/IR/PassRegistry.cpp b/llvm/lib/IR/PassRegistry.cpp index 94f607afec47..6c22fcd34769 100644 --- a/llvm/lib/IR/PassRegistry.cpp +++ b/llvm/lib/IR/PassRegistry.cpp @@ -15,21 +15,15 @@ #include "llvm/ADT/STLExtras.h" #include "llvm/Pass.h" #include "llvm/PassInfo.h" -#include "llvm/Support/ManagedStatic.h" #include <cassert> #include <memory> #include <utility> using namespace llvm; -// FIXME: We use ManagedStatic to erase the pass registrar on shutdown. -// Unfortunately, passes are registered with static ctors, and having -// llvm_shutdown clear this map prevents successful resurrection after -// llvm_shutdown is run. Ideally we should find a solution so that we don't -// leak the map, AND can still resurrect after shutdown. -static ManagedStatic<PassRegistry> PassRegistryObj; PassRegistry *PassRegistry::getPassRegistry() { - return &*PassRegistryObj; + static PassRegistry PassRegistryObj; + return &PassRegistryObj; } //===----------------------------------------------------------------------===// |
