Index: ELF/InputSection.cpp =================================================================== --- ELF/InputSection.cpp +++ ELF/InputSection.cpp @@ -873,14 +873,13 @@ } // Sort both collections to compare addresses efficiently. - llvm::sort(MorestackCalls.begin(), MorestackCalls.end(), - [](const Relocation *L, const Relocation *R) { - return L->Offset < R->Offset; - }); + llvm::sort(MorestackCalls, [](const Relocation *L, const Relocation *R) { + return L->Offset < R->Offset; + }); std::vector Functions(Prologues.begin(), Prologues.end()); - llvm::sort( - Functions.begin(), Functions.end(), - [](const Defined *L, const Defined *R) { return L->Value < R->Value; }); + llvm::sort(Functions, [](const Defined *L, const Defined *R) { + return L->Value < R->Value; + }); auto It = MorestackCalls.begin(); for (Defined *F : Functions) { Index: ELF/SyntheticSections.cpp =================================================================== --- ELF/SyntheticSections.cpp +++ ELF/SyntheticSections.cpp @@ -1626,10 +1626,9 @@ NonRelatives.push_back(R); } - llvm::sort(Relatives.begin(), Relatives.end(), - [](const Elf_Rel &A, const Elf_Rel &B) { - return A.r_offset < B.r_offset; - }); + llvm::sort(Relatives, [](const Elf_Rel &A, const Elf_Rel &B) { + return A.r_offset < B.r_offset; + }); // Try to find groups of relative relocations which are spaced one word // apart from one another. These generally correspond to vtable entries. The @@ -1707,10 +1706,9 @@ } // Finally the non-relative relocations. - llvm::sort(NonRelatives.begin(), NonRelatives.end(), - [](const Elf_Rela &A, const Elf_Rela &B) { - return A.r_offset < B.r_offset; - }); + llvm::sort(NonRelatives, [](const Elf_Rela &A, const Elf_Rela &B) { + return A.r_offset < B.r_offset; + }); if (!NonRelatives.empty()) { Add(NonRelatives.size()); Add(HasAddendIfRela); Index: ELF/Writer.cpp =================================================================== --- ELF/Writer.cpp +++ ELF/Writer.cpp @@ -1135,11 +1135,10 @@ } OrderedSections.push_back({IS, I->second}); } - llvm::sort( - OrderedSections.begin(), OrderedSections.end(), - [&](std::pair A, std::pair B) { - return A.second < B.second; - }); + llvm::sort(OrderedSections, [&](std::pair A, + std::pair B) { + return A.second < B.second; + }); // Find an insertion point for the ordered section list in the unordered // section list. On targets with limited-range branches, this is the mid-point @@ -2133,10 +2132,9 @@ // load and virtual adresses). static void checkOverlap(StringRef Name, std::vector &Sections, bool IsVirtualAddr) { - llvm::sort(Sections.begin(), Sections.end(), - [=](const SectionOffset &A, const SectionOffset &B) { - return A.Offset < B.Offset; - }); + llvm::sort(Sections, [=](const SectionOffset &A, const SectionOffset &B) { + return A.Offset < B.Offset; + }); // Finding overlap is easy given a vector is sorted by start position. // If an element starts before the end of the previous element, they overlap.