From 0ace78e7d4c17a6bf7e2402571161184fe9d8cfd Mon Sep 17 00:00:00 2001 From: Lang Hames Date: Fri, 23 Jan 2015 22:11:07 +0000 Subject: [PATCH] [Orc] Remove a bunch of constructors from ObjectLinkingLayer. These constructors were causing trouble for MSVC and older GCCs. This should fix more of the build failures from r226940. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@226946 91177308-0d34-0410-b5e6-96231b3b80d8 --- .../ExecutionEngine/Orc/ObjectLinkingLayer.h | 53 ++++--------------- lib/ExecutionEngine/Orc/OrcMCJITReplacement.h | 3 +- 2 files changed, 11 insertions(+), 45 deletions(-) diff --git a/include/llvm/ExecutionEngine/Orc/ObjectLinkingLayer.h b/include/llvm/ExecutionEngine/Orc/ObjectLinkingLayer.h index a1d6c48ecd0..ff358007a72 100644 --- a/include/llvm/ExecutionEngine/Orc/ObjectLinkingLayer.h +++ b/include/llvm/ExecutionEngine/Orc/ObjectLinkingLayer.h @@ -94,59 +94,24 @@ public: template class ObjectLinkingLayer : public ObjectLinkingLayerBase { public: + /// @brief LoadedObjectInfo list. Contains a list of owning pointers to /// RuntimeDyld::LoadedObjectInfo instances. typedef std::vector> LoadedObjInfoList; - /// @brief Default construct an ObjectLinkingLayer. - ObjectLinkingLayer() {} + /// @brief Functor to create RTDyldMemoryManager instances. + typedef std::function()> CreateRTDyldMMFtor; - /// @brief Construct an ObjectLinkingLayer with the given NotifyLoaded - /// functor. - ObjectLinkingLayer(NotifyLoadedFtor NotifyLoaded) - : NotifyLoaded(std::move(NotifyLoaded)) {} - - /// @brief Construct an ObjectLinkingLayer with the given NotifyFinalized - /// functor. - ObjectLinkingLayer(std::function NotifyFinalized) - : NotifyFinalized(std::move(NotifyFinalized)) {} - - /// @brief Construct an ObjectLinkingLayer with the given CreateMemoryManager - /// functor. - ObjectLinkingLayer( - std::function()> CreateMemoryManager) - : CreateMemoryManager(std::move(CreateMemoryManager)) {} - - /// @brief Construct an ObjectLinkingLayer with the given NotifyLoaded and - /// NotifyFinalized functors. - ObjectLinkingLayer(NotifyLoadedFtor NotifyLoaded, - std::function NotifyFinalized) - : NotifyLoaded(std::move(NotifyLoaded)), - NotifyFinalized(std::move(NotifyFinalized)) {} - - /// @brief Construct an ObjectLinkingLayer with the given NotifyLoaded and - /// CreateMemoryManager functors. - ObjectLinkingLayer( - NotifyLoadedFtor NotifyLoaded, - std::function()> CreateMemoryManager) - : NotifyLoaded(std::move(NotifyLoaded)), - CreateMemoryManager(std::move(CreateMemoryManager)) {} - - /// @brief Construct an ObjectLinkingLayer with the given NotifyFinalized and - /// CreateMemoryManager functors. - ObjectLinkingLayer( - std::function NotifyFinalized, - std::function()> CreateMemoryManager) - : NotifyFinalized(std::move(NotifyFinalized)), - CreateMemoryManager(std::move(CreateMemoryManager)) {} + /// @brief Functor for receiving finalization notifications. + typedef std::function NotifyFinalizedFtor; /// @brief Construct an ObjectLinkingLayer with the given NotifyLoaded, /// NotifyFinalized and CreateMemoryManager functors. ObjectLinkingLayer( + CreateRTDyldMMFtor CreateMemoryManager, NotifyLoadedFtor NotifyLoaded, - std::function NotifyFinalized, - std::function()> CreateMemoryManager) + NotifyFinalizedFtor NotifyFinalized) : NotifyLoaded(std::move(NotifyLoaded)), NotifyFinalized(std::move(NotifyFinalized)), CreateMemoryManager(std::move(CreateMemoryManager)) {} @@ -245,8 +210,8 @@ public: private: LinkedObjectSetListT LinkedObjSetList; NotifyLoadedFtor NotifyLoaded; - std::function NotifyFinalized; - std::function()> CreateMemoryManager; + NotifyFinalizedFtor NotifyFinalized; + CreateRTDyldMMFtor CreateMemoryManager; }; } // end namespace llvm diff --git a/lib/ExecutionEngine/Orc/OrcMCJITReplacement.h b/lib/ExecutionEngine/Orc/OrcMCJITReplacement.h index 9fdf0efdd90..aea58575629 100644 --- a/lib/ExecutionEngine/Orc/OrcMCJITReplacement.h +++ b/lib/ExecutionEngine/Orc/OrcMCJITReplacement.h @@ -122,7 +122,8 @@ public: : TM(std::move(TM)), MM(std::move(MM)), Mang(this->TM->getSubtargetImpl()->getDataLayout()), NotifyObjectLoaded(*this), NotifyFinalized(*this), - ObjectLayer(NotifyObjectLoaded, NotifyFinalized), + ObjectLayer(ObjectLayerT::CreateRTDyldMMFtor(), NotifyObjectLoaded, + NotifyFinalized), CompileLayer(ObjectLayer, SimpleCompiler(*this->TM)), LazyEmitLayer(CompileLayer) { setDataLayout(this->TM->getSubtargetImpl()->getDataLayout());