aboutsummaryrefslogtreecommitdiff
blob: a11dcfe235d37b528c66deb6a05c78ef89f8435c (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
--- a/include/clang/Driver/Distro.h
+++ b/include/clang/Driver/Distro.h
@@ -26,6 +26,7 @@ public:
     // NB: Releases of a particular Linux distro should be kept together
     // in this enum, because some tests are done by integer comparison against
     // the first and last known member in the family, e.g. IsRedHat().
+    GentooLinux,
     AlpineLinux,
     ArchLinux,
     DebianLenny,
@@ -98,6 +99,10 @@ public:
   /// @name Convenience Predicates
   /// @{
 
+  bool IsGentooLinux() const {
+    return DistroVal == GentooLinux;
+  }
+
   bool IsRedhat() const {
     return DistroVal == Fedora || (DistroVal >= RHEL5 && DistroVal <= RHEL7);
   }
--- a/lib/Driver/Distro.cpp
+++ b/lib/Driver/Distro.cpp
@@ -129,6 +129,9 @@ static Distro::DistroType DetectDistro(vfs::FileSystem &VFS) {
   if (VFS.exists("/etc/arch-release"))
     return Distro::ArchLinux;
 
+  if (VFS.exists("/etc/gentoo-release"))
+    return Distro::GentooLinux;
+
   return Distro::UnknownDistro;
 }