OrcRemoteTargetServer.h: Suppress a warning. [-Wunused-variable]
[oota-llvm.git] / include / llvm / ExecutionEngine / Orc / OrcRemoteTargetServer.h
index af4eb8e5d63b63f373cd0004572650f14d108219..b9db3890cc70d0e78a735ee874c2399cbf0e6e15 100644 (file)
@@ -111,8 +111,11 @@ public:
 private:
   struct Allocator {
     Allocator() = default;
-    Allocator(Allocator &&) = default;
-    Allocator &operator=(Allocator &&) = default;
+    Allocator(Allocator &&Other) : Allocs(std::move(Other.Allocs)) {}
+    Allocator &operator=(Allocator &&Other) {
+      Allocs = std::move(Other.Allocs);
+      return *this;
+    }
 
     ~Allocator() {
       for (auto &Alloc : Allocs)
@@ -153,6 +156,7 @@ private:
         CompiledFnAddr, static_cast<TargetAddress>(
                             reinterpret_cast<uintptr_t>(TrampolineAddr)));
     assert(!EC && "Compile request failed");
+    (void)&EC;
     return CompiledFnAddr;
   }
 
@@ -160,13 +164,16 @@ private:
     typedef int (*IntVoidFnTy)();
 
     IntVoidFnTy Fn = nullptr;
-    if (auto EC = handle<CallIntVoid>(Channel, [&](TargetAddress Addr) {
-          Fn = reinterpret_cast<IntVoidFnTy>(static_cast<uintptr_t>(Addr));
-          return std::error_code();
-        }))
+    if (std::error_code EC =
+            handle<CallIntVoid>(Channel, [&](TargetAddress Addr) {
+              Fn = reinterpret_cast<IntVoidFnTy>(static_cast<uintptr_t>(Addr));
+              return std::error_code();
+            }))
       return EC;
 
-    DEBUG(dbgs() << "  Calling " << reinterpret_cast<void *>(Fn) << "\n");
+    DEBUG(dbgs() << "  Calling "
+                 << reinterpret_cast<void *>(reinterpret_cast<intptr_t>(Fn))
+                 << "\n");
     int Result = Fn();
     DEBUG(dbgs() << "  Result = " << Result << "\n");
 
@@ -178,7 +185,7 @@ private:
 
     MainFnTy Fn = nullptr;
     std::vector<std::string> Args;
-    if (auto EC = handle<CallMain>(
+    if (std::error_code EC = handle<CallMain>(
             Channel, [&](TargetAddress Addr, std::vector<std::string> &A) {
               Fn = reinterpret_cast<MainFnTy>(static_cast<uintptr_t>(Addr));
               Args = std::move(A);
@@ -204,10 +211,11 @@ private:
     typedef void (*VoidVoidFnTy)();
 
     VoidVoidFnTy Fn = nullptr;
-    if (auto EC = handle<CallIntVoid>(Channel, [&](TargetAddress Addr) {
-          Fn = reinterpret_cast<VoidVoidFnTy>(static_cast<uintptr_t>(Addr));
-          return std::error_code();
-        }))
+    if (std::error_code EC =
+            handle<CallIntVoid>(Channel, [&](TargetAddress Addr) {
+              Fn = reinterpret_cast<VoidVoidFnTy>(static_cast<uintptr_t>(Addr));
+              return std::error_code();
+            }))
       return EC;
 
     DEBUG(dbgs() << "  Calling " << reinterpret_cast<void *>(Fn) << "\n");
@@ -384,7 +392,7 @@ private:
   std::error_code handleReadMem() {
     char *Src = nullptr;
     uint64_t Size = 0;
-    if (auto EC =
+    if (std::error_code EC =
             handle<ReadMem>(Channel, [&](TargetAddress RSrc, uint64_t RSize) {
               Src = reinterpret_cast<char *>(static_cast<uintptr_t>(RSrc));
               Size = RSize;
@@ -407,7 +415,7 @@ private:
   std::error_code handleReserveMem() {
     void *LocalAllocAddr = nullptr;
 
-    if (auto EC =
+    if (std::error_code EC =
             handle<ReserveMem>(Channel, [&](ResourceIdMgr::ResourceId Id,
                                             uint64_t Size, uint32_t Align) {
               auto I = Allocators.find(Id);