[Lldb-commits] [PATCH] D103504: Improve performance when parsing symbol tables in mach-o files.

Shafik Yaghmour via Phabricator via lldb-commits lldb-commits at lists.llvm.org
Wed Jun 2 09:47:56 PDT 2021


shafik added inline comments.


================
Comment at: lldb/source/Symbol/ObjectFile.cpp:623
   ConstString file_name = GetModule()->GetFileSpec().GetFilename();
-  ss.Printf("___lldb_unnamed_symbol%u$$%s", ++m_synthetic_symbol_idx,
-            file_name.GetCString());
-  return ConstString(ss.GetString());
+  os << "___lldb_unnamed_symbol" << ++m_synthetic_symbol_idx << "$$"
+     << file_name.GetStringRef();
----------------
We should avoid potentially hiding side effects inside expressions or function calls, I would suggest moving the `++m_synthetic_symbol_idx` before.


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D103504



More information about the lldb-commits mailing list