LLVM  4.0.0
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 //===----------------------------------------------------------------------===//
23 ///
24 /// RegisterRegAlloc class - Track the registration of register allocators.
25 ///
26 //===----------------------------------------------------------------------===//
28 
29 public:
30 
31  typedef FunctionPass *(*FunctionPassCtor)();
32 
34 
35  RegisterRegAlloc(const char *N, const char *D, FunctionPassCtor C)
37  Registry.Add(this);
38  }
39  ~RegisterRegAlloc() { Registry.Remove(this); }
40 
41  // Accessors.
42  //
45  }
47  return (RegisterRegAlloc *)Registry.getList();
48  }
50  return (FunctionPassCtor)Registry.getDefault();
51  }
52  static void setDefault(FunctionPassCtor C) {
53  Registry.setDefault((MachinePassCtor)C);
54  }
56  Registry.setListener(L);
57  }
58 };
59 
60 } // end namespace llvm
61 
62 
63 #endif
MachineLoop * L
RegisterRegAlloc * getNext() const
A global registry used in conjunction with static constructors to make pluggable components (like tar...
Definition: Registry.h:45
void *(* MachinePassCtor)()
FunctionPass *(* FunctionPassCtor)()
static void setDefault(FunctionPassCtor C)
static MachinePassRegistry Registry
RegisterRegAlloc's global Registry tracks allocator registration.
static GCRegistry::Add< StatepointGC > D("statepoint-example","an example strategy for statepoint")
static RegisterRegAlloc * getList()
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)
MachinePassRegistryNode * getNext() const
FunctionPass class - This class is used to implement most global optimizations.
Definition: Pass.h:298
static FunctionPassCtor getDefault()
static GCRegistry::Add< ShadowStackGC > C("shadow-stack","Very portable GC for uncooperative code generators")
MachinePassRegistryListener - Listener to adds and removals of nodes in registration list...
#define N
MachinePassRegistryNode - Machine pass node stored in registration list.