1 //===-- RemoteJITUtils.h - Utilities for remote-JITing ----------*- C++ -*-===//
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
7 //===----------------------------------------------------------------------===//
9 // Utilities for ExecutorProcessControl-based remote JITing with Orc and
12 //===----------------------------------------------------------------------===//
14 #ifndef LLVM_EXAMPLES_ORCV2EXAMPLES_LLJITWITHREMOTEDEBUGGING_REMOTEJITUTILS_H
15 #define LLVM_EXAMPLES_ORCV2EXAMPLES_LLJITWITHREMOTEDEBUGGING_REMOTEJITUTILS_H
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"
27 /// Find the default exectuable on disk and create a JITLinkExecutor for it.
28 std::string
findLocalExecutor(const char *HostArgv0
);
30 llvm::Expected
<std::pair
<std::unique_ptr
<llvm::orc::SimpleRemoteEPC
>, uint64_t>>
31 launchLocalExecutor(llvm::StringRef ExecutablePath
);
33 /// Create a JITLinkExecutor that connects to the given network address
34 /// through a TCP socket. A valid NetworkAddress provides hostname and port,
35 /// e.g. localhost:20000.
36 llvm::Expected
<std::unique_ptr
<llvm::orc::SimpleRemoteEPC
>>
37 connectTCPSocket(llvm::StringRef NetworkAddress
);
39 llvm::Expected
<std::unique_ptr
<llvm::orc::DefinitionGenerator
>>
40 loadDylib(llvm::orc::ExecutionSession
&ES
, llvm::StringRef RemotePath
);