LLVM: lib/Analysis/DomPrinter.cpp Source File (original) (raw)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
24
25using namespace llvm;
26
27
29#ifndef NDEBUG
30 ViewGraph(this, Name, false, Title);
31#else
32 errs() << "DomTree dump not available, build with DEBUG\n";
33#endif
34}
35
37#ifndef NDEBUG
38 this->viewGraph("domtree", "Dominator Tree for function");
39#else
40 errs() << "DomTree dump not available, build with DEBUG\n";
41#endif
42}
43
44namespace {
45struct LegacyDominatorTreeWrapperPassAnalysisGraphTraits {
48 }
49};
50
51struct DomViewerWrapperPass
53 DominatorTreeWrapperPass, false, DominatorTree *,
54 LegacyDominatorTreeWrapperPassAnalysisGraphTraits> {
55 static char ID;
56 DomViewerWrapperPass()
57 : DOTGraphTraitsViewerWrapperPass<
58 DominatorTreeWrapperPass, false, DominatorTree *,
59 LegacyDominatorTreeWrapperPassAnalysisGraphTraits>("dom", ID) {}
60};
61
62struct DomOnlyViewerWrapperPass
64 DominatorTreeWrapperPass, true, DominatorTree *,
65 LegacyDominatorTreeWrapperPassAnalysisGraphTraits> {
66 static char ID;
67 DomOnlyViewerWrapperPass()
68 : DOTGraphTraitsViewerWrapperPass<
69 DominatorTreeWrapperPass, true, DominatorTree *,
70 LegacyDominatorTreeWrapperPassAnalysisGraphTraits>("domonly", ID) {}
71};
72
73struct LegacyPostDominatorTreeWrapperPassAnalysisGraphTraits {
74 static PostDominatorTree *getGraph(PostDominatorTreeWrapperPass *PDTWP) {
76 }
77};
78
79struct PostDomViewerWrapperPass
81 PostDominatorTreeWrapperPass, false, PostDominatorTree *,
82 LegacyPostDominatorTreeWrapperPassAnalysisGraphTraits> {
83 static char ID;
84 PostDomViewerWrapperPass()
85 : DOTGraphTraitsViewerWrapperPass<
86 PostDominatorTreeWrapperPass, false, PostDominatorTree *,
87 LegacyPostDominatorTreeWrapperPassAnalysisGraphTraits>("postdom",
88 ID) {}
89};
90
91struct PostDomOnlyViewerWrapperPass
93 PostDominatorTreeWrapperPass, true, PostDominatorTree *,
94 LegacyPostDominatorTreeWrapperPassAnalysisGraphTraits> {
95 static char ID;
96 PostDomOnlyViewerWrapperPass()
97 : DOTGraphTraitsViewerWrapperPass<
98 PostDominatorTreeWrapperPass, true, PostDominatorTree *,
99 LegacyPostDominatorTreeWrapperPassAnalysisGraphTraits>(
100 "postdomonly", ID) {}
101};
102}
103
104char DomViewerWrapperPass::ID = 0;
106 "View dominance tree of function", false, false)
107
108char DomOnlyViewerWrapperPass::ID = 0;
109INITIALIZE_PASS(DomOnlyViewerWrapperPass, "view-dom-only",
110 "View dominance tree of function (with no function bodies)",
111 false, false)
112
113char PostDomViewerWrapperPass::ID = 0;
115 "View postdominance tree of function", false, false)
116
117char PostDomOnlyViewerWrapperPass::ID = 0;
119 "View postdominance tree of function "
120 "(with no function bodies)",
122
123namespace {
124struct DomPrinterWrapperPass
126 DominatorTreeWrapperPass, false, DominatorTree *,
127 LegacyDominatorTreeWrapperPassAnalysisGraphTraits> {
128 static char ID;
129 DomPrinterWrapperPass()
132 LegacyDominatorTreeWrapperPassAnalysisGraphTraits>("dom", ID) {}
133};
134
135struct DomOnlyPrinterWrapperPass
137 DominatorTreeWrapperPass, true, DominatorTree *,
138 LegacyDominatorTreeWrapperPassAnalysisGraphTraits> {
139 static char ID;
140 DomOnlyPrinterWrapperPass()
143 LegacyDominatorTreeWrapperPassAnalysisGraphTraits>("domonly", ID) {}
144};
145
146struct PostDomPrinterWrapperPass
148 PostDominatorTreeWrapperPass, false, PostDominatorTree *,
149 LegacyPostDominatorTreeWrapperPassAnalysisGraphTraits> {
150 static char ID;
151 PostDomPrinterWrapperPass()
154 LegacyPostDominatorTreeWrapperPassAnalysisGraphTraits>("postdom",
155 ID) {}
156};
157
158struct PostDomOnlyPrinterWrapperPass
160 PostDominatorTreeWrapperPass, true, PostDominatorTree *,
161 LegacyPostDominatorTreeWrapperPassAnalysisGraphTraits> {
162 static char ID;
163 PostDomOnlyPrinterWrapperPass()
166 LegacyPostDominatorTreeWrapperPassAnalysisGraphTraits>(
167 "postdomonly", ID) {}
168};
169}
170
171char DomPrinterWrapperPass::ID = 0;
173 "Print dominance tree of function to 'dot' file", false, false)
174
175char DomOnlyPrinterWrapperPass::ID = 0;
176INITIALIZE_PASS(DomOnlyPrinterWrapperPass, "dot-dom-only",
177 "Print dominance tree of function to 'dot' file "
178 "(with no function bodies)",
179 false, false)
180
181char PostDomPrinterWrapperPass::ID = 0;
183 "Print postdominance tree of function to 'dot' file", false,
184 false)
185
186char PostDomOnlyPrinterWrapperPass::ID = 0;
188 "Print postdominance tree of function to 'dot' file "
189 "(with no function bodies)",
191
192
193
194
195
197 return new DomPrinterWrapperPass();
198}
199
201 return new DomOnlyPrinterWrapperPass();
202}
203
205 return new DomViewerWrapperPass();
206}
207
209 return new DomOnlyViewerWrapperPass();
210}
211
213 return new PostDomPrinterWrapperPass();
214}
215
217 return new PostDomOnlyPrinterWrapperPass();
218}
219
221 return new PostDomViewerWrapperPass();
222}
223
225 return new PostDomOnlyViewerWrapperPass();
226}
Function Alias Analysis false
#define INITIALIZE_PASS(passName, arg, name, cfg, analysis)
Legacy analysis pass which computes a DominatorTree.
DominatorTree & getDomTree()
Concrete subclass of DominatorTreeBase that is used to compute a normal dominator tree.
LLVM_ABI void viewGraph()
Definition DomPrinter.cpp:36
FunctionPass class - This class is used to implement most global optimizations.
PostDominatorTree Class - Concrete subclass of DominatorTree that is used to compute the post-dominat...
Twine - A lightweight data structure for efficiently representing the concatenation of temporary valu...
unsigned ID
LLVM IR allows to use arbitrary numbers as calling convention identifiers.
This is an optimization pass for GlobalISel generic memory operations.
LLVM_ABI FunctionPass * createDomOnlyPrinterWrapperPassPass()
Definition DomPrinter.cpp:200
LLVM_ABI FunctionPass * createPostDomOnlyViewerWrapperPassPass()
Definition DomPrinter.cpp:224
LLVM_ABI FunctionPass * createPostDomViewerWrapperPassPass()
Definition DomPrinter.cpp:220
LLVM_ABI FunctionPass * createDomPrinterWrapperPassPass()
LLVM_ABI FunctionPass * createPostDomOnlyPrinterWrapperPassPass()
Definition DomPrinter.cpp:216
LLVM_ABI raw_fd_ostream & errs()
This returns a reference to a raw_ostream for standard error.
LLVM_ABI FunctionPass * createDomOnlyViewerWrapperPassPass()
Definition DomPrinter.cpp:208
void ViewGraph(const GraphType &G, const Twine &Name, bool ShortNames=false, const Twine &Title="", GraphProgram::Name Program=GraphProgram::DOT)
ViewGraph - Emit a dot graph, run 'dot', run gv on the postscript file, then cleanup.
LLVM_ABI FunctionPass * createPostDomPrinterWrapperPassPass()
Definition DomPrinter.cpp:212
LLVM_ABI FunctionPass * createDomViewerWrapperPassPass()
Definition DomPrinter.cpp:204
PostDominatorTree & getPostDomTree()