[cfe-commits] r170705 - /cfe/trunk/lib/Driver/ToolChains.cpp

Rafael Espindola rafael.espindola at gmail.com
Thu Dec 20 08:15:07 PST 2012


Author: rafael
Date: Thu Dec 20 10:15:07 2012
New Revision: 170705

URL: http://llvm.org/viewvc/llvm-project?rev=170705&view=rev
Log:
Fix Generic_GCC::GCCVersion::operator<

Without this patch comparing two equal versions without patch numbers (4.7 for
example) will result in A < B and B < A.

Patch by Simon Atanasyan.

Modified:
    cfe/trunk/lib/Driver/ToolChains.cpp

Modified: cfe/trunk/lib/Driver/ToolChains.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/Driver/ToolChains.cpp?rev=170705&r1=170704&r2=170705&view=diff
==============================================================================
--- cfe/trunk/lib/Driver/ToolChains.cpp (original)
+++ cfe/trunk/lib/Driver/ToolChains.cpp Thu Dec 20 10:15:07 2012
@@ -973,7 +973,8 @@
   // hard-coding a patch version. Thus if the RHS has no patch, it always
   // wins, and the LHS only wins if it has no patch and the RHS does have
   // a patch.
-  if (RHS.Patch == -1) return true;   if (Patch == -1) return false;
+  if (RHS.Patch == -1 && Patch != -1) return true;
+  if (RHS.Patch != -1 && Patch == -1) return false;
   if (Patch < RHS.Patch) return true; if (Patch > RHS.Patch) return false;
   if (PatchSuffix == RHS.PatchSuffix) return false;
 





More information about the cfe-commits mailing list