labath added inline comments.
================ Comment at: lldb/source/Plugins/ObjectFile/ELF/ObjectFileELF.cpp:2205 + needle.st_section_name_string = ConstString(symbol_section_sp->GetName()); + if (unique_elf_symbols.find(needle) == unique_elf_symbols.end()) { + symtab->AddSymbol(dc_symbol); ---------------- jankratochvil wrote: > labath wrote: > > something like `if (unique_elf_symbols.insert(needle).second)` would be > > more efficient, as you don't need to mess with the map twice. > I would unconditionally add all the symbols to `std::vector<NamedElfSymbol> > unique_elf_symbols` (with `unique_elf_symbols.reserve` in advance for the sym > of `.symtab`+`.dynsym` sizes) and then after processing both `.symtab` and > `.dynsym` and can `llvm::sort(unique_elf_symbols)` and add to `symtab` only > those which are unique. I believe it will be much faster, one could benchmark > it. sounds like a good idea. Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D67390/new/ https://reviews.llvm.org/D67390 _______________________________________________ lldb-commits mailing list lldb-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits