PreferredEHDataFormat is always call with data and global, but this whole
[oota-llvm.git] / lib / CodeGen / MachineLoopInfo.cpp
index 9900728d3e9f658ff9e66d745837836ffd463678..2da8e3760e9ae6c3afb21e14f4cd4bf1a85fa217 100644 (file)
 #include "llvm/CodeGen/Passes.h"
 using namespace llvm;
 
-TEMPLATE_INSTANTIATION(class LoopBase<MachineBasicBlock>);
-TEMPLATE_INSTANTIATION(class LoopInfoBase<MachineBasicBlock>);
+#define MLB class LoopBase<MachineBasicBlock, MachineLoop>
+TEMPLATE_INSTANTIATION(MLB);
+#undef MLB
+#define MLIB class LoopInfoBase<MachineBasicBlock, MachineLoop>
+TEMPLATE_INSTANTIATION(MLIB);
+#undef MLIB
 
 char MachineLoopInfo::ID = 0;
-namespace {
-  RegisterPass<MachineLoopInfo>
-  X("machine-loops", "Machine Natural Loop Construction", true);
-}
+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();
-  LI->Calculate(getAnalysis<MachineDominatorTree>().getBase());    // Update
+  LI.Calculate(getAnalysis<MachineDominatorTree>().getBase());    // Update
   return false;
 }
 
 void MachineLoopInfo::getAnalysisUsage(AnalysisUsage &AU) const {
   AU.setPreservesAll();
   AU.addRequired<MachineDominatorTree>();
+  MachineFunctionPass::getAnalysisUsage(AU);
 }
-
-// Ensure this file gets linked when MachineLoopInfo.h is used.
-DEFINING_FILE_FOR(MachineLoopInfo)