xref: /aosp_15_r20/external/llvm/lib/Analysis/DomPrinter.cpp (revision 9880d6810fe72a1726cb53787c6711e909410d58)
1*9880d681SAndroid Build Coastguard Worker //===- DomPrinter.cpp - DOT printer for the dominance trees    ------------===//
2*9880d681SAndroid Build Coastguard Worker //
3*9880d681SAndroid Build Coastguard Worker //                     The LLVM Compiler Infrastructure
4*9880d681SAndroid Build Coastguard Worker //
5*9880d681SAndroid Build Coastguard Worker // This file is distributed under the University of Illinois Open Source
6*9880d681SAndroid Build Coastguard Worker // License. See LICENSE.TXT for details.
7*9880d681SAndroid Build Coastguard Worker //
8*9880d681SAndroid Build Coastguard Worker //===----------------------------------------------------------------------===//
9*9880d681SAndroid Build Coastguard Worker //
10*9880d681SAndroid Build Coastguard Worker // This file defines '-dot-dom' and '-dot-postdom' analysis passes, which emit
11*9880d681SAndroid Build Coastguard Worker // a dom.<fnname>.dot or postdom.<fnname>.dot file for each function in the
12*9880d681SAndroid Build Coastguard Worker // program, with a graph of the dominance/postdominance tree of that
13*9880d681SAndroid Build Coastguard Worker // function.
14*9880d681SAndroid Build Coastguard Worker //
15*9880d681SAndroid Build Coastguard Worker // There are also passes available to directly call dotty ('-view-dom' or
16*9880d681SAndroid Build Coastguard Worker // '-view-postdom'). By appending '-only' like '-dot-dom-only' only the
17*9880d681SAndroid Build Coastguard Worker // names of the bbs are printed, but the content is hidden.
18*9880d681SAndroid Build Coastguard Worker //
19*9880d681SAndroid Build Coastguard Worker //===----------------------------------------------------------------------===//
20*9880d681SAndroid Build Coastguard Worker 
21*9880d681SAndroid Build Coastguard Worker #include "llvm/Analysis/DomPrinter.h"
22*9880d681SAndroid Build Coastguard Worker #include "llvm/Analysis/DOTGraphTraitsPass.h"
23*9880d681SAndroid Build Coastguard Worker #include "llvm/Analysis/PostDominators.h"
24*9880d681SAndroid Build Coastguard Worker 
25*9880d681SAndroid Build Coastguard Worker using namespace llvm;
26*9880d681SAndroid Build Coastguard Worker 
27*9880d681SAndroid Build Coastguard Worker namespace llvm {
28*9880d681SAndroid Build Coastguard Worker template<>
29*9880d681SAndroid Build Coastguard Worker struct DOTGraphTraits<DomTreeNode*> : public DefaultDOTGraphTraits {
30*9880d681SAndroid Build Coastguard Worker 
DOTGraphTraitsllvm::DOTGraphTraits31*9880d681SAndroid Build Coastguard Worker   DOTGraphTraits (bool isSimple=false)
32*9880d681SAndroid Build Coastguard Worker     : DefaultDOTGraphTraits(isSimple) {}
33*9880d681SAndroid Build Coastguard Worker 
getNodeLabelllvm::DOTGraphTraits34*9880d681SAndroid Build Coastguard Worker   std::string getNodeLabel(DomTreeNode *Node, DomTreeNode *Graph) {
35*9880d681SAndroid Build Coastguard Worker 
36*9880d681SAndroid Build Coastguard Worker     BasicBlock *BB = Node->getBlock();
37*9880d681SAndroid Build Coastguard Worker 
38*9880d681SAndroid Build Coastguard Worker     if (!BB)
39*9880d681SAndroid Build Coastguard Worker       return "Post dominance root node";
40*9880d681SAndroid Build Coastguard Worker 
41*9880d681SAndroid Build Coastguard Worker 
42*9880d681SAndroid Build Coastguard Worker     if (isSimple())
43*9880d681SAndroid Build Coastguard Worker       return DOTGraphTraits<const Function*>
44*9880d681SAndroid Build Coastguard Worker         ::getSimpleNodeLabel(BB, BB->getParent());
45*9880d681SAndroid Build Coastguard Worker     else
46*9880d681SAndroid Build Coastguard Worker       return DOTGraphTraits<const Function*>
47*9880d681SAndroid Build Coastguard Worker         ::getCompleteNodeLabel(BB, BB->getParent());
48*9880d681SAndroid Build Coastguard Worker   }
49*9880d681SAndroid Build Coastguard Worker };
50*9880d681SAndroid Build Coastguard Worker 
51*9880d681SAndroid Build Coastguard Worker template<>
52*9880d681SAndroid Build Coastguard Worker struct DOTGraphTraits<DominatorTree*> : public DOTGraphTraits<DomTreeNode*> {
53*9880d681SAndroid Build Coastguard Worker 
DOTGraphTraitsllvm::DOTGraphTraits54*9880d681SAndroid Build Coastguard Worker   DOTGraphTraits (bool isSimple=false)
55*9880d681SAndroid Build Coastguard Worker     : DOTGraphTraits<DomTreeNode*>(isSimple) {}
56*9880d681SAndroid Build Coastguard Worker 
getGraphNamellvm::DOTGraphTraits57*9880d681SAndroid Build Coastguard Worker   static std::string getGraphName(DominatorTree *DT) {
58*9880d681SAndroid Build Coastguard Worker     return "Dominator tree";
59*9880d681SAndroid Build Coastguard Worker   }
60*9880d681SAndroid Build Coastguard Worker 
getNodeLabelllvm::DOTGraphTraits61*9880d681SAndroid Build Coastguard Worker   std::string getNodeLabel(DomTreeNode *Node, DominatorTree *G) {
62*9880d681SAndroid Build Coastguard Worker     return DOTGraphTraits<DomTreeNode*>::getNodeLabel(Node, G->getRootNode());
63*9880d681SAndroid Build Coastguard Worker   }
64*9880d681SAndroid Build Coastguard Worker };
65*9880d681SAndroid Build Coastguard Worker 
66*9880d681SAndroid Build Coastguard Worker template<>
67*9880d681SAndroid Build Coastguard Worker struct DOTGraphTraits<PostDominatorTree*>
68*9880d681SAndroid Build Coastguard Worker   : public DOTGraphTraits<DomTreeNode*> {
69*9880d681SAndroid Build Coastguard Worker 
DOTGraphTraitsllvm::DOTGraphTraits70*9880d681SAndroid Build Coastguard Worker   DOTGraphTraits (bool isSimple=false)
71*9880d681SAndroid Build Coastguard Worker     : DOTGraphTraits<DomTreeNode*>(isSimple) {}
72*9880d681SAndroid Build Coastguard Worker 
getGraphNamellvm::DOTGraphTraits73*9880d681SAndroid Build Coastguard Worker   static std::string getGraphName(PostDominatorTree *DT) {
74*9880d681SAndroid Build Coastguard Worker     return "Post dominator tree";
75*9880d681SAndroid Build Coastguard Worker   }
76*9880d681SAndroid Build Coastguard Worker 
getNodeLabelllvm::DOTGraphTraits77*9880d681SAndroid Build Coastguard Worker   std::string getNodeLabel(DomTreeNode *Node, PostDominatorTree *G ) {
78*9880d681SAndroid Build Coastguard Worker     return DOTGraphTraits<DomTreeNode*>::getNodeLabel(Node, G->getRootNode());
79*9880d681SAndroid Build Coastguard Worker   }
80*9880d681SAndroid Build Coastguard Worker };
81*9880d681SAndroid Build Coastguard Worker }
82*9880d681SAndroid Build Coastguard Worker 
83*9880d681SAndroid Build Coastguard Worker namespace {
84*9880d681SAndroid Build Coastguard Worker struct DominatorTreeWrapperPassAnalysisGraphTraits {
getGraph__anonc7c14b1f0111::DominatorTreeWrapperPassAnalysisGraphTraits85*9880d681SAndroid Build Coastguard Worker   static DominatorTree *getGraph(DominatorTreeWrapperPass *DTWP) {
86*9880d681SAndroid Build Coastguard Worker     return &DTWP->getDomTree();
87*9880d681SAndroid Build Coastguard Worker   }
88*9880d681SAndroid Build Coastguard Worker };
89*9880d681SAndroid Build Coastguard Worker 
90*9880d681SAndroid Build Coastguard Worker struct DomViewer : public DOTGraphTraitsViewer<
91*9880d681SAndroid Build Coastguard Worker                        DominatorTreeWrapperPass, false, DominatorTree *,
92*9880d681SAndroid Build Coastguard Worker                        DominatorTreeWrapperPassAnalysisGraphTraits> {
93*9880d681SAndroid Build Coastguard Worker   static char ID;
DomViewer__anonc7c14b1f0111::DomViewer94*9880d681SAndroid Build Coastguard Worker   DomViewer()
95*9880d681SAndroid Build Coastguard Worker       : DOTGraphTraitsViewer<DominatorTreeWrapperPass, false, DominatorTree *,
96*9880d681SAndroid Build Coastguard Worker                              DominatorTreeWrapperPassAnalysisGraphTraits>(
97*9880d681SAndroid Build Coastguard Worker             "dom", ID) {
98*9880d681SAndroid Build Coastguard Worker     initializeDomViewerPass(*PassRegistry::getPassRegistry());
99*9880d681SAndroid Build Coastguard Worker   }
100*9880d681SAndroid Build Coastguard Worker };
101*9880d681SAndroid Build Coastguard Worker 
102*9880d681SAndroid Build Coastguard Worker struct DomOnlyViewer : public DOTGraphTraitsViewer<
103*9880d681SAndroid Build Coastguard Worker                            DominatorTreeWrapperPass, true, DominatorTree *,
104*9880d681SAndroid Build Coastguard Worker                            DominatorTreeWrapperPassAnalysisGraphTraits> {
105*9880d681SAndroid Build Coastguard Worker   static char ID;
DomOnlyViewer__anonc7c14b1f0111::DomOnlyViewer106*9880d681SAndroid Build Coastguard Worker   DomOnlyViewer()
107*9880d681SAndroid Build Coastguard Worker       : DOTGraphTraitsViewer<DominatorTreeWrapperPass, true, DominatorTree *,
108*9880d681SAndroid Build Coastguard Worker                              DominatorTreeWrapperPassAnalysisGraphTraits>(
109*9880d681SAndroid Build Coastguard Worker             "domonly", ID) {
110*9880d681SAndroid Build Coastguard Worker     initializeDomOnlyViewerPass(*PassRegistry::getPassRegistry());
111*9880d681SAndroid Build Coastguard Worker   }
112*9880d681SAndroid Build Coastguard Worker };
113*9880d681SAndroid Build Coastguard Worker 
114*9880d681SAndroid Build Coastguard Worker struct PostDominatorTreeWrapperPassAnalysisGraphTraits {
getGraph__anonc7c14b1f0111::PostDominatorTreeWrapperPassAnalysisGraphTraits115*9880d681SAndroid Build Coastguard Worker   static PostDominatorTree *getGraph(PostDominatorTreeWrapperPass *PDTWP) {
116*9880d681SAndroid Build Coastguard Worker     return &PDTWP->getPostDomTree();
117*9880d681SAndroid Build Coastguard Worker   }
118*9880d681SAndroid Build Coastguard Worker };
119*9880d681SAndroid Build Coastguard Worker 
120*9880d681SAndroid Build Coastguard Worker struct PostDomViewer : public DOTGraphTraitsViewer<
121*9880d681SAndroid Build Coastguard Worker                           PostDominatorTreeWrapperPass, false,
122*9880d681SAndroid Build Coastguard Worker                           PostDominatorTree *,
123*9880d681SAndroid Build Coastguard Worker                           PostDominatorTreeWrapperPassAnalysisGraphTraits> {
124*9880d681SAndroid Build Coastguard Worker   static char ID;
PostDomViewer__anonc7c14b1f0111::PostDomViewer125*9880d681SAndroid Build Coastguard Worker   PostDomViewer() :
126*9880d681SAndroid Build Coastguard Worker     DOTGraphTraitsViewer<PostDominatorTreeWrapperPass, false,
127*9880d681SAndroid Build Coastguard Worker                          PostDominatorTree *,
128*9880d681SAndroid Build Coastguard Worker                          PostDominatorTreeWrapperPassAnalysisGraphTraits>(
129*9880d681SAndroid Build Coastguard Worker         "postdom", ID){
130*9880d681SAndroid Build Coastguard Worker       initializePostDomViewerPass(*PassRegistry::getPassRegistry());
131*9880d681SAndroid Build Coastguard Worker     }
132*9880d681SAndroid Build Coastguard Worker };
133*9880d681SAndroid Build Coastguard Worker 
134*9880d681SAndroid Build Coastguard Worker struct PostDomOnlyViewer : public DOTGraphTraitsViewer<
135*9880d681SAndroid Build Coastguard Worker                             PostDominatorTreeWrapperPass, true,
136*9880d681SAndroid Build Coastguard Worker                             PostDominatorTree *,
137*9880d681SAndroid Build Coastguard Worker                             PostDominatorTreeWrapperPassAnalysisGraphTraits> {
138*9880d681SAndroid Build Coastguard Worker   static char ID;
PostDomOnlyViewer__anonc7c14b1f0111::PostDomOnlyViewer139*9880d681SAndroid Build Coastguard Worker   PostDomOnlyViewer() :
140*9880d681SAndroid Build Coastguard Worker     DOTGraphTraitsViewer<PostDominatorTreeWrapperPass, true,
141*9880d681SAndroid Build Coastguard Worker                          PostDominatorTree *,
142*9880d681SAndroid Build Coastguard Worker                          PostDominatorTreeWrapperPassAnalysisGraphTraits>(
143*9880d681SAndroid Build Coastguard Worker         "postdomonly", ID){
144*9880d681SAndroid Build Coastguard Worker       initializePostDomOnlyViewerPass(*PassRegistry::getPassRegistry());
145*9880d681SAndroid Build Coastguard Worker     }
146*9880d681SAndroid Build Coastguard Worker };
147*9880d681SAndroid Build Coastguard Worker } // end anonymous namespace
148*9880d681SAndroid Build Coastguard Worker 
149*9880d681SAndroid Build Coastguard Worker char DomViewer::ID = 0;
150*9880d681SAndroid Build Coastguard Worker INITIALIZE_PASS(DomViewer, "view-dom",
151*9880d681SAndroid Build Coastguard Worker                 "View dominance tree of function", false, false)
152*9880d681SAndroid Build Coastguard Worker 
153*9880d681SAndroid Build Coastguard Worker char DomOnlyViewer::ID = 0;
154*9880d681SAndroid Build Coastguard Worker INITIALIZE_PASS(DomOnlyViewer, "view-dom-only",
155*9880d681SAndroid Build Coastguard Worker                 "View dominance tree of function (with no function bodies)",
156*9880d681SAndroid Build Coastguard Worker                 false, false)
157*9880d681SAndroid Build Coastguard Worker 
158*9880d681SAndroid Build Coastguard Worker char PostDomViewer::ID = 0;
159*9880d681SAndroid Build Coastguard Worker INITIALIZE_PASS(PostDomViewer, "view-postdom",
160*9880d681SAndroid Build Coastguard Worker                 "View postdominance tree of function", false, false)
161*9880d681SAndroid Build Coastguard Worker 
162*9880d681SAndroid Build Coastguard Worker char PostDomOnlyViewer::ID = 0;
163*9880d681SAndroid Build Coastguard Worker INITIALIZE_PASS(PostDomOnlyViewer, "view-postdom-only",
164*9880d681SAndroid Build Coastguard Worker                 "View postdominance tree of function "
165*9880d681SAndroid Build Coastguard Worker                 "(with no function bodies)",
166*9880d681SAndroid Build Coastguard Worker                 false, false)
167*9880d681SAndroid Build Coastguard Worker 
168*9880d681SAndroid Build Coastguard Worker namespace {
169*9880d681SAndroid Build Coastguard Worker struct DomPrinter : public DOTGraphTraitsPrinter<
170*9880d681SAndroid Build Coastguard Worker                         DominatorTreeWrapperPass, false, DominatorTree *,
171*9880d681SAndroid Build Coastguard Worker                         DominatorTreeWrapperPassAnalysisGraphTraits> {
172*9880d681SAndroid Build Coastguard Worker   static char ID;
DomPrinter__anonc7c14b1f0211::DomPrinter173*9880d681SAndroid Build Coastguard Worker   DomPrinter()
174*9880d681SAndroid Build Coastguard Worker       : DOTGraphTraitsPrinter<DominatorTreeWrapperPass, false, DominatorTree *,
175*9880d681SAndroid Build Coastguard Worker                               DominatorTreeWrapperPassAnalysisGraphTraits>(
176*9880d681SAndroid Build Coastguard Worker             "dom", ID) {
177*9880d681SAndroid Build Coastguard Worker     initializeDomPrinterPass(*PassRegistry::getPassRegistry());
178*9880d681SAndroid Build Coastguard Worker   }
179*9880d681SAndroid Build Coastguard Worker };
180*9880d681SAndroid Build Coastguard Worker 
181*9880d681SAndroid Build Coastguard Worker struct DomOnlyPrinter : public DOTGraphTraitsPrinter<
182*9880d681SAndroid Build Coastguard Worker                             DominatorTreeWrapperPass, true, DominatorTree *,
183*9880d681SAndroid Build Coastguard Worker                             DominatorTreeWrapperPassAnalysisGraphTraits> {
184*9880d681SAndroid Build Coastguard Worker   static char ID;
DomOnlyPrinter__anonc7c14b1f0211::DomOnlyPrinter185*9880d681SAndroid Build Coastguard Worker   DomOnlyPrinter()
186*9880d681SAndroid Build Coastguard Worker       : DOTGraphTraitsPrinter<DominatorTreeWrapperPass, true, DominatorTree *,
187*9880d681SAndroid Build Coastguard Worker                               DominatorTreeWrapperPassAnalysisGraphTraits>(
188*9880d681SAndroid Build Coastguard Worker             "domonly", ID) {
189*9880d681SAndroid Build Coastguard Worker     initializeDomOnlyPrinterPass(*PassRegistry::getPassRegistry());
190*9880d681SAndroid Build Coastguard Worker   }
191*9880d681SAndroid Build Coastguard Worker };
192*9880d681SAndroid Build Coastguard Worker 
193*9880d681SAndroid Build Coastguard Worker struct PostDomPrinter
194*9880d681SAndroid Build Coastguard Worker   : public DOTGraphTraitsPrinter<
195*9880d681SAndroid Build Coastguard Worker                             PostDominatorTreeWrapperPass, false,
196*9880d681SAndroid Build Coastguard Worker                             PostDominatorTree *,
197*9880d681SAndroid Build Coastguard Worker                             PostDominatorTreeWrapperPassAnalysisGraphTraits> {
198*9880d681SAndroid Build Coastguard Worker   static char ID;
PostDomPrinter__anonc7c14b1f0211::PostDomPrinter199*9880d681SAndroid Build Coastguard Worker   PostDomPrinter() :
200*9880d681SAndroid Build Coastguard Worker     DOTGraphTraitsPrinter<PostDominatorTreeWrapperPass, false,
201*9880d681SAndroid Build Coastguard Worker                           PostDominatorTree *,
202*9880d681SAndroid Build Coastguard Worker                           PostDominatorTreeWrapperPassAnalysisGraphTraits>(
203*9880d681SAndroid Build Coastguard Worker         "postdom", ID) {
204*9880d681SAndroid Build Coastguard Worker       initializePostDomPrinterPass(*PassRegistry::getPassRegistry());
205*9880d681SAndroid Build Coastguard Worker     }
206*9880d681SAndroid Build Coastguard Worker };
207*9880d681SAndroid Build Coastguard Worker 
208*9880d681SAndroid Build Coastguard Worker struct PostDomOnlyPrinter
209*9880d681SAndroid Build Coastguard Worker   : public DOTGraphTraitsPrinter<
210*9880d681SAndroid Build Coastguard Worker                             PostDominatorTreeWrapperPass, true,
211*9880d681SAndroid Build Coastguard Worker                             PostDominatorTree *,
212*9880d681SAndroid Build Coastguard Worker                             PostDominatorTreeWrapperPassAnalysisGraphTraits> {
213*9880d681SAndroid Build Coastguard Worker   static char ID;
PostDomOnlyPrinter__anonc7c14b1f0211::PostDomOnlyPrinter214*9880d681SAndroid Build Coastguard Worker   PostDomOnlyPrinter() :
215*9880d681SAndroid Build Coastguard Worker     DOTGraphTraitsPrinter<PostDominatorTreeWrapperPass, true,
216*9880d681SAndroid Build Coastguard Worker                           PostDominatorTree *,
217*9880d681SAndroid Build Coastguard Worker                           PostDominatorTreeWrapperPassAnalysisGraphTraits>(
218*9880d681SAndroid Build Coastguard Worker         "postdomonly", ID) {
219*9880d681SAndroid Build Coastguard Worker       initializePostDomOnlyPrinterPass(*PassRegistry::getPassRegistry());
220*9880d681SAndroid Build Coastguard Worker     }
221*9880d681SAndroid Build Coastguard Worker };
222*9880d681SAndroid Build Coastguard Worker } // end anonymous namespace
223*9880d681SAndroid Build Coastguard Worker 
224*9880d681SAndroid Build Coastguard Worker 
225*9880d681SAndroid Build Coastguard Worker 
226*9880d681SAndroid Build Coastguard Worker char DomPrinter::ID = 0;
227*9880d681SAndroid Build Coastguard Worker INITIALIZE_PASS(DomPrinter, "dot-dom",
228*9880d681SAndroid Build Coastguard Worker                 "Print dominance tree of function to 'dot' file",
229*9880d681SAndroid Build Coastguard Worker                 false, false)
230*9880d681SAndroid Build Coastguard Worker 
231*9880d681SAndroid Build Coastguard Worker char DomOnlyPrinter::ID = 0;
232*9880d681SAndroid Build Coastguard Worker INITIALIZE_PASS(DomOnlyPrinter, "dot-dom-only",
233*9880d681SAndroid Build Coastguard Worker                 "Print dominance tree of function to 'dot' file "
234*9880d681SAndroid Build Coastguard Worker                 "(with no function bodies)",
235*9880d681SAndroid Build Coastguard Worker                 false, false)
236*9880d681SAndroid Build Coastguard Worker 
237*9880d681SAndroid Build Coastguard Worker char PostDomPrinter::ID = 0;
238*9880d681SAndroid Build Coastguard Worker INITIALIZE_PASS(PostDomPrinter, "dot-postdom",
239*9880d681SAndroid Build Coastguard Worker                 "Print postdominance tree of function to 'dot' file",
240*9880d681SAndroid Build Coastguard Worker                 false, false)
241*9880d681SAndroid Build Coastguard Worker 
242*9880d681SAndroid Build Coastguard Worker char PostDomOnlyPrinter::ID = 0;
243*9880d681SAndroid Build Coastguard Worker INITIALIZE_PASS(PostDomOnlyPrinter, "dot-postdom-only",
244*9880d681SAndroid Build Coastguard Worker                 "Print postdominance tree of function to 'dot' file "
245*9880d681SAndroid Build Coastguard Worker                 "(with no function bodies)",
246*9880d681SAndroid Build Coastguard Worker                 false, false)
247*9880d681SAndroid Build Coastguard Worker 
248*9880d681SAndroid Build Coastguard Worker // Create methods available outside of this file, to use them
249*9880d681SAndroid Build Coastguard Worker // "include/llvm/LinkAllPasses.h". Otherwise the pass would be deleted by
250*9880d681SAndroid Build Coastguard Worker // the link time optimization.
251*9880d681SAndroid Build Coastguard Worker 
createDomPrinterPass()252*9880d681SAndroid Build Coastguard Worker FunctionPass *llvm::createDomPrinterPass() {
253*9880d681SAndroid Build Coastguard Worker   return new DomPrinter();
254*9880d681SAndroid Build Coastguard Worker }
255*9880d681SAndroid Build Coastguard Worker 
createDomOnlyPrinterPass()256*9880d681SAndroid Build Coastguard Worker FunctionPass *llvm::createDomOnlyPrinterPass() {
257*9880d681SAndroid Build Coastguard Worker   return new DomOnlyPrinter();
258*9880d681SAndroid Build Coastguard Worker }
259*9880d681SAndroid Build Coastguard Worker 
createDomViewerPass()260*9880d681SAndroid Build Coastguard Worker FunctionPass *llvm::createDomViewerPass() {
261*9880d681SAndroid Build Coastguard Worker   return new DomViewer();
262*9880d681SAndroid Build Coastguard Worker }
263*9880d681SAndroid Build Coastguard Worker 
createDomOnlyViewerPass()264*9880d681SAndroid Build Coastguard Worker FunctionPass *llvm::createDomOnlyViewerPass() {
265*9880d681SAndroid Build Coastguard Worker   return new DomOnlyViewer();
266*9880d681SAndroid Build Coastguard Worker }
267*9880d681SAndroid Build Coastguard Worker 
createPostDomPrinterPass()268*9880d681SAndroid Build Coastguard Worker FunctionPass *llvm::createPostDomPrinterPass() {
269*9880d681SAndroid Build Coastguard Worker   return new PostDomPrinter();
270*9880d681SAndroid Build Coastguard Worker }
271*9880d681SAndroid Build Coastguard Worker 
createPostDomOnlyPrinterPass()272*9880d681SAndroid Build Coastguard Worker FunctionPass *llvm::createPostDomOnlyPrinterPass() {
273*9880d681SAndroid Build Coastguard Worker   return new PostDomOnlyPrinter();
274*9880d681SAndroid Build Coastguard Worker }
275*9880d681SAndroid Build Coastguard Worker 
createPostDomViewerPass()276*9880d681SAndroid Build Coastguard Worker FunctionPass *llvm::createPostDomViewerPass() {
277*9880d681SAndroid Build Coastguard Worker   return new PostDomViewer();
278*9880d681SAndroid Build Coastguard Worker }
279*9880d681SAndroid Build Coastguard Worker 
createPostDomOnlyViewerPass()280*9880d681SAndroid Build Coastguard Worker FunctionPass *llvm::createPostDomOnlyViewerPass() {
281*9880d681SAndroid Build Coastguard Worker   return new PostDomOnlyViewer();
282*9880d681SAndroid Build Coastguard Worker }
283