Commit Graph

8 Commits

Author SHA1 Message Date
Fangrui Song c35448ba80 [Driver][test] Fix cc1-spawnprocess.c 2020-11-14 09:53:34 -08:00
Fangrui Song bc7df035ae Make -fintegrated-cc1 work with cc1as
Tested 0.018s faster on my machine.
2020-11-14 01:16:16 -08:00
Yuanfang Chen 3a2df3bad0 [Clang][test] fix tests when using external assembler.
Summary:
The test assume using integraed-as, so make it explicit.

Reviewered by: aganea

Differential Revision: https://reviews.llvm.org/D80454
2020-05-25 16:47:50 -07:00
Alexandre Ganea 20f1abe306 [Clang] Limit -fintegrated-cc1 to only one TU
As discussed in https://reviews.llvm.org/D74447, this patch disables integrated-cc1 behavior if there's more than one job to be executed. This is meant to limit memory bloating, given that currently jobs don't clean up after execution (-disable-free is always active in cc1 mode).

I see this behavior as temporary until release 10.0 ships (to ease merging of this patch), then we'll reevaluate the situation, see if D74447 makes more sense on the long term.

Differential Revision: https://reviews.llvm.org/D74490
2020-02-12 17:02:57 -05:00
Nico Weber 8e5018e990 Replace CLANG_SPAWN_CC1 env var with a driver mode flag
Flags are clang's default UI is flags.

We can have an env var in addition to that, but in D69825 nobody has yet
mentioned why this needs an env var, so omit it for now.  If someone
needs to set the flag via env var, the existing CCC_OVERRIDE_OPTIONS
mechanism works for it (set CCC_OVERRIDE_OPTIONS=+-fno-integrated-cc1
for example).

Also mention the cc1-in-process change in the release notes.

Also spruce up the test a bit so it actually tests something :)

Differential Revision: https://reviews.llvm.org/D72769
2020-01-15 12:22:40 -05:00
Douglas Yung c6e69880ae Modify test to use -S instead of -c so that it works when an external assembler is used that is not present. 2020-01-14 18:58:18 -08:00
Alexandre Ganea 88b8cb7215 Fix NetBSD bot after b4a99a061f ([Clang][Driver] Re-use the calling process instead of creating a new process for the cc1 invocation) 2020-01-14 14:26:50 -05:00
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