LLVM  8.0.1
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 //===----------------------------------------------------------------------===//
29 class RegisterRegAlloc : public MachinePassRegistryNode<FunctionPass *(*)()> {
30 public:
32 
34 
35  RegisterRegAlloc(const char *N, const char *D, FunctionPassCtor C)
36  : MachinePassRegistryNode(N, D, C) {
37  Registry.Add(this);
38  }
39 
40  ~RegisterRegAlloc() { Registry.Remove(this); }
41 
42  // Accessors.
45  }
46 
48  return (RegisterRegAlloc *)Registry.getList();
49  }
50 
51  static FunctionPassCtor getDefault() { return Registry.getDefault(); }
52 
53  static void setDefault(FunctionPassCtor C) { Registry.setDefault(C); }
54 
56  Registry.setListener(L);
57  }
58 };
59 
60 } // end namespace llvm
61 
62 #endif // LLVM_CODEGEN_REGALLOCREGISTRY_H
uint64_t CallInst * C
This class represents lattice values for constants.
Definition: AllocatorList.h:24
void Remove(MachinePassRegistryNode< PassCtorTy > *Node)
Remove - Removes a function pass from the registration list.
static void setDefault(FunctionPassCtor C)
void setDefault(PassCtorTy C)
void setListener(MachinePassRegistryListener< PassCtorTy > *L)
static RegisterRegAlloc * getList()
RegisterRegAlloc(const char *N, const char *D, FunctionPassCtor C)
RegisterRegAlloc class - Track the registration of register allocators.
static void setListener(MachinePassRegistryListener< FunctionPassCtor > *L)
void Add(MachinePassRegistryNode< PassCtorTy > *Node)
Add - Adds a function pass to the registration list.
RegisterRegAlloc * getNext() const
FunctionPass class - This class is used to implement most global optimizations.
Definition: Pass.h:285
static MachinePassRegistry< FunctionPassCtor > Registry
RegisterRegAlloc&#39;s global Registry tracks allocator registration.
MachinePassRegistryNode< PassCtorTy > * getList()
static FunctionPassCtor getDefault()
FunctionPass *(*)() FunctionPassCtor
static GCRegistry::Add< StatepointGC > D("statepoint-example", "an example strategy for statepoint")
MachinePassRegistryNode * getNext() const
#define N
MachinePassRegistryNode - Machine pass node stored in registration list.