llvm-project/llvm/lib/ExecutionEngine/Orc/EPCGenericMemoryAccess.cpp
Lang Hames 2269a941a4 Revert 5629afea910 and bb27e456435 while I look into bot failures.
This reverts commit 5629afea9109d3b72064cbe70e1ca91ffb9dc0a2 ("[ORC] Add missing
include."), and bb27e4564355243e479cab40885d6e0f7f640572 ("[ORC] Add
SimpleRemoteEPC: ExecutorProcessControl over SPS + abstract transport.").

The SimpleRemoteEPC patch currently assumes availability of threads, and needs
to be rewritten with LLVM_ENABLE_THREADS guards.
2021-09-11 19:02:11 +10:00

47 lines
1.6 KiB
C++

//===----- EPCGenericMemoryAccess.cpp - Generic EPC MemoryAccess impl -----===//
//
// 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
//
//===----------------------------------------------------------------------===//
#include "llvm/ExecutionEngine/Orc/EPCGenericMemoryAccess.h"
#include "llvm/ExecutionEngine/Orc/LookupAndRecordAddrs.h"
namespace llvm {
namespace orc {
/// Create from a ExecutorProcessControl instance.
Expected<std::unique_ptr<EPCGenericMemoryAccess>>
EPCGenericMemoryAccess::CreateUsingOrcRTFuncs(ExecutorProcessControl &EPC) {
auto H = EPC.loadDylib("");
if (!H)
return H.takeError();
StringRef GlobalPrefix = "";
if (EPC.getTargetTriple().isOSBinFormatMachO())
GlobalPrefix = "_";
FuncAddrs FAs;
if (auto Err = lookupAndRecordAddrs(
EPC, *H,
{{EPC.intern((GlobalPrefix + "__orc_rt_write_uint8s_wrapper").str()),
&FAs.WriteUInt8s},
{EPC.intern((GlobalPrefix + "__orc_rt_write_uint16s_wrapper").str()),
&FAs.WriteUInt16s},
{EPC.intern((GlobalPrefix + "__orc_rt_write_uint32s_wrapper").str()),
&FAs.WriteUInt32s},
{EPC.intern((GlobalPrefix + "__orc_rt_write_uint64s_wrapper").str()),
&FAs.WriteUInt64s},
{EPC.intern((GlobalPrefix + "__orc_rt_write_buffers_wrapper").str()),
&FAs.WriteBuffers}}))
return std::move(Err);
return std::make_unique<EPCGenericMemoryAccess>(EPC, std::move(FAs));
}
} // end namespace orc
} // end namespace llvm