[FuzzerUtil] Partially revert D38481 on FuzzerUtil

This is because lib/Fuzzer doesn't really depend on llvm infrastucture.
It's not easy to access the llvm hardware_concurrency here.

Differential Reivision: https://reviews.llvm.org/D38481

git-svn-id: svn://svn.chromium.org/llvm-project/llvm/trunk/lib/Fuzzer@314870 0b72dbe1-c17f-4bc7-b9db-2b4152be0356
diff --git a/FuzzerUtil.cpp b/FuzzerUtil.cpp
index 5f76ddc..f5a7773 100644
--- a/FuzzerUtil.cpp
+++ b/FuzzerUtil.cpp
@@ -195,7 +195,15 @@
     Printf(FallbackFMT, PC);
 }
 
-unsigned NumberOfCpuCores() { return hardware_concurrency(); }
+unsigned NumberOfCpuCores() {
+  unsigned N = std::thread::hardware_concurrency();
+  if (!N) {
+    Printf("WARNING: std::thread::hardware_concurrency not well defined for "
+           "your platform. Assuming CPU count of 1.\n");
+    N = 1;
+  }
+  return N;
+}
 
 size_t SimpleFastHash(const uint8_t *Data, size_t Size) {
   size_t Res = 0;