[llvm] 333ae0a - [ORC] Use ExecutorAddr instead of JITTargetAddress in JITDylib symbol table.
Lang Hames via llvm-commits
llvm-commits at lists.llvm.org
Sun Mar 19 17:34:28 PDT 2023
Author: Lang Hames
Date: 2023-03-19T17:32:43-07:00
New Revision: 333ae0a6c4d2209e3b8c6c672986a52644bd5baf
URL: https://github.com/llvm/llvm-project/commit/333ae0a6c4d2209e3b8c6c672986a52644bd5baf
DIFF: https://github.com/llvm/llvm-project/commit/333ae0a6c4d2209e3b8c6c672986a52644bd5baf.diff
LOG: [ORC] Use ExecutorAddr instead of JITTargetAddress in JITDylib symbol table.
Update JITDylib's symbol table entry struct to use the newer ExecutorAddr type.
Added:
Modified:
llvm/include/llvm/ExecutionEngine/Orc/Core.h
llvm/lib/ExecutionEngine/Orc/Core.cpp
Removed:
################################################################################
diff --git a/llvm/include/llvm/ExecutionEngine/Orc/Core.h b/llvm/include/llvm/ExecutionEngine/Orc/Core.h
index adab75d3aaf15..33aa2cfe604f0 100644
--- a/llvm/include/llvm/ExecutionEngine/Orc/Core.h
+++ b/llvm/include/llvm/ExecutionEngine/Orc/Core.h
@@ -1211,14 +1211,14 @@ class JITDylib : public ThreadSafeRefCountedBase<JITDylib>,
: Flags(Flags), State(static_cast<uint8_t>(SymbolState::NeverSearched)),
MaterializerAttached(false), PendingRemoval(false) {}
- JITTargetAddress getAddress() const { return Addr; }
+ ExecutorAddr getAddress() const { return Addr; }
JITSymbolFlags getFlags() const { return Flags; }
SymbolState getState() const { return static_cast<SymbolState>(State); }
bool hasMaterializerAttached() const { return MaterializerAttached; }
bool isPendingRemoval() const { return PendingRemoval; }
- void setAddress(JITTargetAddress Addr) { this->Addr = Addr; }
+ void setAddress(ExecutorAddr Addr) { this->Addr = Addr; }
void setFlags(JITSymbolFlags Flags) { this->Flags = Flags; }
void setState(SymbolState State) {
assert(static_cast<uint8_t>(State) < (1 << 6) &&
@@ -1235,11 +1235,11 @@ class JITDylib : public ThreadSafeRefCountedBase<JITDylib>,
}
JITEvaluatedSymbol getSymbol() const {
- return JITEvaluatedSymbol(Addr, Flags);
+ return JITEvaluatedSymbol(Addr.getValue(), Flags);
}
private:
- JITTargetAddress Addr = 0;
+ ExecutorAddr Addr;
JITSymbolFlags Flags;
uint8_t State : 6;
uint8_t MaterializerAttached : 1;
diff --git a/llvm/lib/ExecutionEngine/Orc/Core.cpp b/llvm/lib/ExecutionEngine/Orc/Core.cpp
index f85719195532d..82fa4bed914e6 100644
--- a/llvm/lib/ExecutionEngine/Orc/Core.cpp
+++ b/llvm/lib/ExecutionEngine/Orc/Core.cpp
@@ -965,7 +965,7 @@ Error JITDylib::resolve(MaterializationResponsibility &MR,
"Resolving symbol with materializer attached?");
assert(SymI->second.getState() == SymbolState::Materializing &&
"Symbol should be materializing");
- assert(SymI->second.getAddress() == 0 &&
+ assert(SymI->second.getAddress() == ExecutorAddr() &&
"Symbol has already been resolved");
if (SymI->second.getFlags().hasError())
@@ -1000,7 +1000,7 @@ Error JITDylib::resolve(MaterializationResponsibility &MR,
// Resolved symbols can not be weak: discard the weak flag.
JITSymbolFlags ResolvedFlags = ResolvedSym.getFlags();
- SymI->second.setAddress(ResolvedSym.getAddress());
+ SymI->second.setAddress(ExecutorAddr(ResolvedSym.getAddress()));
SymI->second.setFlags(ResolvedFlags);
SymI->second.setState(SymbolState::Resolved);
@@ -1441,7 +1441,7 @@ void JITDylib::dump(raw_ostream &OS) {
for (auto &KV : Symbols) {
OS << " \"" << *KV.first << "\": ";
if (auto Addr = KV.second.getAddress())
- OS << format("0x%016" PRIx64, Addr);
+ OS << Addr;
else
OS << "<not resolved> ";
@@ -2667,7 +2667,7 @@ void ExecutionSession::OL_completeLookup(
// whether it has a materializer attached, and if so prepare to run
// it.
if (SymI->second.hasMaterializerAttached()) {
- assert(SymI->second.getAddress() == 0 &&
+ assert(SymI->second.getAddress() == ExecutorAddr() &&
"Symbol not resolved but already has address?");
auto UMII = JD.UnmaterializedInfos.find(Name);
assert(UMII != JD.UnmaterializedInfos.end() &&
More information about the llvm-commits
mailing list