X-Git-Url: http://demsky.eecs.uci.edu/git/?a=blobdiff_plain;f=lib%2FAnalysis%2FDomPrinter.cpp;h=cde431459d5018d9c9f0a83170e5e0d86044d93e;hb=acc9e7315c450ca7cffd4a65c65e578211f9d945;hp=83e39f1e6fcb8191b3c9a2760b3ea7761a60792b;hpb=1f74590e9d1b9cf0f1f81a156efea73f76546e05;p=oota-llvm.git diff --git a/lib/Analysis/DomPrinter.cpp b/lib/Analysis/DomPrinter.cpp index 83e39f1e6fc..cde431459d5 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" @@ -86,74 +84,90 @@ namespace { struct DomViewer : public DOTGraphTraitsViewer { static char ID; - DomViewer() : DOTGraphTraitsViewer("dom", &ID){} + DomViewer() : DOTGraphTraitsViewer("dom", ID){ + initializeDomViewerPass(*PassRegistry::getPassRegistry()); + } }; struct DomOnlyViewer : public DOTGraphTraitsViewer { static char ID; - DomOnlyViewer() : DOTGraphTraitsViewer("domonly", &ID){} + DomOnlyViewer() : DOTGraphTraitsViewer("domonly", ID){ + initializeDomOnlyViewerPass(*PassRegistry::getPassRegistry()); + } }; struct PostDomViewer : public DOTGraphTraitsViewer { static char ID; PostDomViewer() : - DOTGraphTraitsViewer("postdom", &ID){} + DOTGraphTraitsViewer("postdom", ID){ + initializePostDomViewerPass(*PassRegistry::getPassRegistry()); + } }; struct PostDomOnlyViewer : public DOTGraphTraitsViewer { static char ID; PostDomOnlyViewer() : - DOTGraphTraitsViewer("postdomonly", &ID){} + DOTGraphTraitsViewer("postdomonly", ID){ + initializePostDomOnlyViewerPass(*PassRegistry::getPassRegistry()); + } }; } // end anonymous namespace char DomViewer::ID = 0; INITIALIZE_PASS(DomViewer, "view-dom", - "View dominance tree of function", false, false); + "View dominance tree of function", false, false) char DomOnlyViewer::ID = 0; INITIALIZE_PASS(DomOnlyViewer, "view-dom-only", "View dominance tree of function (with no function bodies)", - false, false); + false, false) char PostDomViewer::ID = 0; INITIALIZE_PASS(PostDomViewer, "view-postdom", - "View postdominance tree of function", false, false); + "View postdominance tree of function", false, false) char PostDomOnlyViewer::ID = 0; INITIALIZE_PASS(PostDomOnlyViewer, "view-postdom-only", "View postdominance tree of function " "(with no function bodies)", - false, false); + false, false) namespace { struct DomPrinter : public DOTGraphTraitsPrinter { static char ID; - DomPrinter() : DOTGraphTraitsPrinter("dom", &ID) {} + DomPrinter() : DOTGraphTraitsPrinter("dom", ID) { + initializeDomPrinterPass(*PassRegistry::getPassRegistry()); + } }; struct DomOnlyPrinter : public DOTGraphTraitsPrinter { static char ID; - DomOnlyPrinter() : DOTGraphTraitsPrinter("domonly", &ID) {} + DomOnlyPrinter() : DOTGraphTraitsPrinter("domonly", ID) { + initializeDomOnlyPrinterPass(*PassRegistry::getPassRegistry()); + } }; struct PostDomPrinter : public DOTGraphTraitsPrinter { static char ID; PostDomPrinter() : - DOTGraphTraitsPrinter("postdom", &ID) {} + DOTGraphTraitsPrinter("postdom", ID) { + initializePostDomPrinterPass(*PassRegistry::getPassRegistry()); + } }; struct PostDomOnlyPrinter : public DOTGraphTraitsPrinter { static char ID; PostDomOnlyPrinter() : - DOTGraphTraitsPrinter("postdomonly", &ID) {} + DOTGraphTraitsPrinter("postdomonly", ID) { + initializePostDomOnlyPrinterPass(*PassRegistry::getPassRegistry()); + } }; } // end anonymous namespace @@ -162,24 +176,24 @@ struct PostDomOnlyPrinter char DomPrinter::ID = 0; INITIALIZE_PASS(DomPrinter, "dot-dom", "Print dominance tree of function to 'dot' file", - false, false); + false, false) char DomOnlyPrinter::ID = 0; INITIALIZE_PASS(DomOnlyPrinter, "dot-dom-only", "Print dominance tree of function to 'dot' file " "(with no function bodies)", - false, false); + false, false) char PostDomPrinter::ID = 0; INITIALIZE_PASS(PostDomPrinter, "dot-postdom", "Print postdominance tree of function to 'dot' file", - false, false); + false, false) char PostDomOnlyPrinter::ID = 0; INITIALIZE_PASS(PostDomOnlyPrinter, "dot-postdom-only", "Print postdominance tree of function to 'dot' file " "(with no function bodies)", - false, false); + false, false) // Create methods available outside of this file, to use them // "include/llvm/LinkAllPasses.h". Otherwise the pass would be deleted by