[Lldb-commits] [lldb] r298335 - Delete some dead code in HostInfo.

Zachary Turner via lldb-commits lldb-commits at lists.llvm.org
Mon Mar 20 21:01:59 PDT 2017


Author: zturner
Date: Mon Mar 20 23:01:59 2017
New Revision: 298335

URL: http://llvm.org/viewvc/llvm-project?rev=298335&view=rev
Log:
Delete some dead code in HostInfo.

Modified:
    lldb/trunk/include/lldb/Host/HostInfoBase.h
    lldb/trunk/include/lldb/Host/freebsd/HostInfoFreeBSD.h
    lldb/trunk/include/lldb/Host/linux/HostInfoLinux.h
    lldb/trunk/include/lldb/Host/macosx/HostInfoMacOSX.h
    lldb/trunk/include/lldb/Host/netbsd/HostInfoNetBSD.h
    lldb/trunk/source/Host/common/HostInfoBase.cpp
    lldb/trunk/source/Host/freebsd/HostInfoFreeBSD.cpp
    lldb/trunk/source/Host/linux/HostInfoLinux.cpp
    lldb/trunk/source/Host/macosx/HostInfoMacOSX.mm
    lldb/trunk/source/Host/netbsd/HostInfoNetBSD.cpp

Modified: lldb/trunk/include/lldb/Host/HostInfoBase.h
URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/include/lldb/Host/HostInfoBase.h?rev=298335&r1=298334&r2=298335&view=diff
==============================================================================
--- lldb/trunk/include/lldb/Host/HostInfoBase.h (original)
+++ lldb/trunk/include/lldb/Host/HostInfoBase.h Mon Mar 20 23:01:59 2017
@@ -35,39 +35,6 @@ public:
   static void Terminate();
 
   //------------------------------------------------------------------
-  /// Returns the number of CPUs on this current host.
-  ///
-  /// @return
-  ///     Number of CPUs on this current host, or zero if the number
-  ///     of CPUs can't be determined on this host.
-  //------------------------------------------------------------------
-  static uint32_t GetNumberCPUS();
-
-  //------------------------------------------------------------------
-  /// Returns the maximum length of a thread name on this platform.
-  ///
-  /// @return
-  ///     Maximum length of a thread name on this platform.
-  //------------------------------------------------------------------
-  static uint32_t GetMaxThreadNameLength();
-
-  //------------------------------------------------------------------
-  /// Gets the host vendor string.
-  ///
-  /// @return
-  ///     A const string object containing the host vendor name.
-  //------------------------------------------------------------------
-  static llvm::StringRef GetVendorString();
-
-  //------------------------------------------------------------------
-  /// Gets the host Operating System (OS) string.
-  ///
-  /// @return
-  ///     A const string object containing the host OS name.
-  //------------------------------------------------------------------
-  static llvm::StringRef GetOSString();
-
-  //------------------------------------------------------------------
   /// Gets the host target triple as a const string.
   ///
   /// @return

Modified: lldb/trunk/include/lldb/Host/freebsd/HostInfoFreeBSD.h
URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/include/lldb/Host/freebsd/HostInfoFreeBSD.h?rev=298335&r1=298334&r2=298335&view=diff
==============================================================================
--- lldb/trunk/include/lldb/Host/freebsd/HostInfoFreeBSD.h (original)
+++ lldb/trunk/include/lldb/Host/freebsd/HostInfoFreeBSD.h Mon Mar 20 23:01:59 2017
@@ -17,7 +17,6 @@ namespace lldb_private {
 
 class HostInfoFreeBSD : public HostInfoPosix {
 public:
-  static uint32_t GetMaxThreadNameLength();
   static bool GetOSVersion(uint32_t &major, uint32_t &minor, uint32_t &update);
   static bool GetOSBuildString(std::string &s);
   static bool GetOSKernelDescription(std::string &s);

Modified: lldb/trunk/include/lldb/Host/linux/HostInfoLinux.h
URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/include/lldb/Host/linux/HostInfoLinux.h?rev=298335&r1=298334&r2=298335&view=diff
==============================================================================
--- lldb/trunk/include/lldb/Host/linux/HostInfoLinux.h (original)
+++ lldb/trunk/include/lldb/Host/linux/HostInfoLinux.h Mon Mar 20 23:01:59 2017
@@ -29,7 +29,6 @@ private:
 
 public:
   static void Initialize();
-  static uint32_t GetMaxThreadNameLength();
 
   static bool GetOSVersion(uint32_t &major, uint32_t &minor, uint32_t &update);
   static bool GetOSBuildString(std::string &s);

Modified: lldb/trunk/include/lldb/Host/macosx/HostInfoMacOSX.h
URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/include/lldb/Host/macosx/HostInfoMacOSX.h?rev=298335&r1=298334&r2=298335&view=diff
==============================================================================
--- lldb/trunk/include/lldb/Host/macosx/HostInfoMacOSX.h (original)
+++ lldb/trunk/include/lldb/Host/macosx/HostInfoMacOSX.h Mon Mar 20 23:01:59 2017
@@ -30,7 +30,6 @@ public:
   static bool GetOSBuildString(std::string &s);
   static bool GetOSKernelDescription(std::string &s);
   static FileSpec GetProgramFileSpec();
-  static uint32_t GetMaxThreadNameLength();
 
 protected:
   static bool ComputeSupportExeDirectory(FileSpec &file_spec);

Modified: lldb/trunk/include/lldb/Host/netbsd/HostInfoNetBSD.h
URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/include/lldb/Host/netbsd/HostInfoNetBSD.h?rev=298335&r1=298334&r2=298335&view=diff
==============================================================================
--- lldb/trunk/include/lldb/Host/netbsd/HostInfoNetBSD.h (original)
+++ lldb/trunk/include/lldb/Host/netbsd/HostInfoNetBSD.h Mon Mar 20 23:01:59 2017
@@ -17,7 +17,6 @@ namespace lldb_private {
 
 class HostInfoNetBSD : public HostInfoPosix {
 public:
-  static uint32_t GetMaxThreadNameLength();
   static bool GetOSVersion(uint32_t &major, uint32_t &minor, uint32_t &update);
   static bool GetOSBuildString(std::string &s);
   static bool GetOSKernelDescription(std::string &s);

Modified: lldb/trunk/source/Host/common/HostInfoBase.cpp
URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/source/Host/common/HostInfoBase.cpp?rev=298335&r1=298334&r2=298335&view=diff
==============================================================================
--- lldb/trunk/source/Host/common/HostInfoBase.cpp (original)
+++ lldb/trunk/source/Host/common/HostInfoBase.cpp Mon Mar 20 23:01:59 2017
@@ -50,9 +50,6 @@ struct HostInfoBaseFields {
     }
   }
 
-  uint32_t m_number_cpus;
-  std::string m_vendor_string;
-  std::string m_os_string;
   std::string m_host_triple;
 
   ArchSpec m_host_arch_32;
@@ -79,34 +76,6 @@ void HostInfoBase::Terminate() {
   g_fields = nullptr;
 }
 
-uint32_t HostInfoBase::GetNumberCPUS() {
-  static llvm::once_flag g_once_flag;
-  llvm::call_once(g_once_flag, []() {
-    g_fields->m_number_cpus = std::thread::hardware_concurrency();
-  });
-  return g_fields->m_number_cpus;
-}
-
-uint32_t HostInfoBase::GetMaxThreadNameLength() { return 0; }
-
-llvm::StringRef HostInfoBase::GetVendorString() {
-  static llvm::once_flag g_once_flag;
-  llvm::call_once(g_once_flag, []() {
-    g_fields->m_vendor_string =
-        HostInfo::GetArchitecture().GetTriple().getVendorName().str();
-  });
-  return g_fields->m_vendor_string;
-}
-
-llvm::StringRef HostInfoBase::GetOSString() {
-  static llvm::once_flag g_once_flag;
-  llvm::call_once(g_once_flag, []() {
-    g_fields->m_os_string =
-        std::move(HostInfo::GetArchitecture().GetTriple().getOSName());
-  });
-  return g_fields->m_os_string;
-}
-
 llvm::StringRef HostInfoBase::GetTargetTriple() {
   static llvm::once_flag g_once_flag;
   llvm::call_once(g_once_flag, []() {

Modified: lldb/trunk/source/Host/freebsd/HostInfoFreeBSD.cpp
URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/source/Host/freebsd/HostInfoFreeBSD.cpp?rev=298335&r1=298334&r2=298335&view=diff
==============================================================================
--- lldb/trunk/source/Host/freebsd/HostInfoFreeBSD.cpp (original)
+++ lldb/trunk/source/Host/freebsd/HostInfoFreeBSD.cpp Mon Mar 20 23:01:59 2017
@@ -17,8 +17,6 @@
 
 using namespace lldb_private;
 
-uint32_t HostInfoFreeBSD::GetMaxThreadNameLength() { return 16; }
-
 bool HostInfoFreeBSD::GetOSVersion(uint32_t &major, uint32_t &minor,
                                    uint32_t &update) {
   struct utsname un;

Modified: lldb/trunk/source/Host/linux/HostInfoLinux.cpp
URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/source/Host/linux/HostInfoLinux.cpp?rev=298335&r1=298334&r2=298335&view=diff
==============================================================================
--- lldb/trunk/source/Host/linux/HostInfoLinux.cpp (original)
+++ lldb/trunk/source/Host/linux/HostInfoLinux.cpp Mon Mar 20 23:01:59 2017
@@ -41,8 +41,6 @@ void HostInfoLinux::Initialize() {
   g_fields = new HostInfoLinuxFields();
 }
 
-uint32_t HostInfoLinux::GetMaxThreadNameLength() { return 16; }
-
 bool HostInfoLinux::GetOSVersion(uint32_t &major, uint32_t &minor,
                                  uint32_t &update) {
   static bool success = false;

Modified: lldb/trunk/source/Host/macosx/HostInfoMacOSX.mm
URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/source/Host/macosx/HostInfoMacOSX.mm?rev=298335&r1=298334&r2=298335&view=diff
==============================================================================
--- lldb/trunk/source/Host/macosx/HostInfoMacOSX.mm (original)
+++ lldb/trunk/source/Host/macosx/HostInfoMacOSX.mm Mon Mar 20 23:01:59 2017
@@ -335,5 +335,3 @@ void HostInfoMacOSX::ComputeHostArchitec
     }
   }
 }
-
-uint32_t HostInfoMacOSX::GetMaxThreadNameLength() { return 64; }

Modified: lldb/trunk/source/Host/netbsd/HostInfoNetBSD.cpp
URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/source/Host/netbsd/HostInfoNetBSD.cpp?rev=298335&r1=298334&r2=298335&view=diff
==============================================================================
--- lldb/trunk/source/Host/netbsd/HostInfoNetBSD.cpp (original)
+++ lldb/trunk/source/Host/netbsd/HostInfoNetBSD.cpp Mon Mar 20 23:01:59 2017
@@ -21,10 +21,6 @@
 
 using namespace lldb_private;
 
-uint32_t HostInfoNetBSD::GetMaxThreadNameLength() {
-  return PTHREAD_MAX_NAMELEN_NP;
-}
-
 bool HostInfoNetBSD::GetOSVersion(uint32_t &major, uint32_t &minor,
                                   uint32_t &update) {
   struct utsname un;




More information about the lldb-commits mailing list