mirror of
https://github.com/c64scene-ar/llvm-6502.git
synced 2026-04-24 13:18:17 +00:00
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:
@@ -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;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user