diff options
author | Chris Bieneman <beanz@apple.com> | 2015-01-26 16:56:00 +0000 |
---|---|---|
committer | Chris Bieneman <beanz@apple.com> | 2015-01-26 16:56:00 +0000 |
commit | 831fc5e87db2ea14eaaf964059b392be4463933e (patch) | |
tree | eaf016c751799942388daa8d520102a6746df017 /llvm/unittests/Support/CommandLineTest.cpp | |
parent | 9e3a5db00079bf09c82f091206453f85c055461d (diff) | |
download | llvm-831fc5e87db2ea14eaaf964059b392be4463933e.zip llvm-831fc5e87db2ea14eaaf964059b392be4463933e.tar.gz llvm-831fc5e87db2ea14eaaf964059b392be4463933e.tar.bz2 |
Putting all the standard tool options into a "Generic" category.
Summary:
This puts all the options that CommandLine.cpp implements into a category so that the APIs to hide options can not hide based on the generic category instead of string matching a partial list of argument strings.
This patch is pretty simple and straight forward but it does impact the -help output of all tools using cl::opt. Specifically the options implemented in CommandLine.cpp (help, help-list, help-hidden, help-list-hidden, print-options, print-all-options, version) are all grouped together into an Option category, and these options are never hidden by the cl::HideUnrelatedOptions API.
Reviewers: dexonsmith, chandlerc, majnemer
Subscribers: llvm-commits
Differential Revision: http://reviews.llvm.org/D7150
llvm-svn: 227093
Diffstat (limited to 'llvm/unittests/Support/CommandLineTest.cpp')
-rw-r--r-- | llvm/unittests/Support/CommandLineTest.cpp | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/llvm/unittests/Support/CommandLineTest.cpp b/llvm/unittests/Support/CommandLineTest.cpp index 0defe6f..4fa14e2 100644 --- a/llvm/unittests/Support/CommandLineTest.cpp +++ b/llvm/unittests/Support/CommandLineTest.cpp @@ -240,6 +240,11 @@ TEST(CommandLineTest, HideUnrelatedOptions) { << "Failed to hide extra option."; ASSERT_EQ(cl::NotHidden, TestOption2.getOptionHiddenFlag()) << "Hid extra option that should be visable."; + + StringMap<cl::Option*> Map; + cl::getRegisteredOptions(Map); + ASSERT_EQ(cl::NotHidden, Map["help"]->getOptionHiddenFlag()) + << "Hid default option that should be visable."; } } // anonymous namespace |