From bfa601f6b8bd39902da6ff7cd5332d04ed482e38 Mon Sep 17 00:00:00 2001 From: Pavel Labath Date: Thu, 3 Nov 2016 09:29:56 +0000 Subject: [PATCH] Remove TimeSpecTimeout class the class is unused. llvm-svn: 285891 --- lldb/lldb.xcodeproj/project.pbxproj | 6 -- lldb/source/Utility/CMakeLists.txt | 1 - lldb/source/Utility/TimeSpecTimeout.cpp | 38 ----------- lldb/source/Utility/TimeSpecTimeout.h | 84 ------------------------- 4 files changed, 129 deletions(-) delete mode 100644 lldb/source/Utility/TimeSpecTimeout.cpp delete mode 100644 lldb/source/Utility/TimeSpecTimeout.h diff --git a/lldb/lldb.xcodeproj/project.pbxproj b/lldb/lldb.xcodeproj/project.pbxproj index c72498137bfe..2c095e08af0a 100644 --- a/lldb/lldb.xcodeproj/project.pbxproj +++ b/lldb/lldb.xcodeproj/project.pbxproj @@ -633,7 +633,6 @@ 26CEB5F218762056008F575A /* CommandObjectGUI.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 26CEB5F018762056008F575A /* CommandObjectGUI.cpp */; }; 26CFDCA3186163A4000E63E5 /* Editline.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 26CFDCA2186163A4000E63E5 /* Editline.cpp */; }; 26CFDCA818616473000E63E5 /* libedit.dylib in Frameworks */ = {isa = PBXBuildFile; fileRef = 26F5C32A10F3DFDD009D5894 /* libedit.dylib */; }; - 26D1804216CEDF0700EDFB5B /* TimeSpecTimeout.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 26D1804016CEDF0700EDFB5B /* TimeSpecTimeout.cpp */; }; 26D265BC136B4269002EEE45 /* lldb-public.h in Headers */ = {isa = PBXBuildFile; fileRef = 26651A14133BEC76005B64B7 /* lldb-public.h */; settings = {ATTRIBUTES = (Public, ); }; }; 26D52C1F1A980FE300E5D2FB /* MICmdCmdSymbol.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 26D52C1D1A980FE300E5D2FB /* MICmdCmdSymbol.cpp */; }; 26D55235159A7DB100708D8D /* libxml2.dylib in Frameworks */ = {isa = PBXBuildFile; fileRef = 26D55234159A7DB100708D8D /* libxml2.dylib */; }; @@ -2252,8 +2251,6 @@ 26D0DD5310FE555900271C65 /* BreakpointResolverAddress.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = BreakpointResolverAddress.cpp; path = source/Breakpoint/BreakpointResolverAddress.cpp; sourceTree = ""; }; 26D0DD5410FE555900271C65 /* BreakpointResolverFileLine.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = BreakpointResolverFileLine.cpp; path = source/Breakpoint/BreakpointResolverFileLine.cpp; sourceTree = ""; }; 26D0DD5510FE555900271C65 /* BreakpointResolverName.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = BreakpointResolverName.cpp; path = source/Breakpoint/BreakpointResolverName.cpp; sourceTree = ""; }; - 26D1804016CEDF0700EDFB5B /* TimeSpecTimeout.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = TimeSpecTimeout.cpp; path = source/Utility/TimeSpecTimeout.cpp; sourceTree = ""; }; - 26D1804616CEE12C00EDFB5B /* TimeSpecTimeout.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = TimeSpecTimeout.h; path = source/Utility/TimeSpecTimeout.h; sourceTree = ""; }; 26D27C9D11ED3A4E0024D721 /* ELFHeader.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = ELFHeader.cpp; sourceTree = ""; }; 26D27C9E11ED3A4E0024D721 /* ELFHeader.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = ELFHeader.h; sourceTree = ""; }; 26D52C1D1A980FE300E5D2FB /* MICmdCmdSymbol.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = MICmdCmdSymbol.cpp; path = "tools/lldb-mi/MICmdCmdSymbol.cpp"; sourceTree = SOURCE_ROOT; }; @@ -4242,8 +4239,6 @@ 2676A093119C93C8008A98EF /* StringExtractorGDBRemote.cpp */, 94380B8019940B0300BFE4A8 /* StringLexer.h */, 94380B8119940B0A00BFE4A8 /* StringLexer.cpp */, - 26D1804616CEE12C00EDFB5B /* TimeSpecTimeout.h */, - 26D1804016CEDF0700EDFB5B /* TimeSpecTimeout.cpp */, 94BA8B6E176F8CA0005A91B5 /* Range.h */, 94BA8B6C176F8C9B005A91B5 /* Range.cpp */, AF1FA8891A60A69500272AFC /* RegisterNumber.cpp */, @@ -7048,7 +7043,6 @@ buildActionMask = 2147483647; files = ( 33E5E8471A674FB60024ED68 /* StringConvert.cpp in Sources */, - 26D1804216CEDF0700EDFB5B /* TimeSpecTimeout.cpp in Sources */, 2689FFDA13353D9D00698AC0 /* lldb.cpp in Sources */, 4C0083401B9F9BA900D5CF24 /* UtilityFunction.cpp in Sources */, AF415AE71D949E4400FCE0D4 /* x86AssemblyInspectionEngine.cpp in Sources */, diff --git a/lldb/source/Utility/CMakeLists.txt b/lldb/source/Utility/CMakeLists.txt index dab6f3ee2c2f..9cddcc02cc58 100644 --- a/lldb/source/Utility/CMakeLists.txt +++ b/lldb/source/Utility/CMakeLists.txt @@ -15,6 +15,5 @@ add_lldb_library(lldbUtility StringExtractorGDBRemote.cpp StringLexer.cpp TaskPool.cpp - TimeSpecTimeout.cpp UriParser.cpp ) diff --git a/lldb/source/Utility/TimeSpecTimeout.cpp b/lldb/source/Utility/TimeSpecTimeout.cpp deleted file mode 100644 index b92b028a5da7..000000000000 --- a/lldb/source/Utility/TimeSpecTimeout.cpp +++ /dev/null @@ -1,38 +0,0 @@ -//===--------------------- TimeSpecTimeout.cpp ------------------*- C++ -*-===// -// -// The LLVM Compiler Infrastructure -// -// This file is distributed under the University of Illinois Open Source -// License. See LICENSE.TXT for details. -// -//===----------------------------------------------------------------------===// - -#include "TimeSpecTimeout.h" - -using namespace lldb_private; - -const struct timespec * -TimeSpecTimeout::SetAbsoluteTimeoutMircoSeconds32(uint32_t timeout_usec) { - if (timeout_usec == UINT32_MAX) { - m_infinite = true; - } else { - m_infinite = false; - TimeValue time_value(TimeValue::Now()); - time_value.OffsetWithMicroSeconds(timeout_usec); - m_timespec = time_value.GetAsTimeSpec(); - } - return GetTimeSpecPtr(); -} - -const struct timespec * -TimeSpecTimeout::SetRelativeTimeoutMircoSeconds32(uint32_t timeout_usec) { - if (timeout_usec == UINT32_MAX) { - m_infinite = true; - } else { - m_infinite = false; - TimeValue time_value; - time_value.OffsetWithMicroSeconds(timeout_usec); - m_timespec = time_value.GetAsTimeSpec(); - } - return GetTimeSpecPtr(); -} diff --git a/lldb/source/Utility/TimeSpecTimeout.h b/lldb/source/Utility/TimeSpecTimeout.h deleted file mode 100644 index 60ec33892b5a..000000000000 --- a/lldb/source/Utility/TimeSpecTimeout.h +++ /dev/null @@ -1,84 +0,0 @@ -//===--------------------- TimeSpecTimeout.h --------------------*- C++ -*-===// -// -// The LLVM Compiler Infrastructure -// -// This file is distributed under the University of Illinois Open Source -// License. See LICENSE.TXT for details. -// -//===----------------------------------------------------------------------===// - -#ifndef utility_TimeSpecTimeout_h_ -#define utility_TimeSpecTimeout_h_ - -#include "lldb/Host/PosixApi.h" -#include "lldb/Host/TimeValue.h" - -namespace lldb_private { - -class TimeSpecTimeout { -public: - TimeSpecTimeout() : m_infinite(false) { - m_timespec.tv_sec = 0; - m_timespec.tv_nsec = 0; - } - ~TimeSpecTimeout() {} - - //---------------------------------------------------------------------- - /// Sets the timespec pointer correctly given a timeout relative to the - /// current time. This function should be called immediately prior to - /// calling the function you will use this timeout with since time can - /// elapse between when this function is called and when the timeout is - /// used. - /// - /// @param[in] timeout_usec - /// The timeout in micro seconds. If timeout_usec is UINT32_MAX, the - /// timeout should be set to INFINITE. Otherwise the current time is - /// filled into the timespec and \a timeout_usec is added to the - /// current time. - /// - /// @return - /// If the timeout is INFINITE, then return NULL, otherwise return - /// a pointer to the timespec with the appropriate timeout value. - //---------------------------------------------------------------------- - const struct timespec * - SetAbsoluteTimeoutMircoSeconds32(uint32_t timeout_usec); - - //---------------------------------------------------------------------- - /// Sets the timespec pointer correctly given a relative time in micro - /// seconds. - /// - /// @param[in] timeout_usec - /// The timeout in micro seconds. If timeout_usec is UINT32_MAX, the - /// timeout should be set to INFINITE. Otherwise \a timeout_usec - /// is correctly placed into the timespec. - /// - /// @return - /// If the timeout is INFINITE, then return NULL, otherwise return - /// a pointer to the timespec with the appropriate timeout value. - //---------------------------------------------------------------------- - const struct timespec * - SetRelativeTimeoutMircoSeconds32(uint32_t timeout_usec); - - //---------------------------------------------------------------------- - /// Gets the timespec pointer that is appropriate for the timeout - /// specified. This function should only be used after a call to - /// SetRelativeTimeoutXXX() functions. - /// - /// @return - /// If the timeout is INFINITE, then return NULL, otherwise return - /// a pointer to the timespec with the appropriate timeout value. - //---------------------------------------------------------------------- - const struct timespec *GetTimeSpecPtr() const { - if (m_infinite) - return nullptr; - return &m_timespec; - } - -protected: - struct timespec m_timespec; - bool m_infinite; -}; - -} // namespace lldb_private - -#endif // #ifndef utility_TimeSpecTimeout_h_