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