diff options
author | Markus Lavin <markus.lavin@ericsson.com> | 2022-02-02 09:31:29 +0100 |
---|---|---|
committer | Markus Lavin <markus.lavin@ericsson.com> | 2022-02-02 09:44:56 +0100 |
commit | 0d36d84de5f8182bd9c1628cb6cf4cd47d248c9e (patch) | |
tree | d5da7092e04dfabfad6da14b43add9a53d0cfbd2 /llvm/tools/llvm-reduce/llvm-reduce.cpp | |
parent | be20ee67e561506adc02cec0d68752cafb052c18 (diff) | |
download | llvm-0d36d84de5f8182bd9c1628cb6cf4cd47d248c9e.zip llvm-0d36d84de5f8182bd9c1628cb6cf4cd47d248c9e.tar.gz llvm-0d36d84de5f8182bd9c1628cb6cf4cd47d248c9e.tar.bz2 |
[llvm-reduce] Display all relevant options in -help
Previously the options category given to cl::HideUnrelatedOptions was
local to llvm-reduce.cpp and as a result only options declared in that
file were visible in the -help options listing. This was a bit
unfortunate since there were several useful options declared in other
files. This patch addresses that.
Differential Revision: https://reviews.llvm.org/D118682
Diffstat (limited to 'llvm/tools/llvm-reduce/llvm-reduce.cpp')
-rw-r--r-- | llvm/tools/llvm-reduce/llvm-reduce.cpp | 26 |
1 files changed, 13 insertions, 13 deletions
diff --git a/llvm/tools/llvm-reduce/llvm-reduce.cpp b/llvm/tools/llvm-reduce/llvm-reduce.cpp index 59cc055a..abcd4c6 100644 --- a/llvm/tools/llvm-reduce/llvm-reduce.cpp +++ b/llvm/tools/llvm-reduce/llvm-reduce.cpp @@ -36,44 +36,44 @@ using namespace llvm; -static cl::OptionCategory Options("llvm-reduce options"); +cl::OptionCategory LLVMReduceOptions("llvm-reduce options"); static cl::opt<bool> Help("h", cl::desc("Alias for -help"), cl::Hidden, - cl::cat(Options)); + cl::cat(LLVMReduceOptions)); static cl::opt<bool> Version("v", cl::desc("Alias for -version"), cl::Hidden, - cl::cat(Options)); + cl::cat(LLVMReduceOptions)); static cl::opt<bool> PrintDeltaPasses("print-delta-passes", cl::desc("Print list of delta passes, passable to " "--delta-passes as a comma separated list"), - cl::cat(Options)); + cl::cat(LLVMReduceOptions)); static cl::opt<std::string> InputFilename(cl::Positional, cl::Required, cl::desc("<input llvm ll/bc file>"), - cl::cat(Options)); + cl::cat(LLVMReduceOptions)); static cl::opt<std::string> TestFilename("test", cl::Required, cl::desc("Name of the interesting-ness test to be run"), - cl::cat(Options)); + cl::cat(LLVMReduceOptions)); static cl::list<std::string> TestArguments("test-arg", cl::ZeroOrMore, cl::desc("Arguments passed onto the interesting-ness test"), - cl::cat(Options)); + cl::cat(LLVMReduceOptions)); static cl::opt<std::string> OutputFilename( "output", cl::desc("Specify the output file. default: reduced.ll|mir")); static cl::alias OutputFileAlias("o", cl::desc("Alias for -output"), cl::aliasopt(OutputFilename), - cl::cat(Options)); + cl::cat(LLVMReduceOptions)); static cl::opt<bool> ReplaceInput("in-place", cl::desc("WARNING: This option will replace your input file " "with the reduced version!"), - cl::cat(Options)); + cl::cat(LLVMReduceOptions)); enum class InputLanguages { None, IR, MIR }; @@ -83,17 +83,17 @@ static cl::opt<InputLanguages> cl::init(InputLanguages::None), cl::values(clEnumValN(InputLanguages::IR, "ir", ""), clEnumValN(InputLanguages::MIR, "mir", "")), - cl::cat(Options)); + cl::cat(LLVMReduceOptions)); static cl::opt<std::string> TargetTriple("mtriple", cl::desc("Set the target triple"), - cl::cat(Options)); + cl::cat(LLVMReduceOptions)); static cl::opt<int> MaxPassIterations("max-pass-iterations", cl::desc("Maximum number of times to run the full set " "of delta passes (default=1)"), - cl::init(1), cl::cat(Options)); + cl::init(1), cl::cat(LLVMReduceOptions)); static codegen::RegisterCodeGenFlags CGF; @@ -135,7 +135,7 @@ static std::unique_ptr<LLVMTargetMachine> createTargetMachine() { int main(int Argc, char **Argv) { InitLLVM X(Argc, Argv); - cl::HideUnrelatedOptions({&Options, &getColorCategory()}); + cl::HideUnrelatedOptions({&LLVMReduceOptions, &getColorCategory()}); cl::ParseCommandLineOptions(Argc, Argv, "LLVM automatic testcase reducer.\n"); bool ReduceModeMIR = false; |