forked from OSchip/llvm-project
[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
This commit is contained in:
parent
3a0c5d7cde
commit
a5f33c8694
|
@ -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;
|
||||
};
|
||||
|
||||
|
|
|
@ -93,10 +93,6 @@ void RTDyldObjectLinkingLayer2::emit(MaterializationResponsibility R,
|
|||
{
|
||||
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(MaterializationResponsibility R,
|
|||
|
||||
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(MaterializationResponsibility R,
|
|||
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.
|
||||
|
|
Loading…
Reference in New Issue