LLVM  7.0.0
OrcMCJITReplacement.h
Go to the documentation of this file.
1 //===- OrcMCJITReplacement.h - Orc based MCJIT replacement ------*- C++ -*-===//
2 //
3 // The LLVM Compiler Infrastructure
4 //
5 // This file is distributed under the University of Illinois Open Source
6 // License. See LICENSE.TXT for details.
7 //
8 //===----------------------------------------------------------------------===//
9 //
10 // Orc based MCJIT replacement.
11 //
12 //===----------------------------------------------------------------------===//
13 
14 #ifndef LLVM_LIB_EXECUTIONENGINE_ORC_ORCMCJITREPLACEMENT_H
15 #define LLVM_LIB_EXECUTIONENGINE_ORC_ORCMCJITREPLACEMENT_H
16 
17 #include "llvm/ADT/ArrayRef.h"
18 #include "llvm/ADT/STLExtras.h"
19 #include "llvm/ADT/StringRef.h"
30 #include "llvm/IR/DataLayout.h"
31 #include "llvm/IR/Function.h"
32 #include "llvm/IR/Mangler.h"
33 #include "llvm/IR/Module.h"
34 #include "llvm/Object/Archive.h"
35 #include "llvm/Object/Binary.h"
36 #include "llvm/Object/ObjectFile.h"
37 #include "llvm/Support/Error.h"
41 #include <algorithm>
42 #include <cassert>
43 #include <cstddef>
44 #include <cstdint>
45 #include <map>
46 #include <memory>
47 #include <set>
48 #include <string>
49 #include <vector>
50 
51 namespace llvm {
52 
53 class ObjectCache;
54 
55 namespace orc {
56 
58 
59  // OrcMCJITReplacement needs to do a little extra book-keeping to ensure that
60  // Orc's automatic finalization doesn't kick in earlier than MCJIT clients are
61  // expecting - see finalizeMemory.
62  class MCJITReplacementMemMgr : public MCJITMemoryManager {
63  public:
64  MCJITReplacementMemMgr(OrcMCJITReplacement &M,
65  std::shared_ptr<MCJITMemoryManager> ClientMM)
66  : M(M), ClientMM(std::move(ClientMM)) {}
67 
68  uint8_t *allocateCodeSection(uintptr_t Size, unsigned Alignment,
69  unsigned SectionID,
70  StringRef SectionName) override {
71  uint8_t *Addr =
72  ClientMM->allocateCodeSection(Size, Alignment, SectionID,
73  SectionName);
74  M.SectionsAllocatedSinceLastLoad.insert(Addr);
75  return Addr;
76  }
77 
78  uint8_t *allocateDataSection(uintptr_t Size, unsigned Alignment,
79  unsigned SectionID, StringRef SectionName,
80  bool IsReadOnly) override {
81  uint8_t *Addr = ClientMM->allocateDataSection(Size, Alignment, SectionID,
82  SectionName, IsReadOnly);
83  M.SectionsAllocatedSinceLastLoad.insert(Addr);
84  return Addr;
85  }
86 
87  void reserveAllocationSpace(uintptr_t CodeSize, uint32_t CodeAlign,
88  uintptr_t RODataSize, uint32_t RODataAlign,
89  uintptr_t RWDataSize,
90  uint32_t RWDataAlign) override {
91  return ClientMM->reserveAllocationSpace(CodeSize, CodeAlign,
92  RODataSize, RODataAlign,
93  RWDataSize, RWDataAlign);
94  }
95 
96  bool needsToReserveAllocationSpace() override {
97  return ClientMM->needsToReserveAllocationSpace();
98  }
99 
100  void registerEHFrames(uint8_t *Addr, uint64_t LoadAddr,
101  size_t Size) override {
102  return ClientMM->registerEHFrames(Addr, LoadAddr, Size);
103  }
104 
105  void deregisterEHFrames() override {
106  return ClientMM->deregisterEHFrames();
107  }
108 
109  void notifyObjectLoaded(RuntimeDyld &RTDyld,
110  const object::ObjectFile &O) override {
111  return ClientMM->notifyObjectLoaded(RTDyld, O);
112  }
113 
114  void notifyObjectLoaded(ExecutionEngine *EE,
115  const object::ObjectFile &O) override {
116  return ClientMM->notifyObjectLoaded(EE, O);
117  }
118 
119  bool finalizeMemory(std::string *ErrMsg = nullptr) override {
120  // Each set of objects loaded will be finalized exactly once, but since
121  // symbol lookup during relocation may recursively trigger the
122  // loading/relocation of other modules, and since we're forwarding all
123  // finalizeMemory calls to a single underlying memory manager, we need to
124  // defer forwarding the call on until all necessary objects have been
125  // loaded. Otherwise, during the relocation of a leaf object, we will end
126  // up finalizing memory, causing a crash further up the stack when we
127  // attempt to apply relocations to finalized memory.
128  // To avoid finalizing too early, look at how many objects have been
129  // loaded but not yet finalized. This is a bit of a hack that relies on
130  // the fact that we're lazily emitting object files: The only way you can
131  // get more than one set of objects loaded but not yet finalized is if
132  // they were loaded during relocation of another set.
133  if (M.UnfinalizedSections.size() == 1)
134  return ClientMM->finalizeMemory(ErrMsg);
135  return false;
136  }
137 
138  private:
140  std::shared_ptr<MCJITMemoryManager> ClientMM;
141  };
142 
143  class LinkingORCResolver : public orc::SymbolResolver {
144  public:
145  LinkingORCResolver(OrcMCJITReplacement &M) : M(M) {}
146 
147  SymbolFlagsMap lookupFlags(const SymbolNameSet &Symbols) override {
148  SymbolFlagsMap SymbolFlags;
149 
150  for (auto &S : Symbols) {
151  if (auto Sym = M.findMangledSymbol(*S)) {
152  SymbolFlags[S] = Sym.getFlags();
153  } else if (auto Err = Sym.takeError()) {
154  M.reportError(std::move(Err));
155  return SymbolFlagsMap();
156  } else {
157  if (auto Sym2 = M.ClientResolver->findSymbolInLogicalDylib(*S)) {
158  SymbolFlags[S] = Sym2.getFlags();
159  } else if (auto Err = Sym2.takeError()) {
160  M.reportError(std::move(Err));
161  return SymbolFlagsMap();
162  }
163  }
164  }
165 
166  return SymbolFlags;
167  }
168 
169  SymbolNameSet lookup(std::shared_ptr<AsynchronousSymbolQuery> Query,
170  SymbolNameSet Symbols) override {
171  SymbolNameSet UnresolvedSymbols;
172  bool NewSymbolsResolved = false;
173 
174  for (auto &S : Symbols) {
175  if (auto Sym = M.findMangledSymbol(*S)) {
176  if (auto Addr = Sym.getAddress()) {
177  Query->resolve(S, JITEvaluatedSymbol(*Addr, Sym.getFlags()));
178  Query->notifySymbolReady();
179  NewSymbolsResolved = true;
180  } else {
181  M.ES.legacyFailQuery(*Query, Addr.takeError());
182  return SymbolNameSet();
183  }
184  } else if (auto Err = Sym.takeError()) {
185  M.ES.legacyFailQuery(*Query, std::move(Err));
186  return SymbolNameSet();
187  } else {
188  if (auto Sym2 = M.ClientResolver->findSymbol(*S)) {
189  if (auto Addr = Sym2.getAddress()) {
190  Query->resolve(S, JITEvaluatedSymbol(*Addr, Sym2.getFlags()));
191  Query->notifySymbolReady();
192  NewSymbolsResolved = true;
193  } else {
194  M.ES.legacyFailQuery(*Query, Addr.takeError());
195  return SymbolNameSet();
196  }
197  } else if (auto Err = Sym2.takeError()) {
198  M.ES.legacyFailQuery(*Query, std::move(Err));
199  return SymbolNameSet();
200  } else
201  UnresolvedSymbols.insert(S);
202  }
203  }
204 
205  if (NewSymbolsResolved && Query->isFullyResolved())
206  Query->handleFullyResolved();
207 
208  if (NewSymbolsResolved && Query->isFullyReady())
209  Query->handleFullyReady();
210 
211  return UnresolvedSymbols;
212  }
213 
214  private:
216  };
217 
218 private:
219  static ExecutionEngine *
220  createOrcMCJITReplacement(std::string *ErrorMsg,
221  std::shared_ptr<MCJITMemoryManager> MemMgr,
222  std::shared_ptr<LegacyJITSymbolResolver> Resolver,
223  std::unique_ptr<TargetMachine> TM) {
224  return new OrcMCJITReplacement(std::move(MemMgr), std::move(Resolver),
225  std::move(TM));
226  }
227 
228  void reportError(Error Err) {
229  logAllUnhandledErrors(std::move(Err), errs(), "MCJIT error: ");
230  }
231 
232 public:
233  OrcMCJITReplacement(std::shared_ptr<MCJITMemoryManager> MemMgr,
234  std::shared_ptr<LegacyJITSymbolResolver> ClientResolver,
235  std::unique_ptr<TargetMachine> TM)
236  : ExecutionEngine(TM->createDataLayout()),
237  TM(std::move(TM)),
238  MemMgr(
239  std::make_shared<MCJITReplacementMemMgr>(*this, std::move(MemMgr))),
240  Resolver(std::make_shared<LinkingORCResolver>(*this)),
241  ClientResolver(std::move(ClientResolver)), NotifyObjectLoaded(*this),
242  NotifyFinalized(*this),
243  ObjectLayer(
244  ES,
245  [this](VModuleKey K) {
246  return ObjectLayerT::Resources{this->MemMgr, this->Resolver};
247  },
248  NotifyObjectLoaded, NotifyFinalized),
249  CompileLayer(ObjectLayer, SimpleCompiler(*this->TM),
250  [this](VModuleKey K, std::unique_ptr<Module> M) {
251  Modules.push_back(std::move(M));
252  }),
253  LazyEmitLayer(CompileLayer) {}
254 
255  static void Register() {
256  OrcMCJITReplacementCtor = createOrcMCJITReplacement;
257  }
258 
259  void addModule(std::unique_ptr<Module> M) override {
260  // If this module doesn't have a DataLayout attached then attach the
261  // default.
262  if (M->getDataLayout().isDefault()) {
263  M->setDataLayout(getDataLayout());
264  } else {
265  assert(M->getDataLayout() == getDataLayout() && "DataLayout Mismatch");
266  }
267 
268  // Rename, bump linkage and record static constructors and destructors.
269  // We have to do this before we hand over ownership of the module to the
270  // JIT.
271  std::vector<std::string> CtorNames, DtorNames;
272  {
273  unsigned CtorId = 0, DtorId = 0;
274  for (auto Ctor : orc::getConstructors(*M)) {
275  std::string NewCtorName = ("$static_ctor." + Twine(CtorId++)).str();
276  Ctor.Func->setName(NewCtorName);
277  Ctor.Func->setLinkage(GlobalValue::ExternalLinkage);
278  Ctor.Func->setVisibility(GlobalValue::HiddenVisibility);
279  CtorNames.push_back(mangle(NewCtorName));
280  }
281  for (auto Dtor : orc::getDestructors(*M)) {
282  std::string NewDtorName = ("$static_dtor." + Twine(DtorId++)).str();
283  dbgs() << "Found dtor: " << NewDtorName << "\n";
284  Dtor.Func->setName(NewDtorName);
285  Dtor.Func->setLinkage(GlobalValue::ExternalLinkage);
286  Dtor.Func->setVisibility(GlobalValue::HiddenVisibility);
287  DtorNames.push_back(mangle(NewDtorName));
288  }
289  }
290 
291  auto K = ES.allocateVModule();
292 
293  UnexecutedConstructors[K] = std::move(CtorNames);
294  UnexecutedDestructors[K] = std::move(DtorNames);
295 
296  cantFail(LazyEmitLayer.addModule(K, std::move(M)));
297  }
298 
299  void addObjectFile(std::unique_ptr<object::ObjectFile> O) override {
300  cantFail(ObjectLayer.addObject(
301  ES.allocateVModule(), MemoryBuffer::getMemBufferCopy(O->getData())));
302  }
303 
305  std::unique_ptr<object::ObjectFile> Obj;
306  std::unique_ptr<MemoryBuffer> ObjBuffer;
307  std::tie(Obj, ObjBuffer) = O.takeBinary();
308  cantFail(ObjectLayer.addObject(ES.allocateVModule(), std::move(ObjBuffer)));
309  }
310 
312  Archives.push_back(std::move(A));
313  }
314 
315  bool removeModule(Module *M) override {
316  auto I = Modules.begin();
317  for (auto E = Modules.end(); I != E; ++I)
318  if (I->get() == M)
319  break;
320  if (I == Modules.end())
321  return false;
322  Modules.erase(I);
323  return true;
324  }
325 
327  return cantFail(findSymbol(Name).getAddress());
328  }
329 
331  return findMangledSymbol(mangle(Name));
332  }
333 
334  void finalizeObject() override {
335  // This is deprecated - Aim to remove in ExecutionEngine.
336  // REMOVE IF POSSIBLE - Doesn't make sense for New JIT.
337  }
338 
339  void mapSectionAddress(const void *LocalAddress,
340  uint64_t TargetAddress) override {
341  for (auto &P : UnfinalizedSections)
342  if (P.second.count(LocalAddress))
343  ObjectLayer.mapSectionAddress(P.first, LocalAddress, TargetAddress);
344  }
345 
346  uint64_t getGlobalValueAddress(const std::string &Name) override {
347  return getSymbolAddress(Name);
348  }
349 
350  uint64_t getFunctionAddress(const std::string &Name) override {
351  return getSymbolAddress(Name);
352  }
353 
354  void *getPointerToFunction(Function *F) override {
355  uint64_t FAddr = getSymbolAddress(F->getName());
356  return reinterpret_cast<void *>(static_cast<uintptr_t>(FAddr));
357  }
358 
360  bool AbortOnFailure = true) override {
361  uint64_t Addr = getSymbolAddress(Name);
362  if (!Addr && AbortOnFailure)
363  llvm_unreachable("Missing symbol!");
364  return reinterpret_cast<void *>(static_cast<uintptr_t>(Addr));
365  }
366 
368  ArrayRef<GenericValue> ArgValues) override;
369 
370  void setObjectCache(ObjectCache *NewCache) override {
371  CompileLayer.getCompiler().setObjectCache(NewCache);
372  }
373 
374  void setProcessAllSections(bool ProcessAllSections) override {
375  ObjectLayer.setProcessAllSections(ProcessAllSections);
376  }
377 
378  void runStaticConstructorsDestructors(bool isDtors) override;
379 
380 private:
381  JITSymbol findMangledSymbol(StringRef Name) {
382  if (auto Sym = LazyEmitLayer.findSymbol(Name, false))
383  return Sym;
384  if (auto Sym = ClientResolver->findSymbol(Name))
385  return Sym;
386  if (auto Sym = scanArchives(Name))
387  return Sym;
388 
389  return nullptr;
390  }
391 
392  JITSymbol scanArchives(StringRef Name) {
393  for (object::OwningBinary<object::Archive> &OB : Archives) {
394  object::Archive *A = OB.getBinary();
395  // Look for our symbols in each Archive
396  auto OptionalChildOrErr = A->findSym(Name);
397  if (!OptionalChildOrErr)
398  report_fatal_error(OptionalChildOrErr.takeError());
399  auto &OptionalChild = *OptionalChildOrErr;
400  if (OptionalChild) {
401  // FIXME: Support nested archives?
403  OptionalChild->getAsBinary();
404  if (!ChildBinOrErr) {
405  // TODO: Actually report errors helpfully.
406  consumeError(ChildBinOrErr.takeError());
407  continue;
408  }
409  std::unique_ptr<object::Binary> &ChildBin = ChildBinOrErr.get();
410  if (ChildBin->isObject()) {
411  cantFail(ObjectLayer.addObject(
412  ES.allocateVModule(),
413  MemoryBuffer::getMemBufferCopy(ChildBin->getData())));
414  if (auto Sym = ObjectLayer.findSymbol(Name, true))
415  return Sym;
416  }
417  }
418  }
419  return nullptr;
420  }
421 
422  class NotifyObjectLoadedT {
423  public:
424  using LoadedObjInfoListT =
425  std::vector<std::unique_ptr<RuntimeDyld::LoadedObjectInfo>>;
426 
427  NotifyObjectLoadedT(OrcMCJITReplacement &M) : M(M) {}
428 
429  void operator()(VModuleKey K, const object::ObjectFile &Obj,
430  const RuntimeDyld::LoadedObjectInfo &Info) const {
431  M.UnfinalizedSections[K] = std::move(M.SectionsAllocatedSinceLastLoad);
432  M.SectionsAllocatedSinceLastLoad = SectionAddrSet();
433  M.MemMgr->notifyObjectLoaded(&M, Obj);
434  }
435  private:
437  };
438 
439  class NotifyFinalizedT {
440  public:
441  NotifyFinalizedT(OrcMCJITReplacement &M) : M(M) {}
442 
443  void operator()(VModuleKey K, const object::ObjectFile &Obj,
444  const RuntimeDyld::LoadedObjectInfo &Info) {
445  M.UnfinalizedSections.erase(K);
446  }
447 
448  private:
450  };
451 
452  std::string mangle(StringRef Name) {
453  std::string MangledName;
454  {
455  raw_string_ostream MangledNameStream(MangledName);
456  Mang.getNameWithPrefix(MangledNameStream, Name, getDataLayout());
457  }
458  return MangledName;
459  }
460 
464 
465  ExecutionSession ES;
466 
467  std::unique_ptr<TargetMachine> TM;
468  std::shared_ptr<MCJITReplacementMemMgr> MemMgr;
469  std::shared_ptr<LinkingORCResolver> Resolver;
470  std::shared_ptr<LegacyJITSymbolResolver> ClientResolver;
471  Mangler Mang;
472 
473  // IMPORTANT: ShouldDelete *must* come before LocalModules: The shared_ptr
474  // delete blocks in LocalModules refer to the ShouldDelete map, so
475  // LocalModules needs to be destructed before ShouldDelete.
476  std::map<Module*, bool> ShouldDelete;
477 
478  NotifyObjectLoadedT NotifyObjectLoaded;
479  NotifyFinalizedT NotifyFinalized;
480 
482  CompileLayerT CompileLayer;
483  LazyEmitLayerT LazyEmitLayer;
484 
485  std::map<VModuleKey, std::vector<std::string>> UnexecutedConstructors;
486  std::map<VModuleKey, std::vector<std::string>> UnexecutedDestructors;
487 
488  // We need to store ObjLayerT::ObjSetHandles for each of the object sets
489  // that have been emitted but not yet finalized so that we can forward the
490  // mapSectionAddress calls appropriately.
491  using SectionAddrSet = std::set<const void *>;
492  SectionAddrSet SectionsAllocatedSinceLastLoad;
493  std::map<VModuleKey, SectionAddrSet> UnfinalizedSections;
494 
495  std::vector<object::OwningBinary<object::Archive>> Archives;
496 };
497 
498 } // end namespace orc
499 
500 } // end namespace llvm
501 
502 #endif // LLVM_LIB_EXECUTIONENGINE_ORC_MCJITREPLACEMENT_H
void addObjectFile(std::unique_ptr< object::ObjectFile > O) override
addObjectFile - Add an ObjectFile to the execution engine.
void cantFail(Error Err, const char *Msg=nullptr)
Report a fatal error if Err is a failure value.
Definition: Error.h:697
Information about the loaded object.
Definition: RuntimeDyld.h:69
raw_ostream & errs()
This returns a reference to a raw_ostream for standard error.
Represents a symbol in the JIT.
Definition: JITSymbol.h:186
LLVM_ATTRIBUTE_NORETURN void report_fatal_error(Error Err, bool gen_crash_diag=true)
Report a serious error, calling any installed error handler.
Definition: Error.cpp:119
Compute iterated dominance frontiers using a linear time algorithm.
Definition: AllocatorList.h:24
A Module instance is used to store all the information related to an LLVM module. ...
Definition: Module.h:63
void logAllUnhandledErrors(Error E, raw_ostream &OS, Twine ErrorBanner)
Log all errors (if any) in E to OS.
Definition: Error.cpp:57
void finalizeObject() override
finalizeObject - ensure the module is fully processed and is usable.
Expected< Optional< Child > > findSym(StringRef name) const
Definition: Archive.cpp:978
Bare bones object linking layer.
This class is the base class for all object file types.
Definition: ObjectFile.h:190
Externally visible function.
Definition: GlobalValue.h:49
F(f)
const DataLayout & getDataLayout() const
Error takeError()
Take ownership of the stored error.
Definition: Error.h:546
void legacyFailQuery(AsynchronousSymbolQuery &Q, Error Err)
Definition: Core.cpp:145
uint64_t VModuleKey
VModuleKey provides a unique identifier (allocated and managed by ExecutionSessions) for a module add...
Definition: Core.h:40
Definition: BitVector.h:921
Twine - A lightweight data structure for efficiently representing the concatenation of temporary valu...
Definition: Twine.h:81
uint64_t getFunctionAddress(const std::string &Name) override
getFunctionAddress - Return the address of the specified function.
std::map< SymbolStringPtr, JITSymbolFlags > SymbolFlagsMap
A map from symbol names (as SymbolStringPtrs) to JITSymbolFlags.
Definition: Core.h:57
Tagged union holding either a T or a Error.
Definition: CachePruning.h:23
Simple compile functor: Takes a single IR module and returns an ObjectFile.
Definition: CompileUtils.h:42
OrcMCJITReplacement(std::shared_ptr< MCJITMemoryManager > MemMgr, std::shared_ptr< LegacyJITSymbolResolver > ClientResolver, std::unique_ptr< TargetMachine > TM)
iterator_range< CtorDtorIterator > getDestructors(const Module &M)
Create an iterator range over the entries of the llvm.global_ctors array.
bool removeModule(Module *M) override
removeModule - Removes a Module from the list of modules, but does not free the module&#39;s memory...
ArrayRef - Represent a constant reference to an array (0 or more elements consecutively in memory)...
Definition: APInt.h:33
GenericValue runFunction(Function *F, ArrayRef< GenericValue > ArgValues) override
runFunction - Execute the specified function with the specified arguments, and return the result...
uint64_t getGlobalValueAddress(const std::string &Name) override
getGlobalValueAddress - Return the address of the specified global value.
#define P(N)
static GCRegistry::Add< CoreCLRGC > E("coreclr", "CoreCLR-compatible GC")
void addObjectFile(object::OwningBinary< object::ObjectFile > O) override
Interface for looking up the initializer for a variable name, used by Init::resolveReferences.
Definition: Record.h:1774
void setObjectCache(ObjectCache *NewCache) override
Sets the pre-compiled object cache.
void consumeError(Error Err)
Consume a Error without doing anything.
Definition: Error.h:971
#define llvm_unreachable(msg)
Marks that the current location is not supposed to be reachable.
void * getPointerToFunction(Function *F) override
getPointerToFunction - The different EE&#39;s represent function bodies in different ways.
Abstract interface for implementation execution of LLVM modules, designed to support both interpreter...
std::pair< std::unique_ptr< T >, std::unique_ptr< MemoryBuffer > > takeBinary()
Definition: Binary.h:201
void runStaticConstructorsDestructors(bool isDtors) override
runStaticConstructorsDestructors - This method is used to execute all of the static constructors or d...
Module.h This file contains the declarations for the Module class.
JITSymbol findSymbol(StringRef Name)
Expected< SymbolMap > lookup(const VSOList &VSOs, SymbolNameSet Names)
Look up the given names in the given VSOs.
Definition: Core.cpp:1655
uint64_t getSymbolAddress(StringRef Name)
reference get()
Returns a reference to the stored T value.
Definition: Error.h:526
An ExecutionSession represents a running JIT program.
Definition: Core.h:735
raw_ostream & dbgs()
dbgs() - This returns a reference to a raw_ostream for debugging messages.
Definition: Debug.cpp:133
SymbolResolver is a composable interface for looking up symbol flags and addresses using the Asynchro...
Definition: Legacy.h:30
static std::unique_ptr< MemoryBuffer > getMemBufferCopy(StringRef InputData, const Twine &BufferName="")
Open the specified memory range as a MemoryBuffer, copying the contents and taking ownership of it...
static ExecutionEngine *(* OrcMCJITReplacementCtor)(std::string *ErrorStr, std::shared_ptr< MCJITMemoryManager > MM, std::shared_ptr< LegacyJITSymbolResolver > SR, std::unique_ptr< TargetMachine > TM)
Represents a symbol that has been evaluated to an address already.
Definition: JITSymbol.h:157
SmallVector< std::unique_ptr< Module >, 1 > Modules
The list of Modules that we are JIT&#39;ing from.
StringRef getName() const
Return a constant reference to the value&#39;s name.
Definition: Value.cpp:224
iterator_range< CtorDtorIterator > getConstructors(const Module &M)
Create an iterator range over the entries of the llvm.global_ctors array.
#define I(x, y, z)
Definition: MD5.cpp:58
static void Query(const MachineInstr &MI, AliasAnalysis &AA, bool &Read, bool &Write, bool &Effects, bool &StackPointer)
void setProcessAllSections(bool ProcessAllSections) override
setProcessAllSections (MCJIT Only): By default, only sections that are "required for execution" are p...
This is the base ObjectCache type which can be provided to an ExecutionEngine for the purpose of avoi...
Definition: ObjectCache.h:23
void addModule(std::unique_ptr< Module > M) override
Add a Module to the list of modules that we can JIT from.
void * getPointerToNamedFunction(StringRef Name, bool AbortOnFailure=true) override
getPointerToNamedFunction - This method returns the address of the specified function by using the dl...
assert(ImpDefSCC.getReg()==AMDGPU::SCC &&ImpDefSCC.isDef())
A raw_ostream that writes to an std::string.
Definition: raw_ostream.h:477
void addArchive(object::OwningBinary< object::Archive > A) override
addArchive - Add an Archive to the execution engine.
constexpr char Size[]
Key for Kernel::Arg::Metadata::mSize.
Lightweight error class with error context and mandatory checking.
Definition: Error.h:157
Interface for Layers that accept object files.
Definition: Layer.h:86
StringRef - Represent a constant reference to a string, i.e.
Definition: StringRef.h:49
std::set< SymbolStringPtr > SymbolNameSet
A set of symbol names (represented by SymbolStringPtrs for.
Definition: Core.h:44
void mapSectionAddress(const void *LocalAddress, uint64_t TargetAddress) override
mapSectionAddress - map a section to its target address space value.