LLVM  14.0.0git
OrcRPCExecutorProcessControl.h
Go to the documentation of this file.
1 //===-- OrcRPCExecutorProcessControl.h - Remote target control --*- 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 // Executor control via ORC RPC.
10 //
11 //===----------------------------------------------------------------------===//
12 
13 #ifndef LLVM_EXECUTIONENGINE_ORC_ORCRPCEXECUTORPROCESSCONTROL_H
14 #define LLVM_EXECUTIONENGINE_ORC_ORCRPCEXECUTORPROCESSCONTROL_H
15 
22 
23 namespace llvm {
24 namespace orc {
25 
26 /// JITLinkMemoryManager implementation for a process connected via an ORC RPC
27 /// endpoint.
28 template <typename OrcRPCEPCImplT>
30 private:
31  struct HostAlloc {
32  std::unique_ptr<char[]> Mem;
33  uint64_t Size;
34  };
35 
36  struct TargetAlloc {
38  uint64_t AllocatedSize = 0;
39  };
40 
43 
44 public:
45  class OrcRPCAllocation : public Allocation {
46  public:
48  HostAllocMap HostAllocs, TargetAllocMap TargetAllocs)
49  : Parent(Parent), HostAllocs(std::move(HostAllocs)),
50  TargetAllocs(std::move(TargetAllocs)) {
51  assert(HostAllocs.size() == TargetAllocs.size() &&
52  "HostAllocs size should match TargetAllocs");
53  }
54 
55  ~OrcRPCAllocation() override {
56  assert(TargetAllocs.empty() && "failed to deallocate");
57  }
58 
60  auto I = HostAllocs.find(Seg);
61  assert(I != HostAllocs.end() && "No host allocation for segment");
62  auto &HA = I->second;
63  return {HA.Mem.get(), static_cast<size_t>(HA.Size)};
64  }
65 
67  auto I = TargetAllocs.find(Seg);
68  assert(I != TargetAllocs.end() && "No target allocation for segment");
69  return I->second.Address;
70  }
71 
72  void finalizeAsync(FinalizeContinuation OnFinalize) override {
73 
74  std::vector<tpctypes::BufferWrite> BufferWrites;
76 
77  for (auto &KV : HostAllocs) {
78  assert(TargetAllocs.count(KV.first) &&
79  "No target allocation for buffer");
80  auto &HA = KV.second;
81  auto &TA = TargetAllocs[KV.first];
82  BufferWrites.push_back({TA.Address, StringRef(HA.Mem.get(), HA.Size)});
83  FMR.push_back({tpctypes::toWireProtectionFlags(
84  static_cast<sys::Memory::ProtectionFlags>(KV.first)),
85  TA.Address, TA.AllocatedSize});
86  }
87 
88  DEBUG_WITH_TYPE("orc", {
89  dbgs() << "finalizeAsync " << (void *)this << ":\n";
90  auto FMRI = FMR.begin();
91  for (auto &B : BufferWrites) {
92  auto Prot = FMRI->Prot;
93  ++FMRI;
94  dbgs() << " Writing " << formatv("{0:x16}", B.Buffer.size())
95  << " bytes to " << tpctypes::getWireProtectionFlagsStr(Prot)
96  << " segment: local " << (const void *)B.Buffer.data()
97  << " -> target " << formatv("{0:x16}", B.Address) << "\n";
98  }
99  });
100  if (auto Err =
101  Parent.Parent.getMemoryAccess().writeBuffers(BufferWrites)) {
102  OnFinalize(std::move(Err));
103  return;
104  }
105 
106  DEBUG_WITH_TYPE("orc", dbgs() << " Applying permissions...\n");
107  if (auto Err =
108  Parent.getEndpoint().template callAsync<orcrpctpc::FinalizeMem>(
109  [OF = std::move(OnFinalize)](Error Err2) {
110  // FIXME: Dispatch to work queue.
111  std::thread([OF = std::move(OF),
112  Err3 = std::move(Err2)]() mutable {
113  DEBUG_WITH_TYPE(
114  "orc", { dbgs() << " finalizeAsync complete\n"; });
115  OF(std::move(Err3));
116  }).detach();
117  return Error::success();
118  },
119  FMR)) {
120  DEBUG_WITH_TYPE("orc", dbgs() << " failed.\n");
121  Parent.getEndpoint().abandonPendingResponses();
122  Parent.reportError(std::move(Err));
123  }
124  DEBUG_WITH_TYPE("orc", {
125  dbgs() << "Leaving finalizeAsync (finalization may continue in "
126  "background)\n";
127  });
128  }
129 
130  Error deallocate() override {
132  for (auto &KV : TargetAllocs)
133  RMR.push_back({tpctypes::toWireProtectionFlags(
134  static_cast<sys::Memory::ProtectionFlags>(KV.first)),
135  KV.second.Address, KV.second.AllocatedSize});
136  TargetAllocs.clear();
137 
138  return Parent.getEndpoint().template callB<orcrpctpc::ReleaseMem>(RMR);
139  }
140 
141  private:
143  HostAllocMap HostAllocs;
144  TargetAllocMap TargetAllocs;
145  };
146 
147  OrcRPCEPCJITLinkMemoryManager(OrcRPCEPCImplT &Parent) : Parent(Parent) {}
148 
151  const SegmentsRequestMap &Request) override {
153  HostAllocMap HostAllocs;
154 
155  for (auto &KV : Request) {
156  assert(KV.second.getContentSize() <= std::numeric_limits<size_t>::max() &&
157  "Content size is out-of-range for host");
158 
159  RMR.push_back({tpctypes::toWireProtectionFlags(
160  static_cast<sys::Memory::ProtectionFlags>(KV.first)),
161  KV.second.getContentSize() + KV.second.getZeroFillSize(),
162  KV.second.getAlignment()});
163  HostAllocs[KV.first] = {
164  std::make_unique<char[]>(KV.second.getContentSize()),
165  KV.second.getContentSize()};
166  }
167 
168  DEBUG_WITH_TYPE("orc", {
169  dbgs() << "Orc remote memmgr got request:\n";
170  for (auto &KV : Request)
171  dbgs() << " permissions: "
172  << ((KV.first & sys::Memory::MF_READ) ? 'R' : '-')
173  << ((KV.first & sys::Memory::MF_WRITE) ? 'W' : '-')
174  << ((KV.first & sys::Memory::MF_EXEC) ? 'X' : '-')
175  << ", content size: "
176  << formatv("{0:x16}", KV.second.getContentSize())
177  << " + zero-fill-size: "
178  << formatv("{0:x16}", KV.second.getZeroFillSize())
179  << ", align: " << KV.second.getAlignment() << "\n";
180  });
181 
182  // FIXME: LLVM RPC needs to be fixed to support alt
183  // serialization/deserialization on return types. For now just
184  // translate from std::map to DenseMap manually.
185  auto TmpTargetAllocs =
186  Parent.getEndpoint().template callB<orcrpctpc::ReserveMem>(RMR);
187  if (!TmpTargetAllocs)
188  return TmpTargetAllocs.takeError();
189 
190  if (TmpTargetAllocs->size() != RMR.size())
191  return make_error<StringError>(
192  "Number of target allocations does not match request",
194 
195  TargetAllocMap TargetAllocs;
196  for (auto &E : *TmpTargetAllocs)
197  TargetAllocs[tpctypes::fromWireProtectionFlags(E.Prot)] = {
198  E.Address, E.AllocatedSize};
199 
200  DEBUG_WITH_TYPE("orc", {
201  auto HAI = HostAllocs.begin();
202  for (auto &KV : TargetAllocs)
203  dbgs() << " permissions: "
204  << ((KV.first & sys::Memory::MF_READ) ? 'R' : '-')
205  << ((KV.first & sys::Memory::MF_WRITE) ? 'W' : '-')
206  << ((KV.first & sys::Memory::MF_EXEC) ? 'X' : '-')
207  << " assigned local " << (void *)HAI->second.Mem.get()
208  << ", target " << formatv("{0:x16}", KV.second.Address) << "\n";
209  });
210 
211  return std::make_unique<OrcRPCAllocation>(*this, std::move(HostAllocs),
212  std::move(TargetAllocs));
213  }
214 
215 private:
216  void reportError(Error Err) { Parent.reportError(std::move(Err)); }
217 
218  decltype(std::declval<OrcRPCEPCImplT>().getEndpoint()) getEndpoint() {
219  return Parent.getEndpoint();
220  }
221 
222  OrcRPCEPCImplT &Parent;
223 };
224 
225 /// ExecutorProcessControl::MemoryAccess implementation for a process connected
226 /// via an ORC RPC endpoint.
227 template <typename OrcRPCEPCImplT>
229 public:
230  OrcRPCEPCMemoryAccess(OrcRPCEPCImplT &Parent) : Parent(Parent) {}
231 
233  WriteResultFn OnWriteComplete) override {
234  writeViaRPC<orcrpctpc::WriteUInt8s>(Ws, std::move(OnWriteComplete));
235  }
236 
238  WriteResultFn OnWriteComplete) override {
239  writeViaRPC<orcrpctpc::WriteUInt16s>(Ws, std::move(OnWriteComplete));
240  }
241 
243  WriteResultFn OnWriteComplete) override {
244  writeViaRPC<orcrpctpc::WriteUInt32s>(Ws, std::move(OnWriteComplete));
245  }
246 
248  WriteResultFn OnWriteComplete) override {
249  writeViaRPC<orcrpctpc::WriteUInt64s>(Ws, std::move(OnWriteComplete));
250  }
251 
253  WriteResultFn OnWriteComplete) override {
254  writeViaRPC<orcrpctpc::WriteBuffers>(Ws, std::move(OnWriteComplete));
255  }
256 
257 private:
258  template <typename WriteRPCFunction, typename WriteElementT>
259  void writeViaRPC(ArrayRef<WriteElementT> Ws, WriteResultFn OnWriteComplete) {
260  if (auto Err = Parent.getEndpoint().template callAsync<WriteRPCFunction>(
261  [OWC = std::move(OnWriteComplete)](Error Err2) mutable -> Error {
262  OWC(std::move(Err2));
263  return Error::success();
264  },
265  Ws)) {
266  Parent.reportError(std::move(Err));
267  Parent.getEndpoint().abandonPendingResponses();
268  }
269  }
270 
271  OrcRPCEPCImplT &Parent;
272 };
273 
274 // ExecutorProcessControl for a process connected via an ORC RPC Endpoint.
275 template <typename RPCEndpointT>
277 public:
279 
281 
282  OrcRPCExecutorProcessControlBase(std::shared_ptr<SymbolStringPool> SSP,
283  RPCEndpointT &EP, ErrorReporter ReportError)
285  ReportError(std::move(ReportError)), EP(EP) {
287  EP.template addAsyncHandler<orcrpctpc::RunWrapper>(*this,
288  &ThisT::runWrapperInJIT);
289  }
290 
291  void reportError(Error Err) { ReportError(std::move(Err)); }
292 
293  RPCEndpointT &getEndpoint() { return EP; }
294 
295  Expected<tpctypes::DylibHandle> loadDylib(const char *DylibPath) override {
296  DEBUG_WITH_TYPE("orc", {
297  dbgs() << "Loading dylib \"" << (DylibPath ? DylibPath : "") << "\" ";
298  if (!DylibPath)
299  dbgs() << "(process symbols)";
300  dbgs() << "\n";
301  });
302  if (!DylibPath)
303  DylibPath = "";
304  auto H = EP.template callB<orcrpctpc::LoadDylib>(DylibPath);
305  DEBUG_WITH_TYPE("orc", {
306  if (H)
307  dbgs() << " got handle " << formatv("{0:x16}", *H) << "\n";
308  else
309  dbgs() << " error, unable to load\n";
310  });
311  return H;
312  }
313 
316  std::vector<orcrpctpc::RemoteLookupRequest> RR;
317  for (auto &E : Request) {
318  RR.push_back({});
319  RR.back().first = E.Handle;
320  for (auto &KV : E.Symbols)
321  RR.back().second.push_back(
322  {(*KV.first).str(),
323  KV.second == SymbolLookupFlags::WeaklyReferencedSymbol});
324  }
325  DEBUG_WITH_TYPE("orc", {
326  dbgs() << "Compound lookup:\n";
327  for (auto &R : Request) {
328  dbgs() << " In " << formatv("{0:x16}", R.Handle) << ": {";
329  bool First = true;
330  for (auto &KV : R.Symbols) {
331  dbgs() << (First ? "" : ",") << " " << *KV.first;
332  First = false;
333  }
334  dbgs() << " }\n";
335  }
336  });
337  return EP.template callB<orcrpctpc::LookupSymbols>(RR);
338  }
339 
341  ArrayRef<std::string> Args) override {
342  DEBUG_WITH_TYPE("orc", {
343  dbgs() << "Running as main: " << formatv("{0:x16}", MainFnAddr.getValue())
344  << ", args = [";
345  for (unsigned I = 0; I != Args.size(); ++I)
346  dbgs() << (I ? "," : "") << " \"" << Args[I] << "\"";
347  dbgs() << "]\n";
348  });
349  auto Result =
350  EP.template callB<orcrpctpc::RunMain>(MainFnAddr.getValue(), Args);
351  DEBUG_WITH_TYPE("orc", {
352  dbgs() << " call to " << formatv("{0:x16}", MainFnAddr.getValue());
353  if (Result)
354  dbgs() << " returned result " << *Result << "\n";
355  else
356  dbgs() << " failed\n";
357  });
358  return Result;
359  }
360 
362  ExecutorAddr WrapperFnAddr,
363  ArrayRef<char> ArgBuffer) override {
364  DEBUG_WITH_TYPE("orc", {
365  dbgs() << "Running as wrapper function "
366  << formatv("{0:x16}", WrapperFnAddr.getValue()) << " with "
367  << formatv("{0:x16}", ArgBuffer.size()) << " argument buffer\n";
368  });
369  auto Result = EP.template callB<orcrpctpc::RunWrapper>(
370  WrapperFnAddr.getValue(),
371  ArrayRef<uint8_t>(reinterpret_cast<const uint8_t *>(ArgBuffer.data()),
372  ArgBuffer.size()));
373 
374  if (!Result)
375  OnComplete(shared::WrapperFunctionResult::createOutOfBandError(
376  toString(Result.takeError())));
377  OnComplete(std::move(*Result));
378  }
379 
381  DEBUG_WITH_TYPE("orc", dbgs() << "Closing connection to remote\n");
382  return EP.template callAsync<orcrpctpc::CloseConnection>(
383  std::move(OnCloseConnection));
384  }
385 
387  std::promise<MSVCPError> P;
388  auto F = P.get_future();
389  if (auto Err = closeConnection([&](Error Err2) -> Error {
390  P.set_value(std::move(Err2));
391  return Error::success();
392  })) {
393  EP.abandonAllPendingResponses();
394  return joinErrors(std::move(Err), F.get());
395  }
396  return F.get();
397  }
398 
399 protected:
400  /// Subclasses must call this during construction to initialize the
401  /// TargetTriple and PageSize members.
403  if (auto EPI = EP.template callB<orcrpctpc::GetExecutorProcessInfo>()) {
404  this->TargetTriple = Triple(EPI->Triple);
405  this->PageSize = EPI->PageSize;
406  this->JDI = {ExecutorAddr(EPI->DispatchFuncAddr),
407  ExecutorAddr(EPI->DispatchCtxAddr)};
408  return Error::success();
409  } else
410  return EPI.takeError();
411  }
412 
413 private:
414  Error runWrapperInJIT(
416  JITTargetAddress FunctionTag, std::vector<uint8_t> ArgBuffer) {
417 
418  getExecutionSession().runJITDispatchHandler(
419  [this, SendResult = std::move(SendResult)](
421  if (auto Err = SendResult(std::move(R)))
422  ReportError(std::move(Err));
423  },
424  FunctionTag,
425  {reinterpret_cast<const char *>(ArgBuffer.data()), ArgBuffer.size()});
426  return Error::success();
427  }
428 
429  ErrorReporter ReportError;
430  RPCEndpointT &EP;
431 };
432 
433 } // end namespace orc
434 } // end namespace llvm
435 
436 #endif // LLVM_EXECUTIONENGINE_ORC_ORCRPCEXECUTORPROCESSCONTROL_H
llvm::Check::Size
@ Size
Definition: FileCheck.h:73
llvm::orc::ExecutorAddr
Represents an address in the executor process.
Definition: ExecutorAddress.h:37
llvm::orc::tpctypes::toWireProtectionFlags
WireProtectionFlags toWireProtectionFlags(sys::Memory::ProtectionFlags PF)
Convert from sys::Memory::ProtectionFlags.
Definition: TargetProcessControlTypes.h:41
llvm::orc::OrcRPCEPCJITLinkMemoryManager::allocate
Expected< std::unique_ptr< Allocation > > allocate(const jitlink::JITLinkDylib *JD, const SegmentsRequestMap &Request) override
Create an Allocation object.
Definition: OrcRPCExecutorProcessControl.h:150
llvm::orc::OrcRPCEPCMemoryAccess::writeUInt8sAsync
void writeUInt8sAsync(ArrayRef< tpctypes::UInt8Write > Ws, WriteResultFn OnWriteComplete) override
Definition: OrcRPCExecutorProcessControl.h:232
llvm::sys::Memory::MF_READ
@ MF_READ
Definition: Memory.h:55
llvm
---------------------— PointerInfo ------------------------------------—
Definition: AllocatorList.h:23
llvm::sys::Memory::MF_WRITE
@ MF_WRITE
Definition: Memory.h:56
llvm::unique_function< void(Error)>
llvm::orc::OrcRPCEPCMemoryAccess::writeBuffersAsync
void writeBuffersAsync(ArrayRef< tpctypes::BufferWrite > Ws, WriteResultFn OnWriteComplete) override
Definition: OrcRPCExecutorProcessControl.h:252
P
This currently compiles esp xmm0 movsd esp eax eax esp ret We should use not the dag combiner This is because dagcombine2 needs to be able to see through the X86ISD::Wrapper which DAGCombine can t really do The code for turning x load into a single vector load is target independent and should be moved to the dag combiner The code for turning x load into a vector load can only handle a direct load from a global or a direct load from the stack It should be generalized to handle any load from P
Definition: README-SSE.txt:411
llvm::orc::OrcRPCExecutorProcessControlBase::getEndpoint
RPCEndpointT & getEndpoint()
Definition: OrcRPCExecutorProcessControl.h:293
llvm::toString
std::string toString(Error E)
Write all error messages (if any) in E to a string.
Definition: Error.h:1020
llvm::orc::orcrpctpc::ReleaseOrFinalizeMemRequest
std::vector< ReleaseOrFinalizeMemRequestElement > ReleaseOrFinalizeMemRequest
Definition: OrcRPCTPCServer.h:66
llvm::Error::success
static ErrorSuccess success()
Create a success value.
Definition: Error.h:331
llvm::Triple
Triple - Helper class for working with autoconf configuration names.
Definition: Triple.h:45
llvm::orc::ExecutorAddr::getValue
uint64_t getValue() const
Definition: ExecutorAddress.h:60
OrcRPCTPCServer.h
llvm::DenseMapBase::begin
iterator begin()
Definition: DenseMap.h:74
llvm::X86II::TA
@ TA
Definition: X86BaseInfo.h:803
llvm::orc::OrcRPCExecutorProcessControlBase::closeConnectionAndWait
Error closeConnectionAndWait()
Definition: OrcRPCExecutorProcessControl.h:386
llvm::orc::ExecutorProcessControl
ExecutorProcessControl supports interaction with a JIT target process.
Definition: ExecutorProcessControl.h:38
llvm::orc::OrcRPCEPCJITLinkMemoryManager
JITLinkMemoryManager implementation for a process connected via an ORC RPC endpoint.
Definition: OrcRPCExecutorProcessControl.h:29
MSVCErrorWorkarounds.h
llvm::DenseMapBase::count
size_type count(const_arg_type_t< KeyT > Val) const
Return 1 if the specified key is in the map, 0 otherwise.
Definition: DenseMap.h:145
llvm::orc::OrcRPCEPCMemoryAccess::OrcRPCEPCMemoryAccess
OrcRPCEPCMemoryAccess(OrcRPCEPCImplT &Parent)
Definition: OrcRPCExecutorProcessControl.h:230
llvm::orc::OrcRPCEPCMemoryAccess::writeUInt64sAsync
void writeUInt64sAsync(ArrayRef< tpctypes::UInt64Write > Ws, WriteResultFn OnWriteComplete) override
Definition: OrcRPCExecutorProcessControl.h:247
llvm::Expected
Tagged union holding either a T or a Error.
Definition: APFloat.h:42
llvm::ArrayRef::data
const T * data() const
Definition: ArrayRef.h:162
F
#define F(x, y, z)
Definition: MD5.cpp:56
llvm::dbgs
raw_ostream & dbgs()
dbgs() - This returns a reference to a raw_ostream for debugging messages.
Definition: Debug.cpp:163
llvm::formatv
auto formatv(const char *Fmt, Ts &&... Vals) -> formatv_object< decltype(std::make_tuple(detail::build_format_adapter(std::forward< Ts >(Vals))...))>
Definition: FormatVariadic.h:250
llvm::orc::OrcRPCExecutorProcessControlBase
Definition: OrcRPCExecutorProcessControl.h:276
llvm::orc::OrcRPCExecutorProcessControlBase::runAsMain
Expected< int32_t > runAsMain(ExecutorAddr MainFnAddr, ArrayRef< std::string > Args) override
Run function with a main-like signature.
Definition: OrcRPCExecutorProcessControl.h:340
DEBUG_WITH_TYPE
#define DEBUG_WITH_TYPE(TYPE, X)
DEBUG_WITH_TYPE macro - This macro should be used by passes to emit debug information.
Definition: Debug.h:64
PageSize
static cl::opt< int > PageSize("imp-null-check-page-size", cl::desc("The page size of the target in bytes"), cl::init(4096), cl::Hidden)
Allocation
llvm::MutableArrayRef
MutableArrayRef - Represent a mutable reference to an array (0 or more elements consecutively in memo...
Definition: ArrayRef.h:307
E
static GCRegistry::Add< CoreCLRGC > E("coreclr", "CoreCLR-compatible GC")
llvm::orc::tpctypes::fromWireProtectionFlags
sys::Memory::ProtectionFlags fromWireProtectionFlags(WireProtectionFlags WPF)
Definition: TargetProcessControlTypes.h:53
reportError
static Error reportError(StringRef Message)
Definition: BitcodeAnalyzer.cpp:19
llvm::sys::Memory::ProtectionFlags
ProtectionFlags
Definition: Memory.h:54
B
static GCRegistry::Add< OcamlGC > B("ocaml", "ocaml 3.10-compatible GC")
First
into llvm powi allowing the code generator to produce balanced multiplication trees First
Definition: README.txt:54
llvm::orc::OrcRPCEPCMemoryAccess::writeUInt16sAsync
void writeUInt16sAsync(ArrayRef< tpctypes::UInt16Write > Ws, WriteResultFn OnWriteComplete) override
Definition: OrcRPCExecutorProcessControl.h:237
llvm::sys::Memory::MF_EXEC
@ MF_EXEC
Definition: Memory.h:57
llvm::orc::OrcRPCEPCJITLinkMemoryManager::OrcRPCAllocation::deallocate
Error deallocate() override
Definition: OrcRPCExecutorProcessControl.h:130
llvm::orc::OrcRPCEPCJITLinkMemoryManager::OrcRPCEPCJITLinkMemoryManager
OrcRPCEPCJITLinkMemoryManager(OrcRPCEPCImplT &Parent)
Definition: OrcRPCExecutorProcessControl.h:147
llvm::orc::OrcRPCExecutorProcessControlBase::lookupSymbols
Expected< std::vector< tpctypes::LookupResult > > lookupSymbols(ArrayRef< LookupRequest > Request) override
Search for symbols in the target process.
Definition: OrcRPCExecutorProcessControl.h:315
llvm::orc::OrcRPCExecutorProcessControlBase::loadDylib
Expected< tpctypes::DylibHandle > loadDylib(const char *DylibPath) override
Load the dynamic library at the given path and return a handle to it.
Definition: OrcRPCExecutorProcessControl.h:295
uint64_t
llvm::orc::OrcRPCEPCMemoryAccess::writeUInt32sAsync
void writeUInt32sAsync(ArrayRef< tpctypes::UInt32Write > Ws, WriteResultFn OnWriteComplete) override
Definition: OrcRPCExecutorProcessControl.h:242
llvm::orc::OrcRPCEPCJITLinkMemoryManager::OrcRPCAllocation::OrcRPCAllocation
OrcRPCAllocation(OrcRPCEPCJITLinkMemoryManager< OrcRPCEPCImplT > &Parent, HostAllocMap HostAllocs, TargetAllocMap TargetAllocs)
Definition: OrcRPCExecutorProcessControl.h:47
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::DenseMap< int, HostAlloc >
I
#define I(x, y, z)
Definition: MD5.cpp:59
llvm::joinErrors
Error joinErrors(Error E1, Error E2)
Concatenate errors.
Definition: Error.h:428
llvm::orc::OrcRPCExecutorProcessControlBase::closeConnection
Error closeConnection(OnCloseConnectionFunction OnCloseConnection)
Definition: OrcRPCExecutorProcessControl.h:380
llvm::HighlightColor::Address
@ Address
llvm::DenseMapBase::find
iterator find(const_arg_type_t< KeyT > Val)
Definition: DenseMap.h:150
assert
assert(ImpDefSCC.getReg()==AMDGPU::SCC &&ImpDefSCC.isDef())
llvm::move
OutputIt move(R &&Range, OutputIt Out)
Provide wrappers to std::move which take ranges instead of having to pass begin/end explicitly.
Definition: STLExtras.h:1609
function
print Print MemDeps of function
Definition: MemDepPrinter.cpp:83
llvm::orc::orcrpctpc::ReserveMemRequest
std::vector< ReserveMemRequestElement > ReserveMemRequest
Definition: OrcRPCTPCServer.h:49
llvm::orc::OrcRPCExecutorProcessControlBase::initializeORCRPCEPCBase
Error initializeORCRPCEPCBase()
Subclasses must call this during construction to initialize the TargetTriple and PageSize members.
Definition: OrcRPCExecutorProcessControl.h:402
RPCUtils.h
llvm::orc::OrcRPCEPCJITLinkMemoryManager::OrcRPCAllocation::~OrcRPCAllocation
~OrcRPCAllocation() override
Definition: OrcRPCExecutorProcessControl.h:55
llvm::ArrayRef
ArrayRef - Represent a constant reference to an array (0 or more elements consecutively in memory),...
Definition: APInt.h:32
llvm::StringRef
StringRef - Represent a constant reference to a string, i.e.
Definition: StringRef.h:58
llvm::orc::OrcRPCExecutorProcessControlBase::reportError
void reportError(Error Err)
Definition: OrcRPCExecutorProcessControl.h:291
llvm::DenseMapBase::empty
LLVM_NODISCARD bool empty() const
Definition: DenseMap.h:97
llvm::orc::ExecutorProcessControl::MemoryAccess
APIs for manipulating memory in the target process.
Definition: ExecutorProcessControl.h:47
llvm::orc::tpctypes::getWireProtectionFlagsStr
std::string getWireProtectionFlagsStr(WireProtectionFlags WPF)
Definition: TargetProcessControlTypes.h:64
std
Definition: BitVector.h:838
H
#define H(x, y, z)
Definition: MD5.cpp:58
llvm::inconvertibleErrorCode
std::error_code inconvertibleErrorCode()
The value returned by this function can be returned from convertToErrorCode for Error values where no...
Definition: Error.cpp:77
llvm::DenseMapBase::end
iterator end()
Definition: DenseMap.h:83
llvm::Error
Lightweight error class with error context and mandatory checking.
Definition: Error.h:157
llvm::DenseMapBase::size
unsigned size() const
Definition: DenseMap.h:100
llvm::orc::OrcRPCEPCJITLinkMemoryManager::OrcRPCAllocation::getTargetMemory
JITTargetAddress getTargetMemory(ProtectionFlags Seg) override
Definition: OrcRPCExecutorProcessControl.h:66
llvm::orc::OrcRPCEPCJITLinkMemoryManager::OrcRPCAllocation
Definition: OrcRPCExecutorProcessControl.h:45
llvm::JITTargetAddress
uint64_t JITTargetAddress
Represents an address in the target process's address space.
Definition: JITSymbol.h:42
Core.h
RawByteChannel.h
llvm::orc::OrcRPCExecutorProcessControlBase::callWrapperAsync
void callWrapperAsync(SendResultFunction OnComplete, ExecutorAddr WrapperFnAddr, ArrayRef< char > ArgBuffer) override
Run a wrapper function in the executor.
Definition: OrcRPCExecutorProcessControl.h:361
llvm::ArrayRef::size
size_t size() const
size - Get the array size.
Definition: ArrayRef.h:165
llvm::max
Align max(MaybeAlign Lhs, Align Rhs)
Definition: Alignment.h:340
ExecutorProcessControl.h
llvm::orc::OrcRPCEPCJITLinkMemoryManager::OrcRPCAllocation::getWorkingMemory
MutableArrayRef< char > getWorkingMemory(ProtectionFlags Seg) override
Definition: OrcRPCExecutorProcessControl.h:59
llvm::orc::OrcRPCExecutorProcessControlBase::OrcRPCExecutorProcessControlBase
OrcRPCExecutorProcessControlBase(std::shared_ptr< SymbolStringPool > SSP, RPCEndpointT &EP, ErrorReporter ReportError)
Definition: OrcRPCExecutorProcessControl.h:282
llvm::orc::OrcRPCEPCJITLinkMemoryManager::OrcRPCAllocation::finalizeAsync
void finalizeAsync(FinalizeContinuation OnFinalize) override
Definition: OrcRPCExecutorProcessControl.h:72
llvm::AMDGPU::HSAMD::Kernel::Key::Args
constexpr char Args[]
Key for Kernel::Metadata::mArgs.
Definition: AMDGPUMetadata.h:389
llvm::orc::OrcRPCEPCMemoryAccess
ExecutorProcessControl::MemoryAccess implementation for a process connected via an ORC RPC endpoint.
Definition: OrcRPCExecutorProcessControl.h:228