[lld] 4dbc755 - [lld] Use llvm::count_if (NFC) (#141519)

via llvm-commits llvm-commits at lists.llvm.org
Wed May 28 11:33:01 PDT 2025


Author: Kazu Hirata
Date: 2025-05-28T11:32:58-07:00
New Revision: 4dbc75567d5d1658f0dee1db672e842cc94be925

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

LOG: [lld] Use llvm::count_if (NFC) (#141519)

Added: 
    

Modified: 
    lld/wasm/InputChunks.cpp

Removed: 
    


################################################################################
diff  --git a/lld/wasm/InputChunks.cpp b/lld/wasm/InputChunks.cpp
index ffab83e636392..855589353e4f6 100644
--- a/lld/wasm/InputChunks.cpp
+++ b/lld/wasm/InputChunks.cpp
@@ -174,9 +174,9 @@ static bool relocIsLive(const WasmRelocation &rel, ObjFile *file) {
 }
 
 size_t InputChunk::getNumLiveRelocations() const {
-  return std::count_if(
-      relocations.begin(), relocations.end(),
-      [this](const WasmRelocation &rel) { return relocIsLive(rel, file); });
+  return llvm::count_if(relocations, [this](const WasmRelocation &rel) {
+    return relocIsLive(rel, file);
+  });
 }
 
 // Copy relocation entries to a given output stream.


        


More information about the llvm-commits mailing list