| 1 | //===- llvm/TextAPI/Platform.h - Platform -----------------------*- C++ -*-===// |
|---|---|
| 2 | // |
| 3 | // Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions. |
| 4 | // See https://llvm.org/LICENSE.txt for license information. |
| 5 | // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception |
| 6 | // |
| 7 | //===----------------------------------------------------------------------===// |
| 8 | // |
| 9 | // Defines the Platforms supported by Tapi and helpers. |
| 10 | // |
| 11 | //===----------------------------------------------------------------------===// |
| 12 | #ifndef LLVM_TEXTAPI_PLATFORM_H |
| 13 | #define LLVM_TEXTAPI_PLATFORM_H |
| 14 | |
| 15 | #include "llvm/ADT/SmallSet.h" |
| 16 | #include "llvm/BinaryFormat/MachO.h" |
| 17 | #include "llvm/Support/Compiler.h" |
| 18 | #include "llvm/Support/VersionTuple.h" |
| 19 | |
| 20 | namespace llvm { |
| 21 | namespace MachO { |
| 22 | |
| 23 | using PlatformSet = SmallSet<PlatformType, 3>; |
| 24 | using PlatformVersionSet = SmallSet<std::pair<PlatformType, VersionTuple>, 3>; |
| 25 | |
| 26 | LLVM_ABI PlatformType mapToPlatformType(PlatformType Platform, bool WantSim); |
| 27 | LLVM_ABI PlatformType mapToPlatformType(const Triple &Target); |
| 28 | LLVM_ABI PlatformSet mapToPlatformSet(ArrayRef<Triple> Targets); |
| 29 | LLVM_ABI StringRef getPlatformName(PlatformType Platform); |
| 30 | LLVM_ABI PlatformType getPlatformFromName(StringRef Name); |
| 31 | LLVM_ABI std::string getOSAndEnvironmentName(PlatformType Platform, |
| 32 | std::string Version = ""); |
| 33 | LLVM_ABI VersionTuple mapToSupportedOSVersion(const Triple &Triple); |
| 34 | |
| 35 | } // end namespace MachO. |
| 36 | } // end namespace llvm. |
| 37 | |
| 38 | #endif // LLVM_TEXTAPI_PLATFORM_H |
| 39 |