diff options
author | Hongbin Zheng <etherzhhb@gmail.com> | 2016-02-25 16:45:46 +0000 |
---|---|---|
committer | Hongbin Zheng <etherzhhb@gmail.com> | 2016-02-25 16:45:46 +0000 |
commit | ad782ce3f7e282a818ad062ba3c18c96b7e742b5 (patch) | |
tree | 9c973fdfc739cf3124293c40fabe15d53a272e82 /llvm/lib/Analysis/DominanceFrontier.cpp | |
parent | 921fabf34b8c240d7552cdb3b7809d7c050a75db (diff) | |
download | bcm5719-llvm-ad782ce3f7e282a818ad062ba3c18c96b7e742b5.tar.gz bcm5719-llvm-ad782ce3f7e282a818ad062ba3c18c96b7e742b5.zip |
Revert "Introduce DominanceFrontierAnalysis to the new PassManager to compute DominanceFrontier. NFC"
This reverts commit 109c38b2226a87b0be73fa7a0a8c1a81df20aeb2.
llvm-svn: 261890
Diffstat (limited to 'llvm/lib/Analysis/DominanceFrontier.cpp')
-rw-r--r-- | llvm/lib/Analysis/DominanceFrontier.cpp | 50 |
1 files changed, 15 insertions, 35 deletions
diff --git a/llvm/lib/Analysis/DominanceFrontier.cpp b/llvm/lib/Analysis/DominanceFrontier.cpp index ef7062da775..90e7fd00dba 100644 --- a/llvm/lib/Analysis/DominanceFrontier.cpp +++ b/llvm/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(); -} |