From 57d5adfe15dbb212011940c242a2ef4356c0164a Mon Sep 17 00:00:00 2001 From: Chris Bieneman Date: Tue, 27 Jan 2015 00:42:00 +0000 Subject: [PATCH] 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 --- include/llvm/Support/CommandLine.h | 2 +- lib/Support/CommandLine.cpp | 2 +- unittests/Support/CommandLineTest.cpp | 3 ++- 3 files changed, 4 insertions(+), 3 deletions(-) diff --git a/include/llvm/Support/CommandLine.h b/include/llvm/Support/CommandLine.h index c0e9d972498..efa17219585 100644 --- a/include/llvm/Support/CommandLine.h +++ b/include/llvm/Support/CommandLine.h @@ -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 Categories); +void HideUnrelatedOptions(ArrayRef Categories); } // End namespace cl diff --git a/lib/Support/CommandLine.cpp b/lib/Support/CommandLine.cpp index f17d1f69ad6..35c49be02ce 100644 --- a/lib/Support/CommandLine.cpp +++ b/lib/Support/CommandLine.cpp @@ -1861,7 +1861,7 @@ void cl::HideUnrelatedOptions(cl::OptionCategory &Category) { } } -void cl::HideUnrelatedOptions(ArrayRef Categories) { +void cl::HideUnrelatedOptions(ArrayRef Categories) { auto CategoriesBegin = Categories.begin(); auto CategoriesEnd = Categories.end(); StringMap Options; diff --git a/unittests/Support/CommandLineTest.cpp b/unittests/Support/CommandLineTest.cpp index 750559341cf..8e84bd93072 100644 --- a/unittests/Support/CommandLineTest.cpp +++ b/unittests/Support/CommandLineTest.cpp @@ -254,7 +254,8 @@ TEST(CommandLineTest, HideUnrelatedOptionsMulti) { cl::opt TestOption2("test-option-2", cl::cat(TestCategory)); cl::opt TestOption3("test-option-3", cl::cat(TestCategory2)); - cl::OptionCategory *VisibleCategories[] = {&TestCategory, &TestCategory2}; + const cl::OptionCategory *VisibleCategories[] = {&TestCategory, + &TestCategory2}; cl::HideUnrelatedOptions(makeArrayRef(VisibleCategories)); -- 2.34.1