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

Alexandre Ganea via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Fri Jan 10 17:51:20 PST 2020


aganea added inline comments.


================
Comment at: clang/tools/driver/driver.cpp:267
+
+  StringRef SpawnCC1Str = ::getenv("CLANG_SPAWN_CC1");
+  if (!SpawnCC1Str.empty()) {
----------------
hans wrote:
> aganea wrote:
> > 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`?
> Ah, I didn't think about that.
> 
> This feels a bit fragile though, for example if the user sets it to "yes" instead of "on", it won't be obvious that it has the opposite effect. What do you think about only supporting 1 and 0, and printing a helpful error for other values?
> 
> Also, the comparisons could be done with equals(_lower) instead of the compare methods.
As requested.


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

https://reviews.llvm.org/D69825





More information about the llvm-commits mailing list