[PATCH] D61870: Make cl::HideUnrelatedOptions more flexible
Don Hinton via Phabricator via llvm-commits
llvm-commits at lists.llvm.org
Tue May 14 10:43:17 PDT 2019
hintonda added a subscriber: beanz.
hintonda added inline comments.
================
Comment at: llvm/include/llvm/Support/CommandLine.h:1994
+ OptionHidden Opt = cl::ReallyHidden);
+void HideUnrelatedOptions(ArrayRef<const cl::OptionCategory *> Categories,
+ OptionHidden Opt,
----------------
hintonda wrote:
> Not sure how I feel about the new signatures.
>
> If someone wants to call this and pass something other than `cl::ReallyHidden`, how difficult is it for them to use the original call with the extra parameter? e.g.:
>
> ```
> cl::HideUnrelatedOptions(SomeCat, *cl::TopLevelSubCommand, cl::Hidden);
> ```
I just grep'd all the projects in the repo, and I didn't find a single case of any calls to `cl::HideUnrelatedOptions` that passed `SubCommand`, so I think you could safely change the API to the new signature with `OptionHidden` as the second argument. That would simplify the API.
@beanz, how do you feel about that?
CHANGES SINCE LAST ACTION
https://reviews.llvm.org/D61870/new/
https://reviews.llvm.org/D61870
More information about the llvm-commits
mailing list