[PATCH] D14727: [Driver] Adapt Linux::GCCVersion::Parse to match GCC 5 installations

Thiago Macieira via cfe-commits cfe-commits at lists.llvm.org
Mon Nov 16 15:55:27 PST 2015


thiagomacieira updated this revision to Diff 40359.
thiagomacieira added a comment.

v2: fix accidental breakage of GCC 4


http://reviews.llvm.org/D14727

Files:
  lib/Driver/ToolChains.cpp

Index: lib/Driver/ToolChains.cpp
===================================================================
--- lib/Driver/ToolChains.cpp
+++ lib/Driver/ToolChains.cpp
@@ -1230,14 +1230,17 @@
   GCCVersion GoodVersion = {VersionText.str(), -1, -1, -1, "", "", ""};
   if (First.first.getAsInteger(10, GoodVersion.Major) || GoodVersion.Major < 0)
     return BadVersion;
-  GoodVersion.MajorStr = First.first.str();
+  if (First.second.empty())
+    return GoodVersion;
+
   if (Second.first.getAsInteger(10, GoodVersion.Minor) || GoodVersion.Minor < 0)
     return BadVersion;
   GoodVersion.MinorStr = Second.first.str();
 
   // First look for a number prefix and parse that if present. Otherwise just
   // stash the entire patch string in the suffix, and leave the number
   // unspecified. This covers versions strings such as:
+  //   5        (handled above)
   //   4.4
   //   4.4.0
   //   4.4.x


-------------- next part --------------
A non-text attachment was scrubbed...
Name: D14727.40359.patch
Type: text/x-patch
Size: 899 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/cfe-commits/attachments/20151116/82e0cbeb/attachment-0001.bin>


More information about the cfe-commits mailing list