[llvm] [DebugInfo] Use llvm::remove_if (NFC) (PR #149543)

Kazu Hirata via llvm-commits llvm-commits at lists.llvm.org
Fri Jul 18 09:12:55 PDT 2025


https://github.com/kazutakahirata created https://github.com/llvm/llvm-project/pull/149543

We can pass a range to llvm::remove_if.


>From f1e2aeba95313a72255b1d96aa8c3f3a541fe4bf Mon Sep 17 00:00:00 2001
From: Kazu Hirata <kazu at google.com>
Date: Thu, 17 Jul 2025 15:37:01 -0700
Subject: [PATCH] [DebugInfo] Use llvm::remove_if (NFC)

We can pass a range to llvm::remove_if.
---
 llvm/lib/DebugInfo/LogicalView/Core/LVScope.cpp | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/llvm/lib/DebugInfo/LogicalView/Core/LVScope.cpp b/llvm/lib/DebugInfo/LogicalView/Core/LVScope.cpp
index 93a567e89f774..64f1bfc015380 100644
--- a/llvm/lib/DebugInfo/LogicalView/Core/LVScope.cpp
+++ b/llvm/lib/DebugInfo/LogicalView/Core/LVScope.cpp
@@ -263,7 +263,7 @@ bool LVScope::removeElement(LVElement *Element) {
     return Item == Element;
   };
   auto RemoveElement = [Element, Predicate](auto &Container) -> bool {
-    auto Iter = std::remove_if(Container->begin(), Container->end(), Predicate);
+    auto Iter = llvm::remove_if(*Container, Predicate);
     if (Iter != Container->end()) {
       Container->erase(Iter, Container->end());
       Element->resetParent();



More information about the llvm-commits mailing list