diff options
author | Owen Anderson <resistor@mac.com> | 2010-07-20 18:53:25 +0000 |
---|---|---|
committer | Owen Anderson <resistor@mac.com> | 2010-07-20 18:53:25 +0000 |
commit | d15d2f508748008bfb2d9521b4724a0f80d1169c (patch) | |
tree | 753d58ec0f2eef4a13e23320345352203b2d6392 | |
parent | aab5b3259fb68e988c8306b94a00c3ac802695ad (diff) | |
download | external_llvm-d15d2f508748008bfb2d9521b4724a0f80d1169c.zip external_llvm-d15d2f508748008bfb2d9521b4724a0f80d1169c.tar.gz external_llvm-d15d2f508748008bfb2d9521b4724a0f80d1169c.tar.bz2 |
Oops.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@108885 91177308-0d34-0410-b5e6-96231b3b80d8
-rw-r--r-- | include/llvm/PassRegistry.h | 67 |
1 files changed, 67 insertions, 0 deletions
diff --git a/include/llvm/PassRegistry.h b/include/llvm/PassRegistry.h new file mode 100644 index 0000000..1f627d8 --- /dev/null +++ b/include/llvm/PassRegistry.h @@ -0,0 +1,67 @@ +//===- llvm/PassRegistry.h - Pass Information Registry ----------*- C++ -*-===// +// +// The LLVM Compiler Infrastructure +// +// This file is distributed under the University of Illinois Open Source +// License. See LICENSE.TXT for details. +// +//===----------------------------------------------------------------------===// +// +// 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. +// +//===----------------------------------------------------------------------===// + +#ifndef LLVM_PASSREGISTRY_H +#define LLVM_PASSREGISTRY_H + +#include "llvm/PassSupport.h" +#include "llvm/ADT/StringMap.h" +#include "llvm/System/DataTypes.h" +#include "llvm/System/Mutex.h" +#include <map> +#include <set> + +using namespace llvm; + +namespace llvm { + +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<intptr_t, 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; + +public: + static PassRegistry *getPassRegistry(); + + const PassInfo *getPassInfo(intptr_t TI) const; + const PassInfo *getPassInfo(StringRef Arg) const; + + void registerPass(const PassInfo &PI); + void unregisterPass(const PassInfo &PI); + + /// Analysis Group Mechanisms. + void registerAnalysisGroup(PassInfo *InterfaceInfo, + const PassInfo *ImplementationInfo, + bool isDefault); + + void enumerateWith(PassRegistrationListener *L); +}; + +} + +#endif |