Parallelize .gdb_index string table writes.

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

llvm-svn: 342978
This commit is contained in:
Rui Ueyama 2018-09-25 14:34:56 +00:00
parent 934230c061
commit 7d053709d4
1 changed files with 2 additions and 1 deletions

View File

@ -2576,8 +2576,9 @@ void GdbIndexSection::writeTo(uint8_t *Buf) {
// 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) {