15#ifndef LLVM_EXECUTIONENGINE_JITLINK_DEFINEEXTERNALSECTIONSTARTANDENDSYMBOLS_H
16#define LLVM_EXECUTIONENGINE_JITLINK_DEFINEEXTERNALSECTIONSTARTANDENDSYMBOLS_H
21#define DEBUG_TYPE "jitlink"
36template <
typename SymbolIdentifierFunction>
46 std::vector<Symbol *> Externals(
G.external_symbols().begin(),
47 G.external_symbols().end());
49 for (
auto *
Sym : Externals) {
52 auto &SR = getSectionRange(*
D.Sec);
63 G.makeDefined(*
Sym, *SR.getLastBlock(),
74 auto I = SectionRanges.find(&Sec);
75 if (
I == SectionRanges.end())
76 I = SectionRanges.insert(std::make_pair(&Sec,
SectionRange(Sec))).first;
81 SymbolIdentifierFunction F;
103template <
typename SymbolIdentifierFunction>
104DefineExternalSectionStartAndEndSymbols<SymbolIdentifierFunction>
106 SymbolIdentifierFunction &&
F) {
108 std::forward<SymbolIdentifierFunction>(
F));
static GCRegistry::Add< StatepointGC > D("statepoint-example", "an example strategy for statepoint")
Lightweight error class with error context and mandatory checking.
static ErrorSuccess success()
Create a success value.
Pass implementation for the createDefineExternalSectionStartAndEndSymbols function.
DefineExternalSectionStartAndEndSymbols(SymbolIdentifierFunction F)
Error operator()(LinkGraph &G)
Represents a section address range via a pair of Block pointers to the first and last Blocks in the s...
Represents an object file section.
Represents an address in the executor process.
DefineExternalSectionStartAndEndSymbols< SymbolIdentifierFunction > createDefineExternalSectionStartAndEndSymbolsPass(SymbolIdentifierFunction &&F)
Returns a JITLink pass (as a function class) that uses the given symbol identification function to id...
This is an optimization pass for GlobalISel generic memory operations.
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.
SectionRangeSymbolDesc()=default
SectionRangeSymbolDesc(Section &Sec, bool IsStart)