LLVM: include/llvm/Object/MachOUniversalWriter.h Source File (original) (raw)
1
2
3
4
5
6
7
8
9
10
11
12
13
14#ifndef LLVM_OBJECT_MACHOUNIVERSALWRITER_H
15#define LLVM_OBJECT_MACHOUNIVERSALWRITER_H
16
23#include
24#include
25
26namespace llvm {
28
34
35class Slice {
39 std::string ArchName;
40
41
42
43
45
48
49public:
51
53
54
55
56
59
62
65
67
69
71
73
75
77 return static_cast<uint64_t>(CPUType) << 32 | CPUSubType;
78 }
79
81 if (!ArchName.empty())
82 return ArchName;
83 return ("unknown(" + Twine(CPUType) + "," +
85 .str();
86 }
87
88 friend bool operator<(const Slice &Lhs, const Slice &Rhs) {
89 if (Lhs.CPUType == Rhs.CPUType)
90 return Lhs.CPUSubType < Rhs.CPUSubType;
91
92
94 return false;
96 return true;
97
98 return Lhs.P2Alignment < Rhs.P2Alignment;
99 }
100};
101
103
107
111
112}
113
114}
115
116#endif
static GCRegistry::Add< ErlangGC > A("erlang", "erlang-compatible garbage collector")
ArrayRef - Represent a constant reference to an array (0 or more elements consecutively in memory),...
Lightweight error class with error context and mandatory checking.
Tagged union holding either a T or a Error.
This is an important class for using LLVM in a threaded context.
StringRef - Represent a constant reference to a string, i.e.
Twine - A lightweight data structure for efficiently representing the concatenation of temporary valu...
uint32_t getP2Alignment() const
Definition MachOUniversalWriter.h:74
uint32_t getCPUType() const
Definition MachOUniversalWriter.h:70
std::string getArchString() const
Definition MachOUniversalWriter.h:80
const Binary * getBinary() const
Definition MachOUniversalWriter.h:68
void setP2Alignment(uint32_t Align)
Definition MachOUniversalWriter.h:66
uint32_t getCPUSubType() const
Definition MachOUniversalWriter.h:72
static LLVM_ABI Expected< Slice > create(const Archive &A, LLVMContext *LLVMCtx=nullptr)
uint64_t getCPUID() const
Definition MachOUniversalWriter.h:76
friend bool operator<(const Slice &Lhs, const Slice &Rhs)
Definition MachOUniversalWriter.h:88
This class implements an extremely fast bulk output stream that can only output to a stream.
LLVM_ABI Error writeUniversalBinary(ArrayRef< Slice > Slices, StringRef OutputFileName, FatHeaderType FatHeader=FatHeaderType::FatHeader)
LLVM_ABI Error writeUniversalBinaryToStream(ArrayRef< Slice > Slices, raw_ostream &Out, FatHeaderType FatHeader=FatHeaderType::FatHeader)
FatHeaderType
Definition MachOUniversalWriter.h:102
@ Fat64Header
Definition MachOUniversalWriter.h:102
@ FatHeader
Definition MachOUniversalWriter.h:102
This is an optimization pass for GlobalISel generic memory operations.
This struct is a compact representation of a valid (non-zero power of two) alignment.