summaryrefslogtreecommitdiffstats
path: root/lldb/source/Target/Platform.cpp
diff options
context:
space:
mode:
authorZachary Turner <zturner@google.com>2014-08-19 17:18:29 +0000
committerZachary Turner <zturner@google.com>2014-08-19 17:18:29 +0000
commit97a14e60b29c6940238410f0e8221b113a4a78d5 (patch)
tree16210d9ad28e121ef9b0ffa6d22132f7c866c346 /lldb/source/Target/Platform.cpp
parent91b2fa2a9a2ae436a84216af81bc62699a2bcfa4 (diff)
downloadbcm5719-llvm-97a14e60b29c6940238410f0e8221b113a4a78d5.tar.gz
bcm5719-llvm-97a14e60b29c6940238410f0e8221b113a4a78d5.zip
Move some Host logic into HostInfo class.
This patch creates a HostInfo class, a static class used to answer basic queries about the host platform. As part of this change, some functionality is moved from Host to HostInfo, and relevant fixups are performed in the rest of the codebase. This is part of a larger effort to isolate more code in the Host layer into platform-specific groups, to make it easier to make platform specific changes for a particular Host without breaking other hosts. Reviewed by: Greg Clayton Differential Revision: http://reviews.llvm.org/D4963 llvm-svn: 215992
Diffstat (limited to 'lldb/source/Target/Platform.cpp')
-rw-r--r--lldb/source/Target/Platform.cpp23
1 files changed, 16 insertions, 7 deletions
diff --git a/lldb/source/Target/Platform.cpp b/lldb/source/Target/Platform.cpp
index f5dd66a3e59..2392efd3f4f 100644
--- a/lldb/source/Target/Platform.cpp
+++ b/lldb/source/Target/Platform.cpp
@@ -21,6 +21,7 @@
#include "lldb/Host/FileSpec.h"
#include "lldb/Host/FileSystem.h"
#include "lldb/Host/Host.h"
+#include "lldb/Host/HostInfo.h"
#include "lldb/Target/Process.h"
#include "lldb/Target/Target.h"
#include "lldb/Utility/Utils.h"
@@ -349,9 +350,7 @@ Platform::GetOSVersion (uint32_t &major,
if (!success)
{
// We have a local host platform
- success = Host::GetOSVersion (m_major_os_version,
- m_minor_os_version,
- m_update_os_version);
+ success = HostInfo::GetOSVersion(m_major_os_version, m_minor_os_version, m_update_os_version);
m_os_version_set_while_connected = success;
}
}
@@ -398,8 +397,14 @@ Platform::GetOSVersion (uint32_t &major,
bool
Platform::GetOSBuildString (std::string &s)
{
+ s.clear();
+
if (IsHost())
- return Host::GetOSBuildString (s);
+#if !defined(__linux__)
+ return HostInfo::GetOSBuildString(s);
+#else
+ return false;
+#endif
else
return GetRemoteOSBuildString (s);
}
@@ -408,7 +413,11 @@ bool
Platform::GetOSKernelDescription (std::string &s)
{
if (IsHost())
- return Host::GetOSKernelDescription (s);
+#if !defined(__linux__)
+ return HostInfo::GetOSKernelDescription(s);
+#else
+ return false;
+#endif
else
return GetRemoteOSKernelDescription (s);
}
@@ -801,8 +810,8 @@ Platform::SetOSVersion (uint32_t major,
{
if (IsHost())
{
- // We don't need anyone setting the OS version for the host platform,
- // we should be able to figure it out by calling Host::GetOSVersion(...).
+ // We don't need anyone setting the OS version for the host platform,
+ // we should be able to figure it out by calling HostInfo::GetOSVersion(...).
return false;
}
else
OpenPOWER on IntegriCloud