LLVM: lib/TextAPI/Architecture.cpp Source File (original) (raw)
1
2
3
4
5
6
7
8
9
10
11
12
19
20namespace llvm {
22
24#define ARCHINFO(Arch, Name, Type, Subtype, NumBits) \
25 if (CPUType == (Type) && \
26 (CPUSubType & ~MachO::CPU_SUBTYPE_MASK) == (Subtype)) \
27 return AK_##Arch;
28#include "llvm/TextAPI/Architecture.def"
29#undef ARCHINFO
30
32}
33
36#define ARCHINFO(Arch, Name, Type, Subtype, NumBits) .Case(#Name, AK_##Arch)
37#include "llvm/TextAPI/Architecture.def"
38#undef ARCHINFO
40}
41
43 switch (Arch) {
44#define ARCHINFO(Arch, Name, Type, Subtype, NumBits) \
45 case AK_##Arch: \
46 return #Name;
47#include "llvm/TextAPI/Architecture.def"
48#undef ARCHINFO
50 return "unknown";
51 }
52
53
54
55 return "unknown";
56}
57
59 switch (Arch) {
60#define ARCHINFO(Arch, Name, Type, Subtype, NumBits) \
61 case AK_##Arch: \
62 return std::make_pair(Type, Subtype);
63#include "llvm/TextAPI/Architecture.def"
64#undef ARCHINFO
66 return std::make_pair(0, 0);
67 }
68
69
70
71 return std::make_pair(0, 0);
72}
73
77
79 switch (Arch) {
80#define ARCHINFO(Arch, Name, Type, Subtype, NumBits) \
81 case AK_##Arch: \
82 return NumBits == 64;
83#include "llvm/TextAPI/Architecture.def"
84#undef ARCHINFO
86 return false;
87 }
88
90}
91
96
97}
98}
This file implements the StringSwitch template, which mimics a switch() statement whose cases are str...
StringRef - Represent a constant reference to a string, i.e.
A switch()-like statement whose cases are string literals.
Triple - Helper class for working with autoconf configuration names.
This class implements an extremely fast bulk output stream that can only output to a stream.
#define llvm_unreachable(msg)
Marks that the current location is not supposed to be reachable.
LLVM_ABI Architecture getArchitectureFromName(StringRef Name)
Convert a name to an architecture slice.
Definition Architecture.cpp:34
LLVM_ABI StringRef getArchitectureName(Architecture Arch)
Convert an architecture slice to a string.
Definition Architecture.cpp:42
LLVM_ABI std::pair< uint32_t, uint32_t > getCPUTypeFromArchitecture(Architecture Arch)
Convert an architecture slice to a CPU Type and Subtype pair.
Definition Architecture.cpp:58
LLVM_ABI bool is64Bit(Architecture)
Check if architecture is 64 bit.
Definition Architecture.cpp:78
Architecture
Defines the architecture slices that are supported by Text-based Stub files.
LLVM_ABI raw_ostream & operator<<(raw_ostream &OS, Architecture Arch)
Definition Architecture.cpp:92
LLVM_ABI Architecture mapToArchitecture(const llvm::Triple &Target)
Convert a target to an architecture slice.
Definition Architecture.cpp:74
LLVM_ABI Architecture getArchitectureFromCpuType(uint32_t CPUType, uint32_t CPUSubType)
Convert a CPU Type and Subtype pair to an architecture slice.
Definition Architecture.cpp:23
This is an optimization pass for GlobalISel generic memory operations.