The various maps in Symtab lead to some repetative code. This should
improve the situation somewhat.
Details
Diff Detail
- Repository
- rG LLVM Github Monorepo
Event Timeline
Only have some comments about the way FindFunctionSymbols is now implemented, but otherwise this LGTM.
lldb/include/lldb/Symbol/Symtab.h | ||
---|---|---|
177 | /// Maps function names to symbol indices (grouped by FunctionNameTypes) | |
lldb/source/Symbol/Symtab.cpp | ||
1031 | Those large maps seem rather expensive to copy around. Could you just make this a for loop over the few types we care about? Then we can delete all the duplicated code. for (lldb::FunctionNameType type : {lldb::eFunctionNameTypeBase, lldb::eFunctionNameTypeMethod, lldb::eFunctionNameTypeSelector}) { if (name_type_mask & type) { auto &map = GetFunctypeMap(type); [search map] } } |
Some small rename I forgot to point out, but LGTM modulo that rename. Thanks for cleaning this up!
lldb/include/lldb/Symbol/Symtab.h | ||
---|---|---|
184 | GetNameToSymbolIndexMap might be more accurate now (I should have pointed out when changing the variable name). |
clang-tidy: error: 'lldb/Core/UniqueCStringMap.h' file not found [clang-diagnostic-error]
not useful