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/MCJIT/MCJIT.h | |
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/MCJIT/MCJIT.h')
-rw-r--r-- | llvm/lib/ExecutionEngine/MCJIT/MCJIT.h | 23 |
1 files changed, 10 insertions, 13 deletions
diff --git a/llvm/lib/ExecutionEngine/MCJIT/MCJIT.h b/llvm/lib/ExecutionEngine/MCJIT/MCJIT.h index e25f76cd57f..4cb9bebde55 100644 --- a/llvm/lib/ExecutionEngine/MCJIT/MCJIT.h +++ b/llvm/lib/ExecutionEngine/MCJIT/MCJIT.h @@ -26,23 +26,22 @@ class MCJIT; // functions across modules that it owns. It aggregates the memory manager // that is passed in to the MCJIT constructor and defers most functionality // to that object. -class LinkingSymbolResolver : public RuntimeDyld::SymbolResolver { +class LinkingSymbolResolver : public JITSymbolResolver { public: LinkingSymbolResolver(MCJIT &Parent, - std::shared_ptr<RuntimeDyld::SymbolResolver> Resolver) + std::shared_ptr<JITSymbolResolver> Resolver) : ParentEngine(Parent), ClientResolver(std::move(Resolver)) {} - RuntimeDyld::SymbolInfo findSymbol(const std::string &Name) override; + JITSymbol findSymbol(const std::string &Name) override; // MCJIT doesn't support logical dylibs. - RuntimeDyld::SymbolInfo - findSymbolInLogicalDylib(const std::string &Name) override { + JITSymbol findSymbolInLogicalDylib(const std::string &Name) override { return nullptr; } private: MCJIT &ParentEngine; - std::shared_ptr<RuntimeDyld::SymbolResolver> ClientResolver; + std::shared_ptr<JITSymbolResolver> ClientResolver; }; // About Module states: added->loaded->finalized. @@ -68,7 +67,7 @@ private: class MCJIT : public ExecutionEngine { MCJIT(std::unique_ptr<Module> M, std::unique_ptr<TargetMachine> tm, std::shared_ptr<MCJITMemoryManager> MemMgr, - std::shared_ptr<RuntimeDyld::SymbolResolver> Resolver); + std::shared_ptr<JITSymbolResolver> Resolver); typedef llvm::SmallPtrSet<Module *, 4> ModulePtrSet; @@ -305,13 +304,12 @@ public: createJIT(std::unique_ptr<Module> M, std::string *ErrorStr, std::shared_ptr<MCJITMemoryManager> MemMgr, - std::shared_ptr<RuntimeDyld::SymbolResolver> Resolver, + std::shared_ptr<JITSymbolResolver> Resolver, std::unique_ptr<TargetMachine> TM); // @} - RuntimeDyld::SymbolInfo findSymbol(const std::string &Name, - bool CheckFunctionsOnly); + JITSymbol findSymbol(const std::string &Name, bool CheckFunctionsOnly); // DEPRECATED - Please use findSymbol instead. // This is not directly exposed via the ExecutionEngine API, but it is // used by the LinkingMemoryManager. @@ -330,9 +328,8 @@ protected: const RuntimeDyld::LoadedObjectInfo &L); void NotifyFreeingObject(const object::ObjectFile& Obj); - RuntimeDyld::SymbolInfo findExistingSymbol(const std::string &Name); - Module *findModuleForSymbol(const std::string &Name, - bool CheckFunctionsOnly); + JITSymbol findExistingSymbol(const std::string &Name); + Module *findModuleForSymbol(const std::string &Name, bool CheckFunctionsOnly); }; } // end llvm namespace |