13#ifndef LIB_EXECUTIONENGINE_JITLINK_JITLINKGENERIC_H 
   14#define LIB_EXECUTIONENGINE_JITLINK_JITLINKGENERIC_H 
   18#define DEBUG_TYPE "jitlink" 
   34    assert(this->Ctx && 
"Ctx can not be null");
 
   35    assert(this->G && 
"G can not be null");
 
 
   52    return Ctx->shouldAddDefaultTargetPasses(TT);
 
 
   66  void linkPhase1(std::unique_ptr<JITLinkerBase> Self);
 
   80  void linkPhase3(std::unique_ptr<JITLinkerBase> Self,
 
   98  void abandonAllocAndBailOut(std::unique_ptr<JITLinkerBase> Self, 
Error Err);
 
  100  std::unique_ptr<JITLinkContext> Ctx;
 
  101  std::unique_ptr<LinkGraph> 
G;
 
  103  std::unique_ptr<InFlightAlloc> 
Alloc;
 
 
  113  template <
typename... ArgTs> 
static void link(ArgTs &&... Args) {
 
  114    auto L = std::make_unique<LinkerImpl>(std::forward<ArgTs>(Args)...);
 
  124    LTmp.linkPhase1(std::move(L));
 
 
  128  const LinkerImpl &
impl()
 const {
 
  129    return static_cast<const LinkerImpl &
>(*this);
 
  132  Error fixUpBlocks(LinkGraph &
G)
 const override {
 
  135    for (
auto &Sec : 
G.sections()) {
 
  138      for (
auto *
B : Sec.blocks()) {
 
  145                                             return E.getKind() ==
 
  148               "Non-KeepAlive edges in zero-fill block?");
 
  154          (void)
B->getMutableContent(
G);
 
  156        for (
auto &
E : 
B->edges()) {
 
  159          if (!
E.isRelocation())
 
  164          assert((NoAllocSection || !
E.getTarget().isDefined() ||
 
  165                  E.getTarget().getSection().getMemLifetime() !=
 
  167                 "Block in allocated section has edge pointing to no-alloc " 
  171          if (
auto Err = 
impl().applyFixup(
G, *
B, 
E))
 
 
assert(UImm &&(UImm !=~static_cast< T >(0)) &&"Invalid immediate!")
 
static GCRegistry::Add< CoreCLRGC > E("coreclr", "CoreCLR-compatible GC")
 
static GCRegistry::Add< OcamlGC > B("ocaml", "ocaml 3.10-compatible GC")
 
Function const char * Passes
 
Lightweight error class with error context and mandatory checking.
 
static ErrorSuccess success()
Create a success value.
 
Tagged union holding either a T or a Error.
 
Triple - Helper class for working with autoconf configuration names.
 
DenseMap< orc::SymbolStringPtr, SymbolLookupFlags > LookupMap
 
Represents an allocation which has not been finalized yet.
 
void linkPhase4(std::unique_ptr< JITLinkerBase > Self, FinalizeResult FR)
 
void linkPhase3(std::unique_ptr< JITLinkerBase > Self, Expected< AsyncLookupResult > LookupResult)
 
PassConfiguration & getPassConfig()
 
Expected< std::unique_ptr< InFlightAlloc > > AllocResult
 
void linkPhase1(std::unique_ptr< JITLinkerBase > Self)
 
Expected< JITLinkMemoryManager::FinalizedAlloc > FinalizeResult
 
JITLinkMemoryManager::InFlightAlloc InFlightAlloc
 
void linkPhase2(std::unique_ptr< JITLinkerBase > Self, AllocResult AR)
 
JITLinkerBase(std::unique_ptr< JITLinkContext > Ctx, std::unique_ptr< LinkGraph > G, PassConfiguration Passes)
 
bool shouldAddDefaultTargetPasses(const Triple &TT)
 
static void link(ArgTs &&... Args)
Link constructs a LinkerImpl instance and calls linkPhase1.
 
JITLinkerBase(std::unique_ptr< JITLinkContext > Ctx, std::unique_ptr< LinkGraph > G, PassConfiguration Passes)
 
void prune(LinkGraph &G)
Removes dead symbols/blocks/addressables.
 
DenseMap< orc::SymbolStringPtr, orc::ExecutorSymbolDef > AsyncLookupResult
A map of symbol names to resolved addresses.
 
std::vector< LinkGraphPassFunction > LinkGraphPassList
A list of LinkGraph passes.
 
@ NoAlloc
NoAlloc memory should not be allocated by the JITLinkMemoryManager at all.
 
This is an optimization pass for GlobalISel generic memory operations.
 
bool all_of(R &&range, UnaryPredicate P)
Provide wrappers to std::all_of which take ranges instead of having to pass begin/end explicitly.
 
LLVM_ABI raw_ostream & dbgs()
dbgs() - This returns a reference to a raw_ostream for debugging messages.
 
OutputIt move(R &&Range, OutputIt Out)
Provide wrappers to std::move which take ranges instead of having to pass begin/end explicitly.
 
Implement std::hash so that hash_code can be used in STL containers.
 
An LinkGraph pass configuration, consisting of a list of pre-prune, post-prune, and post-fixup passes...