X-Git-Url: http://demsky.eecs.uci.edu/git/?a=blobdiff_plain;f=lib%2FAnalysis%2FDomPrinter.cpp;h=0c880df54f8e9fdb5c7f1ccc605673ae740e4b33;hb=2b861c3a24fa299d6b8a2d5097114c1000354bee;hp=cde431459d5018d9c9f0a83170e5e0d86044d93e;hpb=9fc5cdf77c812aaa80419036de27576d45894d0d;p=oota-llvm.git diff --git a/lib/Analysis/DomPrinter.cpp b/lib/Analysis/DomPrinter.cpp index cde431459d5..0c880df54f8 100644 --- a/lib/Analysis/DomPrinter.cpp +++ b/lib/Analysis/DomPrinter.cpp @@ -81,18 +81,32 @@ struct DOTGraphTraits } namespace { -struct DomViewer - : public DOTGraphTraitsViewer { +struct DominatorTreeWrapperPassAnalysisGraphTraits { + static DominatorTree *getGraph(DominatorTreeWrapperPass *DTWP) { + return &DTWP->getDomTree(); + } +}; + +struct DomViewer : public DOTGraphTraitsViewer< + DominatorTreeWrapperPass, false, DominatorTree *, + DominatorTreeWrapperPassAnalysisGraphTraits> { static char ID; - DomViewer() : DOTGraphTraitsViewer("dom", ID){ + DomViewer() + : DOTGraphTraitsViewer( + "dom", ID) { initializeDomViewerPass(*PassRegistry::getPassRegistry()); } }; -struct DomOnlyViewer - : public DOTGraphTraitsViewer { +struct DomOnlyViewer : public DOTGraphTraitsViewer< + DominatorTreeWrapperPass, true, DominatorTree *, + DominatorTreeWrapperPassAnalysisGraphTraits> { static char ID; - DomOnlyViewer() : DOTGraphTraitsViewer("domonly", ID){ + DomOnlyViewer() + : DOTGraphTraitsViewer( + "domonly", ID) { initializeDomOnlyViewerPass(*PassRegistry::getPassRegistry()); } }; @@ -136,18 +150,26 @@ INITIALIZE_PASS(PostDomOnlyViewer, "view-postdom-only", false, false) namespace { -struct DomPrinter - : public DOTGraphTraitsPrinter { +struct DomPrinter : public DOTGraphTraitsPrinter< + DominatorTreeWrapperPass, false, DominatorTree *, + DominatorTreeWrapperPassAnalysisGraphTraits> { static char ID; - DomPrinter() : DOTGraphTraitsPrinter("dom", ID) { + DomPrinter() + : DOTGraphTraitsPrinter( + "dom", ID) { initializeDomPrinterPass(*PassRegistry::getPassRegistry()); } }; -struct DomOnlyPrinter - : public DOTGraphTraitsPrinter { +struct DomOnlyPrinter : public DOTGraphTraitsPrinter< + DominatorTreeWrapperPass, true, DominatorTree *, + DominatorTreeWrapperPassAnalysisGraphTraits> { static char ID; - DomOnlyPrinter() : DOTGraphTraitsPrinter("domonly", ID) { + DomOnlyPrinter() + : DOTGraphTraitsPrinter( + "domonly", ID) { initializeDomOnlyPrinterPass(*PassRegistry::getPassRegistry()); } };