aboutsummaryrefslogtreecommitdiff
path: root/lib/Driver/ToolChains.cpp
diff options
context:
space:
mode:
authorRafael Espindola <rafael.espindola@gmail.com>2012-12-20 16:15:07 +0000
committerRafael Espindola <rafael.espindola@gmail.com>2012-12-20 16:15:07 +0000
commita367a0236211dd2c81a363c4b47b40e0ac6a8797 (patch)
tree4f5dd53be740e64bd3af90f5847571cc43d6d74f /lib/Driver/ToolChains.cpp
parentaee388b93e2b17a1047fe40482238562f47fe365 (diff)
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. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@170705 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/Driver/ToolChains.cpp')
-rw-r--r--lib/Driver/ToolChains.cpp3
1 files changed, 2 insertions, 1 deletions
diff --git a/lib/Driver/ToolChains.cpp b/lib/Driver/ToolChains.cpp
index b84a96953a..1a5f2b2ec6 100644
--- a/lib/Driver/ToolChains.cpp
+++ b/lib/Driver/ToolChains.cpp
@@ -973,7 +973,8 @@ bool Generic_GCC::GCCVersion::operator<(const GCCVersion &RHS) const {
// 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;