Remove TimeValue usage from lldb/Interpreter
authorPavel Labath <labath@google.com>
Wed, 9 Nov 2016 14:33:22 +0000 (14:33 +0000)
committerPavel Labath <labath@google.com>
Wed, 9 Nov 2016 14:33:22 +0000 (14:33 +0000)
llvm-svn: 286369

lldb/include/lldb/Interpreter/OptionValueFileSpec.h
lldb/source/Commands/CommandObjectTarget.cpp
lldb/source/Interpreter/OptionValueFileSpec.cpp

index 1a20245..7569a5f 100644 (file)
@@ -13,7 +13,7 @@
 #include "lldb/Interpreter/OptionValue.h"
 
 #include "lldb/Host/FileSpec.h"
-#include "lldb/Host/TimeValue.h"
+#include "llvm/Support/Chrono.h"
 
 namespace lldb_private {
 
@@ -48,7 +48,7 @@ public:
     m_current_value = m_default_value;
     m_value_was_set = false;
     m_data_sp.reset();
-    m_data_mod_time.Clear();
+    m_data_mod_time = llvm::sys::TimePoint<>();
     return true;
   }
 
@@ -85,7 +85,7 @@ protected:
   FileSpec m_current_value;
   FileSpec m_default_value;
   lldb::DataBufferSP m_data_sp;
-  TimeValue m_data_mod_time;
+  llvm::sys::TimePoint<> m_data_mod_time;
   uint32_t m_completion_mask;
   bool m_resolve;
 };
index 8e1e667..a40f9c9 100644 (file)
@@ -21,6 +21,7 @@
 #include "lldb/DataFormatters/ValueObjectPrinter.h"
 #include "lldb/Host/StringConvert.h"
 #include "lldb/Host/Symbols.h"
+#include "lldb/Host/TimeValue.h"
 #include "lldb/Interpreter/Args.h"
 #include "lldb/Interpreter/CommandInterpreter.h"
 #include "lldb/Interpreter/CommandReturnObject.h"
index 479d57e..f5c292d 100644 (file)
@@ -79,7 +79,7 @@ Error OptionValueFileSpec::SetValueFromString(llvm::StringRef value,
       m_value_was_set = true;
       m_current_value.SetFile(value.str(), m_resolve);
       m_data_sp.reset();
-      m_data_mod_time.Clear();
+      m_data_mod_time = llvm::sys::TimePoint<>();
       NotifyValueChanged();
     } else {
       error.SetErrorString("invalid value string");
@@ -117,8 +117,7 @@ size_t OptionValueFileSpec::AutoComplete(CommandInterpreter &interpreter,
 const lldb::DataBufferSP &
 OptionValueFileSpec::GetFileContents(bool null_terminate) {
   if (m_current_value) {
-    const TimeValue file_mod_time =
-        FileSystem::GetModificationTime(m_current_value);
+    const auto file_mod_time = FileSystem::GetModificationTime(m_current_value);
     if (m_data_sp && m_data_mod_time == file_mod_time)
       return m_data_sp;
     if (null_terminate)