[PATCH] Fix an invalid check for duplicate option categories.

Alex McCarthy alexmc at google.com
Wed Feb 5 08:13:51 PST 2014



================
Comment at: lib/Support/CommandLine.cpp:1511
@@ -1497,5 +1510,3 @@
   static bool OptionCategoryCompare(OptionCategory *A, OptionCategory *B) {
-    int Length = strcmp(A->getName(), B->getName());
-    assert(Length != 0 && "Duplicate option categories");
-    return Length < 0;
+    return strcmp(A->getName(), B->getName());
   }
----------------
This used to return true if strcmp returned a negative value, but I think it now returns true for any non-zero return value. Is this correct, or should this be return strcmp() < 0?


http://llvm-reviews.chandlerc.com/D2699



More information about the cfe-commits mailing list