[PATCH] D49094: Reduce memory usage when creating .gdb_index. NFC.

George Rimar via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Tue Jul 10 01:44:56 PDT 2018


grimar accepted this revision.
grimar added a comment.
This revision is now accepted and ready to land.

Looks good. It feels this change can be split into several smaller changes though.
I would do that for committing.



================
Comment at: lld/ELF/SyntheticSections.cpp:2325
+        Ret.push_back({{Ent.Name, computeGdbHash(Ent.Name)},
+                       (Ent.Descriptor.toBits() << 24) | Idx});
   }
----------------
This can be a separate change.


================
Comment at: lld/ELF/SyntheticSections.cpp:2453
     }
   }
 
----------------
This can be a separate NFC.


================
Comment at: lld/ELF/SyntheticSections.cpp:2465
     }
+    Idx += Chunk.CompilationUnits.size();
   }
----------------
Seems this part can be a separate little change too.


================
Comment at: lld/ELF/SyntheticSections.cpp:2499
+    memcpy(Buf + Sym.OutputOff, S.data(), S.size());
+    Buf[Sym.OutputOff + S.size()] = '\0';
   }
----------------
You are assuming at line 2475 that buffer is filled with zeroes. I think you can omit this line then.


https://reviews.llvm.org/D49094





More information about the llvm-commits mailing list