aboutsummaryrefslogtreecommitdiff
path: root/include/llvm/Support/Host.h
diff options
context:
space:
mode:
authorDimitry Andric <dim@FreeBSD.org>2017-04-16 16:01:22 +0000
committerDimitry Andric <dim@FreeBSD.org>2017-04-16 16:01:22 +0000
commit71d5a2540a98c81f5bcaeb48805e0e2881f530ef (patch)
tree5343938942df402b49ec7300a1c25a2d4ccd5821 /include/llvm/Support/Host.h
parent31bbf64f3a4974a2d6c8b3b27ad2f519caf74057 (diff)
Diffstat (limited to 'include/llvm/Support/Host.h')
-rw-r--r--include/llvm/Support/Host.h12
1 files changed, 10 insertions, 2 deletions
diff --git a/include/llvm/Support/Host.h b/include/llvm/Support/Host.h
index 9df584c68c0d..89986fdae971 100644
--- a/include/llvm/Support/Host.h
+++ b/include/llvm/Support/Host.h
@@ -15,6 +15,7 @@
#define LLVM_SUPPORT_HOST_H
#include "llvm/ADT/StringMap.h"
+#include "llvm/Support/MemoryBuffer.h"
#if defined(__linux__) || defined(__GNU__) || defined(__HAIKU__)
#include <endian.h>
@@ -32,9 +33,9 @@ namespace llvm {
namespace sys {
#if defined(BYTE_ORDER) && defined(BIG_ENDIAN) && BYTE_ORDER == BIG_ENDIAN
- static const bool IsBigEndianHost = true;
+constexpr bool IsBigEndianHost = true;
#else
- static const bool IsBigEndianHost = false;
+constexpr bool IsBigEndianHost = false;
#endif
static const bool IsLittleEndianHost = !IsBigEndianHost;
@@ -75,6 +76,13 @@ namespace sys {
/// from thread::hardware_concurrency(), which includes hyperthreads).
/// Returns -1 if unknown for the current host system.
int getHostNumPhysicalCores();
+
+ namespace detail {
+ /// Helper functions to extract HostCPUName from /proc/cpuinfo on linux.
+ StringRef getHostCPUNameForPowerPC(const StringRef &ProcCpuinfoContent);
+ StringRef getHostCPUNameForARM(const StringRef &ProcCpuinfoContent);
+ StringRef getHostCPUNameForS390x(const StringRef &ProcCpuinfoContent);
+ }
}
}