xref: /freebsd/contrib/llvm-project/clang/include/clang/Interpreter/RemoteJITUtils.h (revision 700637cbb5e582861067a11aaca4d053546871d2)
1 //===-- RemoteJITUtils.h - Utilities for remote-JITing ----------*- C++ -*-===//
2 //
3 // Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
4 // See https://llvm.org/LICENSE.txt for license information.
5 // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
6 //
7 //===----------------------------------------------------------------------===//
8 //
9 // Utilities for ExecutorProcessControl-based remote JITing with Orc and
10 // JITLink.
11 //
12 //===----------------------------------------------------------------------===//
13 
14 #ifndef LLVM_CLANG_INTERPRETER_REMOTEJITUTILS_H
15 #define LLVM_CLANG_INTERPRETER_REMOTEJITUTILS_H
16 
17 #include "llvm/ADT/StringRef.h"
18 #include "llvm/ExecutionEngine/Orc/Core.h"
19 #include "llvm/ExecutionEngine/Orc/Layer.h"
20 #include "llvm/ExecutionEngine/Orc/SimpleRemoteEPC.h"
21 #include "llvm/Support/Error.h"
22 
23 #include <cstdint>
24 #include <memory>
25 #include <string>
26 
27 llvm::Expected<std::unique_ptr<llvm::orc::SimpleRemoteEPC>>
28 launchExecutor(llvm::StringRef ExecutablePath, bool UseSharedMemory,
29                llvm::StringRef SlabAllocateSizeString);
30 
31 /// Create a JITLinkExecutor that connects to the given network address
32 /// through a TCP socket. A valid NetworkAddress provides hostname and port,
33 /// e.g. localhost:20000.
34 llvm::Expected<std::unique_ptr<llvm::orc::SimpleRemoteEPC>>
35 connectTCPSocket(llvm::StringRef NetworkAddress, bool UseSharedMemory,
36                  llvm::StringRef SlabAllocateSizeString);
37 
38 #endif // LLVM_CLANG_INTERPRETER_REMOTEJITUTILS_H
39