[llvm] [Support] Show '[subcommand]' in the help for less than 3 subcommands (PR #74557)

David Blaikie via llvm-commits llvm-commits at lists.llvm.org
Wed Dec 6 11:45:19 PST 2023


dwblaikie wrote:

> I can't find an easy way to test this change. `cl::PrintHelpMessage()` uses `llvm::outs()` unconditionally; changing it to take an output stream as an argument would cause a cascade of changes in all the methods it calls directly and indirectly, including, for example, `Option::printOptionInfo()` with its overrides, and many others. The patch doesn't seem worth such a massive change.

I guess more unit-testability would be nice to have sooner or later as this library gets wider adoption. Whether or not you want to sign up for that now is a more open question, probably.

How were similar changes tested? Perhaps tested with a concrete usage like clang, etc? Maybe one of these users has a case that would demonstrate the change/fix?


https://github.com/llvm/llvm-project/pull/74557


More information about the llvm-commits mailing list