xref: /netbsd-src/external/apache2/llvm/dist/llvm/include/llvm/TextAPI/Platform.h (revision 82d56013d7b633d116a93943de88e08335357a7c)
1*82d56013Sjoerg //===- llvm/TextAPI/Platform.h - Platform -----------------------*- C++ -*-===//
2*82d56013Sjoerg //
3*82d56013Sjoerg // Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
4*82d56013Sjoerg // See https://llvm.org/LICENSE.txt for license information.
5*82d56013Sjoerg // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
6*82d56013Sjoerg //
7*82d56013Sjoerg //===----------------------------------------------------------------------===//
8*82d56013Sjoerg //
9*82d56013Sjoerg // Defines the Platforms supported by Tapi and helpers.
10*82d56013Sjoerg //
11*82d56013Sjoerg //===----------------------------------------------------------------------===//
12*82d56013Sjoerg #ifndef LLVM_TEXTAPI_MACHO_PLATFORM_H
13*82d56013Sjoerg #define LLVM_TEXTAPI_MACHO_PLATFORM_H
14*82d56013Sjoerg 
15*82d56013Sjoerg #include "llvm/ADT/SmallSet.h"
16*82d56013Sjoerg #include "llvm/BinaryFormat/MachO.h"
17*82d56013Sjoerg 
18*82d56013Sjoerg namespace llvm {
19*82d56013Sjoerg namespace MachO {
20*82d56013Sjoerg 
21*82d56013Sjoerg /// Defines the list of MachO platforms.
22*82d56013Sjoerg enum class PlatformKind : unsigned {
23*82d56013Sjoerg   unknown,
24*82d56013Sjoerg   macOS = MachO::PLATFORM_MACOS,
25*82d56013Sjoerg   iOS = MachO::PLATFORM_IOS,
26*82d56013Sjoerg   tvOS = MachO::PLATFORM_TVOS,
27*82d56013Sjoerg   watchOS = MachO::PLATFORM_WATCHOS,
28*82d56013Sjoerg   bridgeOS = MachO::PLATFORM_BRIDGEOS,
29*82d56013Sjoerg   macCatalyst = MachO::PLATFORM_MACCATALYST,
30*82d56013Sjoerg   iOSSimulator = MachO::PLATFORM_IOSSIMULATOR,
31*82d56013Sjoerg   tvOSSimulator = MachO::PLATFORM_TVOSSIMULATOR,
32*82d56013Sjoerg   watchOSSimulator = MachO::PLATFORM_WATCHOSSIMULATOR,
33*82d56013Sjoerg   driverKit = MachO::PLATFORM_DRIVERKIT,
34*82d56013Sjoerg };
35*82d56013Sjoerg 
36*82d56013Sjoerg using PlatformSet = SmallSet<PlatformKind, 3>;
37*82d56013Sjoerg 
38*82d56013Sjoerg PlatformKind mapToPlatformKind(PlatformKind Platform, bool WantSim);
39*82d56013Sjoerg PlatformKind mapToPlatformKind(const Triple &Target);
40*82d56013Sjoerg PlatformSet mapToPlatformSet(ArrayRef<Triple> Targets);
41*82d56013Sjoerg StringRef getPlatformName(PlatformKind Platform);
42*82d56013Sjoerg PlatformKind getPlatformFromName(StringRef Name);
43*82d56013Sjoerg 
44*82d56013Sjoerg } // end namespace MachO.
45*82d56013Sjoerg } // end namespace llvm.
46*82d56013Sjoerg 
47*82d56013Sjoerg #endif // LLVM_TEXTAPI_MACHO_PLATFORM_H
48