diff options
Diffstat (limited to 'llvm/include/llvm/Analysis/PostDominators.h')
-rw-r--r-- | llvm/include/llvm/Analysis/PostDominators.h | 23 |
1 files changed, 23 insertions, 0 deletions
diff --git a/llvm/include/llvm/Analysis/PostDominators.h b/llvm/include/llvm/Analysis/PostDominators.h index 992a0cef7af..754d436aed5 100644 --- a/llvm/include/llvm/Analysis/PostDominators.h +++ b/llvm/include/llvm/Analysis/PostDominators.h @@ -84,6 +84,29 @@ private: }; +/// PostETForest Class - Concrete subclass of ETForestBase that is used to +/// compute a forwards post-dominator ET-Forest. +struct PostETForest : public ETForestBase { + PostETForest() : ETForestBase(true) {} + + virtual void getAnalysisUsage(AnalysisUsage &AU) const { + AU.setPreservesAll(); + AU.addRequired<ImmediatePostDominators>(); + } + + virtual bool runOnFunction(Function &F) { + reset(); // Reset from the last time we were run... + ImmediatePostDominators &ID = getAnalysis<ImmediatePostDominators>(); + Roots = ID.getRoots(); + calculate(ID); + return false; + } + + void calculate(const ImmediatePostDominators &ID); + ETNode *getNodeForBlock(BasicBlock *BB); +}; + + /// PostDominanceFrontier Class - Concrete subclass of DominanceFrontier that is /// used to compute the a post-dominance frontier. /// |