diff --git a/llvm/include/llvm/Analysis/BlockFrequencyInfoImpl.h b/llvm/include/llvm/Analysis/BlockFrequencyInfoImpl.h index 0c05be0b9b8cd..8acb75e872541 100644 --- a/llvm/include/llvm/Analysis/BlockFrequencyInfoImpl.h +++ b/llvm/include/llvm/Analysis/BlockFrequencyInfoImpl.h @@ -1532,8 +1532,7 @@ void BlockFrequencyInfoImpl::findReachableBlocks( SmallPtrSet InverseReachable; for (const BlockT &BB : *F) { // An exit block is a block without any successors - bool HasSucc = GraphTraits::child_begin(&BB) != - GraphTraits::child_end(&BB); + bool HasSucc = !llvm::children(&BB).empty(); if (!HasSucc && Reachable.count(&BB)) { Queue.push(&BB); InverseReachable.insert(&BB); @@ -1542,7 +1541,7 @@ void BlockFrequencyInfoImpl::findReachableBlocks( while (!Queue.empty()) { const BlockT *SrcBB = Queue.front(); Queue.pop(); - for (const BlockT *DstBB : children>(SrcBB)) { + for (const BlockT *DstBB : inverse_children(SrcBB)) { auto EP = BPI->getEdgeProbability(DstBB, SrcBB); if (EP.isZero()) continue;