Skip to content

Commit ef391df

Browse files
committed
[ORC] Rename ExecutorAddress to ExecutorAddr.
Removing the 'ess' suffix improves the ergonomics without sacrificing clarity. Since this class is likely to be used more frequently in the future it's worth some short term pain to fix this now.
1 parent 4ed0531 commit ef391df

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

41 files changed

+320
-348
lines changed

llvm/include/llvm/ExecutionEngine/Orc/ELFNixPlatform.h

Lines changed: 16 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -27,18 +27,18 @@ namespace llvm {
2727
namespace orc {
2828

2929
struct ELFPerObjectSectionsToRegister {
30-
ExecutorAddressRange EHFrameSection;
31-
ExecutorAddressRange ThreadDataSection;
30+
ExecutorAddrRange EHFrameSection;
31+
ExecutorAddrRange ThreadDataSection;
3232
};
3333

3434
struct ELFNixJITDylibInitializers {
35-
using SectionList = std::vector<ExecutorAddressRange>;
35+
using SectionList = std::vector<ExecutorAddrRange>;
3636

37-
ELFNixJITDylibInitializers(std::string Name, ExecutorAddress DSOHandleAddress)
37+
ELFNixJITDylibInitializers(std::string Name, ExecutorAddr DSOHandleAddress)
3838
: Name(std::move(Name)), DSOHandleAddress(std::move(DSOHandleAddress)) {}
3939

4040
std::string Name;
41-
ExecutorAddress DSOHandleAddress;
41+
ExecutorAddr DSOHandleAddress;
4242

4343
StringMap<SectionList> InitSections;
4444
};
@@ -179,7 +179,7 @@ class ELFNixPlatform : public Platform {
179179
using SendDeinitializerSequenceFn =
180180
unique_function<void(Expected<ELFNixJITDylibDeinitializerSequence>)>;
181181

182-
using SendSymbolAddressFn = unique_function<void(Expected<ExecutorAddress>)>;
182+
using SendSymbolAddressFn = unique_function<void(Expected<ExecutorAddr>)>;
183183

184184
static bool supportedTarget(const Triple &TT);
185185

@@ -202,9 +202,9 @@ class ELFNixPlatform : public Platform {
202202
StringRef JDName);
203203

204204
void rt_getDeinitializers(SendDeinitializerSequenceFn SendResult,
205-
ExecutorAddress Handle);
205+
ExecutorAddr Handle);
206206

207-
void rt_lookupSymbol(SendSymbolAddressFn SendResult, ExecutorAddress Handle,
207+
void rt_lookupSymbol(SendSymbolAddressFn SendResult, ExecutorAddr Handle,
208208
StringRef SymbolName);
209209

210210
// Records the addresses of runtime symbols used by the platform.
@@ -223,10 +223,10 @@ class ELFNixPlatform : public Platform {
223223
SymbolStringPtr DSOHandleSymbol;
224224
std::atomic<bool> RuntimeBootstrapped{false};
225225

226-
ExecutorAddress orc_rt_elfnix_platform_bootstrap;
227-
ExecutorAddress orc_rt_elfnix_platform_shutdown;
228-
ExecutorAddress orc_rt_elfnix_register_object_sections;
229-
ExecutorAddress orc_rt_elfnix_create_pthread_key;
226+
ExecutorAddr orc_rt_elfnix_platform_bootstrap;
227+
ExecutorAddr orc_rt_elfnix_platform_shutdown;
228+
ExecutorAddr orc_rt_elfnix_register_object_sections;
229+
ExecutorAddr orc_rt_elfnix_create_pthread_key;
230230

231231
DenseMap<JITDylib *, SymbolLookupSet> RegisteredInitSymbols;
232232

@@ -243,7 +243,7 @@ class ELFNixPlatform : public Platform {
243243
namespace shared {
244244

245245
using SPSELFPerObjectSectionsToRegister =
246-
SPSTuple<SPSExecutorAddressRange, SPSExecutorAddressRange>;
246+
SPSTuple<SPSExecutorAddrRange, SPSExecutorAddrRange>;
247247

248248
template <>
249249
class SPSSerializationTraits<SPSELFPerObjectSectionsToRegister,
@@ -268,12 +268,11 @@ class SPSSerializationTraits<SPSELFPerObjectSectionsToRegister,
268268
}
269269
};
270270

271-
using SPSNamedExecutorAddressRangeSequenceMap =
272-
SPSSequence<SPSTuple<SPSString, SPSExecutorAddressRangeSequence>>;
271+
using SPSNamedExecutorAddrRangeSequenceMap =
272+
SPSSequence<SPSTuple<SPSString, SPSExecutorAddrRangeSequence>>;
273273

274274
using SPSELFNixJITDylibInitializers =
275-
SPSTuple<SPSString, SPSExecutorAddress,
276-
SPSNamedExecutorAddressRangeSequenceMap>;
275+
SPSTuple<SPSString, SPSExecutorAddr, SPSNamedExecutorAddrRangeSequenceMap>;
277276

278277
using SPSELFNixJITDylibInitializerSequence =
279278
SPSSequence<SPSELFNixJITDylibInitializers>;

llvm/include/llvm/ExecutionEngine/Orc/EPCGenericDylibManager.h

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -30,9 +30,9 @@ class EPCGenericDylibManager {
3030
public:
3131
/// Function addresses for memory access.
3232
struct SymbolAddrs {
33-
ExecutorAddress Instance;
34-
ExecutorAddress Open;
35-
ExecutorAddress Lookup;
33+
ExecutorAddr Instance;
34+
ExecutorAddr Open;
35+
ExecutorAddr Lookup;
3636
};
3737

3838
/// Create an EPCGenericMemoryAccess instance from a given set of
@@ -49,11 +49,11 @@ class EPCGenericDylibManager {
4949
Expected<tpctypes::DylibHandle> open(StringRef Path, uint64_t Mode);
5050

5151
/// Looks up symbols within the given dylib.
52-
Expected<std::vector<ExecutorAddress>> lookup(tpctypes::DylibHandle H,
53-
const SymbolLookupSet &Lookup);
52+
Expected<std::vector<ExecutorAddr>> lookup(tpctypes::DylibHandle H,
53+
const SymbolLookupSet &Lookup);
5454

5555
/// Looks up symbols within the given dylib.
56-
Expected<std::vector<ExecutorAddress>>
56+
Expected<std::vector<ExecutorAddr>>
5757
lookup(tpctypes::DylibHandle H, const RemoteSymbolLookupSet &Lookup);
5858

5959
private:

llvm/include/llvm/ExecutionEngine/Orc/EPCGenericJITLinkMemoryManager.h

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -28,10 +28,10 @@ class EPCGenericJITLinkMemoryManager : public jitlink::JITLinkMemoryManager {
2828
public:
2929
/// Function addresses for memory access.
3030
struct SymbolAddrs {
31-
ExecutorAddress Allocator;
32-
ExecutorAddress Reserve;
33-
ExecutorAddress Finalize;
34-
ExecutorAddress Deallocate;
31+
ExecutorAddr Allocator;
32+
ExecutorAddr Reserve;
33+
ExecutorAddr Finalize;
34+
ExecutorAddr Deallocate;
3535
};
3636

3737
/// Create an EPCGenericJITLinkMemoryManager instance from a given set of

llvm/include/llvm/ExecutionEngine/Orc/EPCGenericMemoryAccess.h

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -27,11 +27,11 @@ class EPCGenericMemoryAccess : public ExecutorProcessControl::MemoryAccess {
2727
public:
2828
/// Function addresses for memory access.
2929
struct FuncAddrs {
30-
ExecutorAddress WriteUInt8s;
31-
ExecutorAddress WriteUInt16s;
32-
ExecutorAddress WriteUInt32s;
33-
ExecutorAddress WriteUInt64s;
34-
ExecutorAddress WriteBuffers;
30+
ExecutorAddr WriteUInt8s;
31+
ExecutorAddr WriteUInt16s;
32+
ExecutorAddr WriteUInt32s;
33+
ExecutorAddr WriteUInt64s;
34+
ExecutorAddr WriteBuffers;
3535
};
3636

3737
/// Create an EPCGenericMemoryAccess instance from a given set of

llvm/include/llvm/ExecutionEngine/Orc/ExecutorProcessControl.h

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -118,8 +118,8 @@ class ExecutorProcessControl {
118118
/// Contains the address of the dispatch function and context that the ORC
119119
/// runtime can use to call functions in the JIT.
120120
struct JITDispatchInfo {
121-
ExecutorAddress JITDispatchFunctionAddress;
122-
ExecutorAddress JITDispatchContextAddress;
121+
ExecutorAddr JITDispatchFunction;
122+
ExecutorAddr JITDispatchContext;
123123
};
124124

125125
virtual ~ExecutorProcessControl();
@@ -159,15 +159,15 @@ class ExecutorProcessControl {
159159
}
160160

161161
/// Returns the bootstrap symbol map.
162-
const StringMap<ExecutorAddress> &getBootstrapSymbolsMap() const {
162+
const StringMap<ExecutorAddr> &getBootstrapSymbolsMap() const {
163163
return BootstrapSymbols;
164164
}
165165

166-
/// For each (ExecutorAddress&, StringRef) pair, looks up the string in the
167-
/// bootstrap symbols map and writes its address to the ExecutorAddress if
166+
/// For each (ExecutorAddr&, StringRef) pair, looks up the string in the
167+
/// bootstrap symbols map and writes its address to the ExecutorAddr if
168168
/// found. If any symbol is not found then the function returns an error.
169169
Error getBootstrapSymbols(
170-
ArrayRef<std::pair<ExecutorAddress &, StringRef>> Pairs) const {
170+
ArrayRef<std::pair<ExecutorAddr &, StringRef>> Pairs) const {
171171
for (auto &KV : Pairs) {
172172
auto I = BootstrapSymbols.find(KV.second);
173173
if (I == BootstrapSymbols.end())
@@ -275,7 +275,7 @@ class ExecutorProcessControl {
275275
JITDispatchInfo JDI;
276276
MemoryAccess *MemAccess = nullptr;
277277
jitlink::JITLinkMemoryManager *MemMgr = nullptr;
278-
StringMap<ExecutorAddress> BootstrapSymbols;
278+
StringMap<ExecutorAddr> BootstrapSymbols;
279279
};
280280

281281
/// A ExecutorProcessControl instance that asserts if any of its methods are

llvm/include/llvm/ExecutionEngine/Orc/LookupAndRecordAddrs.h

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66
//
77
//===----------------------------------------------------------------------===//
88
//
9-
// Record the addresses of a set of symbols into ExecutorAddress objects.
9+
// Record the addresses of a set of symbols into ExecutorAddr objects.
1010
//
1111
// This can be used to avoid repeated lookup (via ExecutionSession::lookup) of
1212
// the given symbols.
@@ -25,7 +25,7 @@
2525
namespace llvm {
2626
namespace orc {
2727

28-
/// Record addresses of the given symbols in the given ExecutorAddresses.
28+
/// Record addresses of the given symbols in the given ExecutorAddrs.
2929
///
3030
/// Useful for making permanent records of symbol addreses to call or
3131
/// access in the executor (e.g. runtime support functions in Platform
@@ -44,24 +44,24 @@ namespace orc {
4444
void lookupAndRecordAddrs(
4545
unique_function<void(Error)> OnRecorded, ExecutionSession &ES, LookupKind K,
4646
const JITDylibSearchOrder &SearchOrder,
47-
std::vector<std::pair<SymbolStringPtr, ExecutorAddress *>> Pairs,
47+
std::vector<std::pair<SymbolStringPtr, ExecutorAddr *>> Pairs,
4848
SymbolLookupFlags LookupFlags = SymbolLookupFlags::RequiredSymbol);
4949

50-
/// Record addresses of the given symbols in the given ExecutorAddresses.
50+
/// Record addresses of the given symbols in the given ExecutorAddrs.
5151
///
5252
/// Blocking version.
5353
Error lookupAndRecordAddrs(
5454
ExecutionSession &ES, LookupKind K, const JITDylibSearchOrder &SearchOrder,
55-
std::vector<std::pair<SymbolStringPtr, ExecutorAddress *>> Pairs,
55+
std::vector<std::pair<SymbolStringPtr, ExecutorAddr *>> Pairs,
5656
SymbolLookupFlags LookupFlags = SymbolLookupFlags::RequiredSymbol);
5757

58-
/// Record addresses of given symbols in the given ExecutorAddresses.
58+
/// Record addresses of given symbols in the given ExecutorAddrs.
5959
///
6060
/// ExecutorProcessControl lookup version. Lookups are always implicitly
6161
/// weak.
6262
Error lookupAndRecordAddrs(
6363
ExecutorProcessControl &EPC, tpctypes::DylibHandle H,
64-
std::vector<std::pair<SymbolStringPtr, ExecutorAddress *>> Pairs,
64+
std::vector<std::pair<SymbolStringPtr, ExecutorAddr *>> Pairs,
6565
SymbolLookupFlags LookupFlags = SymbolLookupFlags::RequiredSymbol);
6666

6767
} // End namespace orc

llvm/include/llvm/ExecutionEngine/Orc/MachOPlatform.h

Lines changed: 19 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -27,21 +27,20 @@ namespace llvm {
2727
namespace orc {
2828

2929
struct MachOPerObjectSectionsToRegister {
30-
ExecutorAddressRange EHFrameSection;
31-
ExecutorAddressRange ThreadDataSection;
30+
ExecutorAddrRange EHFrameSection;
31+
ExecutorAddrRange ThreadDataSection;
3232
};
3333

3434
struct MachOJITDylibInitializers {
35-
using SectionList = std::vector<ExecutorAddressRange>;
35+
using SectionList = std::vector<ExecutorAddrRange>;
3636

37-
MachOJITDylibInitializers(std::string Name,
38-
ExecutorAddress MachOHeaderAddress)
37+
MachOJITDylibInitializers(std::string Name, ExecutorAddr MachOHeaderAddress)
3938
: Name(std::move(Name)),
4039
MachOHeaderAddress(std::move(MachOHeaderAddress)) {}
4140

4241
std::string Name;
43-
ExecutorAddress MachOHeaderAddress;
44-
ExecutorAddress ObjCImageInfoAddress;
42+
ExecutorAddr MachOHeaderAddress;
43+
ExecutorAddr ObjCImageInfoAddress;
4544

4645
StringMap<SectionList> InitSections;
4746
};
@@ -185,7 +184,7 @@ class MachOPlatform : public Platform {
185184
using SendDeinitializerSequenceFn =
186185
unique_function<void(Expected<MachOJITDylibDeinitializerSequence>)>;
187186

188-
using SendSymbolAddressFn = unique_function<void(Expected<ExecutorAddress>)>;
187+
using SendSymbolAddressFn = unique_function<void(Expected<ExecutorAddr>)>;
189188

190189
static bool supportedTarget(const Triple &TT);
191190

@@ -208,15 +207,15 @@ class MachOPlatform : public Platform {
208207
StringRef JDName);
209208

210209
void rt_getDeinitializers(SendDeinitializerSequenceFn SendResult,
211-
ExecutorAddress Handle);
210+
ExecutorAddr Handle);
212211

213-
void rt_lookupSymbol(SendSymbolAddressFn SendResult, ExecutorAddress Handle,
212+
void rt_lookupSymbol(SendSymbolAddressFn SendResult, ExecutorAddr Handle,
214213
StringRef SymbolName);
215214

216215
// Records the addresses of runtime symbols used by the platform.
217216
Error bootstrapMachORuntime(JITDylib &PlatformJD);
218217

219-
Error registerInitInfo(JITDylib &JD, ExecutorAddress ObjCImageInfoAddr,
218+
Error registerInitInfo(JITDylib &JD, ExecutorAddr ObjCImageInfoAddr,
220219
ArrayRef<jitlink::Section *> InitSections);
221220

222221
Error registerPerObjectSections(const MachOPerObjectSectionsToRegister &POSR);
@@ -229,10 +228,10 @@ class MachOPlatform : public Platform {
229228
SymbolStringPtr MachOHeaderStartSymbol;
230229
std::atomic<bool> RuntimeBootstrapped{false};
231230

232-
ExecutorAddress orc_rt_macho_platform_bootstrap;
233-
ExecutorAddress orc_rt_macho_platform_shutdown;
234-
ExecutorAddress orc_rt_macho_register_object_sections;
235-
ExecutorAddress orc_rt_macho_create_pthread_key;
231+
ExecutorAddr orc_rt_macho_platform_bootstrap;
232+
ExecutorAddr orc_rt_macho_platform_shutdown;
233+
ExecutorAddr orc_rt_macho_register_object_sections;
234+
ExecutorAddr orc_rt_macho_create_pthread_key;
236235

237236
DenseMap<JITDylib *, SymbolLookupSet> RegisteredInitSymbols;
238237

@@ -249,7 +248,7 @@ class MachOPlatform : public Platform {
249248
namespace shared {
250249

251250
using SPSMachOPerObjectSectionsToRegister =
252-
SPSTuple<SPSExecutorAddressRange, SPSExecutorAddressRange>;
251+
SPSTuple<SPSExecutorAddrRange, SPSExecutorAddrRange>;
253252

254253
template <>
255254
class SPSSerializationTraits<SPSMachOPerObjectSectionsToRegister,
@@ -274,12 +273,12 @@ class SPSSerializationTraits<SPSMachOPerObjectSectionsToRegister,
274273
}
275274
};
276275

277-
using SPSNamedExecutorAddressRangeSequenceMap =
278-
SPSSequence<SPSTuple<SPSString, SPSExecutorAddressRangeSequence>>;
276+
using SPSNamedExecutorAddrRangeSequenceMap =
277+
SPSSequence<SPSTuple<SPSString, SPSExecutorAddrRangeSequence>>;
279278

280279
using SPSMachOJITDylibInitializers =
281-
SPSTuple<SPSString, SPSExecutorAddress, SPSExecutorAddress,
282-
SPSNamedExecutorAddressRangeSequenceMap>;
280+
SPSTuple<SPSString, SPSExecutorAddr, SPSExecutorAddr,
281+
SPSNamedExecutorAddrRangeSequenceMap>;
283282

284283
using SPSMachOJITDylibInitializerSequence =
285284
SPSSequence<SPSMachOJITDylibInitializers>;

llvm/include/llvm/ExecutionEngine/Orc/OrcRPCExecutorProcessControl.h

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -402,8 +402,8 @@ class OrcRPCExecutorProcessControlBase : public ExecutorProcessControl {
402402
if (auto EPI = EP.template callB<orcrpctpc::GetExecutorProcessInfo>()) {
403403
this->TargetTriple = Triple(EPI->Triple);
404404
this->PageSize = EPI->PageSize;
405-
this->JDI = {ExecutorAddress(EPI->DispatchFuncAddr),
406-
ExecutorAddress(EPI->DispatchCtxAddr)};
405+
this->JDI = {ExecutorAddr(EPI->DispatchFuncAddr),
406+
ExecutorAddr(EPI->DispatchCtxAddr)};
407407
return Error::success();
408408
} else
409409
return EPI.takeError();

0 commit comments

Comments
 (0)