@@ -37,19 +37,19 @@ class ExecutorAddrDiff {
37
37
};
38
38
39
39
// / Represents an address in the executor process.
40
- class ExecutorAddress {
40
+ class ExecutorAddr {
41
41
public:
42
- ExecutorAddress () = default ;
43
- explicit ExecutorAddress (uint64_t Addr) : Addr(Addr) {}
42
+ ExecutorAddr () = default ;
43
+ explicit ExecutorAddr (uint64_t Addr) : Addr(Addr) {}
44
44
45
- // / Create an ExecutorAddress from the given pointer.
45
+ // / Create an ExecutorAddr from the given pointer.
46
46
// / Warning: This should only be used when JITing in-process.
47
- template <typename T> static ExecutorAddress fromPtr (T *Value) {
48
- return ExecutorAddress (
47
+ template <typename T> static ExecutorAddr fromPtr (T *Value) {
48
+ return ExecutorAddr (
49
49
static_cast <uint64_t >(reinterpret_cast <uintptr_t >(Value)));
50
50
}
51
51
52
- // / Cast this ExecutorAddress to a pointer of the given type.
52
+ // / Cast this ExecutorAddr to a pointer of the given type.
53
53
// / Warning: This should only be esude when JITing in-process.
54
54
template <typename T> T toPtr () const {
55
55
static_assert (std::is_pointer<T>::value, " T must be a pointer type" );
@@ -65,53 +65,47 @@ class ExecutorAddress {
65
65
66
66
explicit operator bool () const { return Addr != 0 ; }
67
67
68
- friend bool operator ==(const ExecutorAddress &LHS,
69
- const ExecutorAddress &RHS) {
68
+ friend bool operator ==(const ExecutorAddr &LHS, const ExecutorAddr &RHS) {
70
69
return LHS.Addr == RHS.Addr ;
71
70
}
72
71
73
- friend bool operator !=(const ExecutorAddress &LHS,
74
- const ExecutorAddress &RHS) {
72
+ friend bool operator !=(const ExecutorAddr &LHS, const ExecutorAddr &RHS) {
75
73
return LHS.Addr != RHS.Addr ;
76
74
}
77
75
78
- friend bool operator <(const ExecutorAddress &LHS,
79
- const ExecutorAddress &RHS) {
76
+ friend bool operator <(const ExecutorAddr &LHS, const ExecutorAddr &RHS) {
80
77
return LHS.Addr < RHS.Addr ;
81
78
}
82
79
83
- friend bool operator <=(const ExecutorAddress &LHS,
84
- const ExecutorAddress &RHS) {
80
+ friend bool operator <=(const ExecutorAddr &LHS, const ExecutorAddr &RHS) {
85
81
return LHS.Addr <= RHS.Addr ;
86
82
}
87
83
88
- friend bool operator >(const ExecutorAddress &LHS,
89
- const ExecutorAddress &RHS) {
84
+ friend bool operator >(const ExecutorAddr &LHS, const ExecutorAddr &RHS) {
90
85
return LHS.Addr > RHS.Addr ;
91
86
}
92
87
93
- friend bool operator >=(const ExecutorAddress &LHS,
94
- const ExecutorAddress &RHS) {
88
+ friend bool operator >=(const ExecutorAddr &LHS, const ExecutorAddr &RHS) {
95
89
return LHS.Addr >= RHS.Addr ;
96
90
}
97
91
98
- ExecutorAddress &operator ++() {
92
+ ExecutorAddr &operator ++() {
99
93
++Addr;
100
94
return *this ;
101
95
}
102
- ExecutorAddress &operator --() {
96
+ ExecutorAddr &operator --() {
103
97
--Addr;
104
98
return *this ;
105
99
}
106
- ExecutorAddress operator ++(int ) { return ExecutorAddress (Addr++); }
107
- ExecutorAddress operator --(int ) { return ExecutorAddress (Addr++); }
100
+ ExecutorAddr operator ++(int ) { return ExecutorAddr (Addr++); }
101
+ ExecutorAddr operator --(int ) { return ExecutorAddr (Addr++); }
108
102
109
- ExecutorAddress &operator +=(const ExecutorAddrDiff Delta) {
103
+ ExecutorAddr &operator +=(const ExecutorAddrDiff Delta) {
110
104
Addr += Delta.getValue ();
111
105
return *this ;
112
106
}
113
107
114
- ExecutorAddress &operator -=(const ExecutorAddrDiff Delta) {
108
+ ExecutorAddr &operator -=(const ExecutorAddrDiff Delta) {
115
109
Addr -= Delta.getValue ();
116
110
return *this ;
117
111
}
@@ -121,27 +115,27 @@ class ExecutorAddress {
121
115
};
122
116
123
117
// / Subtracting two addresses yields an offset.
124
- inline ExecutorAddrDiff operator -(const ExecutorAddress &LHS,
125
- const ExecutorAddress &RHS) {
118
+ inline ExecutorAddrDiff operator -(const ExecutorAddr &LHS,
119
+ const ExecutorAddr &RHS) {
126
120
return ExecutorAddrDiff (LHS.getValue () - RHS.getValue ());
127
121
}
128
122
129
123
// / Adding an offset and an address yields an address.
130
- inline ExecutorAddress operator +(const ExecutorAddress &LHS,
131
- const ExecutorAddrDiff &RHS) {
132
- return ExecutorAddress (LHS.getValue () + RHS.getValue ());
124
+ inline ExecutorAddr operator +(const ExecutorAddr &LHS,
125
+ const ExecutorAddrDiff &RHS) {
126
+ return ExecutorAddr (LHS.getValue () + RHS.getValue ());
133
127
}
134
128
135
129
// / Adding an address and an offset yields an address.
136
- inline ExecutorAddress operator +(const ExecutorAddrDiff &LHS,
137
- const ExecutorAddress &RHS) {
138
- return ExecutorAddress (LHS.getValue () + RHS.getValue ());
130
+ inline ExecutorAddr operator +(const ExecutorAddrDiff &LHS,
131
+ const ExecutorAddr &RHS) {
132
+ return ExecutorAddr (LHS.getValue () + RHS.getValue ());
139
133
}
140
134
141
135
// / Represents an address range in the exceutor process.
142
- struct ExecutorAddressRange {
143
- ExecutorAddressRange () = default ;
144
- ExecutorAddressRange (ExecutorAddress StartAddress, ExecutorAddress EndAddress)
136
+ struct ExecutorAddrRange {
137
+ ExecutorAddrRange () = default ;
138
+ ExecutorAddrRange (ExecutorAddr StartAddress, ExecutorAddr EndAddress)
145
139
: StartAddress(StartAddress), EndAddress(EndAddress) {}
146
140
147
141
bool empty () const { return StartAddress == EndAddress; }
@@ -153,55 +147,53 @@ struct ExecutorAddressRange {
153
147
return span<T>(StartAddress.toPtr <T *>(), size ().getValue () / sizeof (T));
154
148
}
155
149
156
- ExecutorAddress StartAddress;
157
- ExecutorAddress EndAddress;
150
+ ExecutorAddr StartAddress;
151
+ ExecutorAddr EndAddress;
158
152
};
159
153
160
- // / SPS serializatior for ExecutorAddress .
161
- template <> class SPSSerializationTraits <SPSExecutorAddress, ExecutorAddress > {
154
+ // / SPS serializatior for ExecutorAddr .
155
+ template <> class SPSSerializationTraits <SPSExecutorAddr, ExecutorAddr > {
162
156
public:
163
- static size_t size (const ExecutorAddress &EA) {
157
+ static size_t size (const ExecutorAddr &EA) {
164
158
return SPSArgList<uint64_t >::size (EA.getValue ());
165
159
}
166
160
167
- static bool serialize (SPSOutputBuffer &BOB, const ExecutorAddress &EA) {
161
+ static bool serialize (SPSOutputBuffer &BOB, const ExecutorAddr &EA) {
168
162
return SPSArgList<uint64_t >::serialize (BOB, EA.getValue ());
169
163
}
170
164
171
- static bool deserialize (SPSInputBuffer &BIB, ExecutorAddress &EA) {
165
+ static bool deserialize (SPSInputBuffer &BIB, ExecutorAddr &EA) {
172
166
uint64_t Tmp;
173
167
if (!SPSArgList<uint64_t >::deserialize (BIB, Tmp))
174
168
return false ;
175
- EA = ExecutorAddress (Tmp);
169
+ EA = ExecutorAddr (Tmp);
176
170
return true ;
177
171
}
178
172
};
179
173
180
- using SPSExecutorAddressRange =
181
- SPSTuple<SPSExecutorAddress, SPSExecutorAddress>;
174
+ using SPSExecutorAddrRange = SPSTuple<SPSExecutorAddr, SPSExecutorAddr>;
182
175
183
176
// / Serialization traits for address ranges.
184
177
template <>
185
- class SPSSerializationTraits <SPSExecutorAddressRange, ExecutorAddressRange > {
178
+ class SPSSerializationTraits <SPSExecutorAddrRange, ExecutorAddrRange > {
186
179
public:
187
- static size_t size (const ExecutorAddressRange &Value) {
188
- return SPSArgList<SPSExecutorAddress, SPSExecutorAddress >::size (
180
+ static size_t size (const ExecutorAddrRange &Value) {
181
+ return SPSArgList<SPSExecutorAddr, SPSExecutorAddr >::size (
189
182
Value.StartAddress , Value.EndAddress );
190
183
}
191
184
192
- static bool serialize (SPSOutputBuffer &BOB,
193
- const ExecutorAddressRange &Value) {
194
- return SPSArgList<SPSExecutorAddress, SPSExecutorAddress>::serialize (
185
+ static bool serialize (SPSOutputBuffer &BOB, const ExecutorAddrRange &Value) {
186
+ return SPSArgList<SPSExecutorAddr, SPSExecutorAddr>::serialize (
195
187
BOB, Value.StartAddress , Value.EndAddress );
196
188
}
197
189
198
- static bool deserialize (SPSInputBuffer &BIB, ExecutorAddressRange &Value) {
199
- return SPSArgList<SPSExecutorAddress, SPSExecutorAddress >::deserialize (
190
+ static bool deserialize (SPSInputBuffer &BIB, ExecutorAddrRange &Value) {
191
+ return SPSArgList<SPSExecutorAddr, SPSExecutorAddr >::deserialize (
200
192
BIB, Value.StartAddress , Value.EndAddress );
201
193
}
202
194
};
203
195
204
- using SPSExecutorAddressRangeSequence = SPSSequence<SPSExecutorAddressRange >;
196
+ using SPSExecutorAddrRangeSequence = SPSSequence<SPSExecutorAddrRange >;
205
197
206
198
} // End namespace __orc_rt
207
199
0 commit comments