44 return I != PassInfoMap.
end() ? I->second :
nullptr;
50 return I != PassInfoStringMap.
end() ? I->
second :
nullptr;
61 assert(Inserted &&
"Pass registered multiple times!");
66 for (
auto *Listener : Listeners)
67 Listener->passRegistered(&PI);
70 ToFree.push_back(std::unique_ptr<const PassInfo>(&PI));
75 for (
auto PassInfoPair : PassInfoMap)
82 PassInfo &Registeree,
bool isDefault,
88 InterfaceInfo = &Registeree;
91 "Trying to join an analysis group that is a normal pass!");
95 assert(ImplementationInfo &&
96 "Must register pass before adding to AnalysisGroup!");
106 "Default implementation for analysis group already specified!");
109 "Cannot specify pass as default if it does not have a default ctor");
117 ToFree.push_back(std::unique_ptr<const PassInfo>(&Registeree));
122 Listeners.push_back(L);
128 auto I = std::find(Listeners.begin(), Listeners.end(), L);
void registerAnalysisGroup(const void *InterfaceID, const void *PassID, PassInfo &Registeree, bool isDefault, bool ShouldFree=false)
registerAnalysisGroup - Register an analysis group (or a pass implementing
static PassRegistry * getPassRegistry()
getPassRegistry - Access the global registry object, which is automatically initialized at applicatio...
void setNormalCtor(NormalCtor_t Ctor)
void enumerateWith(PassRegistrationListener *L)
enumerateWith - Enumerate the registered passes, calling the provided PassRegistrationListener's pass...
TargetMachineCtor_t getTargetMachineCtor() const
getTargetMachineCtor - Return a pointer to a function, that when called with a TargetMachine, creates an instance of the pass and returns it.
iterator find(StringRef Key)
const void * getTypeInfo() const
getTypeInfo - Return the id object for the pass...
std::pair< iterator, bool > insert(const std::pair< KeyT, ValueT > &KV)
void addInterfaceImplemented(const PassInfo *ItfPI)
addInterfaceImplemented - This method is called when this pass is registered as a member of an analys...
bool isAnalysisGroup() const
isAnalysisGroup - Return true if this is an analysis group, not a normal pass.
void removeRegistrationListener(PassRegistrationListener *L)
removeRegistrationListener - Unregister a PassRegistrationListener so that it no longer receives pass...
ScopedReader - RAII acquisition of a reader lock.
ScopedWriter - RAII acquisition of a writer lock.
void setTargetMachineCtor(TargetMachineCtor_t Ctor)
virtual void passEnumerate(const PassInfo *)
passEnumerate - Callback function invoked when someone calls enumeratePasses on this PassRegistration...
NormalCtor_t getNormalCtor() const
getNormalCtor - Return a pointer to a function, that when called, creates an instance of the pass and...
void addRegistrationListener(PassRegistrationListener *L)
addRegistrationListener - Register the given PassRegistrationListener to receive passRegistered() cal...
PassInfo class - An instance of this class exists for every pass known by the system, and can be obtained from a live Pass by calling its getPassInfo() method.
const char * getPassArgument() const
getPassArgument - Return the command line option that may be passed to 'opt' that will cause this pas...
static ManagedStatic< PassRegistry > PassRegistryObj
PassRegistrationListener class - This class is meant to be derived from by clients that are intereste...
iterator find(const KeyT &Val)
const PassInfo * getPassInfo(const void *TI) const
getPassInfo - Look up a pass' corresponding PassInfo, indexed by the pass' type identifier (&MyPass::...
StringRef - Represent a constant reference to a string, i.e.
PassRegistry - This class manages the registration and intitialization of the pass subsystem as appli...
ManagedStatic - This transparently changes the behavior of global statics to be lazily constructed on...
void registerPass(const PassInfo &PI, bool ShouldFree=false)
registerPass - Register a pass (by means of its PassInfo) with the registry.