llvm-project/clang/tools/driver
Alexandre Ganea b4a99a061f [Clang][Driver] Re-use the calling process instead of creating a new process for the cc1 invocation
With this patch, the clang tool will now call the -cc1 invocation directly inside the same process. Previously, the -cc1 invocation was creating, and waiting for, a new process.
This patch therefore reduces the number of created processes during a build, thus it reduces build times on platforms where process creation can be costly (Windows) and/or impacted by a antivirus.
It also makes debugging a bit easier, as there's no need to attach to the secondary -cc1 process anymore, breakpoints will be hit inside the same process.

Crashes or signaling inside the -cc1 invocation will have the same side-effect as before, and will be reported through the same means.

This behavior can be controlled at compile-time through the CLANG_SPAWN_CC1 cmake flag, which defaults to OFF. Setting it to ON will revert to the previous behavior, where any -cc1 invocation will create/fork a secondary process.
At run-time, it is also possible to tweak the CLANG_SPAWN_CC1 environment variable. Setting it and will override the compile-time setting. A value of 0 calls -cc1 inside the calling process; a value of 1 will create a secondary process, as before.

Differential Revision: https://reviews.llvm.org/D69825
2020-01-13 10:40:18 -05:00
..
CMakeLists.txt Generalize the pass registration mechanism used by Polly to any third-party tool 2020-01-02 16:45:31 +01:00
Info.plist.in [CMake] Fixing typo in Info.plist generation 2016-08-16 20:49:49 +00:00
cc1_main.cpp Generalize the pass registration mechanism used by Polly to any third-party tool 2020-01-02 16:45:31 +01:00
cc1as_main.cpp [Mips] Use appropriate private label prefix based on Mips ABI 2019-10-23 12:24:35 +02:00
cc1gen_reproducer_main.cpp Update the file headers across all of the LLVM projects in the monorepo 2019-01-19 08:50:56 +00:00
driver.cpp [Clang][Driver] Re-use the calling process instead of creating a new process for the cc1 invocation 2020-01-13 10:40:18 -05:00