[PATCH] D59311: [ELF] Dump symbols ordered by profiled guided section layout to file.

Rui Ueyama via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Wed Mar 27 16:01:54 PDT 2019


ruiu added inline comments.


================
Comment at: lld/ELF/CallGraphSort.cpp:243
+        // and find out a Defined symbol with name that is within the section.
+        for (Symbol *Sym: Sections[SecIndex]->File->getSymbols())
+          if (!Sym->isSection()) // Filter out section-type symbols here.
----------------
So the cost of this code is O(n*m) where n is there number of the sorted sections and n is the number of the symbols in each file. I don't think this code needs to be super fast, as this is not in the usual code path. If the performance becomes a problem, let's revisit to optimize. I'm ok with this code for now.


================
Comment at: lld/ELF/Driver.cpp:1475
     error("cannot open map file " + Config->MapFile + ": " + E.message());
+  // Fail early too if the symbol order file is not writable
+  if (auto E = tryCreateFile(Config->PrintSymbolOrder))
----------------
I don't think we need this guard, as this is a minor feature. Can you remove this code?


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D59311





More information about the llvm-commits mailing list