43 lines · c
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-exception6//7//===----------------------------------------------------------------------===//8//9// Utilities for ExecutorProcessControl-based remote JITing with Orc and10// JITLink.11//12//===----------------------------------------------------------------------===//13 14#ifndef LLVM_EXAMPLES_ORCV2EXAMPLES_LLJITWITHREMOTEDEBUGGING_REMOTEJITUTILS_H15#define LLVM_EXAMPLES_ORCV2EXAMPLES_LLJITWITHREMOTEDEBUGGING_REMOTEJITUTILS_H16 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/// Find the default exectuable on disk and create a JITLinkExecutor for it.28std::string findLocalExecutor(const char *HostArgv0);29 30llvm::Expected<std::pair<std::unique_ptr<llvm::orc::SimpleRemoteEPC>, uint64_t>>31launchLocalExecutor(llvm::StringRef ExecutablePath);32 33/// Create a JITLinkExecutor that connects to the given network address34/// through a TCP socket. A valid NetworkAddress provides hostname and port,35/// e.g. localhost:20000.36llvm::Expected<std::unique_ptr<llvm::orc::SimpleRemoteEPC>>37connectTCPSocket(llvm::StringRef NetworkAddress);38 39llvm::Expected<std::unique_ptr<llvm::orc::DefinitionGenerator>>40loadDylib(llvm::orc::ExecutionSession &ES, llvm::StringRef RemotePath);41 42#endif43