Rename parallelFor -> parallelForEachN.
authorRui Ueyama <ruiu@google.com>
Wed, 10 May 2017 20:02:19 +0000 (20:02 +0000)
committerRui Ueyama <ruiu@google.com>
Wed, 10 May 2017 20:02:19 +0000 (20:02 +0000)
So that it is clear that the function is a wrapper for for_each_n.

llvm-svn: 302718

lld/ELF/ICF.cpp
lld/ELF/MapFile.cpp
lld/ELF/OutputSections.cpp
lld/ELF/SyntheticSections.cpp
lld/ELF/Threads.h

index dcf01ea800113e101ff9f3d2bc8705fb93de6a99..3722d4e3ed2f8bc285133c1021beb78aa3c83a5b 100644 (file)
@@ -325,7 +325,7 @@ void ICF<ELFT>::forEachClass(std::function<void(size_t, size_t)> Fn) {
   // 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);
index af5bc3c2c81312faf354228dcde5def025f8f5b1..23c63e845c9a7f7c6dbaf87fbe29b0c4fdc2a223 100644 (file)
@@ -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);
index b25aa0683655fc1294aa9762ef06024f9b375a7c..c5db01827e8aed3601b933c855fe5ccf9ef21ff1 100644 (file)
@@ -297,7 +297,7 @@ template <class ELFT> void OutputSection::writeTo(uint8_t *Buf) {
   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);
 
index a813d2f4097a49a1b39a1d39dbad953c9499c385..b023aa84cb5bdbef2a1f5fbff1468e6bd1570f53 100644 (file)
@@ -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]);
   });
 
index e6f680cef3babdbb5599c1db4e5233ee7423d0a0..ac7992e362cbb475b4ec1d9ffae00e2ed94ed973 100644 (file)
@@ -76,8 +76,8 @@ void parallelForEach(IterTy Begin, IterTy End, FuncTy Fn) {
     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