diff options
| author | Pavel Labath <labath@google.com> | 2016-11-09 14:04:08 +0000 |
|---|---|---|
| committer | Pavel Labath <labath@google.com> | 2016-11-09 14:04:08 +0000 |
| commit | 3dc342eb0c8bf5ba512a771add6d934b317c4941 (patch) | |
| tree | f677a6eeca427ed6f0a5709a3ddbf88476880a97 /lldb/source | |
| parent | ddbe0f51382dcc57eec973149289b79929f3cd69 (diff) | |
| download | bcm5719-llvm-3dc342eb0c8bf5ba512a771add6d934b317c4941.tar.gz bcm5719-llvm-3dc342eb0c8bf5ba512a771add6d934b317c4941.zip | |
Remove TimeValue usage from lldb/Core. NFC.
llvm-svn: 286366
Diffstat (limited to 'lldb/source')
| -rw-r--r-- | lldb/source/Core/ModuleList.cpp | 6 | ||||
| -rw-r--r-- | lldb/source/Core/SourceManager.cpp | 22 | ||||
| -rw-r--r-- | lldb/source/Target/Process.cpp | 1 |
3 files changed, 11 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) { diff --git a/lldb/source/Target/Process.cpp b/lldb/source/Target/Process.cpp index 5fe1e17b3c7..aec00f46181 100644 --- a/lldb/source/Target/Process.cpp +++ b/lldb/source/Target/Process.cpp @@ -35,6 +35,7 @@ #include "lldb/Host/Pipe.h" #include "lldb/Host/Terminal.h" #include "lldb/Host/ThreadLauncher.h" +#include "lldb/Host/TimeValue.h" #include "lldb/Interpreter/CommandInterpreter.h" #include "lldb/Interpreter/OptionValueProperties.h" #include "lldb/Symbol/Function.h" |

