summaryrefslogtreecommitdiffstats
path: root/llvm/tools/lli/RPCChannel.h
diff options
context:
space:
mode:
authorAlp Toker <alp@nuanti.com>2014-01-23 22:19:45 +0000
committerAlp Toker <alp@nuanti.com>2014-01-23 22:19:45 +0000
commit632c6cd114e6ed06b141fbef4c161b60d41fac1b (patch)
treeb4395ecc0fb3ba68444c34c24c0846d293bca63d /llvm/tools/lli/RPCChannel.h
parent146b7b123001e185a76e143a8443b93b7c011c4e (diff)
downloadbcm5719-llvm-632c6cd114e6ed06b141fbef4c161b60d41fac1b.tar.gz
bcm5719-llvm-632c6cd114e6ed06b141fbef4c161b60d41fac1b.zip
lli: Factor portable messaging into a new RPCChannel facility
The client and server now use a single unified low-level RPC core built around LLVM's existing cross-platform abstractions. llvm-svn: 199947
Diffstat (limited to 'llvm/tools/lli/RPCChannel.h')
-rw-r--r--llvm/tools/lli/RPCChannel.h51
1 files changed, 51 insertions, 0 deletions
diff --git a/llvm/tools/lli/RPCChannel.h b/llvm/tools/lli/RPCChannel.h
new file mode 100644
index 00000000000..d04c8c25b49
--- /dev/null
+++ b/llvm/tools/lli/RPCChannel.h
@@ -0,0 +1,51 @@
+//===---------- RPCChannel.h - LLVM out-of-process JIT execution ----------===//
+//
+// The LLVM Compiler Infrastructure
+//
+// This file is distributed under the University of Illinois Open Source
+// License. See LICENSE.TXT for details.
+//
+//===----------------------------------------------------------------------===//
+//
+// Definition of the RemoteTargetExternal class which executes JITed code in a
+// separate process from where it was built.
+//
+//===----------------------------------------------------------------------===//
+
+#ifndef LLI_RPCCHANNEL_H
+#define LLI_RPCCHANNEL_H
+
+#include <stdlib.h>
+#include <string>
+
+namespace llvm {
+
+class RPCChannel {
+public:
+ std::string ChildName;
+
+ RPCChannel() {}
+ ~RPCChannel();
+
+ static void ReportError(int rc, size_t Size, std::string &ErrorMsg);
+
+ /// Start the remote process.
+ ///
+ /// @returns True on success. On failure, ErrorMsg is updated with
+ /// descriptive text of the encountered error.
+ bool createServer();
+
+ bool createClient();
+
+ // This will get filled in as a point to an OS-specific structure.
+ void *ConnectionData;
+
+ int WriteBytes(const void *Data, size_t Size);
+ int ReadBytes(void *Data, size_t Size);
+
+ void Wait();
+};
+
+} // end namespace llvm
+
+#endif // LLI_RPCCHANNEL_H
OpenPOWER on IntegriCloud