[PATCH] D88680: Add ability to turn off -fpch-instantiate-templates in clang-cl

Reid Kleckner via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Thu Oct 1 17:06:58 PDT 2020


rnk added a subscriber: zequanwu.
rnk added a comment.

I think the flag was originally intended to be an internal -cc1 flag not exposed to users. You should be able to work around your problem with `-Xclang -fno-pch-instantiate-templates`, btw.

----

@zequanwu, can you patch this in locally and take over this patch? Please address the hasFlag comment above, add a test to clang/test/Driver, and make sure the flag works with `--driver-mode=gcc` and `--driver-mode=cl`. Follow the examples of the other tests, run clang with `-###`, and make sure this flag does or does not appear on the `-cc1` line.



================
Comment at: clang/lib/Driver/ToolChains/Clang.cpp:1217
+      // precomp using /Yc
+      if (!Args.hasArg(options::OPT_fno_pch_instantiate_templates))
+        CmdArgs.push_back(Args.MakeArgString("-fpch-instantiate-templates"));
----------------
This should probably be `hasFlag(fpch_ins..., fno_pch_inst..., true)` so that `-fno-pch-inst -fpch-inst...` works.


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D88680



More information about the cfe-commits mailing list