summaryrefslogtreecommitdiffstats
path: root/clang/lib
diff options
context:
space:
mode:
authorChandler Carruth <chandlerc@gmail.com>2011-10-05 03:09:51 +0000
committerChandler Carruth <chandlerc@gmail.com>2011-10-05 03:09:51 +0000
commitcf59bc5939007e078ff73ea4090875e52144413c (patch)
tree57fff80c1cbfb2c0c79f5d832072423213edf341 /clang/lib
parent02e760add3601b2e3cffe08dbd7d54499ba1cc9b (diff)
downloadbcm5719-llvm-cf59bc5939007e078ff73ea4090875e52144413c.tar.gz
bcm5719-llvm-cf59bc5939007e078ff73ea4090875e52144413c.zip
Teach Clang to cope with GCC installations that have unusual patch
"versions". Currently, these are just dropped on the floor, A concrete version number will always win out. llvm-svn: 141159
Diffstat (limited to 'clang/lib')
-rw-r--r--clang/lib/Driver/ToolChains.cpp8
1 files changed, 5 insertions, 3 deletions
diff --git a/clang/lib/Driver/ToolChains.cpp b/clang/lib/Driver/ToolChains.cpp
index 33b1916d6a5..0e9dcd14dcc 100644
--- a/clang/lib/Driver/ToolChains.cpp
+++ b/clang/lib/Driver/ToolChains.cpp
@@ -1508,9 +1508,11 @@ class GCCInstallationDetector {
return BadVersion;
if (Second.first.getAsInteger(10, GoodVersion.Minor))
return BadVersion;
- if (!Second.first.empty())
- if (Second.first.getAsInteger(10, GoodVersion.Patch))
- return BadVersion;
+ // We accept a number, or a string for the patch version, in case there
+ // is a strang suffix, or other mangling: '4.1.x', '4.1.2-rc3'. When it
+ // isn't a number, we just use '0' as the number but accept it.
+ if (Second.first.getAsInteger(10, GoodVersion.Patch))
+ GoodVersion.Patch = 0;
return GoodVersion;
}
OpenPOWER on IntegriCloud