diff options
Diffstat (limited to 'llvm/lib/Support/CommandLine.cpp')
-rw-r--r-- | llvm/lib/Support/CommandLine.cpp | 14 |
1 files changed, 14 insertions, 0 deletions
diff --git a/llvm/lib/Support/CommandLine.cpp b/llvm/lib/Support/CommandLine.cpp index 87f2261def5..4cd6f0c5f0a 100644 --- a/llvm/lib/Support/CommandLine.cpp +++ b/llvm/lib/Support/CommandLine.cpp @@ -1861,6 +1861,20 @@ void cl::HideUnrelatedOptions(cl::OptionCategory &Category) { } } +void cl::HideUnrelatedOptions( + SmallVectorImpl<cl::OptionCategory *> &Categories) { + auto CategoriesBegin = Categories.begin(); + auto CategoriesEnd = Categories.end(); + StringMap<cl::Option *> Options; + cl::getRegisteredOptions(Options); + for (auto &I : Options) { + if (std::find(CategoriesBegin, CategoriesEnd, I.second->Category) == + CategoriesEnd && + I.second->Category != &GenericCategory) + I.second->setHiddenFlag(cl::ReallyHidden); + } +} + void LLVMParseCommandLineOptions(int argc, const char *const *argv, const char *Overview) { llvm::cl::ParseCommandLineOptions(argc, argv, Overview); |