aboutsummaryrefslogtreecommitdiff
path: root/llvm/lib/ExecutionEngine/Orc/ObjectLinkingLayer.cpp
diff options
context:
space:
mode:
authorLang Hames <lhames@gmail.com>2023-03-22 11:45:10 -0700
committerLang Hames <lhames@gmail.com>2023-03-27 17:37:58 -0700
commit8b1771bd9f304be39d4dcbdcccedb6d3bcd18200 (patch)
treed4476527433f9c724e2befd071ed0102259d8ebd /llvm/lib/ExecutionEngine/Orc/ObjectLinkingLayer.cpp
parent41a964cff0068ba417d355b499f10ecedd4a4636 (diff)
downloadllvm-8b1771bd9f304be39d4dcbdcccedb6d3bcd18200.zip
llvm-8b1771bd9f304be39d4dcbdcccedb6d3bcd18200.tar.gz
llvm-8b1771bd9f304be39d4dcbdcccedb6d3bcd18200.tar.bz2
[ORC] Move most ORC APIs to ExecutorAddr, introduce ExecutorSymbolDef.
ExecutorAddr was introduced in b8e5f918166 as an eventual replacement for JITTargetAddress. ExecutorSymbolDef is introduced in this patch as a replacement for JITEvaluatedSymbol: ExecutorSymbolDef is an (ExecutorAddr, JITSymbolFlags) pair, where JITEvaluatedSymbol was a (JITTargetAddress, JITSymbolFlags) pair. A number of APIs had already migrated from JITTargetAddress to ExecutorAddr, but many of ORC's internals were still using the older type. This patch aims to address that. Some public APIs are affected as well. If you need to migrate your APIs you can use the following operations: * ExecutorAddr::toPtr replaces jitTargetAddressToPointer and jitTargetAddressToFunction. * ExecutorAddr::fromPtr replace pointerToJITTargetAddress. * ExecutorAddr(JITTargetAddress) creates an ExecutorAddr value from a JITTargetAddress. * ExecutorAddr::getValue() creates a JITTargetAddress value from an ExecutorAddr. JITTargetAddress and JITEvaluatedSymbol will remain in JITSymbol.h for now, but the aim will be to eventually deprecate and remove these types (probably when MCJIT and RuntimeDyld are deprecated).
Diffstat (limited to 'llvm/lib/ExecutionEngine/Orc/ObjectLinkingLayer.cpp')
-rw-r--r--llvm/lib/ExecutionEngine/Orc/ObjectLinkingLayer.cpp8
1 files changed, 4 insertions, 4 deletions
diff --git a/llvm/lib/ExecutionEngine/Orc/ObjectLinkingLayer.cpp b/llvm/lib/ExecutionEngine/Orc/ObjectLinkingLayer.cpp
index 9103c62..03dd6b5 100644
--- a/llvm/lib/ExecutionEngine/Orc/ObjectLinkingLayer.cpp
+++ b/llvm/lib/ExecutionEngine/Orc/ObjectLinkingLayer.cpp
@@ -40,7 +40,7 @@ bool hasInitializerSection(jitlink::LinkGraph &G) {
return false;
}
-JITTargetAddress getJITSymbolPtrForSymbol(Symbol &Sym, const Triple &TT) {
+ExecutorAddr getJITSymbolPtrForSymbol(Symbol &Sym, const Triple &TT) {
uint64_t CallableAddr = Sym.getAddress().getValue();
switch (TT.getArch()) {
case Triple::arm:
@@ -53,7 +53,7 @@ JITTargetAddress getJITSymbolPtrForSymbol(Symbol &Sym, const Triple &TT) {
default:
break;
}
- return CallableAddr;
+ return ExecutorAddr(CallableAddr);
}
JITSymbolFlags getJITSymbolFlagsForSymbol(Symbol &Sym) {
@@ -234,7 +234,7 @@ public:
auto InternedName = ES.intern(Sym->getName());
auto Ptr = getJITSymbolPtrForSymbol(*Sym, G.getTargetTriple());
auto Flags = getJITSymbolFlagsForSymbol(*Sym);
- InternedResult[InternedName] = JITEvaluatedSymbol(Ptr, Flags);
+ InternedResult[InternedName] = {Ptr, Flags};
if (AutoClaim && !MR->getSymbols().count(InternedName)) {
assert(!ExtraSymbolsToClaim.count(InternedName) &&
"Duplicate symbol to claim?");
@@ -247,7 +247,7 @@ public:
auto InternedName = ES.intern(Sym->getName());
auto Ptr = getJITSymbolPtrForSymbol(*Sym, G.getTargetTriple());
auto Flags = getJITSymbolFlagsForSymbol(*Sym);
- InternedResult[InternedName] = JITEvaluatedSymbol(Ptr, Flags);
+ InternedResult[InternedName] = {Ptr, Flags};
if (AutoClaim && !MR->getSymbols().count(InternedName)) {
assert(!ExtraSymbolsToClaim.count(InternedName) &&
"Duplicate symbol to claim?");