summaryrefslogtreecommitdiffstats
path: root/llvm/lib/Support/Threading.cpp
diff options
context:
space:
mode:
authorDaniel Neilson <dneilson@azul.com>2017-10-04 18:19:03 +0000
committerDaniel Neilson <dneilson@azul.com>2017-10-04 18:19:03 +0000
commitbef94bcbae5f5f4e01f0247322e3381f0cc07c5e (patch)
tree2966d82cacfaddcd03fc96d4d9db4d08d09fb8ba /llvm/lib/Support/Threading.cpp
parent9edbe110e88a99215836cfc4700f4fab6c8f4dbe (diff)
downloadbcm5719-llvm-bef94bcbae5f5f4e01f0247322e3381f0cc07c5e.tar.gz
bcm5719-llvm-bef94bcbae5f5f4e01f0247322e3381f0cc07c5e.zip
Revert D38481 due to missing cmake check for CPU_COUNT
Summary: This reverts D38481. The change breaks systems with older versions of glibc. It injects a use of CPU_COUNT() from sched.h without checking to ensure that the function exists first. Reviewers: Subscribers: llvm-svn: 314922
Diffstat (limited to 'llvm/lib/Support/Threading.cpp')
-rw-r--r--llvm/lib/Support/Threading.cpp14
1 files changed, 0 insertions, 14 deletions
diff --git a/llvm/lib/Support/Threading.cpp b/llvm/lib/Support/Threading.cpp
index b3579b57548..6a10b988d46 100644
--- a/llvm/lib/Support/Threading.cpp
+++ b/llvm/lib/Support/Threading.cpp
@@ -47,8 +47,6 @@ void llvm::llvm_execute_on_thread(void (*Fn)(void *), void *UserData,
unsigned llvm::heavyweight_hardware_concurrency() { return 1; }
-unsigned llvm::hardware_concurrency() { return 1; }
-
uint64_t llvm::get_threadid() { return 0; }
uint32_t llvm::get_max_thread_name_length() { return 0; }
@@ -73,18 +71,6 @@ unsigned llvm::heavyweight_hardware_concurrency() {
return NumPhysical;
}
-unsigned llvm::hardware_concurrency() {
-#ifdef HAVE_SCHED_GETAFFINITY
- cpu_set_t Set;
- if (sched_getaffinity(0, sizeof(Set), &Set))
- return CPU_COUNT(&Set);
-#endif
- // Guard against std::thread::hardware_concurrency() returning 0.
- if (unsigned Val = std::thread::hardware_concurrency())
- return Val;
- return 1;
-}
-
// Include the platform-specific parts of this class.
#ifdef LLVM_ON_UNIX
#include "Unix/Threading.inc"
OpenPOWER on IntegriCloud