From: Rafael Espindola Date: Fri, 25 Oct 2013 18:09:41 +0000 (+0000) Subject: Just detect a distro as being fedora or not. X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=1a747829093ce59455685cdbe0aeff8d7b129d40;p=clang Just detect a distro as being fedora or not. 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 --- diff --git a/lib/Driver/ToolChains.cpp b/lib/Driver/ToolChains.cpp index 89938ed22d..76794535ba 100644 --- a/lib/Driver/ToolChains.cpp +++ b/lib/Driver/ToolChains.cpp @@ -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;