summaryrefslogtreecommitdiffstats
path: root/lldb/source
diff options
context:
space:
mode:
Diffstat (limited to 'lldb/source')
-rw-r--r--lldb/source/Host/common/HostInfoBase.cpp37
1 files changed, 18 insertions, 19 deletions
diff --git a/lldb/source/Host/common/HostInfoBase.cpp b/lldb/source/Host/common/HostInfoBase.cpp
index b564b254740..3b90680d451 100644
--- a/lldb/source/Host/common/HostInfoBase.cpp
+++ b/lldb/source/Host/common/HostInfoBase.cpp
@@ -22,86 +22,85 @@
using namespace lldb;
using namespace lldb_private;
+uint32_t HostInfoBase::m_number_cpus = 0;
+std::string HostInfoBase::m_vendor_string;
+std::string HostInfoBase::m_os_string;
+std::string HostInfoBase::m_host_triple;
+ArchSpec HostInfoBase::m_host_arch_32;
+ArchSpec HostInfoBase::m_host_arch_64;
uint32_t
HostInfoBase::GetNumberCPUS()
{
static bool is_initialized = false;
- uint32_t g_number_cpus = 0;
if (!is_initialized)
{
- g_number_cpus = std::thread::hardware_concurrency();
+ m_number_cpus = std::thread::hardware_concurrency();
is_initialized = true;
}
- return g_number_cpus;
+ return m_number_cpus;
}
llvm::StringRef
HostInfoBase::GetVendorString()
{
static bool is_initialized = false;
- std::string g_vendor_string;
if (!is_initialized)
{
const ArchSpec &host_arch = HostInfo::GetArchitecture();
const llvm::StringRef &str_ref = host_arch.GetTriple().getVendorName();
- g_vendor_string.assign(str_ref.begin(), str_ref.end());
+ m_vendor_string.assign(str_ref.begin(), str_ref.end());
is_initialized = true;
}
- return llvm::StringRef(g_vendor_string);
+ return m_vendor_string;
}
llvm::StringRef
HostInfoBase::GetOSString()
{
static bool is_initialized = false;
- std::string g_os_string;
if (!is_initialized)
{
const ArchSpec &host_arch = HostInfo::GetArchitecture();
const llvm::StringRef &str_ref = host_arch.GetTriple().getOSName();
- g_os_string.assign(str_ref.begin(), str_ref.end());
+ m_os_string.assign(str_ref.begin(), str_ref.end());
is_initialized = true;
}
- return llvm::StringRef(g_os_string);
+ return m_os_string;
}
llvm::StringRef
HostInfoBase::GetTargetTriple()
{
static bool is_initialized = false;
- std::string g_host_triple;
if (!is_initialized)
{
const ArchSpec &host_arch = HostInfo::GetArchitecture();
- g_host_triple = host_arch.GetTriple().getTriple();
+ m_host_triple = host_arch.GetTriple().getTriple();
is_initialized = true;
}
- return g_host_triple;
+ return m_host_triple;
}
const ArchSpec &
HostInfoBase::GetArchitecture(ArchitectureKind arch_kind)
{
static bool is_initialized = false;
- static ArchSpec g_host_arch_32;
- static ArchSpec g_host_arch_64;
-
if (!is_initialized)
{
- HostInfo::ComputeHostArchitectureSupport(g_host_arch_32, g_host_arch_64);
+ HostInfo::ComputeHostArchitectureSupport(m_host_arch_32, m_host_arch_64);
is_initialized = true;
}
// If an explicit 32 or 64-bit architecture was requested, return that.
if (arch_kind == eArchKind32)
- return g_host_arch_32;
+ return m_host_arch_32;
if (arch_kind == eArchKind64)
- return g_host_arch_64;
+ return m_host_arch_64;
// Otherwise prefer the 64-bit architecture if it is valid.
- return (g_host_arch_64.IsValid()) ? g_host_arch_64 : g_host_arch_32;
+ return (m_host_arch_64.IsValid()) ? m_host_arch_64 : m_host_arch_32;
}
void
OpenPOWER on IntegriCloud