[clang] 087e7ab - [Driver] Switch Exherbo/Alpine/Arch Linux to /etc/os-release

Fangrui Song via cfe-commits cfe-commits at lists.llvm.org
Thu Mar 4 22:31:11 PST 2021


Author: Fangrui Song
Date: 2021-03-04T22:31:05-08:00
New Revision: 087e7ab459e74ad3b33701296ade581cb4c3ba6c

URL: https://github.com/llvm/llvm-project/commit/087e7ab459e74ad3b33701296ade581cb4c3ba6c
DIFF: https://github.com/llvm/llvm-project/commit/087e7ab459e74ad3b33701296ade581cb4c3ba6c.diff

LOG: [Driver] Switch Exherbo/Alpine/Arch Linux to /etc/os-release

Added: 
    

Modified: 
    clang/lib/Driver/Distro.cpp

Removed: 
    


################################################################################
diff  --git a/clang/lib/Driver/Distro.cpp b/clang/lib/Driver/Distro.cpp
index ee4fe841e7ee..785394eefc97 100644
--- a/clang/lib/Driver/Distro.cpp
+++ b/clang/lib/Driver/Distro.cpp
@@ -39,6 +39,7 @@ static Distro::DistroType DetectOsRelease(llvm::vfs::FileSystem &VFS) {
                     .Case("fedora", Distro::Fedora)
                     .Case("gentoo", Distro::Gentoo)
                     .Case("arch", Distro::ArchLinux)
+                    .Case("exherbo", Distro::Exherbo)
                     // On SLES, /etc/os-release was introduced in SLES 11.
                     .Case("sles", Distro::OpenSUSE)
                     .Case("opensuse", Distro::OpenSUSE)
@@ -188,15 +189,6 @@ static Distro::DistroType DetectDistro(llvm::vfs::FileSystem &VFS) {
   }
 
   // ...and others.
-  if (VFS.exists("/etc/exherbo-release"))
-    return Distro::Exherbo;
-
-  if (VFS.exists("/etc/alpine-release"))
-    return Distro::AlpineLinux;
-
-  if (VFS.exists("/etc/arch-release"))
-    return Distro::ArchLinux;
-
   if (VFS.exists("/etc/gentoo-release"))
     return Distro::Gentoo;
 


        


More information about the cfe-commits mailing list