diff options
author | Lang Hames <lhames@gmail.com> | 2017-09-28 17:43:07 +0000 |
---|---|---|
committer | Lang Hames <lhames@gmail.com> | 2017-09-28 17:43:07 +0000 |
commit | 705db63ce1544c6618a95c4fbf28bc9e994c091a (patch) | |
tree | 4718b92a8fc881f9aa0789ca1a230621657007f5 | |
parent | 3701df55c671d2def10463fd13015ded7472e19a (diff) | |
download | bcm5719-llvm-705db63ce1544c6618a95c4fbf28bc9e994c091a.tar.gz bcm5719-llvm-705db63ce1544c6618a95c4fbf28bc9e994c091a.zip |
[ORC] Fix the type of RTDyldObjectLinkingLayer::NotifyLoadedFtor.
Bug found by Stefan Granitz. Thanks Stefan!
llvm-svn: 314436
3 files changed, 12 insertions, 3 deletions
diff --git a/llvm/include/llvm/ExecutionEngine/Orc/RTDyldObjectLinkingLayer.h b/llvm/include/llvm/ExecutionEngine/Orc/RTDyldObjectLinkingLayer.h index 633713c38ae..246c57341f3 100644 --- a/llvm/include/llvm/ExecutionEngine/Orc/RTDyldObjectLinkingLayer.h +++ b/llvm/include/llvm/ExecutionEngine/Orc/RTDyldObjectLinkingLayer.h @@ -99,8 +99,9 @@ public: using RTDyldObjectLinkingLayerBase::ObjectPtr; /// @brief Functor for receiving object-loaded notifications. - using NotifyLoadedFtor = std::function<void(ObjHandleT, const ObjectPtr &Obj, - const LoadedObjectInfo &)>; + using NotifyLoadedFtor = + std::function<void(ObjHandleT, const ObjectPtr &Obj, + const RuntimeDyld::LoadedObjectInfo &)>; /// @brief Functor for receiving finalization notifications. using NotifyFinalizedFtor = std::function<void(ObjHandleT)>; diff --git a/llvm/lib/ExecutionEngine/Orc/OrcMCJITReplacement.h b/llvm/lib/ExecutionEngine/Orc/OrcMCJITReplacement.h index cb48d6cb230..1dc8d4ac7bc 100644 --- a/llvm/lib/ExecutionEngine/Orc/OrcMCJITReplacement.h +++ b/llvm/lib/ExecutionEngine/Orc/OrcMCJITReplacement.h @@ -341,7 +341,7 @@ private: void operator()(RTDyldObjectLinkingLayerBase::ObjHandleT H, const RTDyldObjectLinkingLayer::ObjectPtr &Obj, - const LoadedObjectInfo &Info) const { + const RuntimeDyld::LoadedObjectInfo &Info) const { M.UnfinalizedSections[H] = std::move(M.SectionsAllocatedSinceLastLoad); M.SectionsAllocatedSinceLastLoad = SectionAddrSet(); M.MemMgr->notifyObjectLoaded(&M, *Obj->getBinary()); diff --git a/llvm/unittests/ExecutionEngine/Orc/RTDyldObjectLinkingLayerTest.cpp b/llvm/unittests/ExecutionEngine/Orc/RTDyldObjectLinkingLayerTest.cpp index e4b61d855c5..132681ecc19 100644 --- a/llvm/unittests/ExecutionEngine/Orc/RTDyldObjectLinkingLayerTest.cpp +++ b/llvm/unittests/ExecutionEngine/Orc/RTDyldObjectLinkingLayerTest.cpp @@ -255,4 +255,12 @@ TEST_F(RTDyldObjectLinkingLayerExecutionTest, NoPrematureAllocation) { "(multiple unrelated objects loaded prior to finalization)"; } +TEST_F(RTDyldObjectLinkingLayerExecutionTest, TestNotifyLoadedSignature) { + RTDyldObjectLinkingLayer ObjLayer([]() { return nullptr; }, + [this](decltype(ObjLayer)::ObjHandleT, + const decltype(ObjLayer)::ObjectPtr &obj, + const RuntimeDyld::LoadedObjectInfo &info) { + }); +} + } // end anonymous namespace |