From 676fbe8105eeb6ff4bb2ed261cb212fcfdbe7b63 Mon Sep 17 00:00:00 2001 From: Dimitry Andric Date: Sat, 19 Jan 2019 10:04:05 +0000 Subject: Vendor import of clang trunk r351319 (just before the release_80 branch point): https://llvm.org/svn/llvm-project/cfe/trunk@351319 --- lib/Driver/Distro.cpp | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) (limited to 'lib/Driver/Distro.cpp') diff --git a/lib/Driver/Distro.cpp b/lib/Driver/Distro.cpp index 2c4d44faf8d08..396d0bee5603c 100644 --- a/lib/Driver/Distro.cpp +++ b/lib/Driver/Distro.cpp @@ -8,6 +8,7 @@ //===----------------------------------------------------------------------===// #include "clang/Driver/Distro.h" +#include "clang/Basic/LLVM.h" #include "llvm/ADT/SmallVector.h" #include "llvm/ADT/StringRef.h" #include "llvm/ADT/StringSwitch.h" @@ -17,7 +18,7 @@ using namespace clang::driver; using namespace clang; -static Distro::DistroType DetectDistro(vfs::FileSystem &VFS) { +static Distro::DistroType DetectDistro(llvm::vfs::FileSystem &VFS) { llvm::ErrorOr> File = VFS.getBufferForFile("/etc/lsb-release"); if (File) { @@ -50,6 +51,7 @@ static Distro::DistroType DetectDistro(vfs::FileSystem &VFS) { .Case("artful", Distro::UbuntuArtful) .Case("bionic", Distro::UbuntuBionic) .Case("cosmic", Distro::UbuntuCosmic) + .Case("disco", Distro::UbuntuDisco) .Default(Distro::UnknownDistro); if (Version != Distro::UnknownDistro) return Version; @@ -136,7 +138,10 @@ static Distro::DistroType DetectDistro(vfs::FileSystem &VFS) { if (VFS.exists("/etc/arch-release")) return Distro::ArchLinux; + if (VFS.exists("/etc/gentoo-release")) + return Distro::Gentoo; + return Distro::UnknownDistro; } -Distro::Distro(vfs::FileSystem &VFS) : DistroVal(DetectDistro(VFS)) {} +Distro::Distro(llvm::vfs::FileSystem &VFS) : DistroVal(DetectDistro(VFS)) {} -- cgit v1.2.3