LLVM  7.0.0svn
RegAllocRegistry.h
Go to the documentation of this file.
1 //===- llvm/CodeGen/RegAllocRegistry.h --------------------------*- C++ -*-===//
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 implementation for register allocator function
11 // pass registry (RegisterRegAlloc).
12 //
13 //===----------------------------------------------------------------------===//
14 
15 #ifndef LLVM_CODEGEN_REGALLOCREGISTRY_H
16 #define LLVM_CODEGEN_REGALLOCREGISTRY_H
17 
19 
20 namespace llvm {
21 
22 class FunctionPass;
23 
24 //===----------------------------------------------------------------------===//
25 ///
26 /// RegisterRegAlloc class - Track the registration of register allocators.
27 ///
28 //===----------------------------------------------------------------------===//
30 public:
32 
34 
35  RegisterRegAlloc(const char *N, const char *D, FunctionPassCtor C)
37  Registry.Add(this);
38  }
39 
40  ~RegisterRegAlloc() { Registry.Remove(this); }
41 
42  // Accessors.
45  }
46 
48  return (RegisterRegAlloc *)Registry.getList();
49  }
50 
52  return (FunctionPassCtor)Registry.getDefault();
53  }
54 
55  static void setDefault(FunctionPassCtor C) {
56  Registry.setDefault((MachinePassCtor)C);
57  }
58 
60  Registry.setListener(L);
61  }
62 };
63 
64 } // end namespace llvm
65 
66 #endif // LLVM_CODEGEN_REGALLOCREGISTRY_H
uint64_t CallInst * C
Compute iterated dominance frontiers using a linear time algorithm.
Definition: AllocatorList.h:24
void Add(MachinePassRegistryNode *Node)
Add - Adds a function pass to the registration list.
MachinePassRegistryNode * getList()
static void setDefault(FunctionPassCtor C)
static MachinePassRegistry Registry
RegisterRegAlloc's global Registry tracks allocator registration.
static RegisterRegAlloc * getList()
void setListener(MachinePassRegistryListener *L)
RegisterRegAlloc(const char *N, const char *D, FunctionPassCtor C)
RegisterRegAlloc class - Track the registration of register allocators.
MachinePassRegistry - Track the registration of machine passes.
static void setListener(MachinePassRegistryListener *L)
RegisterRegAlloc * getNext() const
void Remove(MachinePassRegistryNode *Node)
Remove - Removes a function pass from the registration list.
FunctionPass class - This class is used to implement most global optimizations.
Definition: Pass.h:285
static FunctionPassCtor getDefault()
FunctionPass *(*)() FunctionPassCtor
static GCRegistry::Add< StatepointGC > D("statepoint-example", "an example strategy for statepoint")
MachinePassRegistryListener - Listener to adds and removals of nodes in registration list...
#define N
MachinePassRegistryNode - Machine pass node stored in registration list.
MachinePassRegistryNode * getNext() const
void *(*)() MachinePassCtor
void setDefault(MachinePassCtor C)