One more fix to the new API to fix const-correctness.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@227154 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
Chris Bieneman 2015-01-27 00:42:00 +00:00
parent eb5783171c
commit 57d5adfe15
3 changed files with 4 additions and 3 deletions

View 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

View 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;

View 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));