[PATCH] D51391: [clang-cl,PCH] Add support for #pragma hdrstop

Hans Wennborg via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Mon Sep 10 01:02:55 PDT 2018


hans added inline comments.


================
Comment at: lib/Frontend/CompilerInvocation.cpp:2862
+  Opts.PCHWithHdrStopCreate =
+      Args.getLastArgValue(OPT_pch_through_hdrstop_EQ) == "create";
   Opts.PCHThroughHeader = Args.getLastArgValue(OPT_pch_through_header_EQ);
----------------
mikerice wrote:
> hans wrote:
> > hmm, what if the value is not "create", but also not "use" but something else? maybe that should be diagnosed, or maybe the flag should be split into two?
> I am not totally happy with this but I thought one option might be a little better than two.  It would be equivalent to create two options OPT_pch_through_hdrstop_create and OPT_pch_through_hdrstop_use if that seems better (or more usual) to everyone.  I added a diagnostic if the value is not "create" or "use".  A user should never see that though if the front end and driver as in sync.
Thinking about it again, having two separate flags seems more common to me.


https://reviews.llvm.org/D51391





More information about the cfe-commits mailing list