[PATCH] D119909: [ELF] Parallelize initializeLocalSymbols

Igor Kudrin via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Thu Feb 24 03:42:13 PST 2022


ikudrin added inline comments.


================
Comment at: lld/ELF/InputFiles.cpp:1160
+
+void elf::initializeLocalSymbols(ELFFileBase *file) {
+  switch (config->ekind) {
----------------
MaskRay wrote:
> ikudrin wrote:
> > `initializeLocalSymbols()` is very similar to `postParseObjectFile()` from D119908. I believe they should be defined in the same way: both in `InputFiles.cpp` after methods they call or both in `Driver.cpp`, as static functions before `LinkerDriver::link()`.
> > Technically the new function initializeLocalSymbols can be merged into ObjFile::postParse, but functions like getSrcMsg may access the uninitialized (all nullptr) local part of InputFile::symbols.
> 
> Combing will cause null pointer reference for some diagnostics.
My comment was not about combining. I only suggested moving `initializeLocalSymbols()` to `Driver.cpp`, place it after `postParseObjectFile()` and make `static`.


Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D119909/new/

https://reviews.llvm.org/D119909



More information about the llvm-commits mailing list