There is no way to specify the number of workers when invoking lit indirectly (e.g. when building targets similar "check-clang"). Lit does not see the -j N target passed to the build tool (e.g. ninja).
This patch introduces the LIT_WORKERS environment variable, which works around this. Now, the number of cores for building dependencies of a lit test and runing the lit test can be both parametrized:
LIT_WORKERS=N ninja check-clang -j M
When invoking lit directly, the value specified via LIT_WORKERS can be overwritten by lit -j argument.