#include "llvm/ExecutionEngine/Orc/MemoryMapper.h"
#include "llvm/Config/llvm-config.h"
#include "llvm/ExecutionEngine/Orc/Shared/OrcRTBridge.h"
#include "llvm/Support/WindowsError.h"
#include <algorithm>
#if defined(LLVM_ON_UNIX) && !defined(__ANDROID__)
#include <fcntl.h>
#include <sys/mman.h>
#if defined(__MVS__)
#include "llvm/Support/BLAKE3.h"
#include <sys/shm.h>
#endif
#include <unistd.h>
#elif defined(_WIN32)
#include <windows.h>
#endif
namespace llvm {
namespace orc {
MemoryMapper::~MemoryMapper() { … }
InProcessMemoryMapper::InProcessMemoryMapper(size_t PageSize)
: … { … }
Expected<std::unique_ptr<InProcessMemoryMapper>>
InProcessMemoryMapper::Create() { … }
void InProcessMemoryMapper::reserve(size_t NumBytes,
OnReservedFunction OnReserved) { … }
char *InProcessMemoryMapper::prepare(ExecutorAddr Addr, size_t ContentSize) { … }
void InProcessMemoryMapper::initialize(MemoryMapper::AllocInfo &AI,
OnInitializedFunction OnInitialized) { … }
void InProcessMemoryMapper::deinitialize(
ArrayRef<ExecutorAddr> Bases,
MemoryMapper::OnDeinitializedFunction OnDeinitialized) { … }
void InProcessMemoryMapper::release(ArrayRef<ExecutorAddr> Bases,
OnReleasedFunction OnReleased) { … }
InProcessMemoryMapper::~InProcessMemoryMapper() { … }
SharedMemoryMapper::SharedMemoryMapper(ExecutorProcessControl &EPC,
SymbolAddrs SAs, size_t PageSize)
: … { … }
Expected<std::unique_ptr<SharedMemoryMapper>>
SharedMemoryMapper::Create(ExecutorProcessControl &EPC, SymbolAddrs SAs) { … }
void SharedMemoryMapper::reserve(size_t NumBytes,
OnReservedFunction OnReserved) { … }
char *SharedMemoryMapper::prepare(ExecutorAddr Addr, size_t ContentSize) { … }
void SharedMemoryMapper::initialize(MemoryMapper::AllocInfo &AI,
OnInitializedFunction OnInitialized) { … }
void SharedMemoryMapper::deinitialize(
ArrayRef<ExecutorAddr> Allocations,
MemoryMapper::OnDeinitializedFunction OnDeinitialized) { … }
void SharedMemoryMapper::release(ArrayRef<ExecutorAddr> Bases,
OnReleasedFunction OnReleased) { … }
SharedMemoryMapper::~SharedMemoryMapper() { … }
}
}