[PATCH] D52193: RFC: [clang] Multithreaded compilation support
Reid Kleckner via Phabricator via cfe-commits
cfe-commits at lists.llvm.org
Tue Sep 18 17:18:11 PDT 2018
rnk added a comment.
This is pretty cool. The process launching APIs in LLVM were pretty basic, left a lot to be desired, returned ints, etc etc. This addresses a lot of that.
================
Comment at: clang/trunk/lib/Driver/Driver.cpp:3030
+ if (Arg *A = Args.getLastArg(options::OPT__SLASH_MP)) {
+ C.CoresToUse = llvm::hardware_concurrency();
+ StringRef(A->getValue()).getAsInteger(10, C.CoresToUse);
----------------
Seems nice to save a syscall and not ask how many cores we have if we were given an explicit value first.
================
Comment at: llvm/trunk/lib/Support/Windows/Program.inc:424
-ProcessInfo sys::Wait(const ProcessInfo &PI, unsigned SecondsToWait,
- bool WaitUntilChildTerminates, std::string *ErrMsg) {
- assert(PI.Pid && "invalid pid to wait on, process not started?");
- assert((PI.Process && PI.Process != INVALID_HANDLE_VALUE) &&
- "invalid process handle to wait on, process not started?");
+bool sys::WaitMany(MutableArrayRef<ProcessInfo *> PIArray, bool WaitOnAll,
+ unsigned SecondsToWait, bool WaitUntilProcessTerminates) {
----------------
I guess no Posix implementation? It's kind of hard to know if we made the right abstractions without doing it for Windows and *nix.
Repository:
rC Clang
https://reviews.llvm.org/D52193
More information about the cfe-commits
mailing list