diff options
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(); |