[ExecutionEngine][MCJIT][Orc] Replace RuntimeDyld::SymbolInfo with JITSymbol.
This patch replaces RuntimeDyld::SymbolInfo with JITSymbol: A symbol class
that is capable of lazy materialization (i.e. the symbol definition needn't be
emitted until the address is requested). This can be used to support common
and weak symbols in the JIT (though this is not implemented in this patch).
For consistency, RuntimeDyld::SymbolResolver is renamed to JITSymbolResolver.
For space efficiency a new class, JITEvaluatedSymbol, is introduced that
behaves like the old RuntimeDyld::SymbolInfo - i.e. it is just a pair of an
address and symbol flags. Instances of JITEvaluatedSymbol can be used in
symbol-tables to avoid paying the space cost of the materializer.
llvm-svn: 277386
diff --git a/llvm/lib/ExecutionEngine/RuntimeDyld/RuntimeDyldImpl.h b/llvm/lib/ExecutionEngine/RuntimeDyld/RuntimeDyldImpl.h
index 76bd3fc..af2c9e8 100644
--- a/llvm/lib/ExecutionEngine/RuntimeDyld/RuntimeDyldImpl.h
+++ b/llvm/lib/ExecutionEngine/RuntimeDyld/RuntimeDyldImpl.h
@@ -227,7 +227,7 @@
RuntimeDyld::MemoryManager &MemMgr;
// The symbol resolver to use for external symbols.
- RuntimeDyld::SymbolResolver &Resolver;
+ JITSymbolResolver &Resolver;
// Attached RuntimeDyldChecker instance. Null if no instance attached.
RuntimeDyldCheckerImpl *Checker;
@@ -420,7 +420,7 @@
public:
RuntimeDyldImpl(RuntimeDyld::MemoryManager &MemMgr,
- RuntimeDyld::SymbolResolver &Resolver)
+ JITSymbolResolver &Resolver)
: MemMgr(MemMgr), Resolver(Resolver), Checker(nullptr),
ProcessAllSections(false), HasError(false) {
}
@@ -451,7 +451,7 @@
return getSectionAddress(SymInfo.getSectionID()) + SymInfo.getOffset();
}
- RuntimeDyld::SymbolInfo getSymbol(StringRef Name) const {
+ JITEvaluatedSymbol getSymbol(StringRef Name) const {
// FIXME: Just look up as a function for now. Overly simple of course.
// Work in progress.
RTDyldSymbolTable::const_iterator pos = GlobalSymbolTable.find(Name);
@@ -462,7 +462,7 @@
if (SymEntry.getSectionID() != AbsoluteSymbolSection)
SectionAddr = getSectionLoadAddress(SymEntry.getSectionID());
uint64_t TargetAddr = SectionAddr + SymEntry.getOffset();
- return RuntimeDyld::SymbolInfo(TargetAddr, SymEntry.getFlags());
+ return JITEvaluatedSymbol(TargetAddr, SymEntry.getFlags());
}
void resolveRelocations();