diff options
| author | Jim Laskey <jlaskey@mac.com> | 2006-08-02 12:30:23 +0000 |
|---|---|---|
| committer | Jim Laskey <jlaskey@mac.com> | 2006-08-02 12:30:23 +0000 |
| commit | 29e635d3c976f7bb4f6c3e1111dd0ac58e2b6c4f (patch) | |
| tree | 30a289bb90b8a205c1846c774793cb18228f7c8f /llvm/lib/CodeGen/MachinePassRegistry.cpp | |
| parent | 8ab788fffdccdb4a9f7bf58a6f4d38f15a9a86cd (diff) | |
| download | bcm5719-llvm-29e635d3c976f7bb4f6c3e1111dd0ac58e2b6c4f.tar.gz bcm5719-llvm-29e635d3c976f7bb4f6c3e1111dd0ac58e2b6c4f.zip | |
Final polish on machine pass registries.
llvm-svn: 29471
Diffstat (limited to 'llvm/lib/CodeGen/MachinePassRegistry.cpp')
| -rw-r--r-- | llvm/lib/CodeGen/MachinePassRegistry.cpp | 32 |
1 files changed, 19 insertions, 13 deletions
diff --git a/llvm/lib/CodeGen/MachinePassRegistry.cpp b/llvm/lib/CodeGen/MachinePassRegistry.cpp index c4409924760..a7ba5bb3ca3 100644 --- a/llvm/lib/CodeGen/MachinePassRegistry.cpp +++ b/llvm/lib/CodeGen/MachinePassRegistry.cpp @@ -16,20 +16,26 @@ using namespace llvm; - -//===---------------------------------------------------------------------===// -/// -/// RegisterRegAlloc class - Track the registration of register allocators. + +/// Add - Adds a function pass to the registration list. /// -//===---------------------------------------------------------------------===// -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()); +} -//===---------------------------------------------------------------------===// -/// -/// RegisterScheduler class - Track the registration of instruction schedulers. +/// Remove - Removes a function pass from the registration list. /// -//===---------------------------------------------------------------------===// -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; + } + } +} |

