Don't call computeHostNumPhysicalCores when LLVM_ENABLE_THREADS is off
authorAmy Huang <akhuang@google.com>
Fri, 14 Feb 2020 22:52:25 +0000 (14:52 -0800)
committerAmy Huang <akhuang@google.com>
Fri, 14 Feb 2020 23:09:27 +0000 (15:09 -0800)
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

llvm/lib/Support/Host.cpp

index 7e772b2..371271e 100644 (file)
@@ -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