]> granicus.if.org Git - llvm/commitdiff
One more fix to the new API to fix const-correctness.
authorChris Bieneman <beanz@apple.com>
Tue, 27 Jan 2015 00:42:00 +0000 (00:42 +0000)
committerChris Bieneman <beanz@apple.com>
Tue, 27 Jan 2015 00:42:00 +0000 (00:42 +0000)
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@227154 91177308-0d34-0410-b5e6-96231b3b80d8

include/llvm/Support/CommandLine.h
lib/Support/CommandLine.cpp
unittests/Support/CommandLineTest.cpp

index c0e9d972498c997726b7f79f8d2391c412bddad8..efa17219585b5a5b3b473360c52fe86347d578c5 100644 (file)
@@ -1939,7 +1939,7 @@ void HideUnrelatedOptions(cl::OptionCategory &Category);
 /// Some tools (like clang-format) like to be able to hide all options that are
 /// not specific to the tool. This function allows a tool to specify a single
 /// option category to display in the -help output.
-void HideUnrelatedOptions(ArrayRef<cl::OptionCategory *> Categories);
+void HideUnrelatedOptions(ArrayRef<const cl::OptionCategory *> Categories);
 
 } // End namespace cl
 
index f17d1f69ad64ea87d2032b77df58a028272754f0..35c49be02ced7f95a8cc9552d1b70359a8b8c775 100644 (file)
@@ -1861,7 +1861,7 @@ void cl::HideUnrelatedOptions(cl::OptionCategory &Category) {
   }
 }
 
-void cl::HideUnrelatedOptions(ArrayRef<cl::OptionCategory *> Categories) {
+void cl::HideUnrelatedOptions(ArrayRef<const cl::OptionCategory *> Categories) {
   auto CategoriesBegin = Categories.begin();
   auto CategoriesEnd = Categories.end();
   StringMap<cl::Option *> Options;
index 750559341cf80c22b213f1357393113168379731..8e84bd93072352fdd10a17703501224363b0e1a9 100644 (file)
@@ -254,7 +254,8 @@ TEST(CommandLineTest, HideUnrelatedOptionsMulti) {
   cl::opt<int> TestOption2("test-option-2", cl::cat(TestCategory));
   cl::opt<int> TestOption3("test-option-3", cl::cat(TestCategory2));
 
-  cl::OptionCategory *VisibleCategories[] = {&TestCategory, &TestCategory2};
+  const cl::OptionCategory *VisibleCategories[] = {&TestCategory,
+                                                   &TestCategory2};
 
   cl::HideUnrelatedOptions(makeArrayRef(VisibleCategories));