~ubuntu-branches/ubuntu/feisty/clamav/feisty

« back to all changes in this revision

Viewing changes to libclamav/c++/llvm/lib/CodeGen/MachinePassRegistry.cpp

  • Committer: Bazaar Package Importer
  • Author(s): Kees Cook
  • Date: 2007-02-20 10:33:44 UTC
  • mto: This revision was merged to the branch mainline in revision 16.
  • Revision ID: james.westby@ubuntu.com-20070220103344-zgcu2psnx9d98fpa
Tags: upstream-0.90
ImportĀ upstreamĀ versionĀ 0.90

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
 
//===-- CodeGen/MachineInstr.cpp ------------------------------------------===//
2
 
//
3
 
//                     The LLVM Compiler Infrastructure
4
 
//
5
 
// This file is distributed under the University of Illinois Open Source
6
 
// License. See LICENSE.TXT for details.
7
 
//
8
 
//===----------------------------------------------------------------------===//
9
 
//
10
 
// This file contains the machine function pass registry for register allocators
11
 
// and instruction schedulers.
12
 
//
13
 
//===----------------------------------------------------------------------===//
14
 
 
15
 
#include "llvm/CodeGen/MachinePassRegistry.h"
16
 
 
17
 
using namespace llvm;
18
 
 
19
 
 
20
 
/// Add - Adds a function pass to the registration list.
21
 
///
22
 
void MachinePassRegistry::Add(MachinePassRegistryNode *Node) {
23
 
  Node->setNext(List);
24
 
  List = Node;
25
 
  if (Listener) Listener->NotifyAdd(Node->getName(),
26
 
                                    Node->getCtor(),
27
 
                                    Node->getDescription());
28
 
}
29
 
 
30
 
 
31
 
/// Remove - Removes a function pass from the registration list.
32
 
///
33
 
void MachinePassRegistry::Remove(MachinePassRegistryNode *Node) {
34
 
  for (MachinePassRegistryNode **I = &List; *I; I = (*I)->getNextAddress()) {
35
 
    if (*I == Node) {
36
 
      if (Listener) Listener->NotifyRemove(Node->getName());
37
 
      *I = (*I)->getNext();
38
 
      break;
39
 
    }
40
 
  }
41
 
}