|
19 | 19 |
|
20 | 20 | #include "llvm/Analysis/CFGPrinter.h"
|
21 | 21 | #include "llvm/ADT/PostOrderIterator.h"
|
22 |
| -#include "llvm/InitializePasses.h" |
23 |
| -#include "llvm/Pass.h" |
24 | 22 | #include "llvm/Support/CommandLine.h"
|
25 | 23 | #include "llvm/Support/FileSystem.h"
|
26 | 24 | #include "llvm/Support/GraphWriter.h"
|
@@ -111,37 +109,6 @@ PreservedAnalyses CFGOnlyViewerPass::run(Function &F,
|
111 | 109 | return PreservedAnalyses::all();
|
112 | 110 | }
|
113 | 111 |
|
114 |
| -namespace { |
115 |
| -struct CFGPrinterLegacyPass : public FunctionPass { |
116 |
| - static char ID; // Pass identification, replacement for typeid |
117 |
| - CFGPrinterLegacyPass() : FunctionPass(ID) { |
118 |
| - initializeCFGPrinterLegacyPassPass(*PassRegistry::getPassRegistry()); |
119 |
| - } |
120 |
| - |
121 |
| - bool runOnFunction(Function &F) override { |
122 |
| - if (!CFGFuncName.empty() && !F.getName().contains(CFGFuncName)) |
123 |
| - return false; |
124 |
| - auto *BPI = &getAnalysis<BranchProbabilityInfoWrapperPass>().getBPI(); |
125 |
| - auto *BFI = &getAnalysis<BlockFrequencyInfoWrapperPass>().getBFI(); |
126 |
| - writeCFGToDotFile(F, BFI, BPI, getMaxFreq(F, BFI)); |
127 |
| - return false; |
128 |
| - } |
129 |
| - |
130 |
| - void print(raw_ostream &OS, const Module * = nullptr) const override {} |
131 |
| - |
132 |
| - void getAnalysisUsage(AnalysisUsage &AU) const override { |
133 |
| - FunctionPass::getAnalysisUsage(AU); |
134 |
| - AU.addRequired<BlockFrequencyInfoWrapperPass>(); |
135 |
| - AU.addRequired<BranchProbabilityInfoWrapperPass>(); |
136 |
| - AU.setPreservesAll(); |
137 |
| - } |
138 |
| -}; |
139 |
| -} // namespace |
140 |
| - |
141 |
| -char CFGPrinterLegacyPass::ID = 0; |
142 |
| -INITIALIZE_PASS(CFGPrinterLegacyPass, "dot-cfg", |
143 |
| - "Print CFG of function to 'dot' file", false, true) |
144 |
| - |
145 | 112 | PreservedAnalyses CFGPrinterPass::run(Function &F,
|
146 | 113 | FunctionAnalysisManager &AM) {
|
147 | 114 | if (!CFGFuncName.empty() && !F.getName().contains(CFGFuncName))
|
@@ -189,10 +156,6 @@ void Function::viewCFGOnly(const BlockFrequencyInfo *BFI,
|
189 | 156 | viewCFG(true, BFI, BPI);
|
190 | 157 | }
|
191 | 158 |
|
192 |
| -FunctionPass *llvm::createCFGPrinterLegacyPassPass() { |
193 |
| - return new CFGPrinterLegacyPass(); |
194 |
| -} |
195 |
| - |
196 | 159 | /// Find all blocks on the paths which terminate with a deoptimize or
|
197 | 160 | /// unreachable (i.e. all blocks which are post-dominated by a deoptimize
|
198 | 161 | /// or unreachable). These paths are hidden if the corresponding cl::opts
|
|
0 commit comments