llvm.org GIT mirror llvm / fc728fb
Allow targets to select the default scheduler by name. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@155090 91177308-0d34-0410-b5e6-96231b3b80d8 Andrew Trick 8 years ago
3 changed file(s) with 17 addition(s) and 0 deletion(s). Raw diff Collapse all Expand all
9898 MachinePassRegistryNode *getList() { return List; }
9999 MachinePassCtor getDefault() { return Default; }
100100 void setDefault(MachinePassCtor C) { Default = C; }
101 void setDefault(StringRef Name);
101102 void setListener(MachinePassRegistryListener *L) { Listener = L; }
102103
103104 /// Add - Adds a function pass to the registration list.
8080 static void setDefault(ScheduleDAGCtor C) {
8181 Registry.setDefault((MachinePassCtor)C);
8282 }
83 static void setDefault(StringRef Name) {
84 Registry.setDefault(Name);
85 }
8386 static void setListener(MachinePassRegistryListener *L) {
8487 Registry.setListener(L);
8588 }
1616 using namespace llvm;
1717
1818 void MachinePassRegistryListener::anchor() { }
19
20 /// setDefault - Set the default constructor by name.
21 void MachinePassRegistry::setDefault(StringRef Name) {
22 MachinePassCtor Ctor = 0;
23 for(MachinePassRegistryNode *R = getList(); R; R = R->getNext()) {
24 if (R->getName() == Name) {
25 Ctor = R->getCtor();
26 break;
27 }
28 }
29 assert(Ctor && "Unregistered pass name");
30 setDefault(Ctor);
31 }
1932
2033 /// Add - Adds a function pass to the registration list.
2134 ///