[llvm] r243786 - -Wdeprecated-clean: Fix cases of violating the rule of 5 in ways that are deprecated in C++11

David Blaikie dblaikie at gmail.com
Fri Jul 31 14:26:16 PDT 2015


Author: dblaikie
Date: Fri Jul 31 16:26:16 2015
New Revision: 243786

URL: http://llvm.org/viewvc/llvm-project?rev=243786&view=rev
Log:
-Wdeprecated-clean: Fix cases of violating the rule of 5 in ways that are deprecated in C++11

Modified:
    llvm/trunk/include/llvm/ExecutionEngine/Orc/LogicalDylib.h

Modified: llvm/trunk/include/llvm/ExecutionEngine/Orc/LogicalDylib.h
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/include/llvm/ExecutionEngine/Orc/LogicalDylib.h?rev=243786&r1=243785&r2=243786&view=diff
==============================================================================
--- llvm/trunk/include/llvm/ExecutionEngine/Orc/LogicalDylib.h (original)
+++ llvm/trunk/include/llvm/ExecutionEngine/Orc/LogicalDylib.h Fri Jul 31 16:26:16 2015
@@ -28,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;
   };
@@ -46,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());





More information about the llvm-commits mailing list