[ValueTracking] Remove unused matchSelectPattern optional argument. NFCI.
[llvm-core.git] / include / llvm / TextAPI / MachO / Target.h
blob74e900d812f523e1c217802e332bbd20e0736d07
1 //===- llvm/TextAPI/Target.h - TAPI Target ----------------------*- 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 //===----------------------------------------------------------------------===//
9 #ifndef LLVM_TEXTAPI_MACHO_TARGET_H
10 #define LLVM_TEXTAPI_MACHO_TARGET_H
12 #include "llvm/ADT/Triple.h"
13 #include "llvm/Support/Error.h"
14 #include "llvm/TextAPI/MachO/Architecture.h"
15 #include "llvm/TextAPI/MachO/ArchitectureSet.h"
16 #include "llvm/TextAPI/MachO/Platform.h"
18 namespace llvm {
19 namespace MachO {
21 // This is similar to a llvm Triple, but the triple doesn't have all the
22 // information we need. For example there is no enum value for x86_64h. The
23 // only way to get that information is to parse the triple string.
24 class Target {
25 public:
26 Target() = default;
27 Target(Architecture Arch, PlatformKind Platform)
28 : Arch(Arch), Platform(Platform) {}
29 explicit Target(const llvm::Triple &Triple)
30 : Arch(mapToArchitecture(Triple)), Platform(mapToPlatformKind(Triple)) {}
32 operator std::string() const;
34 Architecture Arch;
35 PlatformKind Platform;
38 inline bool operator==(const Target &LHS, const Target &RHS) {
39 return std::tie(LHS.Arch, LHS.Platform) == std::tie(RHS.Arch, RHS.Platform);
42 inline bool operator!=(const Target &LHS, const Target &RHS) {
43 return std::tie(LHS.Arch, LHS.Platform) != std::tie(RHS.Arch, RHS.Platform);
46 inline bool operator<(const Target &LHS, const Target &RHS) {
47 return std::tie(LHS.Arch, LHS.Platform) < std::tie(RHS.Arch, RHS.Platform);
50 inline bool operator==(const Target &LHS, const Architecture &RHS) {
51 return LHS.Arch == RHS;
54 inline bool operator!=(const Target &LHS, const Architecture &RHS) {
55 return LHS.Arch != RHS;
58 PlatformSet mapToPlatformSet(ArrayRef<Target> Targets);
59 ArchitectureSet mapToArchitectureSet(ArrayRef<Target> Targets);
61 raw_ostream &operator<<(raw_ostream &OS, const Target &Target);
63 } // namespace MachO
64 } // namespace llvm
66 #endif // LLVM_TEXTAPI_MACHO_TARGET_H