@@ -37,19 +37,19 @@ class ExecutorAddrDiff {
3737};
3838
3939// / Represents an address in the executor process.
40- class ExecutorAddress {
40+ class ExecutorAddr {
4141public:
42- ExecutorAddress () = default ;
43- explicit ExecutorAddress (uint64_t Addr) : Addr(Addr) {}
42+ ExecutorAddr () = default ;
43+ explicit ExecutorAddr (uint64_t Addr) : Addr(Addr) {}
4444
45- // / Create an ExecutorAddress from the given pointer.
45+ // / Create an ExecutorAddr from the given pointer.
4646 // / 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 (
4949 static_cast <uint64_t >(reinterpret_cast <uintptr_t >(Value)));
5050 }
5151
52- // / Cast this ExecutorAddress to a pointer of the given type.
52+ // / Cast this ExecutorAddr to a pointer of the given type.
5353 // / Warning: This should only be esude when JITing in-process.
5454 template <typename T> T toPtr () const {
5555 static_assert (std::is_pointer<T>::value, " T must be a pointer type" );
@@ -65,53 +65,47 @@ class ExecutorAddress {
6565
6666 explicit operator bool () const { return Addr != 0 ; }
6767
68- friend bool operator ==(const ExecutorAddress &LHS,
69- const ExecutorAddress &RHS) {
68+ friend bool operator ==(const ExecutorAddr &LHS, const ExecutorAddr &RHS) {
7069 return LHS.Addr == RHS.Addr ;
7170 }
7271
73- friend bool operator !=(const ExecutorAddress &LHS,
74- const ExecutorAddress &RHS) {
72+ friend bool operator !=(const ExecutorAddr &LHS, const ExecutorAddr &RHS) {
7573 return LHS.Addr != RHS.Addr ;
7674 }
7775
78- friend bool operator <(const ExecutorAddress &LHS,
79- const ExecutorAddress &RHS) {
76+ friend bool operator <(const ExecutorAddr &LHS, const ExecutorAddr &RHS) {
8077 return LHS.Addr < RHS.Addr ;
8178 }
8279
83- friend bool operator <=(const ExecutorAddress &LHS,
84- const ExecutorAddress &RHS) {
80+ friend bool operator <=(const ExecutorAddr &LHS, const ExecutorAddr &RHS) {
8581 return LHS.Addr <= RHS.Addr ;
8682 }
8783
88- friend bool operator >(const ExecutorAddress &LHS,
89- const ExecutorAddress &RHS) {
84+ friend bool operator >(const ExecutorAddr &LHS, const ExecutorAddr &RHS) {
9085 return LHS.Addr > RHS.Addr ;
9186 }
9287
93- friend bool operator >=(const ExecutorAddress &LHS,
94- const ExecutorAddress &RHS) {
88+ friend bool operator >=(const ExecutorAddr &LHS, const ExecutorAddr &RHS) {
9589 return LHS.Addr >= RHS.Addr ;
9690 }
9791
98- ExecutorAddress &operator ++() {
92+ ExecutorAddr &operator ++() {
9993 ++Addr;
10094 return *this ;
10195 }
102- ExecutorAddress &operator --() {
96+ ExecutorAddr &operator --() {
10397 --Addr;
10498 return *this ;
10599 }
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++); }
108102
109- ExecutorAddress &operator +=(const ExecutorAddrDiff Delta) {
103+ ExecutorAddr &operator +=(const ExecutorAddrDiff Delta) {
110104 Addr += Delta.getValue ();
111105 return *this ;
112106 }
113107
114- ExecutorAddress &operator -=(const ExecutorAddrDiff Delta) {
108+ ExecutorAddr &operator -=(const ExecutorAddrDiff Delta) {
115109 Addr -= Delta.getValue ();
116110 return *this ;
117111 }
@@ -121,27 +115,27 @@ class ExecutorAddress {
121115};
122116
123117// / 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) {
126120 return ExecutorAddrDiff (LHS.getValue () - RHS.getValue ());
127121}
128122
129123// / 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 ());
133127}
134128
135129// / 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 ());
139133}
140134
141135// / 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)
145139 : StartAddress(StartAddress), EndAddress(EndAddress) {}
146140
147141 bool empty () const { return StartAddress == EndAddress; }
@@ -153,55 +147,53 @@ struct ExecutorAddressRange {
153147 return span<T>(StartAddress.toPtr <T *>(), size ().getValue () / sizeof (T));
154148 }
155149
156- ExecutorAddress StartAddress;
157- ExecutorAddress EndAddress;
150+ ExecutorAddr StartAddress;
151+ ExecutorAddr EndAddress;
158152};
159153
160- // / SPS serializatior for ExecutorAddress .
161- template <> class SPSSerializationTraits <SPSExecutorAddress, ExecutorAddress > {
154+ // / SPS serializatior for ExecutorAddr .
155+ template <> class SPSSerializationTraits <SPSExecutorAddr, ExecutorAddr > {
162156public:
163- static size_t size (const ExecutorAddress &EA) {
157+ static size_t size (const ExecutorAddr &EA) {
164158 return SPSArgList<uint64_t >::size (EA.getValue ());
165159 }
166160
167- static bool serialize (SPSOutputBuffer &BOB, const ExecutorAddress &EA) {
161+ static bool serialize (SPSOutputBuffer &BOB, const ExecutorAddr &EA) {
168162 return SPSArgList<uint64_t >::serialize (BOB, EA.getValue ());
169163 }
170164
171- static bool deserialize (SPSInputBuffer &BIB, ExecutorAddress &EA) {
165+ static bool deserialize (SPSInputBuffer &BIB, ExecutorAddr &EA) {
172166 uint64_t Tmp;
173167 if (!SPSArgList<uint64_t >::deserialize (BIB, Tmp))
174168 return false ;
175- EA = ExecutorAddress (Tmp);
169+ EA = ExecutorAddr (Tmp);
176170 return true ;
177171 }
178172};
179173
180- using SPSExecutorAddressRange =
181- SPSTuple<SPSExecutorAddress, SPSExecutorAddress>;
174+ using SPSExecutorAddrRange = SPSTuple<SPSExecutorAddr, SPSExecutorAddr>;
182175
183176// / Serialization traits for address ranges.
184177template <>
185- class SPSSerializationTraits <SPSExecutorAddressRange, ExecutorAddressRange > {
178+ class SPSSerializationTraits <SPSExecutorAddrRange, ExecutorAddrRange > {
186179public:
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 (
189182 Value.StartAddress , Value.EndAddress );
190183 }
191184
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 (
195187 BOB, Value.StartAddress , Value.EndAddress );
196188 }
197189
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 (
200192 BIB, Value.StartAddress , Value.EndAddress );
201193 }
202194};
203195
204- using SPSExecutorAddressRangeSequence = SPSSequence<SPSExecutorAddressRange >;
196+ using SPSExecutorAddrRangeSequence = SPSSequence<SPSExecutorAddrRange >;
205197
206198} // End namespace __orc_rt
207199
0 commit comments