Skip to content

Commit 5d6c5b4

Browse files
author
Whitney Tsang
committed
[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
1 parent 82bee92 commit 5d6c5b4

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

llvm/lib/Transforms/Utils/LoopUtils.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -713,11 +713,11 @@ void llvm::deleteDeadLoop(Loop *L, DominatorTree *DT, ScalarEvolution *SE,
713713
// its parent. While removeLoop/removeChildLoop remove the given loop but
714714
// not relink its subloops, which is what we want.
715715
if (Loop *ParentLoop = L->getParentLoop()) {
716-
Loop::iterator I = find(ParentLoop->begin(), ParentLoop->end(), L);
716+
Loop::iterator I = find(*ParentLoop, L);
717717
assert(I != ParentLoop->end() && "Couldn't find loop");
718718
ParentLoop->removeChildLoop(I);
719719
} else {
720-
Loop::iterator I = find(LI->begin(), LI->end(), L);
720+
Loop::iterator I = find(*LI, L);
721721
assert(I != LI->end() && "Couldn't find loop");
722722
LI->removeLoop(I);
723723
}

0 commit comments

Comments
 (0)