diff options
Diffstat (limited to 'lldb/source/Core')
| -rw-r--r-- | lldb/source/Core/ModuleList.cpp | 6 | ||||
| -rw-r--r-- | lldb/source/Core/SourceManager.cpp | 22 |
2 files changed, 10 insertions, 18 deletions
diff --git a/lldb/source/Core/ModuleList.cpp b/lldb/source/Core/ModuleList.cpp index e6e64900908..b980e15c0b3 100644 --- a/lldb/source/Core/ModuleList.cpp +++ b/lldb/source/Core/ModuleList.cpp @@ -856,9 +856,9 @@ Error ModuleList::GetSharedModule(const ModuleSpec &module_spec, // If we didn't have a UUID in mind when looking for the object file, // then we should make sure the modification time hasn't changed! if (platform_module_spec.GetUUIDPtr() == nullptr) { - TimeValue file_spec_mod_time(FileSystem::GetModificationTime( - located_binary_modulespec.GetFileSpec())); - if (file_spec_mod_time.IsValid()) { + auto file_spec_mod_time = FileSystem::GetModificationTime( + located_binary_modulespec.GetFileSpec()); + if (file_spec_mod_time != llvm::sys::TimePoint<>()) { if (file_spec_mod_time != module_sp->GetModificationTime()) { if (old_module_sp_ptr) *old_module_sp_ptr = module_sp; diff --git a/lldb/source/Core/SourceManager.cpp b/lldb/source/Core/SourceManager.cpp index 0959cabf86a..603fe571149 100644 --- a/lldb/source/Core/SourceManager.cpp +++ b/lldb/source/Core/SourceManager.cpp @@ -346,7 +346,7 @@ SourceManager::File::File(const FileSpec &file_spec, Target *target) void SourceManager::File::CommonInitializer(const FileSpec &file_spec, Target *target) { - if (!m_mod_time.IsValid()) { + if (m_mod_time == llvm::sys::TimePoint<>()) { if (target) { m_source_map_mod_id = target->GetSourcePathMap().GetModificationID(); @@ -403,7 +403,7 @@ void SourceManager::File::CommonInitializer(const FileSpec &file_spec, } } - if (m_mod_time.IsValid()) + if (m_mod_time != llvm::sys::TimePoint<>()) m_data_sp = m_file_spec.ReadFileContents(); } @@ -477,9 +477,10 @@ 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. - TimeValue curr_mod_time(FileSystem::GetModificationTime(m_file_spec)); + auto curr_mod_time = FileSystem::GetModificationTime(m_file_spec); - if (curr_mod_time.IsValid() && m_mod_time != curr_mod_time) { + if (curr_mod_time != llvm::sys::TimePoint<>() && + m_mod_time != curr_mod_time) { m_mod_time = curr_mod_time; m_data_sp = m_file_spec.ReadFileContents(); m_offsets.clear(); @@ -602,18 +603,9 @@ bool SourceManager::File::FileSpecMatches(const FileSpec &file_spec) { bool lldb_private::operator==(const SourceManager::File &lhs, const SourceManager::File &rhs) { - if (lhs.m_file_spec == rhs.m_file_spec) { - if (lhs.m_mod_time.IsValid()) { - if (rhs.m_mod_time.IsValid()) - return lhs.m_mod_time == rhs.m_mod_time; - else - return false; - } else if (rhs.m_mod_time.IsValid()) - return false; - else - return true; - } else + if (lhs.m_file_spec != rhs.m_file_spec) return false; + return lhs.m_mod_time == rhs.m_mod_time; } bool SourceManager::File::CalculateLineOffsets(uint32_t line) { |

