[llvm] 00fb67a - [Support] Use range-based for loops (NFC) (#169001)

via llvm-commits llvm-commits at lists.llvm.org
Fri Nov 21 10:08:57 PST 2025


Author: Kazu Hirata
Date: 2025-11-21T10:08:53-08:00
New Revision: 00fb67af95635009f1539c88e8706665f4a2d017

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

LOG: [Support] Use range-based for loops (NFC) (#169001)

Identified with modernize-loop-convert.

Added: 
    

Modified: 
    llvm/lib/Support/CommandLine.cpp

Removed: 
    


################################################################################
diff  --git a/llvm/lib/Support/CommandLine.cpp b/llvm/lib/Support/CommandLine.cpp
index dab8beeff7ca5..5095b298fd42d 100644
--- a/llvm/lib/Support/CommandLine.cpp
+++ b/llvm/lib/Support/CommandLine.cpp
@@ -602,10 +602,7 @@ static Option *LookupNearestOption(StringRef Arg,
   // Find the closest match.
   Option *Best = nullptr;
   unsigned BestDistance = 0;
-  for (StringMap<Option *>::const_iterator it = OptionsMap.begin(),
-                                           ie = OptionsMap.end();
-       it != ie; ++it) {
-    Option *O = it->second;
+  for (const auto &[_, O] : OptionsMap) {
     // Do not suggest really hidden options (not shown in any help).
     if (O->getOptionHiddenFlag() == ReallyHidden)
       continue;


        


More information about the llvm-commits mailing list