]> granicus.if.org Git - clang/commitdiff
Just detect a distro as being fedora or not.
authorRafael Espindola <rafael.espindola@gmail.com>
Fri, 25 Oct 2013 18:09:41 +0000 (18:09 +0000)
committerRafael Espindola <rafael.espindola@gmail.com>
Fri, 25 Oct 2013 18:09:41 +0000 (18:09 +0000)
We don't have any checks that depend on the version of fedora, so we can
simplify.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@193423 91177308-0d34-0410-b5e6-96231b3b80d8

lib/Driver/ToolChains.cpp

index 89938ed22d2ce8457ddf4000b372f26156c8c8d9..76794535ba871b1e303238fca58c154143641273 100644 (file)
@@ -2094,11 +2094,7 @@ enum Distro {
   RHEL4,
   RHEL5,
   RHEL6,
-  Fedora13,
-  Fedora14,
-  Fedora15,
-  Fedora16,
-  FedoraRawhide,
+  Fedora,
   OpenSUSE,
   UbuntuHardy,
   UbuntuIntrepid,
@@ -2116,8 +2112,7 @@ enum Distro {
 };
 
 static bool IsRedhat(enum Distro Distro) {
-  return (Distro >= Fedora13 && Distro <= FedoraRawhide) ||
-         (Distro >= RHEL4    && Distro <= RHEL6);
+  return Distro == Fedora || (Distro >= RHEL4 && Distro <= RHEL6);
 }
 
 static bool IsOpenSUSE(enum Distro Distro) {
@@ -2160,17 +2155,8 @@ static Distro DetectDistro(llvm::Triple::ArchType Arch) {
 
   if (!llvm::MemoryBuffer::getFile("/etc/redhat-release", File)) {
     StringRef Data = File.get()->getBuffer();
-    if (Data.startswith("Fedora release 16"))
-      return Fedora16;
-    else if (Data.startswith("Fedora release 15"))
-      return Fedora15;
-    else if (Data.startswith("Fedora release 14"))
-      return Fedora14;
-    else if (Data.startswith("Fedora release 13"))
-      return Fedora13;
-    else if (Data.startswith("Fedora release") &&
-             Data.find("Rawhide") != StringRef::npos)
-      return FedoraRawhide;
+    if (Data.startswith("Fedora release"))
+      return Fedora;
     else if (Data.startswith("Red Hat Enterprise Linux") &&
              Data.find("release 6") != StringRef::npos)
       return RHEL6;