[llvm] e5ef5b9 - [DebugInfo] Use llvm::erase_value (NFC)

Kazu Hirata via llvm-commits llvm-commits at lists.llvm.org
Fri Oct 20 23:45:26 PDT 2023


Author: Kazu Hirata
Date: 2023-10-20T23:45:15-07:00
New Revision: e5ef5b9e32b134b8a8321d7266c9c4b78efb13e9

URL: https://github.com/llvm/llvm-project/commit/e5ef5b9e32b134b8a8321d7266c9c4b78efb13e9
DIFF: https://github.com/llvm/llvm-project/commit/e5ef5b9e32b134b8a8321d7266c9c4b78efb13e9.diff

LOG: [DebugInfo] Use llvm::erase_value (NFC)

Added: 
    

Modified: 
    llvm/lib/DebugInfo/LogicalView/Core/LVScope.cpp

Removed: 
    


################################################################################
diff  --git a/llvm/lib/DebugInfo/LogicalView/Core/LVScope.cpp b/llvm/lib/DebugInfo/LogicalView/Core/LVScope.cpp
index 2f26025d01ec207..e2b0d4db3a26a3b 100644
--- a/llvm/lib/DebugInfo/LogicalView/Core/LVScope.cpp
+++ b/llvm/lib/DebugInfo/LogicalView/Core/LVScope.cpp
@@ -299,20 +299,12 @@ void LVScope::addMissingElements(LVScope *Reference) {
   LVSymbols References;
   References.append(ReferenceSymbols->begin(), ReferenceSymbols->end());
 
-  auto RemoveSymbol = [&](LVSymbols &Symbols, LVSymbol *Symbol) {
-    LVSymbols::iterator Iter = std::remove_if(
-        Symbols.begin(), Symbols.end(),
-        [Symbol](LVSymbol *Item) -> bool { return Item == Symbol; });
-    if (Iter != Symbols.end())
-      Symbols.erase(Iter, Symbols.end());
-  };
-
   // Erase abstract symbols already in this scope from the collection of
   // symbols in the referenced scope.
   if (getSymbols())
     for (const LVSymbol *Symbol : *getSymbols())
       if (Symbol->getHasReferenceAbstract())
-        RemoveSymbol(References, Symbol->getReference());
+        llvm::erase_value(References, Symbol->getReference());
 
   // If we have elements left in 'References', those are the elements that
   // need to be inserted in the current scope.


        


More information about the llvm-commits mailing list