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