diff options
author | Lang Hames <lhames@gmail.com> | 2016-08-01 20:49:11 +0000 |
---|---|---|
committer | Lang Hames <lhames@gmail.com> | 2016-08-01 20:49:11 +0000 |
commit | ad4a911feac0150f6bc5400ee9a8732adfd35f36 (patch) | |
tree | 8bad2b7d3e29a6a018d970c25530c6cce02373a2 /llvm/lib/ExecutionEngine/RuntimeDyld/RuntimeDyld.cpp | |
parent | 317d42c1eae27a05d1b9a7dbbc3c8a7036eaaf91 (diff) | |
download | bcm5719-llvm-ad4a911feac0150f6bc5400ee9a8732adfd35f36.tar.gz bcm5719-llvm-ad4a911feac0150f6bc5400ee9a8732adfd35f36.zip |
[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
Diffstat (limited to 'llvm/lib/ExecutionEngine/RuntimeDyld/RuntimeDyld.cpp')
-rw-r--r-- | llvm/lib/ExecutionEngine/RuntimeDyld/RuntimeDyld.cpp | 16 |
1 files changed, 8 insertions, 8 deletions
diff --git a/llvm/lib/ExecutionEngine/RuntimeDyld/RuntimeDyld.cpp b/llvm/lib/ExecutionEngine/RuntimeDyld/RuntimeDyld.cpp index 1dfbe31f271..1e0903349ef 100644 --- a/llvm/lib/ExecutionEngine/RuntimeDyld/RuntimeDyld.cpp +++ b/llvm/lib/ExecutionEngine/RuntimeDyld/RuntimeDyld.cpp @@ -974,10 +974,10 @@ uint64_t RuntimeDyld::LoadedObjectInfo::getSectionLoadAddress( } void RuntimeDyld::MemoryManager::anchor() {} -void RuntimeDyld::SymbolResolver::anchor() {} +void JITSymbolResolver::anchor() {} RuntimeDyld::RuntimeDyld(RuntimeDyld::MemoryManager &MemMgr, - RuntimeDyld::SymbolResolver &Resolver) + JITSymbolResolver &Resolver) : MemMgr(MemMgr), Resolver(Resolver) { // FIXME: There's a potential issue lurking here if a single instance of // RuntimeDyld is used to load multiple objects. The current implementation @@ -994,8 +994,8 @@ RuntimeDyld::~RuntimeDyld() {} static std::unique_ptr<RuntimeDyldCOFF> createRuntimeDyldCOFF(Triple::ArchType Arch, RuntimeDyld::MemoryManager &MM, - RuntimeDyld::SymbolResolver &Resolver, - bool ProcessAllSections, RuntimeDyldCheckerImpl *Checker) { + JITSymbolResolver &Resolver, bool ProcessAllSections, + RuntimeDyldCheckerImpl *Checker) { std::unique_ptr<RuntimeDyldCOFF> Dyld = RuntimeDyldCOFF::create(Arch, MM, Resolver); Dyld->setProcessAllSections(ProcessAllSections); @@ -1005,8 +1005,8 @@ createRuntimeDyldCOFF(Triple::ArchType Arch, RuntimeDyld::MemoryManager &MM, static std::unique_ptr<RuntimeDyldELF> createRuntimeDyldELF(RuntimeDyld::MemoryManager &MM, - RuntimeDyld::SymbolResolver &Resolver, - bool ProcessAllSections, RuntimeDyldCheckerImpl *Checker) { + JITSymbolResolver &Resolver, bool ProcessAllSections, + RuntimeDyldCheckerImpl *Checker) { std::unique_ptr<RuntimeDyldELF> Dyld(new RuntimeDyldELF(MM, Resolver)); Dyld->setProcessAllSections(ProcessAllSections); Dyld->setRuntimeDyldChecker(Checker); @@ -1015,7 +1015,7 @@ createRuntimeDyldELF(RuntimeDyld::MemoryManager &MM, static std::unique_ptr<RuntimeDyldMachO> createRuntimeDyldMachO(Triple::ArchType Arch, RuntimeDyld::MemoryManager &MM, - RuntimeDyld::SymbolResolver &Resolver, + JITSymbolResolver &Resolver, bool ProcessAllSections, RuntimeDyldCheckerImpl *Checker) { std::unique_ptr<RuntimeDyldMachO> Dyld = @@ -1056,7 +1056,7 @@ void *RuntimeDyld::getSymbolLocalAddress(StringRef Name) const { return Dyld->getSymbolLocalAddress(Name); } -RuntimeDyld::SymbolInfo RuntimeDyld::getSymbol(StringRef Name) const { +JITEvaluatedSymbol RuntimeDyld::getSymbol(StringRef Name) const { if (!Dyld) return nullptr; return Dyld->getSymbol(Name); |