From e8ae2fe2a8cc767f4d7ac55db13bf9adb8e7df70 Mon Sep 17 00:00:00 2001 From: Dan Gohman Date: Wed, 27 Feb 2008 18:38:29 +0000 Subject: [PATCH] Add -analyze support to postdomtree. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@47680 91177308-0d34-0410-b5e6-96231b3b80d8 --- include/llvm/Analysis/Dominators.h | 5 ++++- include/llvm/Analysis/PostDominators.h | 4 ++++ 2 files changed, 8 insertions(+), 1 deletion(-) diff --git a/include/llvm/Analysis/Dominators.h b/include/llvm/Analysis/Dominators.h index 517c4818b1a..ce305d5875e 100644 --- a/include/llvm/Analysis/Dominators.h +++ b/include/llvm/Analysis/Dominators.h @@ -508,7 +508,10 @@ public: /// virtual void print(std::ostream &o, const Module* ) const { o << "=============================--------------------------------\n"; - o << "Inorder Dominator Tree: "; + if (this->isPostDominator()) + o << "Inorder PostDominator Tree: "; + else + o << "Inorder Dominator Tree: "; if (this->DFSInfoValid) o << "DFSNumbers invalid: " << SlowQueries << " slow queries."; o << "\n"; diff --git a/include/llvm/Analysis/PostDominators.h b/include/llvm/Analysis/PostDominators.h index 77ce4cddd25..07910e9538c 100644 --- a/include/llvm/Analysis/PostDominators.h +++ b/include/llvm/Analysis/PostDominators.h @@ -54,6 +54,10 @@ struct PostDominatorTree : public FunctionPass { inline bool properlyDominates(BasicBlock* A, BasicBlock* B) const { return DT->properlyDominates(A, B); } + + virtual void print(std::ostream &OS, const Module* M= 0) const { + DT->print(OS, M); + } };