diff --git a/include/llvm/Analysis/DominatorInternals.h b/include/llvm/Analysis/DominatorInternals.h index 3486b77d77b..c3f81e66498 100644 --- a/include/llvm/Analysis/DominatorInternals.h +++ b/include/llvm/Analysis/DominatorInternals.h @@ -216,8 +216,11 @@ void Link(DominatorTreeBase& DT, #endif } -template -void Calculate(DominatorTreeBase& DT, Function& F) { +template +void Calculate(DominatorTreeBase::NodeType>& DT, + FuncT& F) { + typedef GraphTraits GraphT; + // Step #1: Number blocks in depth-first order and initialize variables used // in later stages of the algorithm. unsigned N = 0; diff --git a/include/llvm/Analysis/Dominators.h b/include/llvm/Analysis/Dominators.h index 7e7f1a70a3c..40c733d815e 100644 --- a/include/llvm/Analysis/Dominators.h +++ b/include/llvm/Analysis/Dominators.h @@ -162,9 +162,9 @@ typedef DomTreeNodeBase MachineDomTreeNode; /// DominatorTree - Calculate the immediate dominator tree for a function. /// -template -void Calculate(DominatorTreeBase& DT, - Function& F); +template +void Calculate(DominatorTreeBase::NodeType>& DT, + FuncT& F); template class DominatorTreeBase : public DominatorBase { @@ -545,9 +545,9 @@ protected: typename GraphT::NodeType* V, unsigned N); - template - friend void Calculate(DominatorTreeBase& DT, - Function& F); + template + friend void Calculate(DominatorTreeBase::NodeType>& DT, + FuncT& F); /// updateDFSNumbers - Assign In and Out numbers to the nodes while walking /// dominator tree in dfs order. @@ -609,7 +609,8 @@ protected: public: /// recalculate - compute a dominator tree for the given function - void recalculate(Function& F) { + template + void recalculate(FT& F) { if (!this->IsPostDominators) { reset(); @@ -619,7 +620,7 @@ public: this->DomTreeNodes[&F.getEntryBlock()] = 0; this->Vertex.push_back(0); - Calculate >(*this, F); + Calculate(*this, F); updateDFSNumbers(); } else { @@ -641,7 +642,7 @@ public: this->Vertex.push_back(0); - Calculate, GraphTraits > >(*this, F); + Calculate >(*this, F); } } };