diff options
author | Benjamin Kramer <benny.kra@googlemail.com> | 2022-02-04 17:00:50 +0100 |
---|---|---|
committer | Benjamin Kramer <benny.kra@googlemail.com> | 2022-02-04 17:00:50 +0100 |
commit | 85243124cf7ab25df3dec14f802f6eca9cf68b39 (patch) | |
tree | d56f9ae8455ebc563f273f7eb34436314046a3ce /llvm/lib/LTO/LTO.cpp | |
parent | 853e0aa424e40b80d0bda1dd8a3471a361048e4b (diff) | |
download | llvm-85243124cf7ab25df3dec14f802f6eca9cf68b39.zip llvm-85243124cf7ab25df3dec14f802f6eca9cf68b39.tar.gz llvm-85243124cf7ab25df3dec14f802f6eca9cf68b39.tar.bz2 |
Tweak some uses of std::iota to skip initializing the underlying storage. NFCI.
Diffstat (limited to 'llvm/lib/LTO/LTO.cpp')
-rw-r--r-- | llvm/lib/LTO/LTO.cpp | 5 |
1 files changed, 2 insertions, 3 deletions
diff --git a/llvm/lib/LTO/LTO.cpp b/llvm/lib/LTO/LTO.cpp index 418aad2..d710c81 100644 --- a/llvm/lib/LTO/LTO.cpp +++ b/llvm/lib/LTO/LTO.cpp @@ -1621,9 +1621,8 @@ lto::setupStatsFile(StringRef StatsFilename) { // is to sort them per size so that the largest module get schedule as soon as // possible. This is purely a compile-time optimization. std::vector<int> lto::generateModulesOrdering(ArrayRef<BitcodeModule *> R) { - std::vector<int> ModulesOrdering; - ModulesOrdering.resize(R.size()); - std::iota(ModulesOrdering.begin(), ModulesOrdering.end(), 0); + auto Seq = llvm::seq<int>(0, R.size()); + std::vector<int> ModulesOrdering(Seq.begin(), Seq.end()); llvm::sort(ModulesOrdering, [&](int LeftIndex, int RightIndex) { auto LSize = R[LeftIndex]->getBuffer().size(); auto RSize = R[RightIndex]->getBuffer().size(); |