Ver código fonte

Hook up --help-hidden with PrintHelp() (#1060)

We have defined --help-hidden in HLSLOptions.td but the compiler
is not set up to respect it. This commit hooks up them.
Lei Zhang 7 anos atrás
pai
commit
236cdc1cdf

+ 1 - 0
include/dxc/Support/HLSLOptions.h

@@ -134,6 +134,7 @@ public:
   bool OptDump = false; // OPT_ODump - dump optimizer commands
   bool OutputWarnings = true; // OPT_no_warnings
   bool ShowHelp = false;  // OPT_help
+  bool ShowHelpHidden = false; // OPT__help_hidden
   bool UseColor = false; // OPT_Cc
   bool UseHexLiterals = false; // OPT_Lx
   bool UseInstructionByteOffsets = false; // OPT_No

+ 1 - 0
lib/DxcSupport/HLSLOptions.cpp

@@ -217,6 +217,7 @@ int ReadDxcOpts(const OptTable *optionTable, unsigned flagsToInclude,
   }
 
   opts.ShowHelp = Args.hasFlag(OPT_help, OPT_INVALID, false);
+  opts.ShowHelp |= (opts.ShowHelpHidden = Args.hasFlag(OPT__help_hidden, OPT_INVALID, false));
   if (opts.ShowHelp) {
     return 0;
   }

+ 3 - 1
tools/clang/tools/dxc/dxc.cpp

@@ -1122,7 +1122,9 @@ int __cdecl wmain(int argc, const wchar_t **argv_) {
       std::string version;
       llvm::raw_string_ostream versionStream(version);
       context.GetCompilerVersionInfo(versionStream);
-      optionTable->PrintHelp(helpStream, "dxc.exe", "HLSL Compiler", versionStream.str().c_str());
+      optionTable->PrintHelp(helpStream, "dxc.exe", "HLSL Compiler",
+                             versionStream.str().c_str(),
+                             dxcOpts.ShowHelpHidden);
       helpStream.flush();
       WriteUtf8ToConsoleSizeT(helpString.data(), helpString.size());
       return 0;