From b4b38d65e68a3aaac2a3101067f067313bf13b4b Mon Sep 17 00:00:00 2001 From: David Blaikie Date: Fri, 31 Jul 2015 21:26:16 +0000 Subject: [PATCH] -Wdeprecated-clean: Fix cases of violating the rule of 5 in ways that are deprecated in C++11 git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@243786 91177308-0d34-0410-b5e6-96231b3b80d8 --- include/llvm/ExecutionEngine/Orc/LogicalDylib.h | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/include/llvm/ExecutionEngine/Orc/LogicalDylib.h b/include/llvm/ExecutionEngine/Orc/LogicalDylib.h index 28700ef347d..be9cdfa7193 100644 --- a/include/llvm/ExecutionEngine/Orc/LogicalDylib.h +++ b/include/llvm/ExecutionEngine/Orc/LogicalDylib.h @@ -28,6 +28,10 @@ private: typedef std::vector 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()); -- 2.34.1