[Lldb-commits] [PATCH] D76806: Remove m_last_file_sp from SourceManager

Pavel Labath via Phabricator via lldb-commits lldb-commits at lists.llvm.org
Thu Mar 26 01:35:32 PDT 2020


labath added reviewers: labath, jingham.
labath added a comment.

It's not clear to me what is the user-visible effect of this. It sounds like there should be one, but I don't know what it is...



================
Comment at: lldb/source/Core/SourceManager.cpp:175-176
 
-  if (m_last_file_sp.get()) {
+  FileSP last_file_sp(GetFile(m_last_file_spec));
+  if (last_file_sp.get()) {
     const uint32_t end_line = start_line + count - 1;
----------------
`if(FileSP last_file_sp = GetLastFile())`


================
Comment at: lldb/source/Core/SourceManager.cpp:253
 
-  if (m_last_file_sp.get() != file_sp.get()) {
+  FileSP last_file_sp(GetFile(m_last_file_spec));
+  if (last_file_sp.get() != file_sp.get()) {
----------------
Use `GetLastFile`, since we already have it.


================
Comment at: lldb/source/Core/SourceManager.cpp:267
   // to figure it out here.
-  const bool have_default_file_line = m_last_file_sp && m_last_line > 0;
+  FileSP last_file_sp(GetFile(m_last_file_spec));
+  const bool have_default_file_line = last_file_sp && m_last_line > 0;
----------------
same here


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D76806





More information about the lldb-commits mailing list