[Lldb-commits] [PATCH] D136114: [lldb] Allow SymbolFileDWARFDebugMap to register multiple compile units

Adrian Prantl via Phabricator via lldb-commits lldb-commits at lists.llvm.org
Wed Oct 19 12:21:41 PDT 2022


aprantl accepted this revision.
aprantl added a comment.
This revision is now accepted and ready to land.

LGTM, with two tiny new suggestions.



================
Comment at: lldb/source/Plugins/SymbolFile/DWARF/SymbolFileDWARFDebugMap.h:179
+    /// The compile units that an object file contains.
+    llvm::SmallVector<lldb::CompUnitSP, 1> compile_units_sps;
+    /// A map from the compile unit ID to its index in the vector.
----------------
IIUC, the common case is 1 unit (clang), 2 units (swift), n units (lto). Should we reserve `2` instead of one to cover the majority of use-cases?


================
Comment at: lldb/source/Plugins/SymbolFile/DWARF/SymbolFileDWARFDebugMap.h:181
+    /// A map from the compile unit ID to its index in the vector.
+    llvm::SmallDenseMap<uint64_t, uint64_t> id_to_index_map;
     uint32_t first_symbol_index = UINT32_MAX;
----------------
nit: I think we should use the same size as above `llvm::SmallDenseMap<uint64_t, uint64_t, 1>`, just to keep them in sync?


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D136114



More information about the lldb-commits mailing list