diff options
author | Jonas Devlieghere <jonas@devlieghere.com> | 2018-10-31 21:49:27 +0000 |
---|---|---|
committer | Jonas Devlieghere <jonas@devlieghere.com> | 2018-10-31 21:49:27 +0000 |
commit | 46376966ea0f7ea9935e5d27deb423d5d9b72eff (patch) | |
tree | f67a900874bc732e7bec2afe10764076cbacc3c1 /lldb/source/Core/SourceManager.cpp | |
parent | 063fd98bcc06e49009df8cbd18484a81a612aeb6 (diff) | |
download | bcm5719-llvm-46376966ea0f7ea9935e5d27deb423d5d9b72eff.tar.gz bcm5719-llvm-46376966ea0f7ea9935e5d27deb423d5d9b72eff.zip |
[FileSystem] Extend file system and have it use the VFS.
This patch extends the FileSystem class with a bunch of functions that
are currently implemented as methods of the FileSpec class. These
methods will be removed in future commits and replaced by calls to the
file system.
The new functions are operated in terms of the virtual file system which
was recently moved from clang into LLVM so it could be reused in lldb.
Because the VFS is stateful, we turned the FileSystem class into a
singleton.
Differential revision: https://reviews.llvm.org/D53532
llvm-svn: 345783
Diffstat (limited to 'lldb/source/Core/SourceManager.cpp')
-rw-r--r-- | lldb/source/Core/SourceManager.cpp | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/lldb/source/Core/SourceManager.cpp b/lldb/source/Core/SourceManager.cpp index 590410a49bb..05e1cc1376f 100644 --- a/lldb/source/Core/SourceManager.cpp +++ b/lldb/source/Core/SourceManager.cpp @@ -370,14 +370,14 @@ void SourceManager::FindLinesMatchingRegex(FileSpec &file_spec, SourceManager::File::File(const FileSpec &file_spec, lldb::DebuggerSP debugger_sp) : m_file_spec_orig(file_spec), m_file_spec(file_spec), - m_mod_time(FileSystem::GetModificationTime(file_spec)), + m_mod_time(FileSystem::Instance().GetModificationTime(file_spec)), m_debugger_wp(debugger_sp) { CommonInitializer(file_spec, nullptr); } SourceManager::File::File(const FileSpec &file_spec, Target *target) : m_file_spec_orig(file_spec), m_file_spec(file_spec), - m_mod_time(FileSystem::GetModificationTime(file_spec)), + m_mod_time(FileSystem::Instance().GetModificationTime(file_spec)), m_debugger_wp(target ? target->GetDebugger().shared_from_this() : DebuggerSP()) { CommonInitializer(file_spec, target); @@ -422,7 +422,7 @@ void SourceManager::File::CommonInitializer(const FileSpec &file_spec, SymbolContext sc; sc_list.GetContextAtIndex(0, sc); m_file_spec = sc.comp_unit; - m_mod_time = FileSystem::GetModificationTime(m_file_spec); + m_mod_time = FileSystem::Instance().GetModificationTime(m_file_spec); } } } @@ -435,7 +435,7 @@ void SourceManager::File::CommonInitializer(const FileSpec &file_spec, if (target->GetSourcePathMap().FindFile(m_file_spec, new_file_spec) || target->GetImages().FindSourceFile(m_file_spec, new_file_spec)) { m_file_spec = new_file_spec; - m_mod_time = FileSystem::GetModificationTime(m_file_spec); + m_mod_time = FileSystem::Instance().GetModificationTime(m_file_spec); } } } @@ -515,7 +515,7 @@ void SourceManager::File::UpdateIfNeeded() { // TODO: use host API to sign up for file modifications to anything in our // source cache and only update when we determine a file has been updated. // For now we check each time we want to display info for the file. - auto curr_mod_time = FileSystem::GetModificationTime(m_file_spec); + auto curr_mod_time = FileSystem::Instance().GetModificationTime(m_file_spec); if (curr_mod_time != llvm::sys::TimePoint<>() && m_mod_time != curr_mod_time) { |