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

Richard Smith richard at metafoo.co.uk
Thu Dec 20 23:10:44 PST 2012


On Thu, Dec 20, 2012 at 8:15 AM, Rafael Espindola
<rafael.espindola at gmail.com> wrote:
> 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.

Looks like this comment also needs updating!

> -  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;
>
>
>
> _______________________________________________
> cfe-commits mailing list
> cfe-commits at cs.uiuc.edu
> http://lists.cs.uiuc.edu/mailman/listinfo/cfe-commits



More information about the cfe-commits mailing list