[llvm] e854321 - [IR] Use llvm::for_each (NFC) (#146989)

via llvm-commits llvm-commits at lists.llvm.org
Fri Jul 4 07:56:45 PDT 2025


Author: Kazu Hirata
Date: 2025-07-04T07:56:42-07:00
New Revision: e8543213e5fc41f521ae902433d49006aefb1bb7

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

LOG: [IR] Use llvm::for_each (NFC) (#146989)

We can pass a range to llvm::for_each.

Added: 
    

Modified: 
    llvm/lib/IR/LegacyPassManager.cpp

Removed: 
    


################################################################################
diff  --git a/llvm/lib/IR/LegacyPassManager.cpp b/llvm/lib/IR/LegacyPassManager.cpp
index c8f1606ea06cb..1d9a61ce4a10b 100644
--- a/llvm/lib/IR/LegacyPassManager.cpp
+++ b/llvm/lib/IR/LegacyPassManager.cpp
@@ -120,7 +120,7 @@ void PMDataManager::emitInstrCountChangedRemark(
   // If no function was passed in, then we're either a module pass or an
   // CGSCC pass.
   if (!CouldOnlyImpactOneFunction)
-    std::for_each(M.begin(), M.end(), UpdateFunctionChanges);
+    llvm::for_each(M, UpdateFunctionChanges);
   else
     UpdateFunctionChanges(*F);
 
@@ -197,9 +197,7 @@ void PMDataManager::emitInstrCountChangedRemark(
   // Are we looking at more than one function? If so, emit remarks for all of
   // the functions in the module. Otherwise, only emit one remark.
   if (!CouldOnlyImpactOneFunction)
-    std::for_each(FunctionToInstrCount.keys().begin(),
-                  FunctionToInstrCount.keys().end(),
-                  EmitFunctionSizeChangedRemark);
+    llvm::for_each(FunctionToInstrCount.keys(), EmitFunctionSizeChangedRemark);
   else
     EmitFunctionSizeChangedRemark(F->getName().str());
 }


        


More information about the llvm-commits mailing list