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/Module.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/Module.cpp')
-rw-r--r-- | lldb/source/Core/Module.cpp | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/lldb/source/Core/Module.cpp b/lldb/source/Core/Module.cpp index 8e60c23a93f..a08c1808b33 100644 --- a/lldb/source/Core/Module.cpp +++ b/lldb/source/Core/Module.cpp @@ -171,10 +171,10 @@ Module::Module(const ModuleSpec &module_spec) } if (module_spec.GetFileSpec()) - m_mod_time = FileSystem::GetModificationTime(module_spec.GetFileSpec()); + m_mod_time = FileSystem::Instance().GetModificationTime(module_spec.GetFileSpec()); else if (matching_module_spec.GetFileSpec()) m_mod_time = - FileSystem::GetModificationTime(matching_module_spec.GetFileSpec()); + FileSystem::Instance().GetModificationTime(matching_module_spec.GetFileSpec()); // Copy the architecture from the actual spec if we got one back, else use // the one that was specified @@ -219,7 +219,7 @@ Module::Module(const ModuleSpec &module_spec) Module::Module(const FileSpec &file_spec, const ArchSpec &arch, const ConstString *object_name, lldb::offset_t object_offset, const llvm::sys::TimePoint<> &object_mod_time) - : m_mod_time(FileSystem::GetModificationTime(file_spec)), m_arch(arch), + : m_mod_time(FileSystem::Instance().GetModificationTime(file_spec)), m_arch(arch), m_file(file_spec), m_object_offset(object_offset), m_object_mod_time(object_mod_time), m_file_has_changed(false), m_first_file_changed_log(false) { @@ -1062,7 +1062,7 @@ void Module::SetFileSpecAndObjectName(const FileSpec &file, // Container objects whose paths do not specify a file directly can call this // function to correct the file and object names. m_file = file; - m_mod_time = FileSystem::GetModificationTime(file); + m_mod_time = FileSystem::Instance().GetModificationTime(file); m_object_name = object_name; } @@ -1125,7 +1125,7 @@ void Module::ReportError(const char *format, ...) { bool Module::FileHasChanged() const { if (!m_file_has_changed) m_file_has_changed = - (FileSystem::GetModificationTime(m_file) != m_mod_time); + (FileSystem::Instance().GetModificationTime(m_file) != m_mod_time); return m_file_has_changed; } |