Alp Toker | 632c6cd | 2014-01-23 22:19:45 +0000 | [diff] [blame] | 1 | //===---------- 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 | |
Benjamin Kramer | a7c40ef | 2014-08-13 16:26:38 +0000 | [diff] [blame] | 15 | #ifndef LLVM_TOOLS_LLI_RPCCHANNEL_H |
| 16 | #define LLVM_TOOLS_LLI_RPCCHANNEL_H |
Alp Toker | 632c6cd | 2014-01-23 22:19:45 +0000 | [diff] [blame] | 17 | |
| 18 | #include <stdlib.h> |
| 19 | #include <string> |
| 20 | |
| 21 | namespace llvm { |
| 22 | |
| 23 | class RPCChannel { |
| 24 | public: |
| 25 | std::string ChildName; |
| 26 | |
| 27 | RPCChannel() {} |
| 28 | ~RPCChannel(); |
| 29 | |
Alp Toker | 632c6cd | 2014-01-23 22:19:45 +0000 | [diff] [blame] | 30 | /// Start the remote process. |
| 31 | /// |
| 32 | /// @returns True on success. On failure, ErrorMsg is updated with |
| 33 | /// descriptive text of the encountered error. |
| 34 | bool createServer(); |
| 35 | |
| 36 | bool createClient(); |
| 37 | |
| 38 | // This will get filled in as a point to an OS-specific structure. |
| 39 | void *ConnectionData; |
| 40 | |
Alp Toker | ad6aa47 | 2014-01-24 17:18:52 +0000 | [diff] [blame] | 41 | bool WriteBytes(const void *Data, size_t Size); |
| 42 | bool ReadBytes(void *Data, size_t Size); |
Alp Toker | 632c6cd | 2014-01-23 22:19:45 +0000 | [diff] [blame] | 43 | |
| 44 | void Wait(); |
| 45 | }; |
| 46 | |
| 47 | } // end namespace llvm |
| 48 | |
Benjamin Kramer | a7c40ef | 2014-08-13 16:26:38 +0000 | [diff] [blame] | 49 | #endif |