LLVM: lib/IR/PassRegistry.cpp Source File (original) (raw)
1
2
3
4
5
6
7
8
9
10
11
12
13
18#include
19#include
20
21using namespace llvm;
22
25 return &PassRegistryObj;
26}
27
28
29
30
31
33
36 return PassInfoMap.lookup(TI);
37}
38
41 return PassInfoStringMap.lookup(Arg);
42}
43
44
45
46
47
50 bool Inserted =
51 PassInfoMap.insert(std::make_pair(PI.getTypeInfo(), &PI)).second;
52 assert(Inserted && "Pass registered multiple times!");
53 (void)Inserted;
55
56
57 for (auto *Listener : Listeners)
58 Listener->passRegistered(&PI);
59
60 if (ShouldFree)
61 ToFree.push_back(std::unique_ptr(&PI));
62}
63
66 for (auto PassInfoPair : PassInfoMap)
67 L->passEnumerate(PassInfoPair.second);
68}
69
72 Listeners.push_back(L);
73}
74
77
79 Listeners.erase(I);
80}
assert(UImm &&(UImm !=~static_cast< T >(0)) &&"Invalid immediate!")
PassInfo class - An instance of this class exists for every pass known by the system,...
StringRef getPassArgument() const
getPassArgument - Return the command line option that may be passed to 'opt' that will cause this pas...
const void * getTypeInfo() const
getTypeInfo - Return the id object for the pass... TODO : Rename
static LLVM_ABI PassRegistry * getPassRegistry()
getPassRegistry - Access the global registry object, which is automatically initialized at applicatio...
Definition PassRegistry.cpp:23
LLVM_ABI void addRegistrationListener(PassRegistrationListener *L)
addRegistrationListener - Register the given PassRegistrationListener to receive passRegistered() cal...
Definition PassRegistry.cpp:70
LLVM_ABI void removeRegistrationListener(PassRegistrationListener *L)
removeRegistrationListener - Unregister a PassRegistrationListener so that it no longer receives pass...
Definition PassRegistry.cpp:75
LLVM_ABI void registerPass(const PassInfo &PI, bool ShouldFree=false)
registerPass - Register a pass (by means of its PassInfo) with the registry.
Definition PassRegistry.cpp:48
LLVM_ABI void enumerateWith(PassRegistrationListener *L)
enumerateWith - Enumerate the registered passes, calling the provided PassRegistrationListener's pass...
Definition PassRegistry.cpp:64
LLVM_ABI const PassInfo * getPassInfo(const void *TI) const
getPassInfo - Look up a pass' corresponding PassInfo, indexed by the pass' type identifier (&MyPass::...
Definition PassRegistry.cpp:34
StringRef - Represent a constant reference to a string, i.e.
std::lock_guard< SmartRWMutex< mt_only > > SmartScopedWriter
ScopedWriter - RAII acquisition of a writer lock.
const std::shared_lock< SmartRWMutex< mt_only > > SmartScopedReader
ScopedReader - RAII acquisition of a reader lock.
This is an optimization pass for GlobalISel generic memory operations.
auto find(R &&Range, const T &Val)
Provide wrappers to std::find which take ranges instead of having to pass begin/end explicitly.
PassRegistrationListener class - This class is meant to be derived from by clients that are intereste...