[lld] r282166 - Simplify. NFC.

Rafael Espindola via llvm-commits llvm-commits at lists.llvm.org
Thu Sep 22 08:25:21 PDT 2016


Author: rafael
Date: Thu Sep 22 10:25:21 2016
New Revision: 282166

URL: http://llvm.org/viewvc/llvm-project?rev=282166&view=rev
Log:
Simplify. NFC.

It doesn't matter which direction we rotate and we haven't really
started optimizing the linker script code, so keep this simple.

Modified:
    lld/trunk/ELF/LinkerScript.cpp

Modified: lld/trunk/ELF/LinkerScript.cpp
URL: http://llvm.org/viewvc/llvm-project/lld/trunk/ELF/LinkerScript.cpp?rev=282166&r1=282165&r2=282166&view=diff
==============================================================================
--- lld/trunk/ELF/LinkerScript.cpp (original)
+++ lld/trunk/ELF/LinkerScript.cpp Thu Sep 22 10:25:21 2016
@@ -547,9 +547,8 @@ template <class ELFT> void LinkerScript<
                           llvm::make_unique<OutputSectionCommand>(Name));
     } else {
       // If linker script lists alloc/non-alloc sections is the wrong order,
-      // this does a right rotate to bring the desired command in place.
-      auto RPos = llvm::make_reverse_iterator(Pos + 1);
-      std::rotate(RPos, RPos + 1, llvm::make_reverse_iterator(CmdIter));
+      // this does a rotate to bring the desired command in place.
+      std::rotate(CmdIter, Pos, Pos + 1);
     }
     ++CmdIndex;
   }




More information about the llvm-commits mailing list