Fix some formatting from a recent commit.
[oota-llvm.git] / include / llvm / ExecutionEngine / Orc / LogicalDylib.h
index f58c089acb44be061a0966cf69ca4f595a4d78ff..90380391decfe2452b12605c2436d8b430ad05cc 100644 (file)
@@ -14,9 +14,6 @@
 #ifndef LLVM_EXECUTIONENGINE_ORC_LOGICALDYLIB_H
 #define LLVM_EXECUTIONENGINE_ORC_LOGICALDYLIB_H
 
-#include "llvm/ADT/iterator.h"
-#include "llvm/ADT/Optional.h"
-
 namespace llvm {
 namespace orc {
 
@@ -31,6 +28,10 @@ private:
   typedef std::vector<BaseLayerModuleSetHandleT> BaseLayerHandleList;
 
   struct LogicalModule {
+    // Make this move-only to ensure they don't get duplicated across moves of
+    // LogicalDylib or anything like that.
+    LogicalModule(LogicalModule &&) = default;
+    LogicalModule() = default;
     LogicalModuleResources Resources;
     BaseLayerHandleList BaseLayerHandles;
   };
@@ -49,6 +50,10 @@ public:
         BaseLayer.removeModuleSet(BLH);
   }
 
+  // If possible, remove this and ~LogicalDylib once the work in the dtor is
+  // moved to members (eg: self-unregistering base layer handles).
+  LogicalDylib(LogicalDylib &&RHS) = default;
+
   LogicalModuleHandle createLogicalModule() {
     LogicalModules.push_back(LogicalModule());
     return std::prev(LogicalModules.end());