[llvm] r226946 - [Orc] Remove a bunch of constructors from ObjectLinkingLayer.

Lang Hames lhames at gmail.com
Fri Jan 23 14:11:07 PST 2015


Author: lhames
Date: Fri Jan 23 16:11:07 2015
New Revision: 226946

URL: http://llvm.org/viewvc/llvm-project?rev=226946&view=rev
Log:
[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.


Modified:
    llvm/trunk/include/llvm/ExecutionEngine/Orc/ObjectLinkingLayer.h
    llvm/trunk/lib/ExecutionEngine/Orc/OrcMCJITReplacement.h

Modified: llvm/trunk/include/llvm/ExecutionEngine/Orc/ObjectLinkingLayer.h
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/include/llvm/ExecutionEngine/Orc/ObjectLinkingLayer.h?rev=226946&r1=226945&r2=226946&view=diff
==============================================================================
--- llvm/trunk/include/llvm/ExecutionEngine/Orc/ObjectLinkingLayer.h (original)
+++ llvm/trunk/include/llvm/ExecutionEngine/Orc/ObjectLinkingLayer.h Fri Jan 23 16:11:07 2015
@@ -94,59 +94,24 @@ public:
 template <typename NotifyLoadedFtor = DoNothingOnNotifyLoaded>
 class ObjectLinkingLayer : public ObjectLinkingLayerBase {
 public:
+
   /// @brief LoadedObjectInfo list. Contains a list of owning pointers to
   ///        RuntimeDyld::LoadedObjectInfo instances.
   typedef std::vector<std::unique_ptr<RuntimeDyld::LoadedObjectInfo>>
       LoadedObjInfoList;
 
-  /// @brief Default construct an ObjectLinkingLayer.
-  ObjectLinkingLayer() {}
-
-  /// @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<void(ObjSetHandleT)> NotifyFinalized)
-      : NotifyFinalized(std::move(NotifyFinalized)) {}
-
-  /// @brief Construct an ObjectLinkingLayer with the given CreateMemoryManager
-  ///        functor.
-  ObjectLinkingLayer(
-      std::function<std::unique_ptr<RTDyldMemoryManager>()> CreateMemoryManager)
-      : CreateMemoryManager(std::move(CreateMemoryManager)) {}
+  /// @brief Functor to create RTDyldMemoryManager instances.
+  typedef std::function<std::unique_ptr<RTDyldMemoryManager>()> CreateRTDyldMMFtor;
 
-  /// @brief Construct an ObjectLinkingLayer with the given NotifyLoaded and
-  ///        NotifyFinalized functors.
-  ObjectLinkingLayer(NotifyLoadedFtor NotifyLoaded,
-                     std::function<void(ObjSetHandleT)> 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<std::unique_ptr<RTDyldMemoryManager>()> CreateMemoryManager)
-      : NotifyLoaded(std::move(NotifyLoaded)),
-        CreateMemoryManager(std::move(CreateMemoryManager)) {}
-
-  /// @brief Construct an ObjectLinkingLayer with the given NotifyFinalized and
-  ///        CreateMemoryManager functors.
-  ObjectLinkingLayer(
-      std::function<void(ObjSetHandleT)> NotifyFinalized,
-      std::function<std::unique_ptr<RTDyldMemoryManager>()> CreateMemoryManager)
-      : NotifyFinalized(std::move(NotifyFinalized)),
-        CreateMemoryManager(std::move(CreateMemoryManager)) {}
+  /// @brief Functor for receiving finalization notifications.
+  typedef std::function<void(ObjSetHandleT)> NotifyFinalizedFtor;
 
   /// @brief Construct an ObjectLinkingLayer with the given NotifyLoaded,
   ///        NotifyFinalized and CreateMemoryManager functors.
   ObjectLinkingLayer(
+      CreateRTDyldMMFtor CreateMemoryManager,
       NotifyLoadedFtor NotifyLoaded,
-      std::function<void(ObjSetHandleT)> NotifyFinalized,
-      std::function<std::unique_ptr<RTDyldMemoryManager>()> 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<void(ObjSetHandleT)> NotifyFinalized;
-  std::function<std::unique_ptr<RTDyldMemoryManager>()> CreateMemoryManager;
+  NotifyFinalizedFtor NotifyFinalized;
+  CreateRTDyldMMFtor CreateMemoryManager;
 };
 
 } // end namespace llvm

Modified: llvm/trunk/lib/ExecutionEngine/Orc/OrcMCJITReplacement.h
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/ExecutionEngine/Orc/OrcMCJITReplacement.h?rev=226946&r1=226945&r2=226946&view=diff
==============================================================================
--- llvm/trunk/lib/ExecutionEngine/Orc/OrcMCJITReplacement.h (original)
+++ llvm/trunk/lib/ExecutionEngine/Orc/OrcMCJITReplacement.h Fri Jan 23 16:11:07 2015
@@ -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());





More information about the llvm-commits mailing list