RPCChannel.h 1.2 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849
  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. #ifndef LLVM_TOOLS_LLI_RPCCHANNEL_H
  15. #define LLVM_TOOLS_LLI_RPCCHANNEL_H
  16. #include <stdlib.h>
  17. #include <string>
  18. namespace llvm {
  19. class RPCChannel {
  20. public:
  21. std::string ChildName;
  22. RPCChannel() {}
  23. ~RPCChannel();
  24. /// Start the remote process.
  25. ///
  26. /// @returns True on success. On failure, ErrorMsg is updated with
  27. /// descriptive text of the encountered error.
  28. bool createServer();
  29. bool createClient();
  30. // This will get filled in as a point to an OS-specific structure.
  31. void *ConnectionData;
  32. bool WriteBytes(const void *Data, size_t Size);
  33. bool ReadBytes(void *Data, size_t Size);
  34. void Wait();
  35. };
  36. } // end namespace llvm
  37. #endif