16#define DEBUG_TYPE "orc"
22namespace rt_bootstrap {
24template <
typename WriteT,
typename SPSWriteT>
29 [](std::vector<WriteT> Ws) {
31 *W.Addr.template toPtr<
decltype(W.Value) *>() = W.Value;
39 handle(ArgData, ArgSize,
40 [](std::vector<tpctypes::PointerWrite> Ws) {
42 *W.Addr.template toPtr<void **>() =
43 W.Value.template toPtr<void *>();
52 [](std::vector<tpctypes::BufferWrite> Ws) {
54 memcpy(W.Addr.template toPtr<char *>(), W.Buffer.data(),
60template <
typename ReadT>
65 [](std::vector<ExecutorAddr> Rs) {
81 [](std::vector<ExecutorAddr> Rs) {
82 std::vector<ExecutorAddr>
Result;
97 [](std::vector<ExecutorAddrRange> Rs) {
98 std::vector<std::vector<uint8_t>>
Result;
102 Result.back().resize(R.size());
103 memcpy(
reinterpret_cast<char *
>(
Result.back().data()),
104 R.Start.toPtr<
char *>(), R.size());
115 [](std::vector<ExecutorAddr> Rs) {
116 std::vector<std::string>
Result;
117 Result.reserve(Rs.size());
131 std::vector<std::string> Args) -> int64_t {
for(const MachineOperand &MO :llvm::drop_begin(OldMI.operands(), Desc.getNumOperands()))
StringMap - This is an unconventional map that is specialized for handling keys that are "strings",...
Represents an address in the executor process.
static ExecutorAddr fromPtr(T *Ptr, UnwrapFn &&Unwrap=UnwrapFn())
Create an ExecutorAddr from the given pointer.
std::enable_if_t< std::is_pointer< T >::value, T > toPtr(WrapFn &&Wrap=WrapFn()) const
Cast this ExecutorAddr to a pointer of the given type.
SPS tag type for sequences.
static llvm::orc::shared::CWrapperFunctionResult writeUIntsWrapper(const char *ArgData, size_t ArgSize)
static llvm::orc::shared::CWrapperFunctionResult readBuffersWrapper(const char *ArgData, size_t ArgSize)
static llvm::orc::shared::CWrapperFunctionResult runAsVoidFunctionWrapper(const char *ArgData, size_t ArgSize)
static llvm::orc::shared::CWrapperFunctionResult readStringsWrapper(const char *ArgData, size_t ArgSize)
void addTo(StringMap< ExecutorAddr > &M)
static llvm::orc::shared::CWrapperFunctionResult writePointersWrapper(const char *ArgData, size_t ArgSize)
static llvm::orc::shared::CWrapperFunctionResult runAsMainWrapper(const char *ArgData, size_t ArgSize)
static llvm::orc::shared::CWrapperFunctionResult readUIntsWrapper(const char *ArgData, size_t ArgSize)
static llvm::orc::shared::CWrapperFunctionResult writeBuffersWrapper(const char *ArgData, size_t ArgSize)
static llvm::orc::shared::CWrapperFunctionResult readPointersWrapper(const char *ArgData, size_t ArgSize)
static llvm::orc::shared::CWrapperFunctionResult runAsIntFunctionWrapper(const char *ArgData, size_t ArgSize)
LLVM_ABI const char * MemoryReadUInt64sWrapperName
LLVM_ABI const char * MemoryWriteUInt16sWrapperName
LLVM_ABI const char * MemoryReadStringsWrapperName
LLVM_ABI const char * MemoryReadUInt16sWrapperName
LLVM_ABI const char * RunAsIntFunctionWrapperName
LLVM_ABI const char * MemoryReadPointersWrapperName
LLVM_ABI const char * MemoryReadUInt32sWrapperName
LLVM_ABI const char * MemoryWriteUInt64sWrapperName
LLVM_ABI const char * MemoryWriteUInt8sWrapperName
LLVM_ABI const char * MemoryWritePointersWrapperName
LLVM_ABI const char * MemoryWriteUInt32sWrapperName
LLVM_ABI const char * RunAsVoidFunctionWrapperName
LLVM_ABI const char * MemoryWriteBuffersWrapperName
LLVM_ABI const char * MemoryReadBuffersWrapperName
LLVM_ABI const char * RunAsMainWrapperName
LLVM_ABI const char * MemoryReadUInt8sWrapperName
LLVM_ABI int runAsVoidFunction(int(*Func)(void))
LLVM_ABI int runAsIntFunction(int(*Func)(int), int Arg)
LLVM_ABI int runAsMain(int(*Main)(int, char *[]), ArrayRef< std::string > Args, std::optional< StringRef > ProgramName=std::nullopt)
Run a main function, returning the result.
This is an optimization pass for GlobalISel generic memory operations.