Skip to content

Commit

Permalink
[ELF] - Use multithreading for building .gdb_index.
Browse files Browse the repository at this point in the history
Enables multithreaded .gdb_index building.

Differential revision: https://reviews.llvm.org/D36090

llvm-svn: 309688
  • Loading branch information
George Rimar committed Aug 1, 2017
1 parent 004bd12 commit 2d23da0
Showing 1 changed file with 6 additions and 5 deletions.
11 changes: 6 additions & 5 deletions lld/ELF/SyntheticSections.cpp
Expand Up @@ -1813,12 +1813,13 @@ static GdbIndexChunk readDwarf(DWARFContext &Dwarf, InputSection *Sec) {
}

template <class ELFT> GdbIndexSection *elf::createGdbIndex() {
std::vector<GdbIndexChunk> Chunks;
for (InputSection *Sec : getDebugInfoSections()) {
ObjFile<ELFT> *F = Sec->getFile<ELFT>();
std::vector<InputSection *> Sections = getDebugInfoSections();
std::vector<GdbIndexChunk> Chunks(Sections.size());
parallelForEachN(0, Chunks.size(), [&](size_t I) {
ObjFile<ELFT> *F = Sections[I]->getFile<ELFT>();
DWARFContext Dwarf(make_unique<LLDDwarfObj<ELFT>>(F));
Chunks.push_back(readDwarf(Dwarf, Sec));
}
Chunks[I] = readDwarf(Dwarf, Sections[I]);
});
return make<GdbIndexSection>(std::move(Chunks));
}

Expand Down

0 comments on commit 2d23da0

Please sign in to comment.