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/VersionTuple.h" 18 19 namespace llvm { 20 namespace MachO { 21 22 using PlatformSet = SmallSet<PlatformType, 3>; 23 using PlatformVersionSet = SmallSet<std::pair<PlatformType, VersionTuple>, 3>; 24 25 PlatformType mapToPlatformType(PlatformType Platform, bool WantSim); 26 PlatformType mapToPlatformType(const Triple &Target); 27 PlatformSet mapToPlatformSet(ArrayRef<Triple> Targets); 28 StringRef getPlatformName(PlatformType Platform); 29 PlatformType getPlatformFromName(StringRef Name); 30 std::string getOSAndEnvironmentName(PlatformType Platform, 31 std::string Version = ""); 32 VersionTuple mapToSupportedOSVersion(const Triple &Triple); 33 34 } // end namespace MachO. 35 } // end namespace llvm. 36 37 #endif // LLVM_TEXTAPI_PLATFORM_H 38