llvm.org GIT mirror llvm / 27745c1
whitespace git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@155089 91177308-0d34-0410-b5e6-96231b3b80d8 Andrew Trick 8 years ago
1 changed file(s) with 8 addition(s) and 8 deletion(s). Raw diff Collapse all Expand all
2525 typedef void *(*MachinePassCtor)();
2626
2727
28 //===----------------------------------------------------------------------===//
28 //===----------------------------------------------------------------------===//
2929 ///
3030 /// MachinePassRegistryListener - Listener to adds and removals of nodes in
3131 /// registration list.
4141 };
4242
4343
44 //===----------------------------------------------------------------------===//
44 //===----------------------------------------------------------------------===//
4545 ///
4646 /// MachinePassRegistryNode - Machine pass node stored in registration list.
4747 ///
5454 const char *Name; // Name of function pass.
5555 const char *Description; // Description string.
5656 MachinePassCtor Ctor; // Function pass creator.
57
57
5858 public:
5959
6060 MachinePassRegistryNode(const char *N, const char *D, MachinePassCtor C)
7171 const char *getDescription() const { return Description; }
7272 MachinePassCtor getCtor() const { return Ctor; }
7373 void setNext(MachinePassRegistryNode *N) { Next = N; }
74
74
7575 };
7676
7777
78 //===----------------------------------------------------------------------===//
78 //===----------------------------------------------------------------------===//
7979 ///
8080 /// MachinePassRegistry - Track the registration of machine passes.
8181 ///
8787 MachinePassRegistryNode *List; // List of registry nodes.
8888 MachinePassCtor Default; // Default function pass creator.
8989 MachinePassRegistryListener* Listener;// Listener for list adds are removes.
90
90
9191 public:
9292
9393 // NO CONSTRUCTOR - we don't want static constructor ordering to mess
125125
126126 void initialize(cl::Option &O) {
127127 cl::parser::initialize(O);
128
128
129129 // Add existing passes to option.
130130 for (RegistryClass *Node = RegistryClass::getList();
131131 Node; Node = Node->getNext()) {
133133 (typename RegistryClass::FunctionPassCtor)Node->getCtor(),
134134 Node->getDescription());
135135 }
136
136
137137 // Make sure we listen for list changes.
138138 RegistryClass::setListener(this);
139139 }