mirror of
https://github.com/RPCS3/llvm.git
synced 2025-04-05 06:41:51 +00:00

asynchronous call/handle. Also updates the ORC remote JIT API to use the new scheme. The previous version of the RPC tools only supported void functions, and required the user to manually call a paired function to return results. This patch replaces the Procedure typedef (which only supported void functions) with the Function typedef which supports return values, e.g.: Function<FooId, int32_t(std::string)> Foo; The RPC primitives and channel operations are also expanded. RPC channels must support four new operations: startSendMessage, endSendMessage, startRecieveMessage and endRecieveMessage, to handle channel locking. In addition, serialization support for tuples to RPCChannels is added to enable multiple return values. The RPC primitives are expanded from callAppend, call, expect and handle, to: appendCallAsync - Make an asynchronous call to the given function. callAsync - The same as appendCallAsync, but calls send on the channel when done. callSTHandling - Blocking call for single-threaded code. Wraps a call to callAsync then waits on the result, using a user-supplied handler to handle any callbacks from the remote. callST - The same as callSTHandling, except that it doesn't handle callbacks - it expects the result to be the first return. expect and handle - as before. handleResponse - Handle a response from the remote. waitForResult - Wait for the response with the given sequence number to arrive. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@266581 91177308-0d34-0410-b5e6-96231b3b80d8
54 lines
1.3 KiB
C++
54 lines
1.3 KiB
C++
//===------- OrcRemoteTargetRPCAPI.cpp - ORC Remote API utilities ---------===//
|
|
//
|
|
// The LLVM Compiler Infrastructure
|
|
//
|
|
// This file is distributed under the University of Illinois Open Source
|
|
// License. See LICENSE.TXT for details.
|
|
//
|
|
//===----------------------------------------------------------------------===//
|
|
|
|
#include "llvm/ExecutionEngine/Orc/OrcRemoteTargetRPCAPI.h"
|
|
|
|
namespace llvm {
|
|
namespace orc {
|
|
namespace remote {
|
|
|
|
#define FUNCNAME(X) \
|
|
case X ## Id: \
|
|
return #X
|
|
|
|
const char *OrcRemoteTargetRPCAPI::getJITFuncIdName(JITFuncId Id) {
|
|
switch (Id) {
|
|
case InvalidId:
|
|
return "*** Invalid JITFuncId ***";
|
|
FUNCNAME(CallIntVoid);
|
|
FUNCNAME(CallMain);
|
|
FUNCNAME(CallVoidVoid);
|
|
FUNCNAME(CreateRemoteAllocator);
|
|
FUNCNAME(CreateIndirectStubsOwner);
|
|
FUNCNAME(DeregisterEHFrames);
|
|
FUNCNAME(DestroyRemoteAllocator);
|
|
FUNCNAME(DestroyIndirectStubsOwner);
|
|
FUNCNAME(EmitIndirectStubs);
|
|
FUNCNAME(EmitResolverBlock);
|
|
FUNCNAME(EmitTrampolineBlock);
|
|
FUNCNAME(GetSymbolAddress);
|
|
FUNCNAME(GetRemoteInfo);
|
|
FUNCNAME(ReadMem);
|
|
FUNCNAME(RegisterEHFrames);
|
|
FUNCNAME(ReserveMem);
|
|
FUNCNAME(RequestCompile);
|
|
FUNCNAME(SetProtections);
|
|
FUNCNAME(TerminateSession);
|
|
FUNCNAME(WriteMem);
|
|
FUNCNAME(WritePtr);
|
|
};
|
|
return nullptr;
|
|
}
|
|
|
|
#undef FUNCNAME
|
|
|
|
} // end namespace remote
|
|
} // end namespace orc
|
|
} // end namespace llvm
|