From 5d6c5b463cab7aeb74b20f51af88ba1d1658f8a8 Mon Sep 17 00:00:00 2001 From: Whitney Tsang Date: Mon, 25 May 2020 13:31:57 +0000 Subject: [PATCH] [LoopUtils] Use llvm::find Summary: Fixes this build error: llvm/lib/Transforms/Utils/LoopUtils.cpp:679:26: error: no matching function for call to 'find' Loop::iterator I = find(ParentLoop->begin(), ParentLoop->end(), L); ^~~~ Authored By: orivej Reviewer: Whitney Reviewed By: Whitney Subscribers: hiraditya, llvm-commits Tag: LLVM Differential Revision: https://reviews.llvm.org/D80473 --- llvm/lib/Transforms/Utils/LoopUtils.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/llvm/lib/Transforms/Utils/LoopUtils.cpp b/llvm/lib/Transforms/Utils/LoopUtils.cpp index 8c7475e..d7ea992 100644 --- a/llvm/lib/Transforms/Utils/LoopUtils.cpp +++ b/llvm/lib/Transforms/Utils/LoopUtils.cpp @@ -713,11 +713,11 @@ void llvm::deleteDeadLoop(Loop *L, DominatorTree *DT, ScalarEvolution *SE, // its parent. While removeLoop/removeChildLoop remove the given loop but // not relink its subloops, which is what we want. if (Loop *ParentLoop = L->getParentLoop()) { - Loop::iterator I = find(ParentLoop->begin(), ParentLoop->end(), L); + Loop::iterator I = find(*ParentLoop, L); assert(I != ParentLoop->end() && "Couldn't find loop"); ParentLoop->removeChildLoop(I); } else { - Loop::iterator I = find(LI->begin(), LI->end(), L); + Loop::iterator I = find(*LI, L); assert(I != LI->end() && "Couldn't find loop"); LI->removeLoop(I); } -- 2.7.4