[lldb] Remove m_last_file_sp from SourceManager
authorEmre Kultursay <emrekultursay@google.com>
Mon, 20 Apr 2020 14:17:36 +0000 (16:17 +0200)
committerPavel Labath <pavel@labath.sk>
Mon, 20 Apr 2020 14:27:19 +0000 (16:27 +0200)
commit865996ddf626a4d6e2a9c401b1fffc731a1946aa
tree4d105ab0b56efcf984a9f1e35acfb7e4c832a954
parent1f820fa4feda34d25e62762392c50049e5282330
[lldb] Remove m_last_file_sp from SourceManager

Summary:
...and replace it with m_last_file_spec instead.

When Source Cache is enabled, the value stored in m_last_file_sp is
already in the Source Cache, and caching it again in SourceManager
brings no extra benefit. All we need is to "remember" the last used
file, and FileSpec can serve the same purpose.

When Source Cache is disabled, the user explicitly requested no caching
of source files, and therefore, m_last_file_sp should NOT be used.

Bug: llvm.org/PR45310

Depends on D76805.

Reviewers: labath, jingham

Reviewed By: jingham

Subscribers: labath, lldb-commits

Tags: #lldb

Differential Revision: https://reviews.llvm.org/D76806
lldb/include/lldb/Core/SourceManager.h
lldb/source/Core/SourceManager.cpp
lldb/test/API/commands/settings/use_source_cache/Makefile [new file with mode: 0644]
lldb/test/API/commands/settings/use_source_cache/TestUseSourceCache.py [new file with mode: 0644]
lldb/test/API/commands/settings/use_source_cache/main.cpp [new file with mode: 0644]