[llvm] r341578 - [ORC] Remove the mapSectionAddress method from RuntimeDyldObjectLinkingLayer2.

Lang Hames via llvm-commits llvm-commits at lists.llvm.org
Thu Sep 6 12:39:22 PDT 2018


Author: lhames
Date: Thu Sep  6 12:39:22 2018
New Revision: 341578

URL: http://llvm.org/viewvc/llvm-project?rev=341578&view=rev
Log:
[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.

Modified:
    llvm/trunk/include/llvm/ExecutionEngine/Orc/RTDyldObjectLinkingLayer.h
    llvm/trunk/lib/ExecutionEngine/Orc/RTDyldObjectLinkingLayer.cpp

Modified: llvm/trunk/include/llvm/ExecutionEngine/Orc/RTDyldObjectLinkingLayer.h
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/include/llvm/ExecutionEngine/Orc/RTDyldObjectLinkingLayer.h?rev=341578&r1=341577&r2=341578&view=diff
==============================================================================
--- llvm/trunk/include/llvm/ExecutionEngine/Orc/RTDyldObjectLinkingLayer.h (original)
+++ llvm/trunk/include/llvm/ExecutionEngine/Orc/RTDyldObjectLinkingLayer.h Thu Sep  6 12:39:22 2018
@@ -60,11 +60,6 @@ public:
   void emit(MaterializationResponsibility R, VModuleKey K,
             std::unique_ptr<MemoryBuffer> 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<VModuleKey, RuntimeDyld *> ActiveRTDylds;
   std::map<VModuleKey, std::shared_ptr<RuntimeDyld::MemoryManager>> MemMgrs;
 };
 

Modified: llvm/trunk/lib/ExecutionEngine/Orc/RTDyldObjectLinkingLayer.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/ExecutionEngine/Orc/RTDyldObjectLinkingLayer.cpp?rev=341578&r1=341577&r2=341578&view=diff
==============================================================================
--- llvm/trunk/lib/ExecutionEngine/Orc/RTDyldObjectLinkingLayer.cpp (original)
+++ llvm/trunk/lib/ExecutionEngine/Orc/RTDyldObjectLinkingLayer.cpp Thu Sep  6 12:39:22 2018
@@ -93,10 +93,6 @@ void RTDyldObjectLinkingLayer2::emit(Mat
   {
     std::lock_guard<std::mutex> 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(Mat
 
   RTDyld->finalizeWithMemoryManagerLocking();
 
-  {
-    std::lock_guard<std::mutex> Lock(RTDyldLayerMutex);
-    ActiveRTDylds.erase(K);
-  }
-
   if (RTDyld->hasError()) {
     ES.reportError(make_error<StringError>(RTDyld->getErrorString(),
                                            inconvertibleErrorCode()));
@@ -177,15 +168,5 @@ void RTDyldObjectLinkingLayer2::emit(Mat
     NotifyEmitted(K);
 }
 
-void RTDyldObjectLinkingLayer2::mapSectionAddress(
-    VModuleKey K, const void *LocalAddress, JITTargetAddress TargetAddr) const {
-  std::lock_guard<std::mutex> 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.




More information about the llvm-commits mailing list