blob: d04c8c25b491bb90772d2a4e2700ddefa7ce69f5 [file] [log] [blame]
Alp Toker632c6cd2014-01-23 22:19:45 +00001//===---------- RPCChannel.h - LLVM out-of-process JIT execution ----------===//
2//
3// The LLVM Compiler Infrastructure
4//
5// This file is distributed under the University of Illinois Open Source
6// License. See LICENSE.TXT for details.
7//
8//===----------------------------------------------------------------------===//
9//
10// Definition of the RemoteTargetExternal class which executes JITed code in a
11// separate process from where it was built.
12//
13//===----------------------------------------------------------------------===//
14
15#ifndef LLI_RPCCHANNEL_H
16#define LLI_RPCCHANNEL_H
17
18#include <stdlib.h>
19#include <string>
20
21namespace llvm {
22
23class RPCChannel {
24public:
25 std::string ChildName;
26
27 RPCChannel() {}
28 ~RPCChannel();
29
30 static void ReportError(int rc, size_t Size, std::string &ErrorMsg);
31
32 /// Start the remote process.
33 ///
34 /// @returns True on success. On failure, ErrorMsg is updated with
35 /// descriptive text of the encountered error.
36 bool createServer();
37
38 bool createClient();
39
40 // This will get filled in as a point to an OS-specific structure.
41 void *ConnectionData;
42
43 int WriteBytes(const void *Data, size_t Size);
44 int ReadBytes(void *Data, size_t Size);
45
46 void Wait();
47};
48
49} // end namespace llvm
50
51#endif // LLI_RPCCHANNEL_H