[lld] r302718 - Rename parallelFor -> parallelForEachN.
Rui Ueyama via llvm-commits
llvm-commits at lists.llvm.org
Wed May 10 13:02:20 PDT 2017
Author: ruiu
Date: Wed May 10 15:02:19 2017
New Revision: 302718
URL: http://llvm.org/viewvc/llvm-project?rev=302718&view=rev
Log:
Rename parallelFor -> parallelForEachN.
So that it is clear that the function is a wrapper for for_each_n.
Modified:
lld/trunk/ELF/ICF.cpp
lld/trunk/ELF/MapFile.cpp
lld/trunk/ELF/OutputSections.cpp
lld/trunk/ELF/SyntheticSections.cpp
lld/trunk/ELF/Threads.h
Modified: lld/trunk/ELF/ICF.cpp
URL: http://llvm.org/viewvc/llvm-project/lld/trunk/ELF/ICF.cpp?rev=302718&r1=302717&r2=302718&view=diff
==============================================================================
--- lld/trunk/ELF/ICF.cpp (original)
+++ lld/trunk/ELF/ICF.cpp Wed May 10 15:02:19 2017
@@ -325,7 +325,7 @@ void ICF<ELFT>::forEachClass(std::functi
// Split sections into 256 shards and call Fn in parallel.
size_t NumShards = 256;
size_t Step = Sections.size() / NumShards;
- parallelFor(0, NumShards, [&](size_t I) {
+ parallelForEachN(0, NumShards, [&](size_t I) {
forEachClassRange(I * Step, (I + 1) * Step, Fn);
});
forEachClassRange(Step * NumShards, Sections.size(), Fn);
Modified: lld/trunk/ELF/MapFile.cpp
URL: http://llvm.org/viewvc/llvm-project/lld/trunk/ELF/MapFile.cpp?rev=302718&r1=302717&r2=302718&view=diff
==============================================================================
--- lld/trunk/ELF/MapFile.cpp (original)
+++ lld/trunk/ELF/MapFile.cpp Wed May 10 15:02:19 2017
@@ -84,7 +84,7 @@ template <class ELFT>
DenseMap<DefinedRegular *, std::string>
getSymbolStrings(ArrayRef<DefinedRegular *> Syms) {
std::vector<std::string> Str(Syms.size());
- parallelFor(0, Syms.size(), [&](size_t I) {
+ parallelForEachN(0, Syms.size(), [&](size_t I) {
raw_string_ostream OS(Str[I]);
writeHeader<ELFT>(OS, Syms[I]->getVA(), Syms[I]->template getSize<ELFT>(),
0);
Modified: lld/trunk/ELF/OutputSections.cpp
URL: http://llvm.org/viewvc/llvm-project/lld/trunk/ELF/OutputSections.cpp?rev=302718&r1=302717&r2=302718&view=diff
==============================================================================
--- lld/trunk/ELF/OutputSections.cpp (original)
+++ lld/trunk/ELF/OutputSections.cpp Wed May 10 15:02:19 2017
@@ -297,7 +297,7 @@ template <class ELFT> void OutputSection
if (Filler)
fill(Buf, Sections.empty() ? Size : Sections[0]->OutSecOff, Filler);
- parallelFor(0, Sections.size(), [=](size_t I) {
+ parallelForEachN(0, Sections.size(), [=](size_t I) {
InputSection *Sec = Sections[I];
Sec->writeTo<ELFT>(Buf);
Modified: lld/trunk/ELF/SyntheticSections.cpp
URL: http://llvm.org/viewvc/llvm-project/lld/trunk/ELF/SyntheticSections.cpp?rev=302718&r1=302717&r2=302718&view=diff
==============================================================================
--- lld/trunk/ELF/SyntheticSections.cpp (original)
+++ lld/trunk/ELF/SyntheticSections.cpp Wed May 10 15:02:19 2017
@@ -356,7 +356,7 @@ void BuildIdSection::computeHash(
std::vector<uint8_t> Hashes(Chunks.size() * HashSize);
// Compute hash values.
- parallelFor(0, Chunks.size(), [&](size_t I) {
+ parallelForEachN(0, Chunks.size(), [&](size_t I) {
HashFn(Hashes.data() + I * HashSize, Chunks[I]);
});
Modified: lld/trunk/ELF/Threads.h
URL: http://llvm.org/viewvc/llvm-project/lld/trunk/ELF/Threads.h?rev=302718&r1=302717&r2=302718&view=diff
==============================================================================
--- lld/trunk/ELF/Threads.h (original)
+++ lld/trunk/ELF/Threads.h Wed May 10 15:02:19 2017
@@ -76,8 +76,8 @@ void parallelForEach(IterTy Begin, IterT
for_each(parallel::seq, Begin, End, Fn);
}
-inline void parallelFor(size_t Begin, size_t End,
- std::function<void(size_t)> Fn) {
+inline void parallelForEachN(size_t Begin, size_t End,
+ std::function<void(size_t)> Fn) {
if (Config->Threads)
for_each_n(parallel::par, Begin, End, Fn);
else
More information about the llvm-commits
mailing list