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

Tiancong Wang via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Wed Mar 27 15:53:35 PDT 2019


tcwang marked an inline comment as done.
tcwang added inline comments.


================
Comment at: lld/ELF/CallGraphSort.cpp:244
+        for (Symbol *Sym: Sections[SecIndex]->File->getSymbols())
+          if (!Sym->getName().empty())
+            if (auto *D = dyn_cast<Defined>(Sym))
----------------
tcwang wrote:
> ruiu wrote:
> > So I think that checking name is fragile. What do you actually want to skip by doing this?
> Because without this checking, I can get two symbols in the file that both match section. One of them is empty name. I wanted to use this filter out that symbol. Plus the goal of this part is to find out a symbol name from the file that is in the section. So empty-named symbols should be ignored?
Change the empty name check to symbol type check. If a symbol is section, no need to do the matching below.


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