On Thu, Dec 20, 2012 at 8:15 AM, Rafael Espindola <[email protected]> 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 > [email protected] > http://lists.cs.uiuc.edu/mailman/listinfo/cfe-commits _______________________________________________ cfe-commits mailing list [email protected] http://lists.cs.uiuc.edu/mailman/listinfo/cfe-commits
