diff options
author | Thomas Schwinge <thomas@schwinge.name> | 2013-03-28 19:02:48 +0000 |
---|---|---|
committer | Thomas Schwinge <thomas@schwinge.name> | 2013-03-28 19:02:48 +0000 |
commit | d52b4a9924f45c45a965a569ad179db25bb1af00 (patch) | |
tree | 9c15952ee26e1e9d95f070d49f25f42348b016e5 /lib/Driver/ToolChains.cpp | |
parent | 65a0892ff5f2c2a70d48b8b649c80967eab67c5e (diff) |
Rename LinuxDistro to Distro.
The concept of such a software distribution is not tied to the Linux kernel;
for example Debian GNU/Linux, Debian GNU/Hurd, and Debian GNU/kFreeBSD all
share the same source packages and generally the same user-space configuration.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@178270 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/Driver/ToolChains.cpp')
-rw-r--r-- | lib/Driver/ToolChains.cpp | 22 |
1 files changed, 11 insertions, 11 deletions
diff --git a/lib/Driver/ToolChains.cpp b/lib/Driver/ToolChains.cpp index 4afb4166d6..eec3845a77 100644 --- a/lib/Driver/ToolChains.cpp +++ b/lib/Driver/ToolChains.cpp @@ -1837,9 +1837,9 @@ Tool *Solaris::buildLinker() const { return new tools::solaris::Link(*this); } -/// Linux toolchain (very bare-bones at the moment). +/// Distribution (very bare-bones at the moment). -enum LinuxDistro { +enum Distro { ArchLinux, DebianLenny, DebianSqueeze, @@ -1872,33 +1872,33 @@ enum LinuxDistro { UnknownDistro }; -static bool IsRedhat(enum LinuxDistro Distro) { +static bool IsRedhat(enum Distro Distro) { return (Distro >= Fedora13 && Distro <= FedoraRawhide) || (Distro >= RHEL4 && Distro <= RHEL6); } -static bool IsOpenSuse(enum LinuxDistro Distro) { +static bool IsOpenSuse(enum Distro Distro) { return Distro >= OpenSuse11_3 && Distro <= OpenSuse12_2; } -static bool IsDebian(enum LinuxDistro Distro) { +static bool IsDebian(enum Distro Distro) { return Distro >= DebianLenny && Distro <= DebianJessie; } -static bool IsUbuntu(enum LinuxDistro Distro) { +static bool IsUbuntu(enum Distro Distro) { return Distro >= UbuntuHardy && Distro <= UbuntuRaring; } -static LinuxDistro DetectLinuxDistro(llvm::Triple::ArchType Arch) { +static Distro DetectDistro(llvm::Triple::ArchType Arch) { OwningPtr<llvm::MemoryBuffer> File; if (!llvm::MemoryBuffer::getFile("/etc/lsb-release", File)) { StringRef Data = File.get()->getBuffer(); SmallVector<StringRef, 8> Lines; Data.split(Lines, "\n"); - LinuxDistro Version = UnknownDistro; + Distro Version = UnknownDistro; for (unsigned i = 0, s = Lines.size(); i != s; ++i) if (Version == UnknownDistro && Lines[i].startswith("DISTRIB_CODENAME=")) - Version = llvm::StringSwitch<LinuxDistro>(Lines[i].substr(17)) + Version = llvm::StringSwitch<Distro>(Lines[i].substr(17)) .Case("hardy", UbuntuHardy) .Case("intrepid", UbuntuIntrepid) .Case("jaunty", UbuntuJaunty) @@ -1955,7 +1955,7 @@ static LinuxDistro DetectLinuxDistro(llvm::Triple::ArchType Arch) { } if (!llvm::MemoryBuffer::getFile("/etc/SuSE-release", File)) - return llvm::StringSwitch<LinuxDistro>(File.get()->getBuffer()) + return llvm::StringSwitch<Distro>(File.get()->getBuffer()) .StartsWith("openSUSE 11.3", OpenSuse11_3) .StartsWith("openSUSE 11.4", OpenSuse11_4) .StartsWith("openSUSE 12.1", OpenSuse12_1) @@ -2089,7 +2089,7 @@ Linux::Linux(const Driver &D, const llvm::Triple &Triple, const ArgList &Args) Linker = GetProgramPath("ld"); - LinuxDistro Distro = DetectLinuxDistro(Arch); + Distro Distro = DetectDistro(Arch); if (IsOpenSuse(Distro) || IsUbuntu(Distro)) { ExtraOpts.push_back("-z"); |