llvm.org GIT mirror llvm / 9b9528d
Breaking out specialized classes. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@29470 91177308-0d34-0410-b5e6-96231b3b80d8 Jim Laskey 13 years ago
2 changed file(s) with 135 addition(s) and 0 deletion(s). Raw diff Collapse all Expand all
0 //===-- llvm/CodeGen/RegAllocRegistry.h -------------------------*- C++ -*-===//
1 //
2 // The LLVM Compiler Infrastructure
3 //
4 // This file was developed by the James M. Laskey and is distributed under
5 // the University of Illinois Open Source License. See LICENSE.TXT for details.
6 //
7 //===----------------------------------------------------------------------===//
8 //
9 // This file contains the implementation for register allocator function
10 // pass registry (RegisterRegAlloc).
11 //
12 //===----------------------------------------------------------------------===//
13
14 #ifndef LLVM_CODEGENREGALLOCREGISTRY_H
15 #define LLVM_CODEGENREGALLOCREGISTRY_H
16
17 #include "llvm/CodeGen/MachinePassRegistry.h"
18
19 namespace llvm {
20
21 //===----------------------------------------------------------------------===//
22 ///
23 /// RegisterRegAlloc class - Track the registration of register allocators.
24 ///
25 //===----------------------------------------------------------------------===//
26 class RegisterRegAlloc : public MachinePassRegistryNode {
27
28 public:
29
30 typedef FunctionPass *(*FunctionPassCtor)();
31
32 static MachinePassRegistry Registry;
33
34 RegisterRegAlloc(const char *N, const char *D, FunctionPassCtor C)
35 : MachinePassRegistryNode(N, D, (MachinePassCtor)C)
36 { Registry.Add(this); }
37 ~RegisterRegAlloc() { Registry.Remove(this); }
38
39
40 // Accessors.
41 //
42 RegisterRegAlloc *getNext() const {
43 return (RegisterRegAlloc *)MachinePassRegistryNode::getNext();
44 }
45 static RegisterRegAlloc *getList() {
46 return (RegisterRegAlloc *)Registry.getList();
47 }
48 static FunctionPassCtor getDefault() {
49 return (FunctionPassCtor)Registry.getDefault();
50 }
51 static void setDefault(FunctionPassCtor C) {
52 Registry.setDefault((MachinePassCtor)C);
53 }
54 static void setListener(MachinePassRegistryListener *L) {
55 Registry.setListener(L);
56 }
57
58 };
59
60 } // end namespace llvm
61
62
63 #endif
0 //===-- llvm/CodeGen/SchedulerRegistry.h ------------------------*- C++ -*-===//
1 //
2 // The LLVM Compiler Infrastructure
3 //
4 // This file was developed by the James M. Laskey and is distributed under
5 // the University of Illinois Open Source License. See LICENSE.TXT for details.
6 //
7 //===----------------------------------------------------------------------===//
8 //
9 // This file contains the implementation for instruction scheduler function
10 // pass registry (RegisterScheduler).
11 //
12 //===----------------------------------------------------------------------===//
13
14 #ifndef LLVM_CODEGENSCHEDULERREGISTRY_H
15 #define LLVM_CODEGENSCHEDULERREGISTRY_H
16
17 #include "llvm/CodeGen/MachinePassRegistry.h"
18
19 namespace llvm {
20
21 //===----------------------------------------------------------------------===//
22 ///
23 /// RegisterScheduler class - Track the registration of instruction schedulers.
24 ///
25 //===----------------------------------------------------------------------===//
26
27 class SelectionDAGISel;
28 class ScheduleDAG;
29 class SelectionDAG;
30 class MachineBasicBlock;
31
32 class RegisterScheduler : public MachinePassRegistryNode {
33
34 public:
35
36 typedef ScheduleDAG *(*FunctionPassCtor)(SelectionDAGISel*, SelectionDAG*,
37 MachineBasicBlock*);
38
39 static MachinePassRegistry Registry;
40
41 RegisterScheduler(const char *N, const char *D, FunctionPassCtor C)
42 : MachinePassRegistryNode(N, D, (MachinePassCtor)C)
43 { Registry.Add(this); }
44 ~RegisterScheduler() { Registry.Remove(this); }
45
46
47 // Accessors.
48 //
49 RegisterScheduler *getNext() const {
50 return (RegisterScheduler *)MachinePassRegistryNode::getNext();
51 }
52 static RegisterScheduler *getList() {
53 return (RegisterScheduler *)Registry.getList();
54 }
55 static FunctionPassCtor getDefault() {
56 return (FunctionPassCtor)Registry.getDefault();
57 }
58 static void setDefault(FunctionPassCtor C) {
59 Registry.setDefault((MachinePassCtor)C);
60 }
61 static void setListener(MachinePassRegistryListener *L) {
62 Registry.setListener(L);
63 }
64
65 };
66
67 } // end namespace llvm
68
69
70 #endif