aboutsummaryrefslogtreecommitdiffstats
path: root/include/llvm/PassRegistry.h
diff options
context:
space:
mode:
authorOwen Anderson <resistor@mac.com>2010-09-15 23:03:33 +0000
committerOwen Anderson <resistor@mac.com>2010-09-15 23:03:33 +0000
commitb6d760c7d5e8496475a0063c32f87bd6161cb2db (patch)
tree0cf860ffa4c2083289f07d9d562299de9bb76a44 /include/llvm/PassRegistry.h
parent8a26f818896c6a02ebdb11d624cb9ef39f082df2 (diff)
downloadexternal_llvm-b6d760c7d5e8496475a0063c32f87bd6161cb2db.zip
external_llvm-b6d760c7d5e8496475a0063c32f87bd6161cb2db.tar.gz
external_llvm-b6d760c7d5e8496475a0063c32f87bd6161cb2db.tar.bz2
Since PassRegistry is currently a shared global object, it needs locking. While it might intuitively seem
that all the setup of this class currently happens at static initialization time, this misses the fact that some later events can cause mutation of the PassRegistrationListeners list, and thus cause race issues. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@114036 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'include/llvm/PassRegistry.h')
-rw-r--r--include/llvm/PassRegistry.h2
1 files changed, 2 insertions, 0 deletions
diff --git a/include/llvm/PassRegistry.h b/include/llvm/PassRegistry.h
index 31d48a4..8b7f036 100644
--- a/include/llvm/PassRegistry.h
+++ b/include/llvm/PassRegistry.h
@@ -18,6 +18,7 @@
#define LLVM_PASSREGISTRY_H
#include "llvm/ADT/StringRef.h"
+#include "llvm/System/Mutex.h"
namespace llvm {
@@ -32,6 +33,7 @@ struct PassRegistrationListener;
/// each thread.
class PassRegistry {
mutable void *pImpl;
+ mutable sys::SmartMutex<true> Lock;
void *getImpl() const;
public: