[Lldb-commits] [PATCH] D158043: [lldb][NFCI] Module constructor should take ConstString by value

Adrian Prantl via Phabricator via lldb-commits lldb-commits at lists.llvm.org
Wed Aug 16 08:54:13 PDT 2023


aprantl added inline comments.


================
Comment at: lldb/include/lldb/Core/Module.h:127
       const FileSpec &file_spec, const ArchSpec &arch,
-      const ConstString *object_name = nullptr,
-      lldb::offset_t object_offset = 0,
+      const ConstString object_name, lldb::offset_t object_offset = 0,
       const llvm::sys::TimePoint<> &object_mod_time = llvm::sys::TimePoint<>());
----------------
If we're passing it by value, why the const qualifier?


================
Comment at: lldb/source/Core/Module.cpp:249
 
-  if (object_name)
-    m_object_name = *object_name;
+  m_object_name = object_name;
 
----------------
why not `m_object_name(object_name)` above?


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D158043



More information about the lldb-commits mailing list