[InstCombine] Signed saturation tests. NFC
[llvm-complete.git] / include / llvm / TextAPI / MachO / Architecture.h
blob3898cbada68f7c7a3aab89820adfeea30ff572a5
1 //===- llvm/TextAPI/MachO/Architecture.h - Architecture ---------*- 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 architecture enum and helper methods.
11 //===----------------------------------------------------------------------===//
13 #ifndef LLVM_TEXTAPI_MACHO_ARCHITECTURE_H
14 #define LLVM_TEXTAPI_MACHO_ARCHITECTURE_H
16 #include "llvm/ADT/StringRef.h"
17 #include "llvm/ADT/Triple.h"
18 #include "llvm/Support/raw_ostream.h"
20 namespace llvm {
21 namespace MachO {
23 /// Defines the architecture slices that are supported by Text-based Stub files.
24 enum Architecture : uint8_t {
25 #define ARCHINFO(Arch, Type, SubType) AK_##Arch,
26 #include "llvm/TextAPI/MachO/Architecture.def"
27 #undef ARCHINFO
28 AK_unknown, // this has to go last.
31 /// Convert a CPU Type and Subtype pair to an architecture slice.
32 Architecture getArchitectureFromCpuType(uint32_t CPUType, uint32_t CPUSubType);
34 /// Convert a name to an architecture slice.
35 Architecture getArchitectureFromName(StringRef Name);
37 /// Convert an architecture slice to a string.
38 StringRef getArchitectureName(Architecture Arch);
40 /// Convert an architecture slice to a CPU Type and Subtype pair.
41 std::pair<uint32_t, uint32_t> getCPUTypeFromArchitecture(Architecture Arch);
43 /// Convert a target to an architecture slice.
44 Architecture mapToArchitecture(const llvm::Triple &Target);
46 raw_ostream &operator<<(raw_ostream &OS, Architecture Arch);
48 } // end namespace MachO.
49 } // end namespace llvm.
51 #endif // LLVM_TEXTAPI_MACHO_ARCHITECTURE_H