[llvm] 5d6c5b4 - [LoopUtils] Use llvm::find
Whitney Tsang via llvm-commits
llvm-commits at lists.llvm.org
Mon May 25 06:35:14 PDT 2020
Author: Whitney Tsang
Date: 2020-05-25T13:34:56Z
New Revision: 5d6c5b463cab7aeb74b20f51af88ba1d1658f8a8
URL: https://github.com/llvm/llvm-project/commit/5d6c5b463cab7aeb74b20f51af88ba1d1658f8a8
DIFF: https://github.com/llvm/llvm-project/commit/5d6c5b463cab7aeb74b20f51af88ba1d1658f8a8.diff
LOG: [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
Added:
Modified:
llvm/lib/Transforms/Utils/LoopUtils.cpp
Removed:
################################################################################
diff --git a/llvm/lib/Transforms/Utils/LoopUtils.cpp b/llvm/lib/Transforms/Utils/LoopUtils.cpp
index 8c7475eae6e3..d7ea9923ed2e 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);
}
More information about the llvm-commits
mailing list