[lld] d423570 - [lld] Use llvm::reverse (NFC)

Kazu Hirata via llvm-commits llvm-commits at lists.llvm.org
Sun Nov 6 08:39:47 PST 2022


Author: Kazu Hirata
Date: 2022-11-06T08:39:41-08:00
New Revision: d42357007da6f70e91553685324b404428fcd290

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

LOG: [lld] Use llvm::reverse (NFC)

Added: 
    

Modified: 
    lld/ELF/Writer.cpp

Removed: 
    


################################################################################
diff  --git a/lld/ELF/Writer.cpp b/lld/ELF/Writer.cpp
index 918490b972efb..2d99f6d6f7d5e 100644
--- a/lld/ELF/Writer.cpp
+++ b/lld/ELF/Writer.cpp
@@ -1794,10 +1794,9 @@ static void removeUnusedSyntheticSections() {
   // all regular ones. Reverse iterate to find the first synthetic section
   // after a non-synthetic one which will be our starting point.
   auto start =
-      std::find_if(
-          ctx.inputSections.rbegin(), ctx.inputSections.rend(),
-          [](InputSectionBase *s) { return !isa<SyntheticSection>(s); })
-          .base();
+      llvm::find_if(llvm::reverse(ctx.inputSections), [](InputSectionBase *s) {
+        return !isa<SyntheticSection>(s);
+      }).base();
 
   // Remove unused synthetic sections from ctx.inputSections;
   DenseSet<InputSectionBase *> unused;


        


More information about the llvm-commits mailing list