aboutsummaryrefslogtreecommitdiff
path: root/llvm/lib/Support/CommandLine.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'llvm/lib/Support/CommandLine.cpp')
-rw-r--r--llvm/lib/Support/CommandLine.cpp12
1 files changed, 11 insertions, 1 deletions
diff --git a/llvm/lib/Support/CommandLine.cpp b/llvm/lib/Support/CommandLine.cpp
index 40570ca..a774421 100644
--- a/llvm/lib/Support/CommandLine.cpp
+++ b/llvm/lib/Support/CommandLine.cpp
@@ -1826,12 +1826,22 @@ void cl::AddExtraVersionPrinter(void (*func)()) {
void cl::getRegisteredOptions(StringMap<Option *> &Map) {
// Get all the options.
SmallVector<Option *, 4> PositionalOpts; // NOT USED
- SmallVector<Option *, 4> SinkOpts; // NOT USED
+ SmallVector<Option *, 4> SinkOpts; // NOT USED
assert(Map.size() == 0 && "StringMap must be empty");
GetOptionInfo(PositionalOpts, SinkOpts, Map);
return;
}
+void cl::HideUnrelatedOptions(cl::OptionCategory &Category) {
+ StringMap<cl::Option *> Options;
+ cl::getRegisteredOptions(Options);
+ for (auto &I : Options) {
+ if (I.second->Category != &Category && I.first() != "help" &&
+ I.first() != "version")
+ I.second->setHiddenFlag(cl::ReallyHidden);
+ }
+}
+
void LLVMParseCommandLineOptions(int argc, const char *const *argv,
const char *Overview) {
llvm::cl::ParseCommandLineOptions(argc, argv, Overview);