From a5f33c86942e49ea3e1d06bb33909ce7bb806be5 Mon Sep 17 00:00:00 2001 From: Lang Hames Date: Thu, 6 Sep 2018 19:39:22 +0000 Subject: [PATCH] [ORC] Remove the mapSectionAddress method from RuntimeDyldObjectLinkingLayer2. Section address mappings can be applied using the RuntimeDyld instance passed to the RuntimeDyld::MemoryManager::notifyObjectLoaded method. Proving an alternate route via RuntimeDyldObjectLinkingLayer2 is redundant. llvm-svn: 341578 --- .../Orc/RTDyldObjectLinkingLayer.h | 6 ------ .../Orc/RTDyldObjectLinkingLayer.cpp | 19 ------------------- 2 files changed, 25 deletions(-) diff --git a/llvm/include/llvm/ExecutionEngine/Orc/RTDyldObjectLinkingLayer.h b/llvm/include/llvm/ExecutionEngine/Orc/RTDyldObjectLinkingLayer.h index 3c845e3588c7..f4a4703363ee 100644 --- a/llvm/include/llvm/ExecutionEngine/Orc/RTDyldObjectLinkingLayer.h +++ b/llvm/include/llvm/ExecutionEngine/Orc/RTDyldObjectLinkingLayer.h @@ -60,11 +60,6 @@ public: void emit(MaterializationResponsibility R, VModuleKey K, std::unique_ptr O) override; - /// Map section addresses for the object associated with the - /// VModuleKey K. - void mapSectionAddress(VModuleKey K, const void *LocalAddress, - JITTargetAddress TargetAddr) const; - /// Set the 'ProcessAllSections' flag. /// /// If set to true, all sections in each object file will be allocated using @@ -115,7 +110,6 @@ private: bool ProcessAllSections = false; bool OverrideObjectFlags = false; bool AutoClaimObjectSymbols = false; - std::map ActiveRTDylds; std::map> MemMgrs; }; diff --git a/llvm/lib/ExecutionEngine/Orc/RTDyldObjectLinkingLayer.cpp b/llvm/lib/ExecutionEngine/Orc/RTDyldObjectLinkingLayer.cpp index db3934d7597a..31568977c33d 100644 --- a/llvm/lib/ExecutionEngine/Orc/RTDyldObjectLinkingLayer.cpp +++ b/llvm/lib/ExecutionEngine/Orc/RTDyldObjectLinkingLayer.cpp @@ -93,10 +93,6 @@ void RTDyldObjectLinkingLayer2::emit(MaterializationResponsibility R, { std::lock_guard Lock(RTDyldLayerMutex); - assert(!ActiveRTDylds.count(K) && - "An active RTDyld already exists for this key?"); - ActiveRTDylds[K] = RTDyld.get(); - assert(!MemMgrs.count(K) && "A memory manager already exists for this key?"); MemMgrs[K] = std::move(MemoryManager); @@ -159,11 +155,6 @@ void RTDyldObjectLinkingLayer2::emit(MaterializationResponsibility R, RTDyld->finalizeWithMemoryManagerLocking(); - { - std::lock_guard Lock(RTDyldLayerMutex); - ActiveRTDylds.erase(K); - } - if (RTDyld->hasError()) { ES.reportError(make_error(RTDyld->getErrorString(), inconvertibleErrorCode())); @@ -177,15 +168,5 @@ void RTDyldObjectLinkingLayer2::emit(MaterializationResponsibility R, NotifyEmitted(K); } -void RTDyldObjectLinkingLayer2::mapSectionAddress( - VModuleKey K, const void *LocalAddress, JITTargetAddress TargetAddr) const { - std::lock_guard Lock(RTDyldLayerMutex); - auto ActiveRTDyldItr = ActiveRTDylds.find(K); - - assert(ActiveRTDyldItr != ActiveRTDylds.end() && - "No active RTDyld instance found for key"); - ActiveRTDyldItr->second->mapSectionAddress(LocalAddress, TargetAddr); -} - } // End namespace orc. } // End namespace llvm.