[PATCH] D87187: [Driver] Perform Linux distribution detection just once

Alexandre Ganea via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Thu Sep 24 06:36:41 PDT 2020


aganea added a comment.

In D87187#2291806 <https://reviews.llvm.org/D87187#2291806>, @dmantipov wrote:

> IIUC compiler driver is not intended to be multithreaded. But OK, here is the version with llvm::call_once(...).

Thanks! There could be at least two cases I see, where the driver //could// be multi-threaded:

1. once `clang-cl /MP -fintegrated-cc1` is supported (D52193 <https://reviews.llvm.org/D52193>), I'm still planning to work on that, although in that case, it wouldn't reach this distro detection. However that patch could be extended to support `clang ... -j`.
2. Further, if the idea of llvm-buildozer ever lands (D86351 <https://reviews.llvm.org/D86351>) which in essence is a generalization of the above.

There's a slight issue with your last update, it now fails the tests (because several distros are checked one after another in the same process). You can perhaps leverage `EXPECT_EXIT(..., ::testing::ExitedWithCode(0))` in the distro tests to run each of them in a separate process (see `llvm/unittests/Support/ErrorTest.cpp` for an example).
Also please run `git clang-format`.


Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D87187/new/

https://reviews.llvm.org/D87187



More information about the cfe-commits mailing list