diff --git a/bolt/lib/Core/DebugData.cpp b/bolt/lib/Core/DebugData.cpp --- a/bolt/lib/Core/DebugData.cpp +++ b/bolt/lib/Core/DebugData.cpp @@ -313,9 +313,7 @@ std::vector SortedMap(indexToAddressBegin(), indexToAdddessEnd()); // Sorting address in increasing order of indices. - sort(SortedMap, [](const IndexAddressPair &A, const IndexAddressPair &B) { - return A.first < B.first; - }); + sort(SortedMap, less_first()); for (auto &Pair : SortedMap) dbgs() << Twine::utohexstr(Pair.second) << "\t" << Pair.first << "\n"; } @@ -374,9 +372,7 @@ std::vector SortedMap(AM->second.indexToAddressBegin(), AM->second.indexToAdddessEnd()); // Sorting address in increasing order of indices. - sort(SortedMap, [](const IndexAddressPair &A, const IndexAddressPair &B) { - return A.first < B.first; - }); + sort(SortedMap, less_first()); uint8_t AddrSize = CU->getAddressByteSize(); uint32_t Counter = 0; @@ -447,9 +443,7 @@ AMIter->second.indexToAddressBegin(), AMIter->second.indexToAdddessEnd()); // Sorting address in increasing order of indices. - sort(SortedMap, [](const IndexAddressPair &A, const IndexAddressPair &B) { - return A.first < B.first; - }); + sort(SortedMap, less_first()); // Writing out Header const uint32_t Length = SortedMap.size() * AddrSize + 4; support::endian::write(AddressStream, Length, Endian); diff --git a/bolt/lib/Passes/LongJmp.cpp b/bolt/lib/Passes/LongJmp.cpp --- a/bolt/lib/Passes/LongJmp.cpp +++ b/bolt/lib/Passes/LongJmp.cpp @@ -254,11 +254,7 @@ for (auto &KeyVal : StubGroups) { for (StubTy &Elem : KeyVal.second) Elem.first = BBAddresses[Elem.second]; - sort(KeyVal.second, - [&](const std::pair &LHS, - const std::pair &RHS) { - return LHS.first < RHS.first; - }); + sort(KeyVal.second, less_first()); } };