Fix some GCC 4.7 issues with the new Orc remote JIT support
authorDavid Blaikie <dblaikie@gmail.com>
Mon, 11 Jan 2016 19:26:01 +0000 (19:26 +0000)
committerDavid Blaikie <dblaikie@gmail.com>
Mon, 11 Jan 2016 19:26:01 +0000 (19:26 +0000)
I'm still seeing GCC ICE locally, but figured I'd throw this at the wall
& see if it sticks for the bots at least. Will continue investigating
the ICE in any case.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@257367 91177308-0d34-0410-b5e6-96231b3b80d8

include/llvm/ExecutionEngine/Orc/OrcRemoteTargetClient.h
include/llvm/ExecutionEngine/Orc/OrcRemoteTargetServer.h

index 8b391ac..20e2646 100644 (file)
@@ -701,10 +701,11 @@ private:
     if (auto EC = call<ReserveMem>(Channel, Id, Size, Align))
       return EC;
 
-    if (auto EC = expect<ReserveMemResponse>(Channel, [&](TargetAddress Addr) {
-          RemoteAddr = Addr;
-          return std::error_code();
-        }))
+    if (std::error_code EC =
+            expect<ReserveMemResponse>(Channel, [&](TargetAddress Addr) {
+              RemoteAddr = Addr;
+              return std::error_code();
+            }))
       return EC;
 
     return std::error_code();
index aa063a3..c05dce0 100644 (file)
@@ -163,13 +163,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");
 
@@ -181,7 +184,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);
@@ -207,10 +210,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");
@@ -387,7 +391,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;
@@ -410,7 +414,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);