11#define DEBUG_TYPE "orc"
18 std::unique_ptr<MaterializationResponsibility> R) {
19 auto G = std::make_unique<LinkGraph>(
20 "orc_sectcreate_" + SectName,
21 ObjLinkingLayer.getExecutionSession().getSymbolStringPool(),
22 ObjLinkingLayer.getExecutionSession().getTargetTriple(),
25 auto &Sect =
G->createSection(SectName, MP);
27 auto &
B =
G->createContentBlock(Sect, Content,
ExecutorAddr(), Alignment, 0);
29 for (
auto &[Name, Info] : ExtraSymbols) {
32 G->addDefinedSymbol(
B, Info.Offset, *Name, 0, L, S, Info.Flags.isCallable(),
36 ObjLinkingLayer.emit(std::move(R), std::move(
G));
39void SectCreateMaterializationUnit::discard(
const JITDylib &JD,
41 ExtraSymbols.
erase(Name);
44MaterializationUnit::Interface SectCreateMaterializationUnit::getInterface(
45 const ExtraSymbolsMap &ExtraSymbols) {
47 for (
auto &[Name, Info] : ExtraSymbols)
48 SymbolFlags[Name] = Info.Flags;
49 return {std::move(SymbolFlags),
nullptr};
static GCRegistry::Add< OcamlGC > B("ocaml", "ocaml 3.10-compatible GC")
ArrayRef - Represent a constant reference to an array (0 or more elements consecutively in memory),...
bool erase(const KeyT &Val)
Manages the enabling and disabling of subtarget specific features.
Represents an address in the executor process.
Represents a JIT'd dynamic library.
void materialize(std::unique_ptr< MaterializationResponsibility > R) override
Implementations of this method should materialize all symbols in the materialzation unit,...
Pointer to a pooled string representing a symbol name.
LLVM_ABI const char * getGenericEdgeKindName(Edge::Kind K)
Returns the string name of the given generic edge kind, or "unknown" otherwise.
DenseMap< SymbolStringPtr, JITSymbolFlags > SymbolFlagsMap
A map from symbol names (as SymbolStringPtrs) to JITSymbolFlags.