mirror of
https://github.com/RPCSX/llvm.git
synced 2025-01-19 10:53:55 +00:00
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
This commit is contained in:
parent
27745c19a9
commit
fc728fbdc2
@ -99,6 +99,7 @@ public:
|
|||||||
MachinePassRegistryNode *getList() { return List; }
|
MachinePassRegistryNode *getList() { return List; }
|
||||||
MachinePassCtor getDefault() { return Default; }
|
MachinePassCtor getDefault() { return Default; }
|
||||||
void setDefault(MachinePassCtor C) { Default = C; }
|
void setDefault(MachinePassCtor C) { Default = C; }
|
||||||
|
void setDefault(StringRef Name);
|
||||||
void setListener(MachinePassRegistryListener *L) { Listener = L; }
|
void setListener(MachinePassRegistryListener *L) { Listener = L; }
|
||||||
|
|
||||||
/// Add - Adds a function pass to the registration list.
|
/// Add - Adds a function pass to the registration list.
|
||||||
|
@ -81,6 +81,9 @@ public:
|
|||||||
static void setDefault(ScheduleDAGCtor C) {
|
static void setDefault(ScheduleDAGCtor C) {
|
||||||
Registry.setDefault((MachinePassCtor)C);
|
Registry.setDefault((MachinePassCtor)C);
|
||||||
}
|
}
|
||||||
|
static void setDefault(StringRef Name) {
|
||||||
|
Registry.setDefault(Name);
|
||||||
|
}
|
||||||
static void setListener(MachinePassRegistryListener *L) {
|
static void setListener(MachinePassRegistryListener *L) {
|
||||||
Registry.setListener(L);
|
Registry.setListener(L);
|
||||||
}
|
}
|
||||||
|
@ -18,6 +18,19 @@ using namespace llvm;
|
|||||||
|
|
||||||
void MachinePassRegistryListener::anchor() { }
|
void MachinePassRegistryListener::anchor() { }
|
||||||
|
|
||||||
|
/// setDefault - Set the default constructor by name.
|
||||||
|
void MachinePassRegistry::setDefault(StringRef Name) {
|
||||||
|
MachinePassCtor Ctor = 0;
|
||||||
|
for(MachinePassRegistryNode *R = getList(); R; R = R->getNext()) {
|
||||||
|
if (R->getName() == Name) {
|
||||||
|
Ctor = R->getCtor();
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
assert(Ctor && "Unregistered pass name");
|
||||||
|
setDefault(Ctor);
|
||||||
|
}
|
||||||
|
|
||||||
/// Add - Adds a function pass to the registration list.
|
/// Add - Adds a function pass to the registration list.
|
||||||
///
|
///
|
||||||
void MachinePassRegistry::Add(MachinePassRegistryNode *Node) {
|
void MachinePassRegistry::Add(MachinePassRegistryNode *Node) {
|
||||||
|
Loading…
x
Reference in New Issue
Block a user