Change class' public PassInfo variables to by initialized with the
address of the PassInfo directly instead of calling getPassInfo.
This eliminates a bunch of dynamic initializations of static data.
Also, fold RegisterPassBase into PassInfo, make a bunch of its
data members const, and rearrange some code to initialize data
members in constructors instead of using setter member functions.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@51022 91177308-0d34-0410-b5e6-96231b3b80d8
diff --git a/lib/CodeGen/MachineDominators.cpp b/lib/CodeGen/MachineDominators.cpp
index 0710c10d..8f67993 100644
--- a/lib/CodeGen/MachineDominators.cpp
+++ b/lib/CodeGen/MachineDominators.cpp
@@ -25,4 +25,4 @@
static RegisterPass<MachineDominatorTree>
E("machinedomtree", "MachineDominator Tree Construction", true);
-const PassInfo *llvm::MachineDominatorsID = E.getPassInfo();
+const PassInfo *const llvm::MachineDominatorsID = &E;
diff --git a/lib/CodeGen/MachineLoopInfo.cpp b/lib/CodeGen/MachineLoopInfo.cpp
index ac3df43..68ddb7b 100644
--- a/lib/CodeGen/MachineLoopInfo.cpp
+++ b/lib/CodeGen/MachineLoopInfo.cpp
@@ -26,7 +26,7 @@
static RegisterPass<MachineLoopInfo>
X("machine-loops", "Machine Natural Loop Construction", true);
-const PassInfo *llvm::MachineLoopInfoID = X.getPassInfo();
+const PassInfo *const llvm::MachineLoopInfoID = &X;
bool MachineLoopInfo::runOnMachineFunction(MachineFunction &) {
releaseMemory();
diff --git a/lib/CodeGen/PHIElimination.cpp b/lib/CodeGen/PHIElimination.cpp
index 4a9077a..4e2ed67 100644
--- a/lib/CodeGen/PHIElimination.cpp
+++ b/lib/CodeGen/PHIElimination.cpp
@@ -79,7 +79,7 @@
static RegisterPass<PNE>
X("phi-node-elimination", "Eliminate PHI nodes for register allocation");
-const PassInfo *llvm::PHIEliminationID = X.getPassInfo();
+const PassInfo *const llvm::PHIEliminationID = &X;
bool PNE::runOnMachineFunction(MachineFunction &Fn) {
MRI = &Fn.getRegInfo();
diff --git a/lib/CodeGen/SimpleRegisterCoalescing.cpp b/lib/CodeGen/SimpleRegisterCoalescing.cpp
index 2526d4d..5e18534 100644
--- a/lib/CodeGen/SimpleRegisterCoalescing.cpp
+++ b/lib/CodeGen/SimpleRegisterCoalescing.cpp
@@ -58,7 +58,7 @@
// Declare that we implement the RegisterCoalescer interface
static RegisterAnalysisGroup<RegisterCoalescer, true/*The Default*/> V(X);
-const PassInfo *llvm::SimpleRegisterCoalescingID = X.getPassInfo();
+const PassInfo *const llvm::SimpleRegisterCoalescingID = &X;
void SimpleRegisterCoalescing::getAnalysisUsage(AnalysisUsage &AU) const {
AU.addPreserved<LiveIntervals>();
diff --git a/lib/CodeGen/StrongPHIElimination.cpp b/lib/CodeGen/StrongPHIElimination.cpp
index 79f8f50..97e4fb9 100644
--- a/lib/CodeGen/StrongPHIElimination.cpp
+++ b/lib/CodeGen/StrongPHIElimination.cpp
@@ -147,7 +147,7 @@
X("strong-phi-node-elimination",
"Eliminate PHI nodes for register allocation, intelligently");
-const PassInfo *llvm::StrongPHIEliminationID = X.getPassInfo();
+const PassInfo *const llvm::StrongPHIEliminationID = &X;
/// computeDFS - Computes the DFS-in and DFS-out numbers of the dominator tree
/// of the given MachineFunction. These numbers are then used in other parts
diff --git a/lib/CodeGen/TwoAddressInstructionPass.cpp b/lib/CodeGen/TwoAddressInstructionPass.cpp
index f343ff4..1e24914 100644
--- a/lib/CodeGen/TwoAddressInstructionPass.cpp
+++ b/lib/CodeGen/TwoAddressInstructionPass.cpp
@@ -81,7 +81,7 @@
static RegisterPass<TwoAddressInstructionPass>
X("twoaddressinstruction", "Two-Address instruction pass");
-const PassInfo *llvm::TwoAddressInstructionPassID = X.getPassInfo();
+const PassInfo *const llvm::TwoAddressInstructionPassID = &X;
/// Sink3AddrInstruction - A two-address instruction has been converted to a
/// three-address instruction to avoid clobbering a register. Try to sink it