[PATCH] D36090: [ELF] - Use multithreading for building .gdb_index.
George Rimar via Phabricator via llvm-commits
llvm-commits at lists.llvm.org
Tue Aug 1 07:14:59 PDT 2017
grimar updated this revision to Diff 109106.
grimar added a comment.
- Addressed comments.
https://reviews.llvm.org/D36090
Files:
ELF/SyntheticSections.cpp
Index: ELF/SyntheticSections.cpp
===================================================================
--- ELF/SyntheticSections.cpp
+++ ELF/SyntheticSections.cpp
@@ -1813,12 +1813,13 @@
}
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));
}
-------------- next part --------------
A non-text attachment was scrubbed...
Name: D36090.109106.patch
Type: text/x-patch
Size: 844 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20170801/c210d418/attachment.bin>
More information about the llvm-commits
mailing list