summaryrefslogtreecommitdiff
path: root/bolt/tools
diff options
context:
space:
mode:
authorAmir Ayupov <aaupov@fb.com>2022-06-23 22:15:47 -0700
committerAmir Aupov <amir.aupov@gmail.com>2022-06-23 22:16:27 -0700
commitd2c876993625ce9b36bdd7ccc5e0c4cb04f32fb9 (patch)
tree503f9ba0228b897dc21fbba1f4e5270a492b9479 /bolt/tools
parent9ffe1b0a792bbc014813e362212b8fb514cc2a9f (diff)
downloadllvm-d2c876993625ce9b36bdd7ccc5e0c4cb04f32fb9.tar.gz
[BOLT][NFC] Use range-based STL wrappers
Replace `std::` algorithms taking begin/end iterators with `llvm::` counterparts accepting ranges. Reviewed By: rafauler Differential Revision: https://reviews.llvm.org/D128154
Diffstat (limited to 'bolt/tools')
-rw-r--r--bolt/tools/merge-fdata/merge-fdata.cpp15
1 files changed, 7 insertions, 8 deletions
diff --git a/bolt/tools/merge-fdata/merge-fdata.cpp b/bolt/tools/merge-fdata/merge-fdata.cpp
index 3cb6c910a8b5..4505c3f20a72 100644
--- a/bolt/tools/merge-fdata/merge-fdata.cpp
+++ b/bolt/tools/merge-fdata/merge-fdata.cpp
@@ -398,14 +398,14 @@ int main(int argc, char **argv) {
BinaryProfile MergedProfile;
MergedProfile.Header = MergedHeader;
MergedProfile.Functions.resize(MergedBFs.size());
- std::transform(
- MergedBFs.begin(), MergedBFs.end(), MergedProfile.Functions.begin(),
+ llvm::transform(
+ MergedBFs, MergedProfile.Functions.begin(),
[](StringMapEntry<BinaryFunctionProfile> &V) { return V.second; });
// For consistency, sort functions by their IDs.
- std::sort(MergedProfile.Functions.begin(), MergedProfile.Functions.end(),
- [](const BinaryFunctionProfile &A,
- const BinaryFunctionProfile &B) { return A.Id < B.Id; });
+ llvm::sort(MergedProfile.Functions,
+ [](const BinaryFunctionProfile &A,
+ const BinaryFunctionProfile &B) { return A.Id < B.Id; });
YamlOut << MergedProfile;
}
@@ -435,9 +435,8 @@ int main(int argc, char **argv) {
CountFuncType CountFunc = (opts::PrintFunctionList == opts::ST_EXEC_COUNT)
? ExecCountFunc
: BranchCountFunc;
- std::transform(MergedBFs.begin(), MergedBFs.end(), FunctionList.begin(),
- CountFunc);
- std::stable_sort(FunctionList.rbegin(), FunctionList.rend());
+ llvm::transform(MergedBFs, FunctionList.begin(), CountFunc);
+ llvm::stable_sort(reverse(FunctionList));
errs() << "Functions sorted by "
<< (opts::PrintFunctionList == opts::ST_EXEC_COUNT ? "execution"
: "total branch")