[llvm] 3f0bddb - Use llvm::find (NFC)
Kazu Hirata via llvm-commits
llvm-commits at lists.llvm.org
Sat Sep 23 16:27:09 PDT 2023
Author: Kazu Hirata
Date: 2023-09-23T16:27:02-07:00
New Revision: 3f0bddb56ac33389e0a02444c6f67c7a42855582
URL: https://github.com/llvm/llvm-project/commit/3f0bddb56ac33389e0a02444c6f67c7a42855582
DIFF: https://github.com/llvm/llvm-project/commit/3f0bddb56ac33389e0a02444c6f67c7a42855582.diff
LOG: Use llvm::find (NFC)
Added:
Modified:
lldb/source/Plugins/DynamicLoader/POSIX-DYLD/DYLDRendezvous.cpp
lldb/source/Target/TargetList.cpp
llvm/lib/ExecutionEngine/Orc/TargetProcess/ExecutorSharedMemoryMapperService.cpp
mlir/lib/Analysis/FlatLinearValueConstraints.cpp
Removed:
################################################################################
diff --git a/lldb/source/Plugins/DynamicLoader/POSIX-DYLD/DYLDRendezvous.cpp b/lldb/source/Plugins/DynamicLoader/POSIX-DYLD/DYLDRendezvous.cpp
index ebda9b230e677a2..68e4ac0cc4007c4 100644
--- a/lldb/source/Plugins/DynamicLoader/POSIX-DYLD/DYLDRendezvous.cpp
+++ b/lldb/source/Plugins/DynamicLoader/POSIX-DYLD/DYLDRendezvous.cpp
@@ -482,7 +482,7 @@ bool DYLDRendezvous::RemoveSOEntriesFromRemote(
// Only add shared libraries and not the executable.
if (!SOEntryIsMainExecutable(entry)) {
- auto pos = std::find(m_soentries.begin(), m_soentries.end(), entry);
+ auto pos = llvm::find(m_soentries, entry);
if (pos == m_soentries.end())
return false;
diff --git a/lldb/source/Target/TargetList.cpp b/lldb/source/Target/TargetList.cpp
index cb198e388011ad2..3ec523b94101033 100644
--- a/lldb/source/Target/TargetList.cpp
+++ b/lldb/source/Target/TargetList.cpp
@@ -370,7 +370,7 @@ Status TargetList::CreateTargetInternal(Debugger &debugger,
bool TargetList::DeleteTarget(TargetSP &target_sp) {
std::lock_guard<std::recursive_mutex> guard(m_target_list_mutex);
- auto it = std::find(m_target_list.begin(), m_target_list.end(), target_sp);
+ auto it = llvm::find(m_target_list, target_sp);
if (it == m_target_list.end())
return false;
@@ -506,7 +506,7 @@ lldb::TargetSP TargetList::GetTargetAtIndex(uint32_t idx) const {
uint32_t TargetList::GetIndexOfTarget(lldb::TargetSP target_sp) const {
std::lock_guard<std::recursive_mutex> guard(m_target_list_mutex);
- auto it = std::find(m_target_list.begin(), m_target_list.end(), target_sp);
+ auto it = llvm::find(m_target_list, target_sp);
if (it != m_target_list.end())
return std::distance(m_target_list.begin(), it);
return UINT32_MAX;
@@ -533,7 +533,7 @@ void TargetList::SetSelectedTarget(uint32_t index) {
void TargetList::SetSelectedTarget(const TargetSP &target_sp) {
std::lock_guard<std::recursive_mutex> guard(m_target_list_mutex);
- auto it = std::find(m_target_list.begin(), m_target_list.end(), target_sp);
+ auto it = llvm::find(m_target_list, target_sp);
SetSelectedTargetInternal(std::distance(m_target_list.begin(), it));
}
diff --git a/llvm/lib/ExecutionEngine/Orc/TargetProcess/ExecutorSharedMemoryMapperService.cpp b/llvm/lib/ExecutionEngine/Orc/TargetProcess/ExecutorSharedMemoryMapperService.cpp
index 3f70dbf60437a5a..e8b0e240ac1fc98 100644
--- a/llvm/lib/ExecutionEngine/Orc/TargetProcess/ExecutorSharedMemoryMapperService.cpp
+++ b/llvm/lib/ExecutionEngine/Orc/TargetProcess/ExecutorSharedMemoryMapperService.cpp
@@ -194,9 +194,7 @@ Error ExecutorSharedMemoryMapperService::deinitialize(
// Remove the allocation from the allocation list of its reservation
for (auto &Reservation : Reservations) {
- auto AllocationIt =
- std::find(Reservation.second.Allocations.begin(),
- Reservation.second.Allocations.end(), Base);
+ auto AllocationIt = llvm::find(Reservation.second.Allocations, Base);
if (AllocationIt != Reservation.second.Allocations.end()) {
Reservation.second.Allocations.erase(AllocationIt);
break;
diff --git a/mlir/lib/Analysis/FlatLinearValueConstraints.cpp b/mlir/lib/Analysis/FlatLinearValueConstraints.cpp
index 31aff1a216bacc3..382d05f3b2d4851 100644
--- a/mlir/lib/Analysis/FlatLinearValueConstraints.cpp
+++ b/mlir/lib/Analysis/FlatLinearValueConstraints.cpp
@@ -1250,8 +1250,8 @@ AffineMap mlir::alignAffineMapWithValues(AffineMap map, ValueRange operands,
for (const auto &operand : llvm::enumerate(operands)) {
// Compute replacement dim/sym of operand.
AffineExpr replacement;
- auto dimIt = std::find(dims.begin(), dims.end(), operand.value());
- auto symIt = std::find(syms.begin(), syms.end(), operand.value());
+ auto dimIt = llvm::find(dims, operand.value());
+ auto symIt = llvm::find(syms, operand.value());
if (dimIt != dims.end()) {
replacement =
builder.getAffineDimExpr(std::distance(dims.begin(), dimIt));
More information about the llvm-commits
mailing list