-
Notifications
You must be signed in to change notification settings - Fork 14.3k
[lldb] Use llvm::find (NFC) #143338
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[lldb] Use llvm::find (NFC) #143338
Conversation
This patch should be mostly obvious, but in one place, this patch changes: const auto &it = std::find(...) to: auto it = llvm::find(...) We do not need to bind to a temporary with const ref.
@llvm/pr-subscribers-lldb Author: Kazu Hirata (kazutakahirata) ChangesThis patch should be mostly obvious, but in one place, this patch changes: const auto &it = std::find(...) to: auto it = llvm::find(...) We do not need to bind to a temporary with const ref. Full diff: https://github.com/llvm/llvm-project/pull/143338.diff 4 Files Affected:
diff --git a/lldb/source/Breakpoint/WatchpointResource.cpp b/lldb/source/Breakpoint/WatchpointResource.cpp
index 49d9d12aadfc3..c2f510f03638f 100644
--- a/lldb/source/Breakpoint/WatchpointResource.cpp
+++ b/lldb/source/Breakpoint/WatchpointResource.cpp
@@ -56,8 +56,7 @@ void WatchpointResource::AddConstituent(const WatchpointSP &wp_sp) {
void WatchpointResource::RemoveConstituent(WatchpointSP &wp_sp) {
std::lock_guard<std::mutex> guard(m_constituents_mutex);
- const auto &it =
- std::find(m_constituents.begin(), m_constituents.end(), wp_sp);
+ auto it = llvm::find(m_constituents, wp_sp);
if (it != m_constituents.end())
m_constituents.erase(it);
}
diff --git a/lldb/source/Expression/FunctionCaller.cpp b/lldb/source/Expression/FunctionCaller.cpp
index 83cac130ba728..6c93d94f691cb 100644
--- a/lldb/source/Expression/FunctionCaller.cpp
+++ b/lldb/source/Expression/FunctionCaller.cpp
@@ -323,8 +323,7 @@ bool FunctionCaller::FetchFunctionResults(ExecutionContext &exe_ctx,
void FunctionCaller::DeallocateFunctionResults(ExecutionContext &exe_ctx,
lldb::addr_t args_addr) {
std::list<lldb::addr_t>::iterator pos;
- pos = std::find(m_wrapper_args_addrs.begin(), m_wrapper_args_addrs.end(),
- args_addr);
+ pos = llvm::find(m_wrapper_args_addrs, args_addr);
if (pos != m_wrapper_args_addrs.end())
m_wrapper_args_addrs.erase(pos);
diff --git a/lldb/source/Plugins/Process/gdb-remote/ProcessGDBRemote.cpp b/lldb/source/Plugins/Process/gdb-remote/ProcessGDBRemote.cpp
index 420c84b496d15..f18bdd5175f2e 100644
--- a/lldb/source/Plugins/Process/gdb-remote/ProcessGDBRemote.cpp
+++ b/lldb/source/Plugins/Process/gdb-remote/ProcessGDBRemote.cpp
@@ -1728,7 +1728,7 @@ ThreadSP ProcessGDBRemote::SetThreadStopInfo(
reg_ctx_sp->InvalidateIfNeeded(true);
- auto iter = std::find(m_thread_ids.begin(), m_thread_ids.end(), tid);
+ auto iter = llvm::find(m_thread_ids, tid);
if (iter != m_thread_ids.end())
SetThreadPc(thread_sp, iter - m_thread_ids.begin());
diff --git a/lldb/source/Target/Process.cpp b/lldb/source/Target/Process.cpp
index 58edf972ddbe7..61a3d05bc3746 100644
--- a/lldb/source/Target/Process.cpp
+++ b/lldb/source/Target/Process.cpp
@@ -5838,7 +5838,7 @@ void Process::ClearPreResumeActions() { m_pre_resume_actions.clear(); }
void Process::ClearPreResumeAction(PreResumeActionCallback callback, void *baton)
{
PreResumeCallbackAndBaton element(callback, baton);
- auto found_iter = std::find(m_pre_resume_actions.begin(), m_pre_resume_actions.end(), element);
+ auto found_iter = llvm::find(m_pre_resume_actions, element);
if (found_iter != m_pre_resume_actions.end())
{
m_pre_resume_actions.erase(found_iter);
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
This patch should be mostly obvious, but in one place, this patch changes: const auto &it = std::find(...) to: auto it = llvm::find(...) We do not need to bind to a temporary with const ref.
This patch should be mostly obvious, but in one place, this patch changes: const auto &it = std::find(...) to: auto it = llvm::find(...) We do not need to bind to a temporary with const ref.
This patch should be mostly obvious, but in one place, this patch changes: const auto &it = std::find(...) to: auto it = llvm::find(...) We do not need to bind to a temporary with const ref.
This patch should be mostly obvious, but in one place, this patch changes:
const auto &it = std::find(...)
to:
auto it = llvm::find(...)
We do not need to bind to a temporary with const ref.