forked from OSchip/llvm-project
[ELF] - Use multithreading for building .gdb_index.
Enables multithreaded .gdb_index building. Differential revision: https://reviews.llvm.org/D36090 llvm-svn: 309688
This commit is contained in:
parent
004bd1237d
commit
2d23da0033
|
@ -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));
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in New Issue