Go to the documentation of this file.
13 #ifndef LIB_EXECUTIONENGINE_JITLINK_JITLINKGENERIC_H
14 #define LIB_EXECUTIONENGINE_JITLINK_JITLINKGENERIC_H
19 #define DEBUG_TYPE "jitlink"
35 assert(this->Ctx &&
"Ctx can not be null");
36 assert(this->G &&
"G can not be null");
57 void linkPhase1(std::unique_ptr<JITLinkerBase> Self);
71 void linkPhase3(std::unique_ptr<JITLinkerBase> Self,
89 void abandonAllocAndBailOut(std::unique_ptr<JITLinkerBase> Self,
Error Err);
91 std::unique_ptr<JITLinkContext> Ctx;
92 std::unique_ptr<LinkGraph> G;
94 std::unique_ptr<InFlightAlloc> Alloc;
104 template <
typename... ArgTs>
static void link(ArgTs &&...
Args) {
105 auto L = std::make_unique<LinkerImpl>(std::forward<ArgTs>(
Args)...);
119 const LinkerImpl &impl()
const {
120 return static_cast<const LinkerImpl &
>(*this);
123 Error fixUpBlocks(LinkGraph &G)
const override {
126 for (
auto *
B :
G.blocks()) {
131 assert((!
B->isZeroFill() ||
B->edges_size() == 0) &&
132 "Edges in zero-fill block?");
133 for (
auto &
E :
B->edges()) {
136 if (!
E.isRelocation())
159 #undef DEBUG_TYPE // "jitlink"
161 #endif // LIB_EXECUTIONENGINE_JITLINK_JITLINKGENERIC_H
This is an optimization pass for GlobalISel generic memory operations.
void linkPhase3(std::unique_ptr< JITLinkerBase > Self, Expected< AsyncLookupResult > LookupResult)
PassConfiguration & getPassConfig()
static ErrorSuccess success()
Create a success value.
void prune(LinkGraph &G)
Removes dead symbols/blocks/addressables.
Tagged union holding either a T or a Error.
Error applyFixup(LinkGraph &G, Block &B, const Edge &E)
Apply fixup expression for edge to block content.
void linkPhase1(std::unique_ptr< JITLinkerBase > Self)
JITLinkerBase(std::unique_ptr< JITLinkContext > Ctx, std::unique_ptr< LinkGraph > G, PassConfiguration Passes)
raw_ostream & dbgs()
dbgs() - This returns a reference to a raw_ostream for debugging messages.
std::vector< JITTargetAddress > LookupResult
static GCRegistry::Add< CoreCLRGC > E("coreclr", "CoreCLR-compatible GC")
static GCRegistry::Add< OcamlGC > B("ocaml", "ocaml 3.10-compatible GC")
Expected< std::unique_ptr< InFlightAlloc > > AllocResult
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
std::vector< LinkGraphPassFunction > LinkGraphPassList
A list of LinkGraph passes.
Expected< JITLinkMemoryManager::FinalizedAlloc > FinalizeResult
assert(ImpDefSCC.getReg()==AMDGPU::SCC &&ImpDefSCC.isDef())
OutputIt move(R &&Range, OutputIt Out)
Provide wrappers to std::move which take ranges instead of having to pass begin/end explicitly.
void linkPhase2(std::unique_ptr< JITLinkerBase > Self, AllocResult AR)
An LinkGraph pass configuration, consisting of a list of pre-prune, post-prune, and post-fixup passes...
Represents an allocation which has not been finalized yet.
Lightweight error class with error context and mandatory checking.
void linkPhase4(std::unique_ptr< JITLinkerBase > Self, FinalizeResult FR)
Base class for a JIT linker.
static void link(ArgTs &&... Args)
Link constructs a LinkerImpl instance and calls linkPhase1.
constexpr char Args[]
Key for Kernel::Metadata::mArgs.