From ada56848f5ff516cb5754215b265cd0ef78092b7 Mon Sep 17 00:00:00 2001 From: Lang Hames Date: Mon, 11 Jan 2016 19:39:49 +0000 Subject: [PATCH] [Orc] Add explicit move construction/assignment to RCMemoryManager. Yet another attempt to pacify MSVC. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@257372 91177308-0d34-0410-b5e6-96231b3b80d8 --- .../ExecutionEngine/Orc/OrcRemoteTargetClient.h | 16 +++++++++++++--- 1 file changed, 13 insertions(+), 3 deletions(-) diff --git a/include/llvm/ExecutionEngine/Orc/OrcRemoteTargetClient.h b/include/llvm/ExecutionEngine/Orc/OrcRemoteTargetClient.h index 20e26469fbb..7a4489c1eff 100644 --- a/include/llvm/ExecutionEngine/Orc/OrcRemoteTargetClient.h +++ b/include/llvm/ExecutionEngine/Orc/OrcRemoteTargetClient.h @@ -44,6 +44,19 @@ public: DEBUG(dbgs() << "Created remote allocator " << Id << "\n"); } + RCMemoryManager(RCMemoryManager &&Other) + : Client(std::move(Other.Client)), Id(std::move(Other.Id)), + Unmapped(std::move(Other.Unmapped)), + Unfinalized(std::move(Other.Unfinalized)) {} + + RCMemoryManager operator=(RCMemoryManager &&Other) { + Client = std::move(Other.Client); + Id = std::move(Other.Id); + Unmapped = std::move(Other.Unmapped); + Unfinalized = std::move(Other.Unfinalized); + return *this; + } + ~RCMemoryManager() { Client.destroyRemoteAllocator(Id); DEBUG(dbgs() << "Destroyed remote allocator " << Id << "\n"); @@ -253,9 +266,6 @@ public: : Size(Size), Align(Align), Contents(new char[Size + Align - 1]), RemoteAddr(0) {} - Alloc(const Alloc&) = delete; - Alloc& operator=(const Alloc&) = delete; - Alloc(Alloc &&Other) : Size(std::move(Other.Size)), Align(std::move(Other.Align)), Contents(std::move(Other.Contents)), -- 2.34.1