summaryrefslogtreecommitdiffstats
path: root/llvm/lib/IR/PassRegistry.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'llvm/lib/IR/PassRegistry.cpp')
-rw-r--r--llvm/lib/IR/PassRegistry.cpp5
1 files changed, 4 insertions, 1 deletions
diff --git a/llvm/lib/IR/PassRegistry.cpp b/llvm/lib/IR/PassRegistry.cpp
index 6a5bee2f57b..e85fabffb8c 100644
--- a/llvm/lib/IR/PassRegistry.cpp
+++ b/llvm/lib/IR/PassRegistry.cpp
@@ -73,7 +73,10 @@ void *PassRegistry::getImpl() const {
//
PassRegistry::~PassRegistry() {
- sys::SmartScopedWriter<true> Guard(*Lock);
+ // Don't acquire the mutex here. This is destroyed during static execution of
+ // static destructors, after llvm_shutdown() has been called, so all instances
+ // of all ManagedStatics (including the Mutex), will have been destroyed as
+ // well.
PassRegistryImpl *Impl = static_cast<PassRegistryImpl*>(pImpl);
delete Impl;
pImpl = nullptr;
OpenPOWER on IntegriCloud