[PATCH] D128242: [BOLT][NFC] Use llvm::less_first
Amir Ayupov via Phabricator via llvm-commits
llvm-commits at lists.llvm.org
Thu Jun 23 22:59:29 PDT 2022
Amir updated this revision to Diff 439627.
Amir added a comment.
Herald added a subscriber: mgrang.
Rebase + llvm::less_first
Repository:
rG LLVM Github Monorepo
CHANGES SINCE LAST ACTION
https://reviews.llvm.org/D128242/new/
https://reviews.llvm.org/D128242
Files:
bolt/lib/Core/DebugData.cpp
bolt/lib/Passes/LongJmp.cpp
Index: bolt/lib/Passes/LongJmp.cpp
===================================================================
--- bolt/lib/Passes/LongJmp.cpp
+++ bolt/lib/Passes/LongJmp.cpp
@@ -255,11 +255,7 @@
for (auto &KeyVal : StubGroups) {
for (StubTy &Elem : KeyVal.second)
Elem.first = BBAddresses[Elem.second];
- llvm::sort(KeyVal.second,
- [&](const std::pair<uint64_t, BinaryBasicBlock *> &LHS,
- const std::pair<uint64_t, BinaryBasicBlock *> &RHS) {
- return LHS.first < RHS.first;
- });
+ llvm::sort(KeyVal.second, llvm::less_first());
}
};
Index: bolt/lib/Core/DebugData.cpp
===================================================================
--- bolt/lib/Core/DebugData.cpp
+++ bolt/lib/Core/DebugData.cpp
@@ -313,10 +313,7 @@
std::vector<IndexAddressPair> SortedMap(indexToAddressBegin(),
indexToAdddessEnd());
// Sorting address in increasing order of indices.
- llvm::sort(SortedMap,
- [](const IndexAddressPair &A, const IndexAddressPair &B) {
- return A.first < B.first;
- });
+ llvm::sort(SortedMap, llvm::less_first());
for (auto &Pair : SortedMap)
dbgs() << Twine::utohexstr(Pair.second) << "\t" << Pair.first << "\n";
}
@@ -375,10 +372,7 @@
std::vector<IndexAddressPair> SortedMap(AM->second.indexToAddressBegin(),
AM->second.indexToAdddessEnd());
// Sorting address in increasing order of indices.
- llvm::sort(SortedMap,
- [](const IndexAddressPair &A, const IndexAddressPair &B) {
- return A.first < B.first;
- });
+ llvm::sort(SortedMap, llvm::less_first());
uint8_t AddrSize = CU->getAddressByteSize();
uint32_t Counter = 0;
@@ -449,10 +443,7 @@
AMIter->second.indexToAddressBegin(),
AMIter->second.indexToAdddessEnd());
// Sorting address in increasing order of indices.
- llvm::sort(SortedMap,
- [](const IndexAddressPair &A, const IndexAddressPair &B) {
- return A.first < B.first;
- });
+ llvm::sort(SortedMap, llvm::less_first());
// Writing out Header
const uint32_t Length = SortedMap.size() * AddrSize + 4;
support::endian::write(AddressStream, Length, Endian);
-------------- next part --------------
A non-text attachment was scrubbed...
Name: D128242.439627.patch
Type: text/x-patch
Size: 2389 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20220624/918e6bf9/attachment.bin>
More information about the llvm-commits
mailing list