From: Daniel Berlin Date: Wed, 14 Oct 2015 19:54:24 +0000 (+0000) Subject: [IDFCalculator] Use DominatorTreeBase instead of DominatorTree X-Git-Url: http://demsky.eecs.uci.edu/git/?a=commitdiff_plain;h=a0241a7b06ae27a7052072683bffd50bed774fba;p=oota-llvm.git [IDFCalculator] Use DominatorTreeBase instead of DominatorTree Summary: IDFCalculator used a DominatorTree instance for its calculations. Since the PostDominatorTree struct is not a subclass of DominatorTree, it wasn't possible to use PDT in IDFCalculator to compute post-dominance frontiers. This patch makes IDFCalculator work with a DominatorTreeBase instead, which enables PDTs to be utilized. Patch by Victor Campos (vhscampos@gmail.com) Reviewers: dberlin Subscribers: dberlin, llvm-commits Differential Revision: http://reviews.llvm.org/D13725 git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@250320 91177308-0d34-0410-b5e6-96231b3b80d8 --- diff --git a/include/llvm/Analysis/IteratedDominanceFrontier.h b/include/llvm/Analysis/IteratedDominanceFrontier.h index 5a339f10f50..a1ded2554d4 100644 --- a/include/llvm/Analysis/IteratedDominanceFrontier.h +++ b/include/llvm/Analysis/IteratedDominanceFrontier.h @@ -34,7 +34,7 @@ namespace llvm { class BasicBlock; template class DomTreeNodeBase; typedef DomTreeNodeBase DomTreeNode; -class DominatorTree; +template class DominatorTreeBase; /// \brief Determine the iterated dominance frontier, given a set of defining /// blocks, and optionally, a set of live-in blocks. @@ -47,7 +47,7 @@ class DominatorTree; class IDFCalculator { public: - IDFCalculator(DominatorTree &DT) : DT(DT), useLiveIn(false) {} + IDFCalculator(DominatorTreeBase &DT) : DT(DT), useLiveIn(false) {} /// \brief Give the IDF calculator the set of blocks in which the value is /// defined. This is equivalent to the set of starting blocks it should be @@ -85,7 +85,7 @@ public: void calculate(SmallVectorImpl &IDFBlocks); private: - DominatorTree &DT; + DominatorTreeBase &DT; bool useLiveIn; DenseMap DomLevels; const SmallPtrSetImpl *LiveInBlocks;