[PATCH] D69825: [Clang][Driver] Re-use the calling process instead of creating a new process for the cc1 invocation

Alexandre Ganea via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Thu Jan 9 05:59:31 PST 2020


aganea added inline comments.


================
Comment at: clang/lib/Driver/Job.cpp:394
+
+  llvm::CrashRecoveryContext::Enable();
+
----------------
hans wrote:
> Do we need to disable afterwards?
I moved this line to `clang/tools/driver/driver.cpp` like discussed previously.


================
Comment at: clang/tools/driver/driver.cpp:267
+
+  StringRef SpawnCC1Str = ::getenv("CLANG_SPAWN_CC1");
+  if (!SpawnCC1Str.empty()) {
----------------
hans wrote:
> Maybe just do the "!!" thing like for the environment variables above? It's not pretty, but at least that would be consistent, and it avoids the problem of deciding what values mean "on" and what mean "off".
Not if we want to negate the `CLANG_SPAWN_CC1` compile-time flag initialized just above. `!!::getenv` will only say the option is there, it won't say what we should do. My rationale was, if the env variable is there, its value overrides the compile-time flag. Unless we want something along the lines of `CLANG_ENABLE_SPAWN_CC1` / `CLANG_DISABLE_SPAWN_CC1`?


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

https://reviews.llvm.org/D69825





More information about the cfe-commits mailing list