[PATCH] D125655: [HLSL] add -P option for dxc mode.

Greg Roth via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Mon Jul 11 23:30:06 PDT 2022


pow2clk added a comment.

Mostly just some comments on user output



================
Comment at: clang/include/clang/Basic/DiagnosticDriverKinds.td:684
+def warn_drv_dxc_ignore_output_for_preprocess : Warning<
+  "output compiler options like -Fo ignored with Preprocess">,
+  InGroup<OptionIgnored>;
----------------
As I read it, "like -Fo" means either "-Fo" or "-o". I think saying that would be less vague.


================
Comment at: clang/include/clang/Driver/Options.td:6793
 def fcgl : DXCFlag<"fcgl">, Alias<emit_pristine_llvm>;
+def dxc_P : Option<["--", "/", "-"], "P", KIND_SEPARATE>,
+  Group<dxc_Group>, Flags<[DXCOption, NoXarchOption]>,
----------------
--P is not allowed by DXC 


================
Comment at: clang/include/clang/Driver/Options.td:6796
+  HelpText<"Preprocess to file (must be used alone)."
+           "Same as -E + -o.">;
----------------
It's not the same as DXC's "-E", which is an unfortunate clash since I love redirecting preprocessed output into less 😒

I realize that we are using some of the clang defined flags to represent the weird DXC ones and in this case that is -E and -o, but this text to the user isn't going to be too helpful to the user who only has access to the DXC -E.

I'm not sure what "used alone" means in this context as you can very much include other flags alongside it


================
Comment at: clang/lib/Driver/ToolChains/Clang.cpp:3480
+      options::OPT_dxil_validator_version, options::OPT_E, options::OPT_S,
+      options::OPT_emit_llvm, options::OPT_disable_llvm_passes};
 
----------------
I think we need OPT_o here too in order to capture the full intent since -E doesn't include an output file


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D125655



More information about the cfe-commits mailing list