Skip to content

[lldb] Use llvm::any_of (NFC) #141443

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

Merged

Conversation

kazutakahirata
Copy link
Contributor

No description provided.

@llvmbot
Copy link
Member

llvmbot commented May 26, 2025

@llvm/pr-subscribers-lldb

Author: Kazu Hirata (kazutakahirata)

Changes

Full diff: https://github.com/llvm/llvm-project/pull/141443.diff

2 Files Affected:

  • (modified) lldb/source/Breakpoint/WatchpointResource.cpp (+2-4)
  • (modified) lldb/source/Plugins/ABI/AArch64/ABIAArch64.cpp (+2-2)
diff --git a/lldb/source/Breakpoint/WatchpointResource.cpp b/lldb/source/Breakpoint/WatchpointResource.cpp
index fa0442997b528..49d9d12aadfc3 100644
--- a/lldb/source/Breakpoint/WatchpointResource.cpp
+++ b/lldb/source/Breakpoint/WatchpointResource.cpp
@@ -73,10 +73,8 @@ bool WatchpointResource::ConstituentsContains(const WatchpointSP &wp_sp) {
 
 bool WatchpointResource::ConstituentsContains(const Watchpoint *wp) {
   std::lock_guard<std::mutex> guard(m_constituents_mutex);
-  WatchpointCollection::const_iterator match =
-      std::find_if(m_constituents.begin(), m_constituents.end(),
-                   [&wp](const WatchpointSP &x) { return x.get() == wp; });
-  return match != m_constituents.end();
+  return llvm::any_of(m_constituents,
+                      [&wp](const WatchpointSP &x) { return x.get() == wp; });
 }
 
 WatchpointSP WatchpointResource::GetConstituentAtIndex(size_t idx) {
diff --git a/lldb/source/Plugins/ABI/AArch64/ABIAArch64.cpp b/lldb/source/Plugins/ABI/AArch64/ABIAArch64.cpp
index 3bafb21f7c33a..b9e7c698cdec0 100644
--- a/lldb/source/Plugins/ABI/AArch64/ABIAArch64.cpp
+++ b/lldb/source/Plugins/ABI/AArch64/ABIAArch64.cpp
@@ -177,8 +177,8 @@ void ABIAArch64::AugmentRegisterInfo(
                       lldb::eFormatHex);
 
   auto bool_predicate = [](const auto &reg_num) { return bool(reg_num); };
-  bool saw_v_regs = std::any_of(v_regs.begin(), v_regs.end(), bool_predicate);
-  bool saw_z_regs = std::any_of(z_regs.begin(), z_regs.end(), bool_predicate);
+  bool saw_v_regs = llvm::any_of(v_regs, bool_predicate);
+  bool saw_z_regs = llvm::any_of(z_regs, bool_predicate);
 
   // Sn/Dn for Vn.
   if (saw_v_regs) {

@kazutakahirata kazutakahirata merged commit 85cbf74 into llvm:main May 26, 2025
12 checks passed
@kazutakahirata kazutakahirata deleted the cleanup_20250525_llvm_any_of_lldb branch May 26, 2025 16:24
sivan-shani pushed a commit to sivan-shani/llvm-project that referenced this pull request Jun 3, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants