[lld] r342978 - Parallelize .gdb_index string table writes.

Rui Ueyama via llvm-commits llvm-commits at lists.llvm.org
Tue Sep 25 07:34:56 PDT 2018


Author: ruiu
Date: Tue Sep 25 07:34:56 2018
New Revision: 342978

URL: http://llvm.org/viewvc/llvm-project?rev=342978&view=rev
Log:
Parallelize .gdb_index string table writes.

When we are creating a large .gdb_index, this change makes a difference.

Modified:
    lld/trunk/ELF/SyntheticSections.cpp

Modified: lld/trunk/ELF/SyntheticSections.cpp
URL: http://llvm.org/viewvc/llvm-project/lld/trunk/ELF/SyntheticSections.cpp?rev=342978&r1=342977&r2=342978&view=diff
==============================================================================
--- lld/trunk/ELF/SyntheticSections.cpp (original)
+++ lld/trunk/ELF/SyntheticSections.cpp Tue Sep 25 07:34:56 2018
@@ -2576,8 +2576,9 @@ void GdbIndexSection::writeTo(uint8_t *B
 
   // Write the string pool.
   Hdr->ConstantPoolOff = Buf - Start;
-  for (GdbSymbol &Sym : Symbols)
+  parallelForEach(Symbols, [&](GdbSymbol &Sym) {
     memcpy(Buf + Sym.NameOff, Sym.Name.data(), Sym.Name.size());
+  });
 
   // Write the CU vectors.
   for (GdbSymbol &Sym : Symbols) {




More information about the llvm-commits mailing list