Skip to content

Hide irreleveant command line options of lldb-moduleimport-test #20577

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Nov 15, 2018
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
42 changes: 25 additions & 17 deletions tools/lldb-moduleimport-test/lldb-moduleimport-test.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -181,30 +181,38 @@ int main(int argc, char **argv) {
INITIALIZE_LLVM();

// Command line handling.
llvm::cl::list<std::string> InputNames(
llvm::cl::Positional, llvm::cl::desc("compiled_swift_file1.o ..."),
llvm::cl::OneOrMore);
using namespace llvm::cl;
static OptionCategory Visible("Specific Options");
HideUnrelatedOptions({&Visible});
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It looks like HideUnrelatedOptions(None) will hide everything, and then the following options don't need to get a category.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Good to know! But this way it also prints nicely in the --help output as

General options:
--version ...
Specific options:
--dump-module ...

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

By the way, do you happen to know what's up with the failure in https://ci.swift.org/job/swift-PR-osx/8961/ ?

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@graydon's disabling the test in #20581 while he investigates.


llvm::cl::opt<bool> DumpModule(
"dump-module", llvm::cl::desc(
"Dump the imported module after checking it imports just fine"));
list<std::string> InputNames(Positional, desc("compiled_swift_file1.o ..."),
OneOrMore, cat(Visible));

llvm::cl::opt<bool> Verbose(
"verbose", llvm::cl::desc("Dump informations on the loaded module"));
opt<bool> DumpModule(
"dump-module",
desc("Dump the imported module after checking it imports just fine"),
cat(Visible));

llvm::cl::opt<std::string> ModuleCachePath(
"module-cache-path", llvm::cl::desc("Clang module cache path"));
opt<bool> Verbose("verbose", desc("Dump informations on the loaded module"),
cat(Visible));

llvm::cl::opt<std::string> DumpDeclFromMangled(
"decl-from-mangled", llvm::cl::desc("dump decl from mangled names list"));
opt<std::string> ModuleCachePath(
"module-cache-path", desc("Clang module cache path"), cat(Visible));

llvm::cl::opt<std::string> DumpTypeFromMangled(
"type-from-mangled", llvm::cl::desc("dump type from mangled names list"));
opt<std::string> DumpDeclFromMangled(
"decl-from-mangled", desc("dump decl from mangled names list"),
cat(Visible));

llvm::cl::opt<std::string> ResourceDir("resource-dir",
llvm::cl::desc("The directory that holds the compiler resource files"));
opt<std::string> DumpTypeFromMangled(
"type-from-mangled", desc("dump type from mangled names list"),
cat(Visible));

llvm::cl::ParseCommandLineOptions(argc, argv);
opt<std::string> ResourceDir(
"resource-dir",
desc("The directory that holds the compiler resource files"),
cat(Visible));

ParseCommandLineOptions(argc, argv);
// Unregister our options so they don't interfere with the command line
// parsing in CodeGen/BackendUtil.cpp.
ModuleCachePath.removeArgument();
Expand Down