From 51bd393f52d833d7c3542417f849217c125a539d Mon Sep 17 00:00:00 2001 From: Lang Hames Date: Thu, 27 Nov 2014 00:12:28 +0000 Subject: [PATCH] [MCJIT] Move get-any-symbol-load-address logic out of RuntimeDyld and into RuntimeDyldChecker. RuntimeDyld instances should only provide lookup for locally defined symbols. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@222859 91177308-0d34-0410-b5e6-96231b3b80d8 --- lib/ExecutionEngine/RuntimeDyld/RuntimeDyldChecker.cpp | 4 +++- lib/ExecutionEngine/RuntimeDyld/RuntimeDyldImpl.h | 8 -------- 2 files changed, 3 insertions(+), 9 deletions(-) diff --git a/lib/ExecutionEngine/RuntimeDyld/RuntimeDyldChecker.cpp b/lib/ExecutionEngine/RuntimeDyld/RuntimeDyldChecker.cpp index 8818349ab67..1e146338ee4 100644 --- a/lib/ExecutionEngine/RuntimeDyld/RuntimeDyldChecker.cpp +++ b/lib/ExecutionEngine/RuntimeDyld/RuntimeDyldChecker.cpp @@ -740,7 +740,9 @@ uint64_t RuntimeDyldCheckerImpl::getSymbolLinkerAddr(StringRef Symbol) const { } uint64_t RuntimeDyldCheckerImpl::getSymbolRemoteAddr(StringRef Symbol) const { - return getRTDyld().getAnySymbolRemoteAddress(Symbol); + if (uint64_t InternalSymbolAddr = getRTDyld().getSymbolLoadAddress(Symbol)) + return InternalSymbolAddr; + return getRTDyld().MemMgr->getSymbolAddress(Symbol); } uint64_t RuntimeDyldCheckerImpl::readMemoryAtAddr(uint64_t SrcAddr, diff --git a/lib/ExecutionEngine/RuntimeDyld/RuntimeDyldImpl.h b/lib/ExecutionEngine/RuntimeDyld/RuntimeDyldImpl.h index 22d39408a59..cf7dbb2abe1 100644 --- a/lib/ExecutionEngine/RuntimeDyld/RuntimeDyldImpl.h +++ b/lib/ExecutionEngine/RuntimeDyld/RuntimeDyldImpl.h @@ -159,14 +159,6 @@ public: class RuntimeDyldImpl { friend class RuntimeDyld::LoadedObjectInfo; friend class RuntimeDyldCheckerImpl; -private: - - uint64_t getAnySymbolRemoteAddress(StringRef Symbol) { - if (uint64_t InternalSymbolAddr = getSymbolLoadAddress(Symbol)) - return InternalSymbolAddr; - return MemMgr->getSymbolAddress(Symbol); - } - protected: // The MemoryManager to load objects into. RTDyldMemoryManager *MemMgr; -- 2.34.1