[Lldb-commits] [PATCH] D104404: Change PathMappingList::RemapPath to return an optional result (NFC)

Jim Ingham via Phabricator via lldb-commits lldb-commits at lists.llvm.org
Fri Jun 25 09:36:11 PDT 2021


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

LGTM.

If the return type of the new function is not too awful to type, maybe don't use auto?  It says it's returning a path, which is usually a string, not a FileSpec...  But that's more a matter of taste.



================
Comment at: lldb/source/Core/Module.cpp:1607
   std::lock_guard<std::recursive_mutex> guard(m_mutex);
-  return m_source_mappings.RemapPath(path, new_path);
+  if (auto remapped = m_source_mappings.RemapPath(path)) {
+    new_path = remapped->GetPath();
----------------
RemapPath doesn't make it obvious you are getting a FileSpec back.  Is the actual return something awful to type?


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

https://reviews.llvm.org/D104404



More information about the lldb-commits mailing list