llvm/llvm/include/llvm/ExecutionEngine/Orc/Shared/TargetProcessControlTypes.h

//===--- TargetProcessControlTypes.h -- Shared Core/TPC types ---*- C++ -*-===//
//
// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
// See https://llvm.org/LICENSE.txt for license information.
// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
//
//===----------------------------------------------------------------------===//
//
// TargetProcessControl types that are used by both the Orc and
// OrcTargetProcess libraries.
//
//===----------------------------------------------------------------------===//

#ifndef LLVM_EXECUTIONENGINE_ORC_SHARED_TARGETPROCESSCONTROLTYPES_H
#define LLVM_EXECUTIONENGINE_ORC_SHARED_TARGETPROCESSCONTROLTYPES_H

#include "llvm/ADT/ArrayRef.h"
#include "llvm/ADT/StringRef.h"
#include "llvm/ExecutionEngine/JITSymbol.h"
#include "llvm/ExecutionEngine/Orc/Shared/AllocationActions.h"
#include "llvm/ExecutionEngine/Orc/Shared/ExecutorAddress.h"
#include "llvm/ExecutionEngine/Orc/Shared/ExecutorSymbolDef.h"
#include "llvm/ExecutionEngine/Orc/Shared/MemoryFlags.h"
#include "llvm/ExecutionEngine/Orc/Shared/SimplePackedSerialization.h"
#include "llvm/ExecutionEngine/Orc/Shared/WrapperFunctionUtils.h"
#include "llvm/Support/Memory.h"

#include <vector>

namespace llvm {
namespace orc {
namespace tpctypes {

struct RemoteAllocGroup {};

struct SegFinalizeRequest {};

struct FinalizeRequest {};

struct SharedMemorySegFinalizeRequest {};

struct SharedMemoryFinalizeRequest {};

template <typename T> struct UIntWrite {};

/// Describes a write to a uint8_t.
UInt8Write;

/// Describes a write to a uint16_t.
UInt16Write;

/// Describes a write to a uint32_t.
UInt32Write;

/// Describes a write to a uint64_t.
UInt64Write;

/// Describes a write to a buffer.
/// For use with TargetProcessControl::MemoryAccess objects.
struct BufferWrite {};

/// Describes a write to a pointer.
/// For use with TargetProcessControl::MemoryAccess objects.
struct PointerWrite {};

/// A handle used to represent a loaded dylib in the target process.
DylibHandle;

LookupResult;

} // end namespace tpctypes

namespace shared {

class SPSRemoteAllocGroup;

SPSSegFinalizeRequest;

SPSFinalizeRequest;

SPSSharedMemorySegFinalizeRequest;

SPSSharedMemoryFinalizeRequest;

SPSMemoryAccessUIntWrite;

SPSMemoryAccessUInt8Write;
SPSMemoryAccessUInt16Write;
SPSMemoryAccessUInt32Write;
SPSMemoryAccessUInt64Write;

SPSMemoryAccessBufferWrite;
SPSMemoryAccessPointerWrite;

template <>
class SPSSerializationTraits<SPSRemoteAllocGroup, tpctypes::RemoteAllocGroup> {};

template <>
class SPSSerializationTraits<SPSSegFinalizeRequest,
                             tpctypes::SegFinalizeRequest> {};

template <>
class SPSSerializationTraits<SPSFinalizeRequest, tpctypes::FinalizeRequest> {};

template <>
class SPSSerializationTraits<SPSSharedMemorySegFinalizeRequest,
                             tpctypes::SharedMemorySegFinalizeRequest> {};

template <>
class SPSSerializationTraits<SPSSharedMemoryFinalizeRequest,
                             tpctypes::SharedMemoryFinalizeRequest> {};

SPSSerializationTraits<SPSMemoryAccessUIntWrite<T>, tpctypes::UIntWrite<T>>;

template <>
class SPSSerializationTraits<SPSMemoryAccessBufferWrite,
                             tpctypes::BufferWrite> {};

template <>
class SPSSerializationTraits<SPSMemoryAccessPointerWrite,
                             tpctypes::PointerWrite> {};

} // end namespace shared
} // end namespace orc
} // end namespace llvm

#endif // LLVM_EXECUTIONENGINE_ORC_SHARED_TARGETPROCESSCONTROLTYPES_H