Parallelize .gdb_index string table writes.
When we are creating a large .gdb_index, this change makes a difference.
git-svn-id: https://llvm.org/svn/llvm-project/lld/trunk@342978 91177308-0d34-0410-b5e6-96231b3b80d8
diff --git a/ELF/SyntheticSections.cpp b/ELF/SyntheticSections.cpp
index e4b1b0c..a12a506 100644
--- a/ELF/SyntheticSections.cpp
+++ b/ELF/SyntheticSections.cpp
@@ -2576,8 +2576,9 @@
// 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) {