[llvm] r227167 - Revert r227148 & r227154 which added a test which infinitely loops.
Owen Anderson
resistor at mac.com
Tue Jan 27 11:07:24 PST 2015
Richard,
Please don’t revert changes without explanation of what’s happening and how to reproduce it. We don’t see see this failure happening on buildbots. At the very least, a reply to the original commit email with a pointer to the failure would be polite.
—Owen
> On Jan 26, 2015, at 7:03 PM, Richard Trieu <rtrieu at google.com> wrote:
>
> Author: rtrieu
> Date: Mon Jan 26 21:03:47 2015
> New Revision: 227167
>
> URL: http://llvm.org/viewvc/llvm-project?rev=227167&view=rev
> Log:
> Revert r227148 & r227154 which added a test which infinitely loops.
>
> r227148 added test CommandLineTest.HideUnrelatedOptionsMulti which repeatedly
> outputs two following lines:
>
> -tool: CommandLine Error: Option 'test-option-1' registered more than once!
> -tool: CommandLine Error: Option 'test-option-2' registered more than once!
>
> r227154 depends on changes from r227148
>
> 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=227167&r1=227166&r2=227167&view=diff
> ==============================================================================
> --- llvm/trunk/include/llvm/Support/CommandLine.h (original)
> +++ llvm/trunk/include/llvm/Support/CommandLine.h Mon Jan 26 21:03:47 2015
> @@ -20,7 +20,6 @@
> #ifndef LLVM_SUPPORT_COMMANDLINE_H
> #define LLVM_SUPPORT_COMMANDLINE_H
>
> -#include "llvm/ADT/ArrayRef.h"
> #include "llvm/ADT/SmallVector.h"
> #include "llvm/ADT/StringMap.h"
> #include "llvm/ADT/Twine.h"
> @@ -1939,7 +1938,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<const cl::OptionCategory *> Categories);
> +void HideUnrelatedOptions(SmallVectorImpl<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=227167&r1=227166&r2=227167&view=diff
> ==============================================================================
> --- llvm/trunk/lib/Support/CommandLine.cpp (original)
> +++ llvm/trunk/lib/Support/CommandLine.cpp Mon Jan 26 21:03:47 2015
> @@ -1861,7 +1861,8 @@ void cl::HideUnrelatedOptions(cl::Option
> }
> }
>
> -void cl::HideUnrelatedOptions(ArrayRef<const cl::OptionCategory *> Categories) {
> +void cl::HideUnrelatedOptions(
> + SmallVectorImpl<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=227167&r1=227166&r2=227167&view=diff
> ==============================================================================
> --- llvm/trunk/unittests/Support/CommandLineTest.cpp (original)
> +++ llvm/trunk/unittests/Support/CommandLineTest.cpp Mon Jan 26 21:03:47 2015
> @@ -247,29 +247,4 @@ TEST(CommandLineTest, HideUnrelatedOptio
> << "Hid default option that should be visable.";
> }
>
> -cl::OptionCategory TestCategory2("Test Options set 2", "Description");
> -
> -TEST(CommandLineTest, HideUnrelatedOptionsMulti) {
> - cl::opt<int> TestOption1("test-option-1");
> - cl::opt<int> TestOption2("test-option-2", cl::cat(TestCategory));
> - cl::opt<int> TestOption3("test-option-3", cl::cat(TestCategory2));
> -
> - const cl::OptionCategory *VisibleCategories[] = {&TestCategory,
> - &TestCategory2};
> -
> - cl::HideUnrelatedOptions(makeArrayRef(VisibleCategories));
> -
> - ASSERT_EQ(cl::ReallyHidden, TestOption1.getOptionHiddenFlag())
> - << "Failed to hide extra option.";
> - ASSERT_EQ(cl::NotHidden, TestOption2.getOptionHiddenFlag())
> - << "Hid extra option that should be visable.";
> - ASSERT_EQ(cl::NotHidden, TestOption3.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
>
>
> _______________________________________________
> llvm-commits mailing list
> llvm-commits at cs.uiuc.edu
> http://lists.cs.uiuc.edu/mailman/listinfo/llvm-commits
More information about the llvm-commits
mailing list