summaryrefslogtreecommitdiff
path: root/lib/Analysis/DominanceFrontier.cpp
diff options
context:
space:
mode:
authorHongbin Zheng <etherzhhb@gmail.com>2016-02-25 16:45:46 +0000
committerHongbin Zheng <etherzhhb@gmail.com>2016-02-25 16:45:46 +0000
commit173d9faa779684171f3bf4d2f5968932cf369b22 (patch)
treefed594a802bedd7d7cee4f9ef3479caed8dd422f /lib/Analysis/DominanceFrontier.cpp
parentf5f73cd4ca1176a9fcc638374c4ef65c55a67088 (diff)
Revert "Introduce DominanceFrontierAnalysis to the new PassManager to compute DominanceFrontier. NFC"
This reverts commit 109c38b2226a87b0be73fa7a0a8c1a81df20aeb2. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@261890 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/Analysis/DominanceFrontier.cpp')
-rw-r--r--lib/Analysis/DominanceFrontier.cpp50
1 files changed, 15 insertions, 35 deletions
diff --git a/lib/Analysis/DominanceFrontier.cpp b/lib/Analysis/DominanceFrontier.cpp
index ef7062da775..90e7fd00dba 100644
--- a/lib/Analysis/DominanceFrontier.cpp
+++ b/lib/Analysis/DominanceFrontier.cpp
@@ -9,7 +9,6 @@
#include "llvm/Analysis/DominanceFrontier.h"
#include "llvm/Analysis/DominanceFrontierImpl.h"
-#include "llvm/IR/PassManager.h"
using namespace llvm;
@@ -18,60 +17,41 @@ template class DominanceFrontierBase<BasicBlock>;
template class ForwardDominanceFrontierBase<BasicBlock>;
}
-char DominanceFrontierWrapperPass::ID = 0;
+char DominanceFrontier::ID = 0;
-INITIALIZE_PASS_BEGIN(DominanceFrontierWrapperPass, "domfrontier",
+INITIALIZE_PASS_BEGIN(DominanceFrontier, "domfrontier",
"Dominance Frontier Construction", true, true)
INITIALIZE_PASS_DEPENDENCY(DominatorTreeWrapperPass)
-INITIALIZE_PASS_END(DominanceFrontierWrapperPass, "domfrontier",
+INITIALIZE_PASS_END(DominanceFrontier, "domfrontier",
"Dominance Frontier Construction", true, true)
- DominanceFrontierWrapperPass::DominanceFrontierWrapperPass()
- : FunctionPass(ID), DF() {
- initializeDominanceFrontierWrapperPassPass(*PassRegistry::getPassRegistry());
+DominanceFrontier::DominanceFrontier()
+ : FunctionPass(ID),
+ Base() {
+ initializeDominanceFrontierPass(*PassRegistry::getPassRegistry());
}
-void DominanceFrontierWrapperPass::releaseMemory() {
- DF.releaseMemory();
+void DominanceFrontier::releaseMemory() {
+ Base.releaseMemory();
}
-bool DominanceFrontierWrapperPass::runOnFunction(Function &) {
+bool DominanceFrontier::runOnFunction(Function &) {
releaseMemory();
- DF.analyze(getAnalysis<DominatorTreeWrapperPass>().getDomTree());
+ Base.analyze(getAnalysis<DominatorTreeWrapperPass>().getDomTree());
return false;
}
-void DominanceFrontierWrapperPass::getAnalysisUsage(AnalysisUsage &AU) const {
+void DominanceFrontier::getAnalysisUsage(AnalysisUsage &AU) const {
AU.setPreservesAll();
AU.addRequired<DominatorTreeWrapperPass>();
}
-void DominanceFrontierWrapperPass::print(raw_ostream &OS, const Module *) const {
- DF.print(OS);
+void DominanceFrontier::print(raw_ostream &OS, const Module *) const {
+ Base.print(OS);
}
#if !defined(NDEBUG) || defined(LLVM_ENABLE_DUMP)
-LLVM_DUMP_METHOD void DominanceFrontierWrapperPass::dump() const {
+LLVM_DUMP_METHOD void DominanceFrontier::dump() const {
print(dbgs());
}
#endif
-
-char DominanceFrontierAnalysis::PassID;
-
-DominanceFrontier DominanceFrontierAnalysis::run(Function &F,
- FunctionAnalysisManager *AM) {
- DominanceFrontier DF;
- DF.analyze(AM->getResult<DominatorTreeAnalysis>(F));
- return DF;
-}
-
-DominanceFrontierPrinterPass::DominanceFrontierPrinterPass(raw_ostream &OS)
- : OS(OS) {}
-
-PreservedAnalyses
-DominanceFrontierPrinterPass::run(Function &F, FunctionAnalysisManager *AM) {
- OS << "DominanceFrontier for function: " << F.getName() << "\n";
- AM->getResult<DominanceFrontierAnalysis>(F).print(OS);
-
- return PreservedAnalyses::all();
-}