[Lldb-commits] [PATCH] D70827: [lldb] Remove FileSpec->CompileUnit inheritance

Pavel Labath via Phabricator via lldb-commits lldb-commits at lists.llvm.org
Thu Nov 28 07:40:25 PST 2019


labath marked 2 inline comments as done.
labath added inline comments.


================
Comment at: lldb/source/Commands/CommandObjectThread.cpp:1196
             start_idx_ptr = sc.comp_unit->FindLineEntry(
-                start_idx_ptr, line_number, sc.comp_unit, exact, &line_entry);
+                start_idx_ptr, line_number, nullptr, exact, &line_entry);
             if (start_idx_ptr == UINT32_MAX)
----------------
The reason the is equivalent is a bit unobvious. CompileUnit::FindLineEntry will automatically pick the primary file (the support file at index zero) if this argument is null.


================
Comment at: lldb/source/Plugins/SymbolFile/DWARF/SymbolFileDWARFDebugMap.cpp:607
   for (uint32_t i = 0; i < cu_count; ++i) {
-    if (comp_unit == m_compile_unit_infos[i].compile_unit_sp.get())
+    if (&comp_unit == m_compile_unit_infos[i].compile_unit_sp.get())
       return &m_compile_unit_infos[i];
----------------
This used to be a pointer comparison, until the type of comp_unit was changed to a reference in D56564, and the whole thing still miraculously compiled.


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D70827





More information about the lldb-commits mailing list