]> granicus.if.org Git - llvm/commitdiff
[ORC] Fix the type of RTDyldObjectLinkingLayer::NotifyLoadedFtor.
authorLang Hames <lhames@gmail.com>
Thu, 28 Sep 2017 17:43:07 +0000 (17:43 +0000)
committerLang Hames <lhames@gmail.com>
Thu, 28 Sep 2017 17:43:07 +0000 (17:43 +0000)
Bug found by Stefan Granitz. Thanks Stefan!

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@314436 91177308-0d34-0410-b5e6-96231b3b80d8

include/llvm/ExecutionEngine/Orc/RTDyldObjectLinkingLayer.h
lib/ExecutionEngine/Orc/OrcMCJITReplacement.h
unittests/ExecutionEngine/Orc/RTDyldObjectLinkingLayerTest.cpp

index 633713c38ae4805c61987acd272a0942dd84029e..246c57341f3591d0f009d32ce5ca0744d6605201 100644 (file)
@@ -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)>;
index cb48d6cb230d0883f0be3ded2532655dfe5feec9..1dc8d4ac7bc5f39505ab713974bcae349245cbc9 100644 (file)
@@ -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());
index e4b61d855c5f455a7f11e735e5cd2328ff9880e9..132681ecc1960a4785fa46b90e59403e8caf4daa 100644 (file)
@@ -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