summaryrefslogtreecommitdiff
path: root/lld
diff options
context:
space:
mode:
authorNico Weber <thakis@chromium.org>2022-06-19 12:30:06 -0400
committerNico Weber <thakis@chromium.org>2022-06-19 17:49:00 -0400
commit7effcbda49ba32991b8955821b8fdbd4f8f303e2 (patch)
treed55acb89f56ca9445f99ba60efa1dcc8c0270fbe /lld
parenta5cb6edb475bd41a3e3ced3fa9323096535c2da9 (diff)
downloadllvm-7effcbda49ba32991b8955821b8fdbd4f8f303e2.tar.gz
Rename parallelForEachN to just parallelFor
Patch created by running: rg -l parallelForEachN | xargs sed -i '' -c 's/parallelForEachN/parallelFor/' No behavior change. Differential Revision: https://reviews.llvm.org/D128140
Diffstat (limited to 'lld')
-rw-r--r--lld/COFF/DebugTypes.cpp2
-rw-r--r--lld/COFF/ICF.cpp4
-rw-r--r--lld/COFF/LLDMapFile.cpp2
-rw-r--r--lld/COFF/MapFile.cpp2
-rw-r--r--lld/ELF/ICF.cpp4
-rw-r--r--lld/ELF/MapFile.cpp2
-rw-r--r--lld/ELF/OutputSections.cpp8
-rw-r--r--lld/ELF/SyntheticSections.cpp10
-rw-r--r--lld/ELF/Writer.cpp2
-rw-r--r--lld/MachO/ICF.cpp4
-rw-r--r--lld/MachO/MapFile.cpp2
-rw-r--r--lld/MachO/UnwindInfoSection.cpp2
-rw-r--r--lld/wasm/MapFile.cpp2
13 files changed, 23 insertions, 23 deletions
diff --git a/lld/COFF/DebugTypes.cpp b/lld/COFF/DebugTypes.cpp
index 0d25de464f9f..5878386aeb93 100644
--- a/lld/COFF/DebugTypes.cpp
+++ b/lld/COFF/DebugTypes.cpp
@@ -1056,7 +1056,7 @@ void TypeMerger::mergeTypesWithGHash() {
// position. Because the table does not rehash, the position will not change
// under insertion. After insertion is done, the value of the cell can be read
// to retrieve the final PDB type index.
- parallelForEachN(0, ctx.tpiSourceList.size(), [&](size_t tpiSrcIdx) {
+ parallelFor(0, ctx.tpiSourceList.size(), [&](size_t tpiSrcIdx) {
TpiSource *source = ctx.tpiSourceList[tpiSrcIdx];
source->indexMapStorage.resize(source->ghashes.size());
for (uint32_t i = 0, e = source->ghashes.size(); i < e; i++) {
diff --git a/lld/COFF/ICF.cpp b/lld/COFF/ICF.cpp
index 832362662394..49546ea8bdc2 100644
--- a/lld/COFF/ICF.cpp
+++ b/lld/COFF/ICF.cpp
@@ -233,10 +233,10 @@ void ICF::forEachClass(std::function<void(size_t, size_t)> fn) {
size_t boundaries[numShards + 1];
boundaries[0] = 0;
boundaries[numShards] = chunks.size();
- parallelForEachN(1, numShards, [&](size_t i) {
+ parallelFor(1, numShards, [&](size_t i) {
boundaries[i] = findBoundary((i - 1) * step, chunks.size());
});
- parallelForEachN(1, numShards + 1, [&](size_t i) {
+ parallelFor(1, numShards + 1, [&](size_t i) {
if (boundaries[i - 1] < boundaries[i]) {
forEachClassRange(boundaries[i - 1], boundaries[i], fn);
}
diff --git a/lld/COFF/LLDMapFile.cpp b/lld/COFF/LLDMapFile.cpp
index 639b186dbb6f..af15af5accf1 100644
--- a/lld/COFF/LLDMapFile.cpp
+++ b/lld/COFF/LLDMapFile.cpp
@@ -75,7 +75,7 @@ static SymbolMapTy getSectionSyms(ArrayRef<DefinedRegular *> syms) {
static DenseMap<DefinedRegular *, std::string>
getSymbolStrings(ArrayRef<DefinedRegular *> syms) {
std::vector<std::string> str(syms.size());
- parallelForEachN((size_t)0, syms.size(), [&](size_t i) {
+ parallelFor((size_t)0, syms.size(), [&](size_t i) {
raw_string_ostream os(str[i]);
writeHeader(os, syms[i]->getRVA(), 0, 0);
os << indent16 << toString(*syms[i]);
diff --git a/lld/COFF/MapFile.cpp b/lld/COFF/MapFile.cpp
index ace614da866b..2da50af30387 100644
--- a/lld/COFF/MapFile.cpp
+++ b/lld/COFF/MapFile.cpp
@@ -141,7 +141,7 @@ static void getSymbols(const COFFLinkerContext &ctx,
static DenseMap<Defined *, std::string>
getSymbolStrings(const COFFLinkerContext &ctx, ArrayRef<Defined *> syms) {
std::vector<std::string> str(syms.size());
- parallelForEachN((size_t)0, syms.size(), [&](size_t i) {
+ parallelFor((size_t)0, syms.size(), [&](size_t i) {
raw_string_ostream os(str[i]);
Defined *sym = syms[i];
diff --git a/lld/ELF/ICF.cpp b/lld/ELF/ICF.cpp
index f4e4389b41fc..77d32db6718a 100644
--- a/lld/ELF/ICF.cpp
+++ b/lld/ELF/ICF.cpp
@@ -422,11 +422,11 @@ void ICF<ELFT>::forEachClass(llvm::function_ref<void(size_t, size_t)> fn) {
boundaries[0] = 0;
boundaries[numShards] = sections.size();
- parallelForEachN(1, numShards, [&](size_t i) {
+ parallelFor(1, numShards, [&](size_t i) {
boundaries[i] = findBoundary((i - 1) * step, sections.size());
});
- parallelForEachN(1, numShards + 1, [&](size_t i) {
+ parallelFor(1, numShards + 1, [&](size_t i) {
if (boundaries[i - 1] < boundaries[i])
forEachClassRange(boundaries[i - 1], boundaries[i], fn);
});
diff --git a/lld/ELF/MapFile.cpp b/lld/ELF/MapFile.cpp
index 048d41b8d0ee..bcd897a83a82 100644
--- a/lld/ELF/MapFile.cpp
+++ b/lld/ELF/MapFile.cpp
@@ -92,7 +92,7 @@ static SymbolMapTy getSectionSyms(ArrayRef<Defined *> syms) {
static DenseMap<Symbol *, std::string>
getSymbolStrings(ArrayRef<Defined *> syms) {
auto strs = std::make_unique<std::string[]>(syms.size());
- parallelForEachN(0, syms.size(), [&](size_t i) {
+ parallelFor(0, syms.size(), [&](size_t i) {
raw_string_ostream os(strs[i]);
OutputSection *osec = syms[i]->getOutputSection();
uint64_t vma = syms[i]->getVA();
diff --git a/lld/ELF/OutputSections.cpp b/lld/ELF/OutputSections.cpp
index 44d3d3c7ca28..bc940c7e6546 100644
--- a/lld/ELF/OutputSections.cpp
+++ b/lld/ELF/OutputSections.cpp
@@ -350,7 +350,7 @@ template <class ELFT> void OutputSection::maybeCompress() {
// concatenated with the next shard.
auto shardsOut = std::make_unique<SmallVector<uint8_t, 0>[]>(numShards);
auto shardsAdler = std::make_unique<uint32_t[]>(numShards);
- parallelForEachN(0, numShards, [&](size_t i) {
+ parallelFor(0, numShards, [&](size_t i) {
shardsOut[i] = deflateShard(shardsIn[i], level,
i != numShards - 1 ? Z_SYNC_FLUSH : Z_FINISH);
shardsAdler[i] = adler32(1, shardsIn[i].data(), shardsIn[i].size());
@@ -409,7 +409,7 @@ template <class ELFT> void OutputSection::writeTo(uint8_t *buf) {
buf[0] = 0x78; // CMF
buf[1] = 0x01; // FLG: best speed
- parallelForEachN(0, compressed.numShards, [&](size_t i) {
+ parallelFor(0, compressed.numShards, [&](size_t i) {
memcpy(buf + offsets[i], compressed.shards[i].data(),
compressed.shards[i].size());
});
@@ -425,7 +425,7 @@ template <class ELFT> void OutputSection::writeTo(uint8_t *buf) {
if (nonZeroFiller)
fill(buf, sections.empty() ? size : sections[0]->outSecOff, filler);
- parallelForEachN(0, sections.size(), [&](size_t i) {
+ parallelFor(0, sections.size(), [&](size_t i) {
InputSection *isec = sections[i];
if (auto *s = dyn_cast<SyntheticSection>(isec))
s->writeTo(buf + isec->outSecOff);
@@ -623,7 +623,7 @@ void OutputSection::checkDynRelAddends(const uint8_t *bufStart) {
assert(config->writeAddends && config->checkDynamicRelocs);
assert(type == SHT_REL || type == SHT_RELA);
SmallVector<InputSection *, 0> sections = getInputSections(*this);
- parallelForEachN(0, sections.size(), [&](size_t i) {
+ parallelFor(0, sections.size(), [&](size_t i) {
// When linking with -r or --emit-relocs we might also call this function
// for input .rel[a].<sec> sections which we simply pass through to the
// output. We skip over those and only look at the synthetic relocation
diff --git a/lld/ELF/SyntheticSections.cpp b/lld/ELF/SyntheticSections.cpp
index 2f16ddcd5b97..091e03836527 100644
--- a/lld/ELF/SyntheticSections.cpp
+++ b/lld/ELF/SyntheticSections.cpp
@@ -2841,7 +2841,7 @@ static SmallVector<GdbIndexSection::GdbSymbol, 0> createSymbols(
// Instantiate GdbSymbols while uniqufying them by name.
auto symbols = std::make_unique<SmallVector<GdbSymbol, 0>[]>(numShards);
- parallelForEachN(0, concurrency, [&](size_t threadId) {
+ parallelFor(0, concurrency, [&](size_t threadId) {
uint32_t i = 0;
for (ArrayRef<NameAttrEntry> entries : nameAttrs) {
for (const NameAttrEntry &ent : entries) {
@@ -2921,7 +2921,7 @@ template <class ELFT> GdbIndexSection *GdbIndexSection::create() {
SmallVector<GdbChunk, 0> chunks(files.size());
SmallVector<SmallVector<NameAttrEntry, 0>, 0> nameAttrs(files.size());
- parallelForEachN(0, files.size(), [&](size_t i) {
+ parallelFor(0, files.size(), [&](size_t i) {
// To keep memory usage low, we don't want to keep cached DWARFContext, so
// avoid getDwarf() here.
ObjFile<ELFT> *file = cast<ObjFile<ELFT>>(files[i]);
@@ -3287,8 +3287,8 @@ void MergeTailSection::finalizeContents() {
}
void MergeNoTailSection::writeTo(uint8_t *buf) {
- parallelForEachN(0, numShards,
- [&](size_t i) { shards[i].write(buf + shardOffsets[i]); });
+ parallelFor(0, numShards,
+ [&](size_t i) { shards[i].write(buf + shardOffsets[i]); });
}
// This function is very hot (i.e. it can take several seconds to finish)
@@ -3312,7 +3312,7 @@ void MergeNoTailSection::finalizeContents() {
numShards));
// Add section pieces to the builders.
- parallelForEachN(0, concurrency, [&](size_t threadId) {
+ parallelFor(0, concurrency, [&](size_t threadId) {
for (MergeInputSection *sec : sections) {
for (size_t i = 0, e = sec->pieces.size(); i != e; ++i) {
if (!sec->pieces[i].live)
diff --git a/lld/ELF/Writer.cpp b/lld/ELF/Writer.cpp
index 649958b74798..5e2cf0713c40 100644
--- a/lld/ELF/Writer.cpp
+++ b/lld/ELF/Writer.cpp
@@ -2915,7 +2915,7 @@ computeHash(llvm::MutableArrayRef<uint8_t> hashBuf,
std::unique_ptr<uint8_t[]> hashes(new uint8_t[hashesSize]);
// Compute hash values.
- parallelForEachN(0, chunks.size(), [&](size_t i) {
+ parallelFor(0, chunks.size(), [&](size_t i) {
hashFn(hashes.get() + i * hashBuf.size(), chunks[i]);
});
diff --git a/lld/MachO/ICF.cpp b/lld/MachO/ICF.cpp
index 6d10262826e5..515fa7fbbf54 100644
--- a/lld/MachO/ICF.cpp
+++ b/lld/MachO/ICF.cpp
@@ -270,10 +270,10 @@ void ICF::forEachClass(llvm::function_ref<void(size_t, size_t)> func) {
size_t boundaries[shards + 1];
boundaries[0] = 0;
boundaries[shards] = icfInputs.size();
- parallelForEachN(1, shards, [&](size_t i) {
+ parallelFor(1, shards, [&](size_t i) {
boundaries[i] = findBoundary((i - 1) * step, icfInputs.size());
});
- parallelForEachN(1, shards + 1, [&](size_t i) {
+ parallelFor(1, shards + 1, [&](size_t i) {
if (boundaries[i - 1] < boundaries[i]) {
forEachClassRange(boundaries[i - 1], boundaries[i], func);
}
diff --git a/lld/MachO/MapFile.cpp b/lld/MachO/MapFile.cpp
index a4a0065c2816..974d823a4fab 100644
--- a/lld/MachO/MapFile.cpp
+++ b/lld/MachO/MapFile.cpp
@@ -75,7 +75,7 @@ static std::pair<Symbols, Symbols> getSymbols() {
static DenseMap<Symbol *, std::string>
getSymbolStrings(ArrayRef<Defined *> syms) {
std::vector<std::string> str(syms.size());
- parallelForEachN(0, syms.size(), [&](size_t i) {
+ parallelFor(0, syms.size(), [&](size_t i) {
raw_string_ostream os(str[i]);
Defined *sym = syms[i];
diff --git a/lld/MachO/UnwindInfoSection.cpp b/lld/MachO/UnwindInfoSection.cpp
index 5822d668b4c0..2c4a469578de 100644
--- a/lld/MachO/UnwindInfoSection.cpp
+++ b/lld/MachO/UnwindInfoSection.cpp
@@ -326,7 +326,7 @@ void UnwindInfoSectionImpl::prepareRelocations(ConcatInputSection *isec) {
// is no source address to make a relative location meaningful.
void UnwindInfoSectionImpl::relocateCompactUnwind(
std::vector<CompactUnwindEntry> &cuEntries) {
- parallelForEachN(0, symbolsVec.size(), [&](size_t i) {
+ parallelFor(0, symbolsVec.size(), [&](size_t i) {
CompactUnwindEntry &cu = cuEntries[i];
const Defined *d = symbolsVec[i].second;
cu.functionAddress = d->getVA();
diff --git a/lld/wasm/MapFile.cpp b/lld/wasm/MapFile.cpp
index 9dbab5046e23..0e63fda6acd6 100644
--- a/lld/wasm/MapFile.cpp
+++ b/lld/wasm/MapFile.cpp
@@ -75,7 +75,7 @@ static SymbolMapTy getSectionSyms(ArrayRef<Symbol *> syms) {
static DenseMap<Symbol *, std::string>
getSymbolStrings(ArrayRef<Symbol *> syms) {
std::vector<std::string> str(syms.size());
- parallelForEachN(0, syms.size(), [&](size_t i) {
+ parallelFor(0, syms.size(), [&](size_t i) {
raw_string_ostream os(str[i]);
auto *chunk = syms[i]->getChunk();
if (chunk == nullptr)