diff --git a/clang/include/clang/Analysis/Analyses/Dominators.h b/clang/include/clang/Analysis/Analyses/Dominators.h --- a/clang/include/clang/Analysis/Analyses/Dominators.h +++ b/clang/include/clang/Analysis/Analyses/Dominators.h @@ -193,7 +193,7 @@ /// Specialize ChildrenGetterTy to skip nullpointer successors. template struct ChildrenGetterTy { - using NodeRef = typename GraphTraits::NodeRef; + using NodeRef = typename GraphTraits::NodeRef; using ChildrenTy = SmallVector; ChildrenTy get(const NodeRef &N) { diff --git a/clang/include/clang/Analysis/CFG.h b/clang/include/clang/Analysis/CFG.h --- a/clang/include/clang/Analysis/CFG.h +++ b/clang/include/clang/Analysis/CFG.h @@ -1494,9 +1494,6 @@ static ChildIteratorType child_end(NodeRef N) { return N->succ_end(); } }; -template <> struct GraphTraits - : GraphTraits {}; - template <> struct GraphTraits< const ::clang::CFGBlock *> { using NodeRef = const ::clang::CFGBlock *; using ChildIteratorType = ::clang::CFGBlock::const_succ_iterator; @@ -1506,9 +1503,6 @@ static ChildIteratorType child_end(NodeRef N) { return N->succ_end(); } }; -template <> struct GraphTraits - : GraphTraits {}; - template <> struct GraphTraits> { using NodeRef = ::clang::CFGBlock *; using ChildIteratorType = ::clang::CFGBlock::const_pred_iterator; @@ -1521,9 +1515,6 @@ static ChildIteratorType child_end(NodeRef N) { return N->pred_end(); } }; -template <> struct GraphTraits> - : GraphTraits {}; - template <> struct GraphTraits> { using NodeRef = const ::clang::CFGBlock *; using ChildIteratorType = ::clang::CFGBlock::const_pred_iterator; @@ -1536,9 +1527,6 @@ static ChildIteratorType child_end(NodeRef N) { return N->pred_end(); } }; -template <> struct GraphTraits> - : GraphTraits {}; - // Traits for: CFG template <> struct GraphTraits< ::clang::CFG* > diff --git a/llvm/include/llvm/Support/GenericIteratedDominanceFrontier.h b/llvm/include/llvm/Support/GenericIteratedDominanceFrontier.h --- a/llvm/include/llvm/Support/GenericIteratedDominanceFrontier.h +++ b/llvm/include/llvm/Support/GenericIteratedDominanceFrontier.h @@ -37,7 +37,7 @@ /// May be specialized if, for example, one wouldn't like to return nullpointer /// successors. template struct ChildrenGetterTy { - using NodeRef = typename GraphTraits::NodeRef; + using NodeRef = typename GraphTraits::NodeRef; using ChildrenTy = SmallVector; ChildrenTy get(const NodeRef &N); diff --git a/llvm/lib/CodeGen/LiveDebugValues/InstrRefBasedImpl.cpp b/llvm/lib/CodeGen/LiveDebugValues/InstrRefBasedImpl.cpp --- a/llvm/lib/CodeGen/LiveDebugValues/InstrRefBasedImpl.cpp +++ b/llvm/lib/CodeGen/LiveDebugValues/InstrRefBasedImpl.cpp @@ -2212,40 +2212,6 @@ // redundant PHIs. } -// Boilerplate for feeding MachineBasicBlocks into IDF calculator. Provide -// template specialisations for graph traits and a successor enumerator. -namespace llvm { -template <> struct GraphTraits { - using NodeRef = MachineBasicBlock *; - using ChildIteratorType = MachineBasicBlock::succ_iterator; - - static NodeRef getEntryNode(MachineBasicBlock *BB) { return BB; } - static ChildIteratorType child_begin(NodeRef N) { return N->succ_begin(); } - static ChildIteratorType child_end(NodeRef N) { return N->succ_end(); } -}; - -template <> struct GraphTraits { - using NodeRef = const MachineBasicBlock *; - using ChildIteratorType = MachineBasicBlock::const_succ_iterator; - - static NodeRef getEntryNode(const MachineBasicBlock *BB) { return BB; } - static ChildIteratorType child_begin(NodeRef N) { return N->succ_begin(); } - static ChildIteratorType child_end(NodeRef N) { return N->succ_end(); } -}; - -using MachineDomTreeBase = DomTreeBase::NodeType; -using MachineDomTreeChildGetter = - typename IDFCalculatorDetail::ChildrenGetterTy; - -namespace IDFCalculatorDetail { -template <> -typename MachineDomTreeChildGetter::ChildrenTy -MachineDomTreeChildGetter::get(const NodeRef &N) { - return {N->succ_begin(), N->succ_end()}; -} -} // namespace IDFCalculatorDetail -} // namespace llvm - void InstrRefBasedLDV::BlockPHIPlacement( const SmallPtrSetImpl &AllBlocks, const SmallPtrSetImpl &DefBlocks, @@ -2253,8 +2219,7 @@ // Apply IDF calculator to the designated set of location defs, storing // required PHIs into PHIBlocks. Uses the dominator tree stored in the // InstrRefBasedLDV object. - IDFCalculatorDetail::ChildrenGetterTy foo; - IDFCalculatorBase IDF(DomTree->getBase(), foo); + IDFCalculatorBase IDF(DomTree->getBase()); IDF.setLiveInBlocks(AllBlocks); IDF.setDefiningBlocks(DefBlocks);