Index: llvm/include/llvm/Analysis/DomPrinter.h =================================================================== --- llvm/include/llvm/Analysis/DomPrinter.h +++ llvm/include/llvm/Analysis/DomPrinter.h @@ -14,30 +14,121 @@ #ifndef LLVM_ANALYSIS_DOMPRINTER_H #define LLVM_ANALYSIS_DOMPRINTER_H +#include "llvm/Analysis/DOTGraphTraitsPass.h" +#include "llvm/Analysis/PostDominators.h" +#include "llvm/IR/Dominators.h" #include "llvm/IR/PassManager.h" namespace llvm { -class DomTreePrinterPass : public PassInfoMixin { -public: - PreservedAnalyses run(Function &F, FunctionAnalysisManager &AM); + +template <> +struct DOTGraphTraits : public DefaultDOTGraphTraits { + + DOTGraphTraits(bool isSimple = false) : DefaultDOTGraphTraits(isSimple) {} + + std::string getNodeLabel(DomTreeNode *Node, DomTreeNode *Graph) { + + BasicBlock *BB = Node->getBlock(); + + if (!BB) + return "Post dominance root node"; + + if (isSimple()) + return DOTGraphTraits::getSimpleNodeLabel(BB, nullptr); + else + return DOTGraphTraits::getCompleteNodeLabel(BB, nullptr); + } +}; + +template <> +struct DOTGraphTraits + : public DOTGraphTraits { + + DOTGraphTraits(bool isSimple = false) + : DOTGraphTraits(isSimple) {} + + static std::string getGraphName(DominatorTree *DT) { + return "Dominator tree"; + } + + std::string getNodeLabel(DomTreeNode *Node, DominatorTree *G) { + return DOTGraphTraits::getNodeLabel(Node, + G->getRootNode()); + } +}; + +template<> +struct DOTGraphTraits + : public DOTGraphTraits { + + DOTGraphTraits (bool isSimple=false) + : DOTGraphTraits(isSimple) {} + + static std::string getGraphName(PostDominatorTree *DT) { + return "Post dominator tree"; + } + + std::string getNodeLabel(DomTreeNode *Node, + PostDominatorTree *G) { + return DOTGraphTraits::getNodeLabel(Node, G->getRootNode()); + } +}; + +struct DomViewer : public DOTGraphTraitsViewer { + DomViewer() : DOTGraphTraitsViewer("dom") {} +}; + +struct DomOnlyViewer + : public DOTGraphTraitsViewer { + DomOnlyViewer() + : DOTGraphTraitsViewer("domonly") {} +}; + +struct PostDomViewer + : public DOTGraphTraitsViewer { + PostDomViewer() + : DOTGraphTraitsViewer("postdom") {} +}; + +struct PostDomOnlyViewer + : public DOTGraphTraitsViewer { + PostDomOnlyViewer() + : DOTGraphTraitsViewer("postdomonly") {} +}; + +struct DomPrinter : public DOTGraphTraitsPrinter { + DomPrinter() : DOTGraphTraitsPrinter("dom") {} +}; + +struct DomOnlyPrinter + : public DOTGraphTraitsPrinter { + DomOnlyPrinter() + : DOTGraphTraitsPrinter("domonly") {} +}; + +struct PostDomPrinter + : public DOTGraphTraitsPrinter { + PostDomPrinter() + : DOTGraphTraitsPrinter("postdom") {} }; -class DomTreeOnlyPrinterPass : public PassInfoMixin { -public: - PreservedAnalyses run(Function &F, FunctionAnalysisManager &AM); +struct PostDomOnlyPrinter + : public DOTGraphTraitsPrinter { + PostDomOnlyPrinter() + : DOTGraphTraitsPrinter("postdomonly") {} }; } // namespace llvm namespace llvm { class FunctionPass; - FunctionPass *createDomPrinterPass(); - FunctionPass *createDomOnlyPrinterPass(); - FunctionPass *createDomViewerPass(); - FunctionPass *createDomOnlyViewerPass(); - FunctionPass *createPostDomPrinterPass(); - FunctionPass *createPostDomOnlyPrinterPass(); - FunctionPass *createPostDomViewerPass(); - FunctionPass *createPostDomOnlyViewerPass(); + FunctionPass *createDomPrinterWrapperPassPass(); + FunctionPass *createDomOnlyPrinterWrapperPassPass(); + FunctionPass *createDomViewerWrapperPassPass(); + FunctionPass *createDomOnlyViewerWrapperPassPass(); + FunctionPass *createPostDomPrinterWrapperPassPass(); + FunctionPass *createPostDomOnlyPrinterWrapperPassPass(); + FunctionPass *createPostDomViewerWrapperPassPass(); + FunctionPass *createPostDomOnlyViewerWrapperPassPass(); } // End llvm namespace #endif Index: llvm/include/llvm/Analysis/PostDominators.h =================================================================== --- llvm/include/llvm/Analysis/PostDominators.h +++ llvm/include/llvm/Analysis/PostDominators.h @@ -102,10 +102,7 @@ } static nodes_iterator nodes_begin(PostDominatorTree *N) { - if (getEntryNode(N)) - return df_begin(getEntryNode(N)); - else - return df_end(getEntryNode(N)); + return df_begin(getEntryNode(N)); } static nodes_iterator nodes_end(PostDominatorTree *N) { Index: llvm/include/llvm/InitializePasses.h =================================================================== --- llvm/include/llvm/InitializePasses.h +++ llvm/include/llvm/InitializePasses.h @@ -132,10 +132,10 @@ void initializeDependenceAnalysisWrapperPassPass(PassRegistry&); void initializeDetectDeadLanesPass(PassRegistry&); void initializeDivRemPairsLegacyPassPass(PassRegistry&); -void initializeDomOnlyPrinterPass(PassRegistry&); -void initializeDomOnlyViewerPass(PassRegistry&); -void initializeDomPrinterPass(PassRegistry&); -void initializeDomViewerPass(PassRegistry&); +void initializeDomOnlyPrinterWrapperPassPass(PassRegistry &); +void initializeDomOnlyViewerWrapperPassPass(PassRegistry &); +void initializeDomPrinterWrapperPassPass(PassRegistry &); +void initializeDomViewerWrapperPassPass(PassRegistry &); void initializeDominanceFrontierWrapperPassPass(PassRegistry&); void initializeDominatorTreeWrapperPassPass(PassRegistry&); void initializeDwarfEHPrepareLegacyPassPass(PassRegistry &); @@ -342,10 +342,10 @@ void initializePhysicalRegisterUsageInfoPass(PassRegistry&); void initializePlaceBackedgeSafepointsImplPass(PassRegistry&); void initializePlaceSafepointsPass(PassRegistry&); -void initializePostDomOnlyPrinterPass(PassRegistry&); -void initializePostDomOnlyViewerPass(PassRegistry&); -void initializePostDomPrinterPass(PassRegistry&); -void initializePostDomViewerPass(PassRegistry&); +void initializePostDomOnlyPrinterWrapperPassPass(PassRegistry &); +void initializePostDomOnlyViewerWrapperPassPass(PassRegistry &); +void initializePostDomPrinterWrapperPassPass(PassRegistry &); +void initializePostDomViewerWrapperPassPass(PassRegistry &); void initializePostDominatorTreeWrapperPassPass(PassRegistry&); void initializePostInlineEntryExitInstrumenterPass(PassRegistry&); void initializePostMachineSchedulerPass(PassRegistry&); Index: llvm/include/llvm/LinkAllPasses.h =================================================================== --- llvm/include/llvm/LinkAllPasses.h +++ llvm/include/llvm/LinkAllPasses.h @@ -98,10 +98,10 @@ (void) llvm::createDeadCodeEliminationPass(); (void) llvm::createDeadStoreEliminationPass(); (void) llvm::createDependenceAnalysisWrapperPass(); - (void) llvm::createDomOnlyPrinterPass(); - (void) llvm::createDomPrinterPass(); - (void) llvm::createDomOnlyViewerPass(); - (void) llvm::createDomViewerPass(); + (void) llvm::createDomOnlyPrinterWrapperPassPass(); + (void) llvm::createDomPrinterWrapperPassPass(); + (void) llvm::createDomOnlyViewerWrapperPassPass(); + (void) llvm::createDomViewerWrapperPassPass(); (void) llvm::createInstrProfilingLegacyPass(); (void) llvm::createFunctionImportPass(); (void) llvm::createFunctionInliningPass(); @@ -151,10 +151,10 @@ (void) llvm::createPromoteMemoryToRegisterPass(); (void) llvm::createDemoteRegisterToMemoryPass(); (void) llvm::createPruneEHPass(); - (void) llvm::createPostDomOnlyPrinterPass(); - (void) llvm::createPostDomPrinterPass(); - (void) llvm::createPostDomOnlyViewerPass(); - (void) llvm::createPostDomViewerPass(); + (void)llvm::createPostDomOnlyPrinterWrapperPassPass(); + (void)llvm::createPostDomPrinterWrapperPassPass(); + (void)llvm::createPostDomOnlyViewerWrapperPassPass(); + (void)llvm::createPostDomViewerWrapperPassPass(); (void) llvm::createReassociatePass(); (void) llvm::createRedundantDbgInstEliminationPass(); (void) llvm::createRegionInfoPass(); Index: llvm/lib/Analysis/Analysis.cpp =================================================================== --- llvm/lib/Analysis/Analysis.cpp +++ llvm/lib/Analysis/Analysis.cpp @@ -40,14 +40,14 @@ initializeDelinearizationPass(Registry); initializeDemandedBitsWrapperPassPass(Registry); initializeDominanceFrontierWrapperPassPass(Registry); - initializeDomViewerPass(Registry); - initializeDomPrinterPass(Registry); - initializeDomOnlyViewerPass(Registry); - initializePostDomViewerPass(Registry); - initializeDomOnlyPrinterPass(Registry); - initializePostDomPrinterPass(Registry); - initializePostDomOnlyViewerPass(Registry); - initializePostDomOnlyPrinterPass(Registry); + initializeDomViewerWrapperPassPass(Registry); + initializeDomPrinterWrapperPassPass(Registry); + initializeDomOnlyViewerWrapperPassPass(Registry); + initializePostDomViewerWrapperPassPass(Registry); + initializeDomOnlyPrinterWrapperPassPass(Registry); + initializePostDomPrinterWrapperPassPass(Registry); + initializePostDomOnlyViewerWrapperPassPass(Registry); + initializePostDomOnlyPrinterWrapperPassPass(Registry); initializeAAResultsWrapperPassPass(Registry); initializeGlobalsAAWrapperPassPass(Registry); initializeIVUsersWrapperPassPass(Registry); Index: llvm/lib/Analysis/DomPrinter.cpp =================================================================== --- llvm/lib/Analysis/DomPrinter.cpp +++ llvm/lib/Analysis/DomPrinter.cpp @@ -24,74 +24,6 @@ using namespace llvm; -namespace llvm { -template<> -struct DOTGraphTraits : public DefaultDOTGraphTraits { - - DOTGraphTraits (bool isSimple=false) - : DefaultDOTGraphTraits(isSimple) {} - - std::string getNodeLabel(DomTreeNode *Node, DomTreeNode *Graph) { - - BasicBlock *BB = Node->getBlock(); - - if (!BB) - return "Post dominance root node"; - - - if (isSimple()) - return DOTGraphTraits - ::getSimpleNodeLabel(BB, nullptr); - else - return DOTGraphTraits - ::getCompleteNodeLabel(BB, nullptr); - } -}; - -template<> -struct DOTGraphTraits : public DOTGraphTraits { - - DOTGraphTraits (bool isSimple=false) - : DOTGraphTraits(isSimple) {} - - static std::string getGraphName(DominatorTree *DT) { - return "Dominator tree"; - } - - std::string getNodeLabel(DomTreeNode *Node, DominatorTree *G) { - return DOTGraphTraits::getNodeLabel(Node, G->getRootNode()); - } -}; - -template<> -struct DOTGraphTraits - : public DOTGraphTraits { - - DOTGraphTraits (bool isSimple=false) - : DOTGraphTraits(isSimple) {} - - static std::string getGraphName(PostDominatorTree *DT) { - return "Post dominator tree"; - } - - std::string getNodeLabel(DomTreeNode *Node, PostDominatorTree *G ) { - return DOTGraphTraits::getNodeLabel(Node, G->getRootNode()); - } -}; -} - -PreservedAnalyses DomTreePrinterPass::run(Function &F, - FunctionAnalysisManager &AM) { - WriteDOTGraphToFile(F, &AM.getResult(F), "dom", false); - return PreservedAnalyses::all(); -} - -PreservedAnalyses DomTreeOnlyPrinterPass::run(Function &F, - FunctionAnalysisManager &AM) { - WriteDOTGraphToFile(F, &AM.getResult(F), "domonly", - true); - return PreservedAnalyses::all(); -} void DominatorTree::viewGraph(const Twine &Name, const Twine &Title) { #ifndef NDEBUG @@ -110,162 +42,167 @@ } namespace { -struct DominatorTreeWrapperPassAnalysisGraphTraits { +struct LegacyDominatorTreeWrapperPassAnalysisGraphTraits { static DominatorTree *getGraph(DominatorTreeWrapperPass *DTWP) { return &DTWP->getDomTree(); } }; -struct DomViewer : public DOTGraphTraitsViewerWrapperPass< - DominatorTreeWrapperPass, false, DominatorTree *, - DominatorTreeWrapperPassAnalysisGraphTraits> { +struct DomViewerWrapperPass + : public DOTGraphTraitsViewerWrapperPass< + DominatorTreeWrapperPass, false, DominatorTree *, + LegacyDominatorTreeWrapperPassAnalysisGraphTraits> { static char ID; - DomViewer() + DomViewerWrapperPass() : DOTGraphTraitsViewerWrapperPass< DominatorTreeWrapperPass, false, DominatorTree *, - DominatorTreeWrapperPassAnalysisGraphTraits>("dom", ID) { - initializeDomViewerPass(*PassRegistry::getPassRegistry()); + LegacyDominatorTreeWrapperPassAnalysisGraphTraits>("dom", ID) { + initializeDomViewerWrapperPassPass(*PassRegistry::getPassRegistry()); } }; -struct DomOnlyViewer : public DOTGraphTraitsViewerWrapperPass< - DominatorTreeWrapperPass, true, DominatorTree *, - DominatorTreeWrapperPassAnalysisGraphTraits> { +struct DomOnlyViewerWrapperPass + : public DOTGraphTraitsViewerWrapperPass< + DominatorTreeWrapperPass, true, DominatorTree *, + LegacyDominatorTreeWrapperPassAnalysisGraphTraits> { static char ID; - DomOnlyViewer() + DomOnlyViewerWrapperPass() : DOTGraphTraitsViewerWrapperPass< DominatorTreeWrapperPass, true, DominatorTree *, - DominatorTreeWrapperPassAnalysisGraphTraits>("domonly", ID) { - initializeDomOnlyViewerPass(*PassRegistry::getPassRegistry()); + LegacyDominatorTreeWrapperPassAnalysisGraphTraits>("domonly", ID) { + initializeDomOnlyViewerWrapperPassPass(*PassRegistry::getPassRegistry()); } }; -struct PostDominatorTreeWrapperPassAnalysisGraphTraits { +struct LegacyPostDominatorTreeWrapperPassAnalysisGraphTraits { static PostDominatorTree *getGraph(PostDominatorTreeWrapperPass *PDTWP) { return &PDTWP->getPostDomTree(); } }; -struct PostDomViewer +struct PostDomViewerWrapperPass : public DOTGraphTraitsViewerWrapperPass< PostDominatorTreeWrapperPass, false, PostDominatorTree *, - PostDominatorTreeWrapperPassAnalysisGraphTraits> { + LegacyPostDominatorTreeWrapperPassAnalysisGraphTraits> { static char ID; - PostDomViewer() + PostDomViewerWrapperPass() : DOTGraphTraitsViewerWrapperPass< PostDominatorTreeWrapperPass, false, PostDominatorTree *, - PostDominatorTreeWrapperPassAnalysisGraphTraits>("postdom", ID) { - initializePostDomViewerPass(*PassRegistry::getPassRegistry()); + LegacyPostDominatorTreeWrapperPassAnalysisGraphTraits>("postdom", + ID) { + initializePostDomViewerWrapperPassPass(*PassRegistry::getPassRegistry()); } }; -struct PostDomOnlyViewer +struct PostDomOnlyViewerWrapperPass : public DOTGraphTraitsViewerWrapperPass< PostDominatorTreeWrapperPass, true, PostDominatorTree *, - PostDominatorTreeWrapperPassAnalysisGraphTraits> { + LegacyPostDominatorTreeWrapperPassAnalysisGraphTraits> { static char ID; - PostDomOnlyViewer() + PostDomOnlyViewerWrapperPass() : DOTGraphTraitsViewerWrapperPass< PostDominatorTreeWrapperPass, true, PostDominatorTree *, - PostDominatorTreeWrapperPassAnalysisGraphTraits>("postdomonly", - ID) { - initializePostDomOnlyViewerPass(*PassRegistry::getPassRegistry()); + LegacyPostDominatorTreeWrapperPassAnalysisGraphTraits>( + "postdomonly", ID) { + initializePostDomOnlyViewerWrapperPassPass( + *PassRegistry::getPassRegistry()); } }; } // end anonymous namespace -char DomViewer::ID = 0; -INITIALIZE_PASS(DomViewer, "view-dom", +char DomViewerWrapperPass::ID = 0; +INITIALIZE_PASS(DomViewerWrapperPass, "view-dom", "View dominance tree of function", false, false) -char DomOnlyViewer::ID = 0; -INITIALIZE_PASS(DomOnlyViewer, "view-dom-only", +char DomOnlyViewerWrapperPass::ID = 0; +INITIALIZE_PASS(DomOnlyViewerWrapperPass, "view-dom-only", "View dominance tree of function (with no function bodies)", false, false) -char PostDomViewer::ID = 0; -INITIALIZE_PASS(PostDomViewer, "view-postdom", +char PostDomViewerWrapperPass::ID = 0; +INITIALIZE_PASS(PostDomViewerWrapperPass, "view-postdom", "View postdominance tree of function", false, false) -char PostDomOnlyViewer::ID = 0; -INITIALIZE_PASS(PostDomOnlyViewer, "view-postdom-only", +char PostDomOnlyViewerWrapperPass::ID = 0; +INITIALIZE_PASS(PostDomOnlyViewerWrapperPass, "view-postdom-only", "View postdominance tree of function " "(with no function bodies)", false, false) namespace { -struct DomPrinter : public DOTGraphTraitsPrinterWrapperPass< - DominatorTreeWrapperPass, false, DominatorTree *, - DominatorTreeWrapperPassAnalysisGraphTraits> { +struct DomPrinterWrapperPass + : public DOTGraphTraitsPrinterWrapperPass< + DominatorTreeWrapperPass, false, DominatorTree *, + LegacyDominatorTreeWrapperPassAnalysisGraphTraits> { static char ID; - DomPrinter() + DomPrinterWrapperPass() : DOTGraphTraitsPrinterWrapperPass< DominatorTreeWrapperPass, false, DominatorTree *, - DominatorTreeWrapperPassAnalysisGraphTraits>("dom", ID) { - initializeDomPrinterPass(*PassRegistry::getPassRegistry()); + LegacyDominatorTreeWrapperPassAnalysisGraphTraits>("dom", ID) { + initializeDomPrinterWrapperPassPass(*PassRegistry::getPassRegistry()); } }; -struct DomOnlyPrinter : public DOTGraphTraitsPrinterWrapperPass< - DominatorTreeWrapperPass, true, DominatorTree *, - DominatorTreeWrapperPassAnalysisGraphTraits> { +struct DomOnlyPrinterWrapperPass + : public DOTGraphTraitsPrinterWrapperPass< + DominatorTreeWrapperPass, true, DominatorTree *, + LegacyDominatorTreeWrapperPassAnalysisGraphTraits> { static char ID; - DomOnlyPrinter() + DomOnlyPrinterWrapperPass() : DOTGraphTraitsPrinterWrapperPass< DominatorTreeWrapperPass, true, DominatorTree *, - DominatorTreeWrapperPassAnalysisGraphTraits>("domonly", ID) { - initializeDomOnlyPrinterPass(*PassRegistry::getPassRegistry()); + LegacyDominatorTreeWrapperPassAnalysisGraphTraits>("domonly", ID) { + initializeDomOnlyPrinterWrapperPassPass(*PassRegistry::getPassRegistry()); } }; -struct PostDomPrinter +struct PostDomPrinterWrapperPass : public DOTGraphTraitsPrinterWrapperPass< PostDominatorTreeWrapperPass, false, PostDominatorTree *, - PostDominatorTreeWrapperPassAnalysisGraphTraits> { + LegacyPostDominatorTreeWrapperPassAnalysisGraphTraits> { static char ID; - PostDomPrinter() + PostDomPrinterWrapperPass() : DOTGraphTraitsPrinterWrapperPass< PostDominatorTreeWrapperPass, false, PostDominatorTree *, - PostDominatorTreeWrapperPassAnalysisGraphTraits>("postdom", ID) { - initializePostDomPrinterPass(*PassRegistry::getPassRegistry()); + LegacyPostDominatorTreeWrapperPassAnalysisGraphTraits>("postdom", + ID) { + initializePostDomPrinterWrapperPassPass(*PassRegistry::getPassRegistry()); } }; -struct PostDomOnlyPrinter +struct PostDomOnlyPrinterWrapperPass : public DOTGraphTraitsPrinterWrapperPass< PostDominatorTreeWrapperPass, true, PostDominatorTree *, - PostDominatorTreeWrapperPassAnalysisGraphTraits> { + LegacyPostDominatorTreeWrapperPassAnalysisGraphTraits> { static char ID; - PostDomOnlyPrinter() + PostDomOnlyPrinterWrapperPass() : DOTGraphTraitsPrinterWrapperPass< PostDominatorTreeWrapperPass, true, PostDominatorTree *, - PostDominatorTreeWrapperPassAnalysisGraphTraits>("postdomonly", - ID) { - initializePostDomOnlyPrinterPass(*PassRegistry::getPassRegistry()); + LegacyPostDominatorTreeWrapperPassAnalysisGraphTraits>( + "postdomonly", ID) { + initializePostDomOnlyPrinterWrapperPassPass( + *PassRegistry::getPassRegistry()); } }; } // end anonymous namespace +char DomPrinterWrapperPass::ID = 0; +INITIALIZE_PASS(DomPrinterWrapperPass, "dot-dom", + "Print dominance tree of function to 'dot' file", false, false) - -char DomPrinter::ID = 0; -INITIALIZE_PASS(DomPrinter, "dot-dom", - "Print dominance tree of function to 'dot' file", - false, false) - -char DomOnlyPrinter::ID = 0; -INITIALIZE_PASS(DomOnlyPrinter, "dot-dom-only", +char DomOnlyPrinterWrapperPass::ID = 0; +INITIALIZE_PASS(DomOnlyPrinterWrapperPass, "dot-dom-only", "Print dominance tree of function to 'dot' file " "(with no function bodies)", false, false) -char PostDomPrinter::ID = 0; -INITIALIZE_PASS(PostDomPrinter, "dot-postdom", - "Print postdominance tree of function to 'dot' file", - false, false) +char PostDomPrinterWrapperPass::ID = 0; +INITIALIZE_PASS(PostDomPrinterWrapperPass, "dot-postdom", + "Print postdominance tree of function to 'dot' file", false, + false) -char PostDomOnlyPrinter::ID = 0; -INITIALIZE_PASS(PostDomOnlyPrinter, "dot-postdom-only", +char PostDomOnlyPrinterWrapperPass::ID = 0; +INITIALIZE_PASS(PostDomOnlyPrinterWrapperPass, "dot-postdom-only", "Print postdominance tree of function to 'dot' file " "(with no function bodies)", false, false) @@ -274,34 +211,34 @@ // "include/llvm/LinkAllPasses.h". Otherwise the pass would be deleted by // the link time optimization. -FunctionPass *llvm::createDomPrinterPass() { - return new DomPrinter(); +FunctionPass *llvm::createDomPrinterWrapperPassPass() { + return new DomPrinterWrapperPass(); } -FunctionPass *llvm::createDomOnlyPrinterPass() { - return new DomOnlyPrinter(); +FunctionPass *llvm::createDomOnlyPrinterWrapperPassPass() { + return new DomOnlyPrinterWrapperPass(); } -FunctionPass *llvm::createDomViewerPass() { - return new DomViewer(); +FunctionPass *llvm::createDomViewerWrapperPassPass() { + return new DomViewerWrapperPass(); } -FunctionPass *llvm::createDomOnlyViewerPass() { - return new DomOnlyViewer(); +FunctionPass *llvm::createDomOnlyViewerWrapperPassPass() { + return new DomOnlyViewerWrapperPass(); } -FunctionPass *llvm::createPostDomPrinterPass() { - return new PostDomPrinter(); +FunctionPass *llvm::createPostDomPrinterWrapperPassPass() { + return new PostDomPrinterWrapperPass(); } -FunctionPass *llvm::createPostDomOnlyPrinterPass() { - return new PostDomOnlyPrinter(); +FunctionPass *llvm::createPostDomOnlyPrinterWrapperPassPass() { + return new PostDomOnlyPrinterWrapperPass(); } -FunctionPass *llvm::createPostDomViewerPass() { - return new PostDomViewer(); +FunctionPass *llvm::createPostDomViewerWrapperPassPass() { + return new PostDomViewerWrapperPass(); } -FunctionPass *llvm::createPostDomOnlyViewerPass() { - return new PostDomOnlyViewer(); +FunctionPass *llvm::createPostDomOnlyViewerWrapperPassPass() { + return new PostDomOnlyViewerWrapperPass(); } Index: llvm/lib/Passes/PassRegistry.def =================================================================== --- llvm/lib/Passes/PassRegistry.def +++ llvm/lib/Passes/PassRegistry.def @@ -261,8 +261,14 @@ FUNCTION_PASS("dse", DSEPass()) FUNCTION_PASS("dot-cfg", CFGPrinterPass()) FUNCTION_PASS("dot-cfg-only", CFGOnlyPrinterPass()) -FUNCTION_PASS("dot-dom", DomTreePrinterPass()) -FUNCTION_PASS("dot-dom-only", DomTreeOnlyPrinterPass()) +FUNCTION_PASS("dot-dom", DomPrinter()) +FUNCTION_PASS("dot-dom-only", DomOnlyPrinter()) +FUNCTION_PASS("dot-post-dom", PostDomPrinter()) +FUNCTION_PASS("dot-post-dom-only", PostDomOnlyPrinter()) +FUNCTION_PASS("view-dom", DomViewer()) +FUNCTION_PASS("view-dom-only", DomOnlyViewer()) +FUNCTION_PASS("view-post-dom", PostDomViewer()) +FUNCTION_PASS("view-post-dom-only", PostDomOnlyViewer()) FUNCTION_PASS("fix-irreducible", FixIrreduciblePass()) FUNCTION_PASS("flattencfg", FlattenCFGPass()) FUNCTION_PASS("make-guards-explicit", MakeGuardsExplicitPass())