Final polish on machine pass registries.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@29471 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
Jim Laskey
2006-08-02 12:30:23 +00:00
parent 9b9528d8f6
commit eb577ba3b8
10 changed files with 98 additions and 229 deletions
+19 -13
View File
@@ -16,20 +16,26 @@
using namespace llvm;
//===---------------------------------------------------------------------===//
/// Add - Adds a function pass to the registration list.
///
/// RegisterRegAlloc class - Track the registration of register allocators.
///
//===---------------------------------------------------------------------===//
MachinePassRegistry<RegisterRegAlloc::FunctionPassCtor>
RegisterRegAlloc::Registry;
void MachinePassRegistry::Add(MachinePassRegistryNode *Node) {
Node->setNext(List);
List = Node;
if (Listener) Listener->NotifyAdd(Node->getName(),
Node->getCtor(),
Node->getDescription());
}
//===---------------------------------------------------------------------===//
/// Remove - Removes a function pass from the registration list.
///
/// RegisterScheduler class - Track the registration of instruction schedulers.
///
//===---------------------------------------------------------------------===//
MachinePassRegistry<RegisterScheduler::FunctionPassCtor>
RegisterScheduler::Registry;
void MachinePassRegistry::Remove(MachinePassRegistryNode *Node) {
for (MachinePassRegistryNode **I = &List; *I; I = (*I)->getNextAddress()) {
if (*I == Node) {
if (Listener) Listener->NotifyRemove(Node->getName());
*I = (*I)->getNext();
break;
}
}
}