[llvm] 01b02a7 - Don't call computeHostNumPhysicalCores when LLVM_ENABLE_THREADS is off

Amy Huang via llvm-commits llvm-commits at lists.llvm.org
Fri Feb 14 15:09:39 PST 2020


Author: Amy Huang
Date: 2020-02-14T15:09:27-08:00
New Revision: 01b02a73de78146c2072e0b5399d2a40c01eca08

URL: https://github.com/llvm/llvm-project/commit/01b02a73de78146c2072e0b5399d2a40c01eca08
DIFF: https://github.com/llvm/llvm-project/commit/01b02a73de78146c2072e0b5399d2a40c01eca08.diff

LOG: Don't call computeHostNumPhysicalCores when LLVM_ENABLE_THREADS is off

Summary:
Fix change from 8404aeb56a73 to avoid calling
computeHostNumPhysicalCores if LLVM_ENABLE_THREADS is off.

Reviewers: rnk, aganea

Subscribers: hiraditya, llvm-commits

Tags: #llvm

Differential Revision: https://reviews.llvm.org/D74654

Added: 
    

Modified: 
    llvm/lib/Support/Host.cpp

Removed: 
    


################################################################################
diff  --git a/llvm/lib/Support/Host.cpp b/llvm/lib/Support/Host.cpp
index 7e772b2b1378..371271e6bae1 100644
--- a/llvm/lib/Support/Host.cpp
+++ b/llvm/lib/Support/Host.cpp
@@ -1326,7 +1326,7 @@ int computeHostNumPhysicalCores() {
   }
   return count;
 }
-#elif defined(_WIN32)
+#elif defined(_WIN32) && LLVM_THREADS_ENABLED
 // Defined in llvm/lib/Support/Windows/Threading.inc
 int computeHostNumPhysicalCores();
 #else


        


More information about the llvm-commits mailing list