[llvm] r227154 - One more fix to the new API to fix const-correctness.
Chris Bieneman
beanz at apple.com
Mon Jan 26 16:42:00 PST 2015
Author: cbieneman
Date: Mon Jan 26 18:42:00 2015
New Revision: 227154
URL: http://llvm.org/viewvc/llvm-project?rev=227154&view=rev
Log:
One more fix to the new API to fix const-correctness.
Modified:
llvm/trunk/include/llvm/Support/CommandLine.h
llvm/trunk/lib/Support/CommandLine.cpp
llvm/trunk/unittests/Support/CommandLineTest.cpp
Modified: llvm/trunk/include/llvm/Support/CommandLine.h
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/include/llvm/Support/CommandLine.h?rev=227154&r1=227153&r2=227154&view=diff
==============================================================================
--- llvm/trunk/include/llvm/Support/CommandLine.h (original)
+++ llvm/trunk/include/llvm/Support/CommandLine.h Mon Jan 26 18:42:00 2015
@@ -1939,7 +1939,7 @@ void HideUnrelatedOptions(cl::OptionCate
/// 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
Modified: llvm/trunk/lib/Support/CommandLine.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Support/CommandLine.cpp?rev=227154&r1=227153&r2=227154&view=diff
==============================================================================
--- llvm/trunk/lib/Support/CommandLine.cpp (original)
+++ llvm/trunk/lib/Support/CommandLine.cpp Mon Jan 26 18:42:00 2015
@@ -1861,7 +1861,7 @@ void cl::HideUnrelatedOptions(cl::Option
}
}
-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;
Modified: llvm/trunk/unittests/Support/CommandLineTest.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/unittests/Support/CommandLineTest.cpp?rev=227154&r1=227153&r2=227154&view=diff
==============================================================================
--- llvm/trunk/unittests/Support/CommandLineTest.cpp (original)
+++ llvm/trunk/unittests/Support/CommandLineTest.cpp Mon Jan 26 18:42:00 2015
@@ -254,7 +254,8 @@ TEST(CommandLineTest, HideUnrelatedOptio
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));
More information about the llvm-commits
mailing list