Revert "[Support] Move getHostNumPhysicalCores to Threading.h"
authorFlorian Hahn <flo@fhahn.com>
Fri, 25 Nov 2022 14:11:56 +0000 (14:11 +0000)
committerFlorian Hahn <flo@fhahn.com>
Fri, 25 Nov 2022 14:11:56 +0000 (14:11 +0000)
commit07ca9cc04bc2d57730507ad5ab444a1fd56cae11
tree4a038be25d66891a1bc1cf842caa72db4cdd68be
parentbe1ff1fe58b0315ac4985010c59e78d4ba353467
Revert "[Support] Move getHostNumPhysicalCores to Threading.h"

This reverts commit 5577207d6d3e0642ea047a8dfbfcf3ad372a7f25.

This breaks building LLVM on recent macOS. Error messages below:

llvm/lib/Support/Threading.cpp:190:3: error: use of undeclared
identifier 'sysctlbyname'
  sysctlbyname("hw.physicalcpu", &count, &len, NULL, 0);
    ^

llvm/lib/Support/Threading.cpp:193:13: error: use of undeclared
identifier 'CTL_HW'
    nm[0] = CTL_HW;
            ^

llvm/lib/Support/Threading.cpp:194:13: error: use of undeclared identifier 'HW_AVAILCPU'
    nm[1] = HW_AVAILCPU;
            ^

llvm/lib/Support/Threading.cpp:195:5: error: use of undeclared identifier 'sysctl'
    sysctl(nm, 2, &count, &len, NULL, 0);
    ^
clang-tools-extra/clangd/test/Inputs/BenchmarkHeader.h
llvm/include/llvm/Support/Host.h
llvm/include/llvm/Support/Threading.h
llvm/lib/Support/Host.cpp
llvm/lib/Support/Threading.cpp
llvm/unittests/Support/Host.cpp
llvm/unittests/Support/Threading.cpp