17#ifndef LLVM_CODEGEN_MACHINEPASSREGISTRY_H
18#define LLVM_CODEGEN_MACHINEPASSREGISTRY_H
33 virtual void anchor() {}
57 : Name(
N), Description(
D), Ctor(
C) {}
64 PassCtorTy
getCtor()
const {
return Ctor; }
91 PassCtorTy Ctor =
nullptr;
94 if (R->getName() ==
Name) {
99 assert(Ctor &&
"Unregistered pass name");
111 Node->getDescription());
118 I = (*I)->getNextAddress()) {
122 *
I = (*I)->getNext();
134template <
class RegistryClass>
137 typename RegistryClass::FunctionPassCtor>,
138 public cl::parser<typename RegistryClass::FunctionPassCtor> {
148 for (RegistryClass *
Node = RegistryClass::getList();
151 (
typename RegistryClass::FunctionPassCtor)
Node->getCtor(),
152 Node->getDescription());
156 RegistryClass::setListener(
this);
static GCRegistry::Add< StatepointGC > D("statepoint-example", "an example strategy for statepoint")
assert(ImpDefSCC.getReg()==AMDGPU::SCC &&ImpDefSCC.isDef())
MachinePassRegistryListener - Listener to adds and removals of nodes in registration list.
MachinePassRegistryListener()=default
virtual ~MachinePassRegistryListener()=default
virtual void NotifyRemove(StringRef N)=0
virtual void NotifyAdd(StringRef N, PassCtorTy C, StringRef D)=0
MachinePassRegistryNode - Machine pass node stored in registration list.
StringRef getDescription() const
PassCtorTy getCtor() const
void setNext(MachinePassRegistryNode *N)
StringRef getName() const
MachinePassRegistryNode(const char *N, const char *D, PassCtorTy C)
MachinePassRegistryNode * getNext() const
MachinePassRegistryNode ** getNextAddress()
MachinePassRegistry - Track the registration of machine passes.
void Remove(MachinePassRegistryNode< PassCtorTy > *Node)
Remove - Removes a function pass from the registration list.
void setListener(MachinePassRegistryListener< PassCtorTy > *L)
void Add(MachinePassRegistryNode< PassCtorTy > *Node)
Add - Adds a function pass to the registration list.
MachinePassRegistryNode< PassCtorTy > * getList()
void setDefault(PassCtorTy C)
void setDefault(StringRef Name)
setDefault - Set the default constructor by name.
RegisterPassParser class - Handle the addition of new machine passes.
void NotifyRemove(StringRef N) override
RegisterPassParser(cl::Option &O)
~RegisterPassParser() override
void NotifyAdd(StringRef N, typename RegistryClass::FunctionPassCtor C, StringRef D) override
StringRef - Represent a constant reference to a string, i.e.
void removeLiteralOption(StringRef Name)
Remove the specified option.
void addLiteralOption(StringRef Name, const DT &V, StringRef HelpStr)
Add an entry to the mapping table.
@ C
The default llvm calling convention, compatible with C.
This is an optimization pass for GlobalISel generic memory operations.