diff options
| author | 2019-06-23 21:36:31 +0000 | |
|---|---|---|
| committer | 2019-06-23 21:36:31 +0000 | |
| commit | 23f101f37937a1bd4a29726cab2f76e0fb038b35 (patch) | |
| tree | f7da7d6b32c2e07114da399150bfa88d72187012 /gnu/llvm/tools/clang/lib/Driver/Distro.cpp | |
| parent | sort previous; ok deraadt (diff) | |
| download | wireguard-openbsd-23f101f37937a1bd4a29726cab2f76e0fb038b35.tar.xz wireguard-openbsd-23f101f37937a1bd4a29726cab2f76e0fb038b35.zip | |
Import LLVM 8.0.0 release including clang, lld and lldb.
Diffstat (limited to 'gnu/llvm/tools/clang/lib/Driver/Distro.cpp')
| -rw-r--r-- | gnu/llvm/tools/clang/lib/Driver/Distro.cpp | 9 |
1 files changed, 7 insertions, 2 deletions
diff --git a/gnu/llvm/tools/clang/lib/Driver/Distro.cpp b/gnu/llvm/tools/clang/lib/Driver/Distro.cpp index 2c4d44faf8d..396d0bee560 100644 --- a/gnu/llvm/tools/clang/lib/Driver/Distro.cpp +++ b/gnu/llvm/tools/clang/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<std::unique_ptr<llvm::MemoryBuffer>> 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)) {} |
