aboutsummaryrefslogtreecommitdiffstats
path: root/main/clang/clang-0001-Add-Alpine-Linux-distro.patch
blob: f69baf5b83a570c8c5a342fcb9c250e3028fbfcd (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
34
35
36
37
From: Natanael Copa <ncopa@alpinelinux.org>
From: Jakub Jirutka <jakub@jirutka.cz>
Date: Sun, 16 Apr 2017 16:49:00 +0100
Subject: [PATCH] Add Alpine Linux distro

--- a/include/clang/Driver/Distro.h
+++ b/include/clang/Driver/Distro.h
@@ -26,6 +26,7 @@
     // 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().
+    AlpineLinux,
     ArchLinux,
     DebianLenny,
     DebianSqueeze,
@@ -97,6 +98,10 @@
   /// @name Convenience Predicates
   /// @{
 
+  bool IsAlpineLinux() const {
+    return DistroVal == AlpineLinux;
+  }
+
   bool IsRedhat() const {
     return DistroVal == Fedora || (DistroVal >= RHEL5 && DistroVal <= RHEL7);
   }
--- a/lib/Driver/Distro.cpp
+++ b/lib/Driver/Distro.cpp
@@ -128,6 +128,9 @@
   if (VFS.exists("/etc/arch-release"))
     return Distro::ArchLinux;
 
+  if (VFS.exists("/etc/alpine-release"))
+    return Distro::AlpineLinux;
+
   return Distro::UnknownDistro;
 }