aboutsummaryrefslogtreecommitdiffstats
path: root/include/llvm/PassRegistry.h
diff options
context:
space:
mode:
authorOwen Anderson <resistor@mac.com>2010-09-07 19:16:25 +0000
committerOwen Anderson <resistor@mac.com>2010-09-07 19:16:25 +0000
commit6bcd3a02653c45b87094577517547b7eb9f76395 (patch)
treeefaed99aa36f9601f8763857583296f308462608 /include/llvm/PassRegistry.h
parent72d1027d873ab42ccd93719b6e0248807422f959 (diff)
downloadexternal_llvm-6bcd3a02653c45b87094577517547b7eb9f76395.zip
external_llvm-6bcd3a02653c45b87094577517547b7eb9f76395.tar.gz
external_llvm-6bcd3a02653c45b87094577517547b7eb9f76395.tar.bz2
Clean up some of the PassRegistry implementation, and pImpl-ize it to reduce #include clutter
and exposing internal details. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@113252 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'include/llvm/PassRegistry.h')
-rw-r--r--include/llvm/PassRegistry.h37
1 files changed, 12 insertions, 25 deletions
diff --git a/include/llvm/PassRegistry.h b/include/llvm/PassRegistry.h
index adaccf3..8c1be67 100644
--- a/include/llvm/PassRegistry.h
+++ b/include/llvm/PassRegistry.h
@@ -8,9 +8,9 @@
//===----------------------------------------------------------------------===//
//
// This file defines PassRegistry, a class that is used in the initialization
-// and registration of passes. At initialization, passes are registered with
-// the PassRegistry, which is later provided to the PassManager for dependency
-// resolution and similar tasks.
+// and registration of passes. At application startup, passes are registered
+// with the PassRegistry, which is later provided to the PassManager for
+// dependency resolution and similar tasks.
//
//===----------------------------------------------------------------------===//
@@ -19,35 +19,22 @@
#include "llvm/ADT/StringMap.h"
#include "llvm/System/DataTypes.h"
-#include "llvm/System/Mutex.h"
-#include <map>
-#include <set>
-#include <vector>
namespace llvm {
class PassInfo;
struct PassRegistrationListener;
+/// PassRegistry - This class manages the registration and intitialization of
+/// the pass subsystem as application startup, and assists the PassManager
+/// in resolving pass dependencies.
+/// NOTE: PassRegistry is NOT thread-safe. If you want to use LLVM on multiple
+/// threads simultaneously, you will need to use a separate PassRegistry on
+/// each thread.
class PassRegistry {
- /// Guards the contents of this class.
- mutable sys::SmartMutex<true> Lock;
-
- /// PassInfoMap - Keep track of the PassInfo object for each registered pass.
- typedef std::map<const void*, const PassInfo*> MapType;
- MapType PassInfoMap;
-
- typedef StringMap<const PassInfo*> StringMapType;
- StringMapType PassInfoStringMap;
-
- /// AnalysisGroupInfo - Keep track of information for each analysis group.
- struct AnalysisGroupInfo {
- std::set<const PassInfo *> Implementations;
- };
- std::map<const PassInfo*, AnalysisGroupInfo> AnalysisGroupInfoMap;
-
- std::vector<PassRegistrationListener*> Listeners;
-
+ mutable void *pImpl;
+ void *getImpl() const;
+
public:
static PassRegistry *getPassRegistry();