diff options
author | Mehdi Amini <mehdi.amini@apple.com> | 2016-10-14 21:32:35 +0000 |
---|---|---|
committer | Mehdi Amini <mehdi.amini@apple.com> | 2016-10-14 21:32:35 +0000 |
commit | f8fd20402acc0a8348a2ca1e5a399731ff723211 (patch) | |
tree | 67a71deac1dce7211067f7859c098deab3306a97 /llvm/lib/Support/Threading.cpp | |
parent | 797cb4f64614bf14c9dfccf67248718b716e1496 (diff) | |
download | bcm5719-llvm-f8fd20402acc0a8348a2ca1e5a399731ff723211.tar.gz bcm5719-llvm-f8fd20402acc0a8348a2ca1e5a399731ff723211.zip |
hardware_physical_concurrency() should return 1 when LLVM is built with LLVM_ENABLE_THREADS=OFF
llvm-svn: 284283
Diffstat (limited to 'llvm/lib/Support/Threading.cpp')
-rw-r--r-- | llvm/lib/Support/Threading.cpp | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/llvm/lib/Support/Threading.cpp b/llvm/lib/Support/Threading.cpp index 415c63f245d..fd303afbb91 100644 --- a/llvm/lib/Support/Threading.cpp +++ b/llvm/lib/Support/Threading.cpp @@ -119,6 +119,9 @@ void llvm::llvm_execute_on_thread(void (*Fn)(void*), void *UserData, #endif unsigned llvm::hardware_physical_concurrency() { +#if !LLVM_ENABLE_THREADS + return 1; +#endif int NumPhysical = sys::getHostNumPhysicalCores(); if (NumPhysical == -1) return thread::hardware_concurrency(); |