X-Git-Url: http://demsky.eecs.uci.edu/git/?a=blobdiff_plain;f=lib%2FAnalysis%2FDomPrinter.cpp;h=0c880df54f8e9fdb5c7f1ccc605673ae740e4b33;hb=2b861c3a24fa299d6b8a2d5097114c1000354bee;hp=051e44b150b506a538d4145f76c6440ab626f595;hpb=081c34b725980f995be9080eaec24cd3dfaaf065;p=oota-llvm.git diff --git a/lib/Analysis/DomPrinter.cpp b/lib/Analysis/DomPrinter.cpp index 051e44b150b..0c880df54f8 100644 --- a/lib/Analysis/DomPrinter.cpp +++ b/lib/Analysis/DomPrinter.cpp @@ -19,8 +19,6 @@ //===----------------------------------------------------------------------===// #include "llvm/Analysis/DomPrinter.h" - -#include "llvm/Analysis/Dominators.h" #include "llvm/Analysis/DOTGraphTraitsPass.h" #include "llvm/Analysis/PostDominators.h" @@ -83,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()); } }; @@ -138,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()); } };