LLVM: include/llvm/Support/OptimizedStructLayout.h Source File (original) (raw)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35#ifndef LLVM_SUPPORT_OPTIMIZEDSTRUCTLAYOUT_H
36#define LLVM_SUPPORT_OPTIMIZEDSTRUCTLAYOUT_H
37
41#include
42
43namespace llvm {
44
45
47
48
50
54 assert(Size > 0 && "adding an empty field to the layout");
55 }
56
57
58
59
61
62
63
65
66
68
69
70
72
73
75
76
77
81
82
83
88};
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
141
142}
143
144#endif
assert(UImm &&(UImm !=~static_cast< T >(0)) &&"Invalid immediate!")
This is an optimization pass for GlobalISel generic memory operations.
MutableArrayRef(T &OneElt) -> MutableArrayRef< T >
LLVM_ABI std::pair< uint64_t, Align > performOptimizedStructLayout(MutableArrayRef< OptimizedStructLayoutField > Fields)
Compute a layout for a struct containing the given fields, making a best-effort attempt to minimize t...
This struct is a compact representation of a valid (non-zero power of two) alignment.
const void * Id
A opaque value which uniquely identifies this field.
Definition OptimizedStructLayout.h:67
Align Alignment
The required alignment of this field.
Definition OptimizedStructLayout.h:74
uint64_t getEndOffset() const
Given that this field has a fixed offset, return the offset of the first byte following it.
Definition OptimizedStructLayout.h:84
void * Scratch
Private scratch space for the algorithm.
Definition OptimizedStructLayout.h:71
bool hasFixedOffset() const
Return true if this field has been assigned a fixed offset.
Definition OptimizedStructLayout.h:78
uint64_t Offset
The offset of this field in the final layout.
Definition OptimizedStructLayout.h:60
OptimizedStructLayoutField(const void *Id, uint64_t Size, Align Alignment, uint64_t FixedOffset=FlexibleOffset)
Definition OptimizedStructLayout.h:51
uint64_t Size
The required size of this field in bytes.
Definition OptimizedStructLayout.h:64
static constexpr uint64_t FlexibleOffset
A special value for Offset indicating that the field can be moved anywhere.
Definition OptimizedStructLayout.h:49