diff options
author | Pavel Labath <labath@google.com> | 2016-11-16 10:54:22 +0000 |
---|---|---|
committer | Pavel Labath <labath@google.com> | 2016-11-16 10:54:22 +0000 |
commit | 8cb1cd9b7bb96e311e75b5427113f920ec0b6289 (patch) | |
tree | 6accc2e8663fca00575540ef057ee012467fb045 /lldb/source/Commands | |
parent | 5b909a6534ab18c8d8ab04ed1c05a9c50815bebc (diff) | |
download | bcm5719-llvm-8cb1cd9b7bb96e311e75b5427113f920ec0b6289.tar.gz bcm5719-llvm-8cb1cd9b7bb96e311e75b5427113f920ec0b6289.zip |
Remove TimeValue class
Summary:
All usages have been replaced by appropriate std::chrono funcionality, and the
class is now unused. The only used part of the cpp file is the DumpTimePoint
function, which I have moved into the only caller (CommandObjectTarget.cpp).
Reviewers: clayborg, zturner
Subscribers: mgorny, lldb-commits
Differential Revision: https://reviews.llvm.org/D26451
llvm-svn: 287096
Diffstat (limited to 'lldb/source/Commands')
-rw-r--r-- | lldb/source/Commands/CommandObjectTarget.cpp | 20 |
1 files changed, 19 insertions, 1 deletions
diff --git a/lldb/source/Commands/CommandObjectTarget.cpp b/lldb/source/Commands/CommandObjectTarget.cpp index 7f351ab038d..fbf69d88bf0 100644 --- a/lldb/source/Commands/CommandObjectTarget.cpp +++ b/lldb/source/Commands/CommandObjectTarget.cpp @@ -21,7 +21,6 @@ #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" @@ -133,6 +132,25 @@ static uint32_t DumpTargetList(TargetList &target_list, return num_targets; } +// TODO: Remove this once llvm can pretty-print time points +static void DumpTimePoint(llvm::sys::TimePoint<> tp, Stream &s, uint32_t width) { +#ifndef LLDB_DISABLE_POSIX + char time_buf[32]; + time_t time = llvm::sys::toTimeT(tp); + char *time_cstr = ::ctime_r(&time, time_buf); + if (time_cstr) { + char *newline = ::strpbrk(time_cstr, "\n\r"); + if (newline) + *newline = '\0'; + if (width > 0) + s.Printf("%-*s", width, time_cstr); + else + s.PutCString(time_cstr); + } else if (width > 0) + s.Printf("%-*s", width, ""); +#endif +} + #pragma mark CommandObjectTargetCreate //------------------------------------------------------------------------- |