LLVM  14.0.0git
EPCGenericMemoryAccess.h
Go to the documentation of this file.
1 //===- EPCGenericMemoryAccess.h - Generic EPC MemoryAccess impl -*- 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-exception
6 //
7 //===----------------------------------------------------------------------===//
8 //
9 // Implements ExecutorProcessControl::MemoryAccess by making calls to
10 // ExecutorProcessControl::callWrapperAsync.
11 //
12 // This simplifies the implementaton of new ExecutorProcessControl instances,
13 // as this implementation will always work (at the cost of some performance
14 // overhead for the calls).
15 //
16 //===----------------------------------------------------------------------===//
17 
18 #ifndef LLVM_EXECUTIONENGINE_ORC_EPCGENERICMEMORYACCESS_H
19 #define LLVM_EXECUTIONENGINE_ORC_EPCGENERICMEMORYACCESS_H
20 
22 
23 namespace llvm {
24 namespace orc {
25 
27 public:
28  /// Function addresses for memory access.
29  struct FuncAddrs {
35  };
36 
37  /// Create an EPCGenericMemoryAccess instance from a given set of
38  /// function addrs.
40  : EPC(EPC), FAs(FAs) {}
41 
43  WriteResultFn OnWriteComplete) override {
44  using namespace shared;
45  EPC.callSPSWrapperAsync<void(SPSSequence<SPSMemoryAccessUInt8Write>)>(
46  FAs.WriteUInt8s, std::move(OnWriteComplete), Ws);
47  }
48 
50  WriteResultFn OnWriteComplete) override {
51  using namespace shared;
52  EPC.callSPSWrapperAsync<void(SPSSequence<SPSMemoryAccessUInt16Write>)>(
53  FAs.WriteUInt16s, std::move(OnWriteComplete), Ws);
54  }
55 
57  WriteResultFn OnWriteComplete) override {
58  using namespace shared;
59  EPC.callSPSWrapperAsync<void(SPSSequence<SPSMemoryAccessUInt32Write>)>(
60  FAs.WriteUInt32s, std::move(OnWriteComplete), Ws);
61  }
62 
64  WriteResultFn OnWriteComplete) override {
65  using namespace shared;
66  EPC.callSPSWrapperAsync<void(SPSSequence<SPSMemoryAccessUInt64Write>)>(
67  FAs.WriteUInt64s, std::move(OnWriteComplete), Ws);
68  }
69 
71  WriteResultFn OnWriteComplete) override {
72  using namespace shared;
73  EPC.callSPSWrapperAsync<void(SPSSequence<SPSMemoryAccessBufferWrite>)>(
74  FAs.WriteBuffers, std::move(OnWriteComplete), Ws);
75  }
76 
77 private:
79  FuncAddrs FAs;
80 };
81 
82 } // end namespace orc
83 } // end namespace llvm
84 
85 #endif // LLVM_EXECUTIONENGINE_ORC_EPCGENERICMEMORYACCESS_H
llvm::orc::ExecutorAddr
Represents an address in the executor process.
Definition: ExecutorAddress.h:37
llvm::orc::EPCGenericMemoryAccess::FuncAddrs::WriteBuffers
ExecutorAddr WriteBuffers
Definition: EPCGenericMemoryAccess.h:34
llvm
This is an optimization pass for GlobalISel generic memory operations.
Definition: AllocatorList.h:23
llvm::unique_function< void(Error)>
llvm::orc::EPCGenericMemoryAccess::writeUInt32sAsync
void writeUInt32sAsync(ArrayRef< tpctypes::UInt32Write > Ws, WriteResultFn OnWriteComplete) override
Definition: EPCGenericMemoryAccess.h:56
llvm::orc::ExecutorProcessControl
ExecutorProcessControl supports interaction with a JIT target process.
Definition: ExecutorProcessControl.h:38
llvm::orc::EPCGenericMemoryAccess::writeBuffersAsync
void writeBuffersAsync(ArrayRef< tpctypes::BufferWrite > Ws, WriteResultFn OnWriteComplete) override
Definition: EPCGenericMemoryAccess.h:70
llvm::orc::EPCGenericMemoryAccess::FuncAddrs
Function addresses for memory access.
Definition: EPCGenericMemoryAccess.h:29
llvm::orc::EPCGenericMemoryAccess::FuncAddrs::WriteUInt16s
ExecutorAddr WriteUInt16s
Definition: EPCGenericMemoryAccess.h:31
llvm::orc::EPCGenericMemoryAccess
Definition: EPCGenericMemoryAccess.h:26
llvm::orc::EPCGenericMemoryAccess::FuncAddrs::WriteUInt8s
ExecutorAddr WriteUInt8s
Definition: EPCGenericMemoryAccess.h:30
move
compiles ldr LCPI1_0 ldr ldr mov lsr tst moveq r1 ldr LCPI1_1 and r0 bx lr It would be better to do something like to fold the shift into the conditional move
Definition: README.txt:546
llvm::ArrayRef
ArrayRef - Represent a constant reference to an array (0 or more elements consecutively in memory),...
Definition: APInt.h:32
llvm::orc::EPCGenericMemoryAccess::writeUInt8sAsync
void writeUInt8sAsync(ArrayRef< tpctypes::UInt8Write > Ws, WriteResultFn OnWriteComplete) override
Definition: EPCGenericMemoryAccess.h:42
llvm::orc::ExecutorProcessControl::MemoryAccess
APIs for manipulating memory in the target process.
Definition: ExecutorProcessControl.h:101
llvm::orc::EPCGenericMemoryAccess::EPCGenericMemoryAccess
EPCGenericMemoryAccess(ExecutorProcessControl &EPC, FuncAddrs FAs)
Create an EPCGenericMemoryAccess instance from a given set of function addrs.
Definition: EPCGenericMemoryAccess.h:39
llvm::orc::EPCGenericMemoryAccess::writeUInt16sAsync
void writeUInt16sAsync(ArrayRef< tpctypes::UInt16Write > Ws, WriteResultFn OnWriteComplete) override
Definition: EPCGenericMemoryAccess.h:49
llvm::orc::EPCGenericMemoryAccess::FuncAddrs::WriteUInt32s
ExecutorAddr WriteUInt32s
Definition: EPCGenericMemoryAccess.h:32
llvm::orc::EPCGenericMemoryAccess::writeUInt64sAsync
void writeUInt64sAsync(ArrayRef< tpctypes::UInt64Write > Ws, WriteResultFn OnWriteComplete) override
Definition: EPCGenericMemoryAccess.h:63
Core.h
llvm::orc::EPCGenericMemoryAccess::FuncAddrs::WriteUInt64s
ExecutorAddr WriteUInt64s
Definition: EPCGenericMemoryAccess.h:33