diff options
| author | Pavel Labath <labath@google.com> | 2016-11-02 12:18:42 +0000 |
|---|---|---|
| committer | Pavel Labath <labath@google.com> | 2016-11-02 12:18:42 +0000 |
| commit | 774103c83154d776701b40d2f793867b5d6660ce (patch) | |
| tree | 8893f29c474096af2ad9c0e11c29886541ee66f4 | |
| parent | 75d2f1b10df5c258ff8acf04b86ddc9aa1c137d1 (diff) | |
| download | bcm5719-llvm-774103c83154d776701b40d2f793867b5d6660ce.tar.gz bcm5719-llvm-774103c83154d776701b40d2f793867b5d6660ce.zip | |
Remove TimeValue usage from two files
llvm-svn: 285801
| -rw-r--r-- | lldb/source/Core/Communication.cpp | 3 | ||||
| -rw-r--r-- | lldb/source/Core/Log.cpp | 35 |
2 files changed, 20 insertions, 18 deletions
diff --git a/lldb/source/Core/Communication.cpp b/lldb/source/Core/Communication.cpp index a7114cea4ab..78c2debe16a 100644 --- a/lldb/source/Core/Communication.cpp +++ b/lldb/source/Core/Communication.cpp @@ -305,8 +305,9 @@ lldb::thread_result_t Communication::ReadThread(lldb::thread_arg_t p) { ConnectionStatus status = eConnectionStatusSuccess; bool done = false; while (!done && comm->m_read_thread_enabled) { + const int timeout_us = 5000000; size_t bytes_read = comm->ReadFromConnection( - buf, sizeof(buf), 5 * TimeValue::MicroSecPerSec, status, &error); + buf, sizeof(buf), timeout_us, status, &error); if (bytes_read > 0) comm->AppendBytesToCache(buf, bytes_read, true, status); else if ((bytes_read == 0) && status == eConnectionStatusEndOfFile) { diff --git a/lldb/source/Core/Log.cpp b/lldb/source/Core/Log.cpp index cac334367ce..173d954fa16 100644 --- a/lldb/source/Core/Log.cpp +++ b/lldb/source/Core/Log.cpp @@ -7,20 +7,6 @@ // //===----------------------------------------------------------------------===// -// C Includes -// C++ Includes -#include <cstdarg> -#include <cstdio> -#include <cstdlib> -#include <map> -#include <mutex> -#include <string> - -// Other libraries and framework includes -#include "llvm/ADT/SmallString.h" -#include "llvm/Support/Signals.h" -#include "llvm/Support/raw_ostream.h" - // Project includes #include "lldb/Core/Log.h" #include "lldb/Core/PluginManager.h" @@ -28,10 +14,24 @@ #include "lldb/Core/StreamString.h" #include "lldb/Host/Host.h" #include "lldb/Host/ThisThread.h" -#include "lldb/Host/TimeValue.h" #include "lldb/Interpreter/Args.h" #include "lldb/Utility/NameMatches.h" +// Other libraries and framework includes +#include "llvm/ADT/SmallString.h" +#include "llvm/Support/Chrono.h" +#include "llvm/Support/Signals.h" +#include "llvm/Support/raw_ostream.h" + +// C Includes +// C++ Includes +#include <cstdarg> +#include <cstdio> +#include <cstdlib> +#include <map> +#include <mutex> +#include <string> + using namespace lldb; using namespace lldb_private; @@ -81,8 +81,9 @@ void Log::VAPrintf(const char *format, va_list args) { // Timestamp if requested if (m_options.Test(LLDB_LOG_OPTION_PREPEND_TIMESTAMP)) { - TimeValue now = TimeValue::Now(); - header.Printf("%9d.%9.9d ", now.seconds(), now.nanoseconds()); + auto now = std::chrono::duration<double>( + std::chrono::system_clock::now().time_since_epoch()); + header.Printf("%.9f ", now.count()); } // Add the process and thread if requested |

