[PATCH] D38129: [ELF] - Speedup -r and --emit-relocs

Rui Ueyama via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Mon Sep 25 10:57:54 PDT 2017


ruiu added inline comments.


================
Comment at: ELF/SyntheticSections.cpp:1358-1360
+  // Initialize symbol search table lazily. This is used only when -r or
+  // --emit-relocs is given and allows to find symbol table index without
+  // linear search what improves perfomance drastically in some cases.
----------------
is -> are
allow to -> allow us to

Probably a better comment is just: Initializes a symbol lookup table lazily. This is used only for -r or -emit-relocs.


================
Comment at: ELF/SyntheticSections.cpp:1372-1375
+  // Handling STT_SECTION is special. We ignore section symbols when reading
+  // files and create a section symbol for each output section instead to merge
+  // them. That means we should distinguish STT_SECTION symbols by output
+  // sections they belongs to.
----------------
I think the following comment suffices.

  // Section symbols are mapped based on their output sections to maintain their semantics.


================
Comment at: ELF/SyntheticSections.h:422-424
+  llvm::once_flag InitSearchTableFlag;
+  llvm::DenseMap<SymbolBody *, size_t> SymbolToIndexMap;
+  llvm::DenseMap<OutputSection *, size_t> SectionToIndexMap;
----------------
Rename OnceFlag, SymbolIndexMap and SectionIndexMap.


https://reviews.llvm.org/D38129





More information about the llvm-commits mailing list