X-Git-Url: http://demsky.eecs.uci.edu/git/?a=blobdiff_plain;f=lib%2FCodeGen%2FMachineDominators.cpp;h=04c8ecbf9bdc1e1e236faef8c456d50a1517fa9e;hb=021e3b6444e9179751002db7b20de96455e03171;hp=f7820484376c0eb3c6855bf17375e0b3d5f7821b;hpb=d68a07650cdb2e18f18f362ba533459aa10e01b6;p=oota-llvm.git diff --git a/lib/CodeGen/MachineDominators.cpp b/lib/CodeGen/MachineDominators.cpp index f7820484376..04c8ecbf9bd 100644 --- a/lib/CodeGen/MachineDominators.cpp +++ b/lib/CodeGen/MachineDominators.cpp @@ -17,15 +17,17 @@ using namespace llvm; +namespace llvm { TEMPLATE_INSTANTIATION(class DomTreeNodeBase); TEMPLATE_INSTANTIATION(class DominatorTreeBase); +} char MachineDominatorTree::ID = 0; -static RegisterPass -E("machinedomtree", "MachineDominator Tree Construction", true); +INITIALIZE_PASS(MachineDominatorTree, "machinedomtree", + "MachineDominator Tree Construction", true, true) -const PassInfo *const llvm::MachineDominatorsID = &E; +char &llvm::MachineDominatorsID = MachineDominatorTree::ID; void MachineDominatorTree::getAnalysisUsage(AnalysisUsage &AU) const { AU.setPreservesAll(); @@ -39,15 +41,19 @@ bool MachineDominatorTree::runOnMachineFunction(MachineFunction &F) { } MachineDominatorTree::MachineDominatorTree() - : MachineFunctionPass(intptr_t(&ID)) { + : MachineFunctionPass(ID) { + initializeMachineDominatorTreePass(*PassRegistry::getPassRegistry()); DT = new DominatorTreeBase(false); } MachineDominatorTree::~MachineDominatorTree() { - DT->releaseMemory(); delete DT; } void MachineDominatorTree::releaseMemory() { DT->releaseMemory(); } + +void MachineDominatorTree::print(raw_ostream &OS, const Module*) const { + DT->print(OS); +}