From c45bf3b4bfda473198584d2e196bef0202f98029 Mon Sep 17 00:00:00 2001 From: David Blaikie Date: Mon, 11 Jan 2016 19:26:01 +0000 Subject: [PATCH] Fix some GCC 4.7 issues with the new Orc remote JIT support 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 --- .../Orc/OrcRemoteTargetClient.h | 9 +++--- .../Orc/OrcRemoteTargetServer.h | 28 +++++++++++-------- 2 files changed, 21 insertions(+), 16 deletions(-) diff --git a/include/llvm/ExecutionEngine/Orc/OrcRemoteTargetClient.h b/include/llvm/ExecutionEngine/Orc/OrcRemoteTargetClient.h index 8b391acf0be..20e26469fbb 100644 --- a/include/llvm/ExecutionEngine/Orc/OrcRemoteTargetClient.h +++ b/include/llvm/ExecutionEngine/Orc/OrcRemoteTargetClient.h @@ -701,10 +701,11 @@ private: if (auto EC = call(Channel, Id, Size, Align)) return EC; - if (auto EC = expect(Channel, [&](TargetAddress Addr) { - RemoteAddr = Addr; - return std::error_code(); - })) + if (std::error_code EC = + expect(Channel, [&](TargetAddress Addr) { + RemoteAddr = Addr; + return std::error_code(); + })) return EC; return std::error_code(); diff --git a/include/llvm/ExecutionEngine/Orc/OrcRemoteTargetServer.h b/include/llvm/ExecutionEngine/Orc/OrcRemoteTargetServer.h index aa063a3f944..c05dce09c0b 100644 --- a/include/llvm/ExecutionEngine/Orc/OrcRemoteTargetServer.h +++ b/include/llvm/ExecutionEngine/Orc/OrcRemoteTargetServer.h @@ -163,13 +163,16 @@ private: typedef int (*IntVoidFnTy)(); IntVoidFnTy Fn = nullptr; - if (auto EC = handle(Channel, [&](TargetAddress Addr) { - Fn = reinterpret_cast(static_cast(Addr)); - return std::error_code(); - })) + if (std::error_code EC = + handle(Channel, [&](TargetAddress Addr) { + Fn = reinterpret_cast(static_cast(Addr)); + return std::error_code(); + })) return EC; - DEBUG(dbgs() << " Calling " << reinterpret_cast(Fn) << "\n"); + DEBUG(dbgs() << " Calling " + << reinterpret_cast(reinterpret_cast(Fn)) + << "\n"); int Result = Fn(); DEBUG(dbgs() << " Result = " << Result << "\n"); @@ -181,7 +184,7 @@ private: MainFnTy Fn = nullptr; std::vector Args; - if (auto EC = handle( + if (std::error_code EC = handle( Channel, [&](TargetAddress Addr, std::vector &A) { Fn = reinterpret_cast(static_cast(Addr)); Args = std::move(A); @@ -207,10 +210,11 @@ private: typedef void (*VoidVoidFnTy)(); VoidVoidFnTy Fn = nullptr; - if (auto EC = handle(Channel, [&](TargetAddress Addr) { - Fn = reinterpret_cast(static_cast(Addr)); - return std::error_code(); - })) + if (std::error_code EC = + handle(Channel, [&](TargetAddress Addr) { + Fn = reinterpret_cast(static_cast(Addr)); + return std::error_code(); + })) return EC; DEBUG(dbgs() << " Calling " << reinterpret_cast(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(Channel, [&](TargetAddress RSrc, uint64_t RSize) { Src = reinterpret_cast(static_cast(RSrc)); Size = RSize; @@ -410,7 +414,7 @@ private: std::error_code handleReserveMem() { void *LocalAllocAddr = nullptr; - if (auto EC = + if (std::error_code EC = handle(Channel, [&](ResourceIdMgr::ResourceId Id, uint64_t Size, uint32_t Align) { auto I = Allocators.find(Id); -- 2.34.1