34 return LS.IPLS.release();
38 return LS.reset(IPLS);
94 Name(
std::
move(Name)), Ctx(Ctx), Materialize(Materialize),
95 Discard(Discard), Destroy(Destroy) {}
104 void materialize(std::unique_ptr<MaterializationResponsibility> R)
override {
107 Materialize(Tmp,
wrap(R.release()));
158 Result.reserve(Symbols.Length);
159 for (
size_t I = 0;
I != Symbols.Length; ++
I)
160 Result.insert(
unwrap(Symbols.Symbols[
I]).moveToSymbolStringPtr());
166 for (
size_t I = 0;
I != NumPairs; ++
I) {
168 SM[
unwrap(Syms[
I].Name).moveToSymbolStringPtr()] = {
177 for (
size_t I = 0;
I != NumPairs; ++
I) {
267 : Dispose(Dispose), Ctx(Ctx), TryToGenerate(TryToGenerate) {}
285 LLVMOrcJITDylibLookupFlags CJDLookupFlags =
286 fromJITDylibLookupFlags(JDLookupFlags);
289 std::vector<LLVMOrcCLookupSetElement> CLookupSet;
290 CLookupSet.reserve(LookupSet.
size());
291 for (
auto &KV : LookupSet) {
294 LLVMOrcSymbolLookupFlags SLF = fromSymbolLookupFlags(KV.second);
295 CLookupSet.push_back({Name, SLF});
299 auto Err =
unwrap(TryToGenerate(
::wrap(
this), Ctx, &LSR, CLookupKind,
300 ::wrap(&JD), CJDLookupFlags,
301 CLookupSet.data(), CLookupSet.size()));
321 unwrap(ES)->setErrorReporter(
322 [=](
Error Err) { ReportError(Ctx,
wrap(std::move(Err))); });
328 unwrap(ES)->getExecutorProcessControl().getSymbolStringPool().
get());
332 unwrap(SSP)->clearDeadEntries();
345 assert(ES &&
"ES cannot be null");
346 assert(SearchOrder &&
"SearchOrder cannot be null");
347 assert(Symbols &&
"Symbols cannot be null");
348 assert(HandleResult &&
"HandleResult cannot be null");
351 for (
size_t I = 0;
I != SearchOrderSize; ++
I)
352 SO.push_back({unwrap(SearchOrder[I].JD),
353 toJITDylibLookupFlags(SearchOrder[I].JDLookupFlags)});
356 for (
size_t I = 0;
I != SymbolsSize; ++
I)
357 SLS.
add(
unwrap(Symbols[
I].Name).moveToSymbolStringPtr(),
358 toSymbolLookupFlags(Symbols[
I].LookupFlags));
368 fromExecutorSymbolDef(KV.second)});
371 HandleResult(
wrap(
Result.takeError()),
nullptr, 0, Ctx);
385 return unwrap(S).rawPtr()->getKey().data();
390 auto RT =
unwrap(JD)->createResourceTracker();
393 return wrap(RT.get());
398 auto RT =
unwrap(JD)->getDefaultResourceTracker();
400 return wrap(RT.get());
420 std::unique_ptr<DefinitionGenerator> TmpDG(
unwrap(DG));
424 std::unique_ptr<MaterializationUnit> TmpMU(
unwrap(MU));
434 for (
size_t I = 0;
I != NumSyms; ++
I)
435 SFM[
unwrap(Syms[
I].Name).moveToSymbolStringPtr()] =
436 toJITSymbolFlags(Syms[
I].Flags);
438 auto IS =
unwrap(InitSym).moveToSymbolStringPtr();
440 return wrap(
new OrcCAPIMaterializationUnit(
441 Name, std::move(SFM), std::move(IS), Ctx, Materialize, Discard, Destroy));
446 SymbolMap SM = toSymbolMap(Syms, NumPairs);
456 for (
size_t I = 0;
I != NumPairs; ++
I) {
457 auto pair = CallableAliases[
I];
460 SAM[
unwrap(pair.Name).moveToSymbolStringPtr()] =
471 std::unique_ptr<MaterializationResponsibility> TmpMR(
unwrap(MR));
476 return wrap(&
unwrap(MR)->getTargetJITDylib());
482 return wrap(&
unwrap(MR)->getExecutionSession());
488 auto Symbols =
unwrap(MR)->getSymbols();
492 for (
auto const &pair : Symbols) {
494 auto Flags = pair.second;
495 Result[
I] = {Name, fromJITSymbolFlags(Flags)};
498 *NumPairs = Symbols.size();
509 auto Sym =
unwrap(MR)->getInitializerSymbol();
517 auto Symbols =
unwrap(MR)->getRequestedSymbols();
522 for (
auto &Name : Symbols) {
526 *NumSymbols = Symbols.size();
537 SymbolMap SM = toSymbolMap(Symbols, NumSymbols);
538 return wrap(
unwrap(MR)->notifyResolved(std::move(SM)));
544 std::vector<SymbolDependenceGroup> SDGs;
545 SDGs.reserve(NumSymbolDepGroups);
546 for (
size_t I = 0;
I != NumSymbolDepGroups; ++
I) {
548 auto &SDG = SDGs.back();
549 SDG.Symbols = toSymbolNameSet(SymbolDepGroups[
I].Symbols);
550 SDG.Dependencies = toSymbolDependenceMap(
551 SymbolDepGroups[
I].Dependencies, SymbolDepGroups[
I].NumDependencies);
560 for (
size_t I = 0;
I != NumSyms; ++
I)
561 SFM[
unwrap(Syms[
I].Name).moveToSymbolStringPtr()] =
562 toJITSymbolFlags(Syms[
I].Flags);
564 return wrap(
unwrap(MR)->defineMaterializing(std::move(SFM)));
570 std::unique_ptr<MaterializationUnit> TmpMU(
unwrap(MU));
579 for (
size_t I = 0;
I != NumSymbols;
I++) {
582 auto OtherMR =
unwrap(MR)->delegate(Syms);
585 return wrap(OtherMR.takeError());
593 unwrap(MR)->failMaterialization();
599 std::unique_ptr<ThreadSafeModule> TmpTSM(
unwrap(TSM));
601 std::unique_ptr<MaterializationResponsibility>(
unwrap(MR)),
608 return wrap(&
unwrap(ES)->createBareJITDylib(Name));
615 auto JD =
unwrap(ES)->createJITDylib(Name);
617 return wrap(JD.takeError());
625 return wrap(
unwrap(ES)->getJITDylibByName(Name));
630 std::unique_ptr<MaterializationUnit> TmpMU(
unwrap(MU));
632 if (
auto Err =
unwrap(JD)->define(TmpMU)) {
634 return wrap(std::move(Err));
645 unwrap(JD)->addGenerator(std::unique_ptr<DefinitionGenerator>(
unwrap(DG)));
651 auto DG = std::make_unique<CAPIDefinitionGenerator>(Dispose, Ctx,
F);
652 return wrap(DG.release());
659 LS.continueLookup(
unwrap(Err));
667 "if Filter is null then FilterCtx must also be null");
675 auto ProcessSymsGenerator =
678 if (!ProcessSymsGenerator) {
680 return wrap(ProcessSymsGenerator.takeError());
683 *
Result =
wrap(ProcessSymsGenerator->release());
691 assert(FileName &&
"FileName can not be null");
693 "if Filter is null then FilterCtx must also be null");
701 auto LibrarySymsGenerator =
704 if (!LibrarySymsGenerator) {
706 return wrap(LibrarySymsGenerator.takeError());
709 *
Result =
wrap(LibrarySymsGenerator->release());
715 const char *FileName) {
717 assert(FileName &&
"Filename can not be null");
718 assert(ObjLayer &&
"ObjectLayer can not be null");
720 auto LibrarySymsGenerator =
722 if (!LibrarySymsGenerator) {
724 return wrap(LibrarySymsGenerator.takeError());
726 *
Result =
wrap(LibrarySymsGenerator->release());
769 return wrap(JTMB.takeError());
778 auto *TemplateTM =
unwrap(TM);
781 std::make_unique<JITTargetMachineBuilder>(TemplateTM->getTargetTriple());
784 .setCPU(TemplateTM->getTargetCPU().str())
785 .setRelocationModel(TemplateTM->getRelocationModel())
786 .setCodeModel(TemplateTM->getCodeModel())
787 .setCodeGenOptLevel(TemplateTM->getOptLevel())
788 .setFeatures(TemplateTM->getTargetFeatureString())
789 .setOptions(TemplateTM->Options);
793 return wrap(JTMB.release());
803 auto Tmp =
unwrap(JTMB)->getTargetTriple().str();
804 char *TargetTriple = (
char *)malloc(Tmp.size() + 1);
805 strcpy(TargetTriple, Tmp.c_str());
818 *
unwrap(JD), std::unique_ptr<MemoryBuffer>(
unwrap(ObjBuffer))));
826 std::unique_ptr<MemoryBuffer>(
unwrap(ObjBuffer))));
833 std::unique_ptr<MaterializationResponsibility>(
unwrap(R)),
834 std::unique_ptr<MemoryBuffer>(
unwrap(ObjBuffer)));
851 assert(!TSMRef &&
"TSMRef was not reset to null on error");
854 assert(TSMRef &&
"Transform succeeded, but TSMRef was set to null");
865 ->setTransform([TransformFunction, Ctx](std::unique_ptr<MemoryBuffer> Obj)
866 ->
Expected<std::unique_ptr<MemoryBuffer>> {
868 if (
LLVMErrorRef Err = TransformFunction(Ctx, &ObjBuffer)) {
869 assert(!ObjBuffer &&
"ObjBuffer was not reset to null on error");
872 return std::unique_ptr<MemoryBuffer>(
unwrap(ObjBuffer));
877 const char *IdentifierOverride) {
878 assert(DumpDir &&
"DumpDir should not be null");
879 assert(IdentifierOverride &&
"IdentifierOverride should not be null");
889 std::unique_ptr<MemoryBuffer> OB(
unwrap(*ObjBuffer));
894 *ObjBuffer =
nullptr;
909 unwrap(Builder)->setJITTargetMachineBuilder(std::move(*
unwrap(JTMB)));
918 return std::unique_ptr<ObjectLayer>(
930 auto J =
unwrap(Builder)->create();
935 return wrap(J.takeError());
948 return wrap(&
unwrap(J)->getExecutionSession());
956 return unwrap(J)->getTargetTriple().str().c_str();
960 return unwrap(J)->getDataLayout().getGlobalPrefix();
966 unwrap(J)->mangleAndIntern(UnmangledName)));
972 *
unwrap(JD), std::unique_ptr<MemoryBuffer>(
unwrap(ObjBuffer))));
980 std::unique_ptr<MemoryBuffer>(
unwrap(ObjBuffer))));
986 std::unique_ptr<ThreadSafeModule> TmpTSM(
unwrap(TSM));
993 std::unique_ptr<ThreadSafeModule> TmpTSM(
unwrap(TSM));
995 std::move(*TmpTSM)));
1003 auto Sym =
unwrap(J)->lookup(Name);
1006 return wrap(Sym.takeError());
1009 *
Result = Sym->getValue();
1014 return wrap(&
unwrap(J)->getObjLinkingLayer());
1019 return wrap(&
unwrap(J)->getObjTransformLayer());
1025 assert(ES &&
"ES must not be null");
1028 return wrap(MM.takeError());
1036 assert(ES &&
"ES must not be null");
1039 return std::make_unique<SectionMemoryManager>();
1053 struct MCJITMemoryManagerLikeCallbacks {
1054 MCJITMemoryManagerLikeCallbacks() =
default;
1055 MCJITMemoryManagerLikeCallbacks(
1056 void *CreateContextCtx,
1063 : CreateContextCtx(CreateContextCtx), CreateContext(CreateContext),
1064 NotifyTerminating(NotifyTerminating),
1065 AllocateCodeSection(AllocateCodeSection),
1066 AllocateDataSection(AllocateDataSection),
1067 FinalizeMemory(FinalizeMemory), Destroy(Destroy) {}
1069 MCJITMemoryManagerLikeCallbacks(MCJITMemoryManagerLikeCallbacks &&
Other) {
1079 ~MCJITMemoryManagerLikeCallbacks() {
1080 if (NotifyTerminating)
1081 NotifyTerminating(CreateContextCtx);
1084 void *CreateContextCtx =
nullptr;
1095 MCJITMemoryManagerLikeCallbacksMemMgr(
1096 const MCJITMemoryManagerLikeCallbacks &CBs)
1098 Opaque = CBs.CreateContext(CBs.CreateContextCtx);
1100 ~MCJITMemoryManagerLikeCallbacksMemMgr()
override { CBs.Destroy(Opaque); }
1105 return CBs.AllocateCodeSection(Opaque,
Size, Alignment, SectionID,
1111 bool isReadOnly)
override {
1112 return CBs.AllocateDataSection(Opaque,
Size, Alignment, SectionID,
1117 char *ErrMsgCString =
nullptr;
1118 bool Result = CBs.FinalizeMemory(Opaque, &ErrMsgCString);
1120 "Did not expect an error message if FinalizeMemory succeeded");
1121 if (ErrMsgCString) {
1123 *ErrMsg = ErrMsgCString;
1124 free(ErrMsgCString);
1130 const MCJITMemoryManagerLikeCallbacks &CBs;
1131 void *Opaque =
nullptr;
1134 assert(ES &&
"ES must not be null");
1135 assert(CreateContext &&
"CreateContext must not be null");
1136 assert(NotifyTerminating &&
"NotifyTerminating must not be null");
1137 assert(AllocateCodeSection &&
"AllocateCodeSection must not be null");
1138 assert(AllocateDataSection &&
"AllocateDataSection must not be null");
1139 assert(FinalizeMemory &&
"FinalizeMemory must not be null");
1140 assert(Destroy &&
"Destroy must not be null");
1142 MCJITMemoryManagerLikeCallbacks CBs(
1143 CreateContextCtx, CreateContext, NotifyTerminating, AllocateCodeSection,
1144 AllocateDataSection, FinalizeMemory, Destroy);
1148 return std::make_unique<MCJITMemoryManagerLikeCallbacksMemMgr>(CBs);
1157 assert(RTDyldObjLinkingLayer &&
"RTDyldObjLinkingLayer must not be null");
1158 assert(Listener &&
"Listener must not be null");
1160 ->registerJITEventListener(*
unwrap(Listener));
1164 return wrap(&
unwrap(J)->getIRTransformLayer());
1168 return unwrap(J)->getDataLayout().getStringRepresentation().c_str();
1178 std::unique_ptr<IndirectStubsManager> TmpISM(
unwrap(ISM));
1189 return wrap(LCTM.takeError());
1196 std::unique_ptr<LazyCallThroughManager> TmpLCM(
unwrap(LCM));
assert(UImm &&(UImm !=~static_cast< T >(0)) &&"Invalid immediate!")
static GCRegistry::Add< CoreCLRGC > E("coreclr", "CoreCLR-compatible GC")
#define DEFINE_SIMPLE_CONVERSION_FUNCTIONS(ty, ref)
LLVM_C_EXTERN_C_BEGIN typedef void *(* LLVMMemoryManagerCreateContextCallback)(void *CtxCtx)
void(* LLVMMemoryManagerNotifyTerminatingCallback)(void *CtxCtx)
StringRef getName() const override
Return the name of this materialization unit.
~OrcCAPIMaterializationUnit() override
void materialize(std::unique_ptr< MaterializationResponsibility > R) override
Implementations of this method should materialize all symbols in the materialzation unit,...
OrcCAPIMaterializationUnit(std::string Name, SymbolFlagsMap InitialSymbolFlags, SymbolStringPtr InitSymbol, void *Ctx, LLVMOrcMaterializationUnitMaterializeFunction Materialize, LLVMOrcMaterializationUnitDiscardFunction Discard, LLVMOrcMaterializationUnitDestroyFunction Destroy)
Lightweight error class with error context and mandatory checking.
Tagged union holding either a T or a Error.
Flags for symbols in the JIT.
TargetFlagsType & getTargetFlags()
Return a reference to the target-specific flags.
@ MaterializationSideEffectsOnly
This interface provides simple read-only access to a block of memory, and provides simple methods for...
A Module instance is used to store all the information related to an LLVM module.
virtual uint8_t * allocateDataSection(uintptr_t Size, unsigned Alignment, unsigned SectionID, StringRef SectionName, bool IsReadOnly)=0
Allocate a memory block of (at least) the given size suitable for data.
virtual uint8_t * allocateCodeSection(uintptr_t Size, unsigned Alignment, unsigned SectionID, StringRef SectionName)=0
Allocate a memory block of (at least) the given size suitable for executable code.
virtual bool finalizeMemory(std::string *ErrMsg=nullptr)=0
This method is called when object loading is complete and section page permissions can be applied.
void push_back(const T &Elt)
pointer data()
Return a pointer to the vector's buffer, even if empty().
This is a 'vector' (really, a variable-sized array), optimized for the case when the array is small.
StringRef - Represent a constant reference to a string, i.e.
Primary interface to the complete machine description for the target machine.
Triple - Helper class for working with autoconf configuration names.
const std::string & str() const
std::pair< iterator, bool > insert(const ValueT &V)
static Expected< std::unique_ptr< InProcessMemoryManager > > Create()
Attempts to auto-detect the host page size.
~CAPIDefinitionGenerator() override
Error tryToGenerate(LookupState &LS, LookupKind K, JITDylib &JD, JITDylibLookupFlags JDLookupFlags, const SymbolLookupSet &LookupSet) override
DefinitionGenerators should override this method to insert new definitions into the parent JITDylib.
CAPIDefinitionGenerator(LLVMOrcDisposeCAPIDefinitionGeneratorFunction Dispose, void *Ctx, LLVMOrcCAPIDefinitionGeneratorTryToGenerateFunction TryToGenerate)
Definition generators can be attached to JITDylibs to generate new definitions for otherwise unresolv...
A function object that can be used as an ObjectTransformLayer transform to dump object files to disk ...
std::function< bool(const SymbolStringPtr &)> SymbolPredicate
static Expected< std::unique_ptr< DynamicLibrarySearchGenerator > > Load(const char *FileName, char GlobalPrefix, SymbolPredicate Allow=SymbolPredicate(), AddAbsoluteSymbolsFn AddAbsoluteSymbols=nullptr)
Permanently loads the library at the given path and, on success, returns a DynamicLibrarySearchGenera...
static Expected< std::unique_ptr< DynamicLibrarySearchGenerator > > GetForCurrentProcess(char GlobalPrefix, SymbolPredicate Allow=SymbolPredicate(), AddAbsoluteSymbolsFn AddAbsoluteSymbols=nullptr)
Creates a DynamicLibrarySearchGenerator that searches for symbols in the current process.
An ExecutionSession represents a running JIT program.
const Triple & getTargetTriple() const
Return the triple for the executor.
Represents an address in the executor process.
uint64_t getValue() const
Represents a defining location for a JIT symbol.
const JITSymbolFlags & getFlags() const
const ExecutorAddr & getAddress() const
Interface for layers that accept LLVM IR.
Base class for managing collections of named indirect stubs.
Represents a JIT'd dynamic library.
A utility class for building TargetMachines for JITs.
static LLVM_ABI Expected< JITTargetMachineBuilder > detectHost()
Create a JITTargetMachineBuilder for the host system.
Constructs LLJIT instances.
A pre-fabricated ORC JIT stack that can serve as an alternative to MCJIT.
Manages a set of 'lazy call-through' trampolines.
Wraps state for a lookup-in-progress.
Tracks responsibility for materialization, and mediates interactions between MaterializationUnits and...
A MaterializationUnit represents a set of symbol definitions that can be materialized as a group,...
MaterializationUnit(Interface I)
SymbolStringPtr InitSymbol
Interface for Layers that accept object files.
An ObjectLayer implementation built on JITLink.
static InProgressLookupState * extractLookupState(LookupState &LS)
static void resetLookupState(LookupState &LS, InProgressLookupState *IPLS)
API to remove / transfer ownership of JIT resources.
LLVM_ABI void transferTo(ResourceTracker &DstRT)
Transfer all resources associated with this key to the given tracker, which must target the same JITD...
LLVM_ABI Error remove()
Remove all resources associated with this key.
static Expected< std::unique_ptr< StaticLibraryDefinitionGenerator > > Load(ObjectLayer &L, const char *FileName, VisitMembersFunction VisitMembers=VisitMembersFunction(), GetObjectFileInterface GetObjFileInterface=GetObjectFileInterface())
Try to create a StaticLibraryDefinitionGenerator from the given path.
A set of symbols to look up, each associated with a SymbolLookupFlags value.
UnderlyingVector::size_type size() const
SymbolLookupSet & add(SymbolStringPtr Name, SymbolLookupFlags Flags=SymbolLookupFlags::RequiredSymbol)
Add an element to the set.
Provides unsafe access to ownership operations on SymbolStringPtr.
SymbolStringPool::PoolMapEntry PoolEntry
static SymbolStringPoolEntryUnsafe from(const SymbolStringPtrBase &S)
Create an unsafe pool entry ref without changing the ref-count.
static SymbolStringPoolEntryUnsafe take(SymbolStringPtr &&S)
Consumes the given SymbolStringPtr without releasing the pool entry.
String pool for symbol names used by the JIT.
Pointer to a pooled string representing a symbol name.
An LLVMContext together with an associated mutex that can be used to lock the context to prevent conc...
An LLVM Module together with a shared ThreadSafeContext.
struct LLVMOpaqueError * LLVMErrorRef
Opaque reference to an error instance.
void LLVMOrcDisposeLLJITBuilder(LLVMOrcLLJITBuilderRef Builder)
Dispose of an LLVMOrcLLJITBuilderRef.
LLVMErrorRef LLVMOrcLLJITAddObjectFile(LLVMOrcLLJITRef J, LLVMOrcJITDylibRef JD, LLVMMemoryBufferRef ObjBuffer)
Add a buffer representing an object file to the given JITDylib in the given LLJIT instance.
LLVMOrcIRTransformLayerRef LLVMOrcLLJITGetIRTransformLayer(LLVMOrcLLJITRef J)
Returns a non-owning reference to the LLJIT instance's IR transform layer.
struct LLVMOrcOpaqueLLJIT * LLVMOrcLLJITRef
A reference to an orc::LLJIT instance.
LLVMOrcObjectLayerRef(* LLVMOrcLLJITBuilderObjectLinkingLayerCreatorFunction)(void *Ctx, LLVMOrcExecutionSessionRef ES, const char *Triple)
A function for constructing an ObjectLinkingLayer instance to be used by an LLJIT instance.
LLVMOrcObjectLayerRef LLVMOrcLLJITGetObjLinkingLayer(LLVMOrcLLJITRef J)
Returns a non-owning reference to the LLJIT instance's object linking layer.
LLVMErrorRef LLVMOrcLLJITAddLLVMIRModuleWithRT(LLVMOrcLLJITRef J, LLVMOrcResourceTrackerRef RT, LLVMOrcThreadSafeModuleRef TSM)
Add an IR module to the given ResourceTracker's JITDylib in the given LLJIT instance.
void LLVMOrcLLJITBuilderSetObjectLinkingLayerCreator(LLVMOrcLLJITBuilderRef Builder, LLVMOrcLLJITBuilderObjectLinkingLayerCreatorFunction F, void *Ctx)
Set an ObjectLinkingLayer creator function for this LLJIT instance.
const char * LLVMOrcLLJITGetTripleString(LLVMOrcLLJITRef J)
Return the target triple for this LLJIT instance.
const char * LLVMOrcLLJITGetDataLayoutStr(LLVMOrcLLJITRef J)
Get the LLJIT instance's default data layout string.
LLVMOrcJITDylibRef LLVMOrcLLJITGetMainJITDylib(LLVMOrcLLJITRef J)
Return a reference to the Main JITDylib.
LLVMErrorRef LLVMOrcLLJITLookup(LLVMOrcLLJITRef J, LLVMOrcJITTargetAddress *Result, const char *Name)
Look up the given symbol in the main JITDylib of the given LLJIT instance.
LLVMOrcSymbolStringPoolEntryRef LLVMOrcLLJITMangleAndIntern(LLVMOrcLLJITRef J, const char *UnmangledName)
Mangles the given string according to the LLJIT instance's DataLayout, then interns the result in the...
LLVMErrorRef LLVMOrcLLJITAddLLVMIRModule(LLVMOrcLLJITRef J, LLVMOrcJITDylibRef JD, LLVMOrcThreadSafeModuleRef TSM)
Add an IR module to the given JITDylib in the given LLJIT instance.
struct LLVMOrcOpaqueLLJITBuilder * LLVMOrcLLJITBuilderRef
A reference to an orc::LLJITBuilder instance.
LLVMErrorRef LLVMOrcDisposeLLJIT(LLVMOrcLLJITRef J)
Dispose of an LLJIT instance.
char LLVMOrcLLJITGetGlobalPrefix(LLVMOrcLLJITRef J)
Returns the global prefix character according to the LLJIT's DataLayout.
void LLVMOrcLLJITBuilderSetJITTargetMachineBuilder(LLVMOrcLLJITBuilderRef Builder, LLVMOrcJITTargetMachineBuilderRef JTMB)
Set the JITTargetMachineBuilder to be used when constructing the LLJIT instance.
LLVMOrcLLJITBuilderRef LLVMOrcCreateLLJITBuilder(void)
Create an LLVMOrcLLJITBuilder.
LLVMErrorRef LLVMOrcCreateLLJIT(LLVMOrcLLJITRef *Result, LLVMOrcLLJITBuilderRef Builder)
Create an LLJIT instance from an LLJITBuilder.
LLVMOrcExecutionSessionRef LLVMOrcLLJITGetExecutionSession(LLVMOrcLLJITRef J)
Get a reference to the ExecutionSession for this LLJIT instance.
LLVMErrorRef LLVMOrcLLJITAddObjectFileWithRT(LLVMOrcLLJITRef J, LLVMOrcResourceTrackerRef RT, LLVMMemoryBufferRef ObjBuffer)
Add a buffer representing an object file to the given ResourceTracker's JITDylib in the given LLJIT i...
LLVMOrcObjectTransformLayerRef LLVMOrcLLJITGetObjTransformLayer(LLVMOrcLLJITRef J)
Returns a non-owning reference to the LLJIT instance's object linking layer.
void LLVMOrcRTDyldObjectLinkingLayerRegisterJITEventListener(LLVMOrcObjectLayerRef RTDyldObjLinkingLayer, LLVMJITEventListenerRef Listener)
Add the given listener to the given RTDyldObjectLinkingLayer.
LLVMErrorRef LLVMOrcCreateObjectLinkingLayerWithInProcessMemoryManager(LLVMOrcObjectLayerRef *Result, LLVMOrcExecutionSessionRef ES)
Create a ObjectLinkingLayer instance using the standard JITLink InProcessMemoryManager for memory man...
LLVMOrcObjectLayerRef LLVMOrcCreateRTDyldObjectLinkingLayerWithSectionMemoryManager(LLVMOrcExecutionSessionRef ES)
Create a RTDyldObjectLinkingLayer instance using the standard SectionMemoryManager for memory managem...
LLVMOrcObjectLayerRef LLVMOrcCreateRTDyldObjectLinkingLayerWithMCJITMemoryManagerLikeCallbacks(LLVMOrcExecutionSessionRef ES, void *CreateContextCtx, LLVMMemoryManagerCreateContextCallback CreateContext, LLVMMemoryManagerNotifyTerminatingCallback NotifyTerminating, LLVMMemoryManagerAllocateCodeSectionCallback AllocateCodeSection, LLVMMemoryManagerAllocateDataSectionCallback AllocateDataSection, LLVMMemoryManagerFinalizeMemoryCallback FinalizeMemory, LLVMMemoryManagerDestroyCallback Destroy)
Create a RTDyldObjectLinkingLayer instance using MCJIT-memory-manager-like callbacks.
uint64_t LLVMOrcJITTargetAddress
Represents an address in the executor process.
void LLVMOrcObjectTransformLayerSetTransform(LLVMOrcObjectTransformLayerRef ObjTransformLayer, LLVMOrcObjectTransformLayerTransformFunction TransformFunction, void *Ctx)
Set the transform function on an LLVMOrcObjectTransformLayer.
void LLVMOrcDisposeDefinitionGenerator(LLVMOrcDefinitionGeneratorRef DG)
Dispose of a JITDylib::DefinitionGenerator.
LLVMErrorRef(* LLVMOrcGenericIRModuleOperationFunction)(void *Ctx, LLVMModuleRef M)
A function for inspecting/mutating IR modules, suitable for use with LLVMOrcThreadSafeModuleWithModul...
LLVMErrorRef LLVMOrcCreateStaticLibrarySearchGeneratorForPath(LLVMOrcDefinitionGeneratorRef *Result, LLVMOrcObjectLayerRef ObjLayer, const char *FileName)
Get a LLVMOrcCreateStaticLibrarySearchGeneratorForPath that will reflect static library symbols into ...
void LLVMOrcDisposeSymbols(LLVMOrcSymbolStringPoolEntryRef *Symbols)
Disposes of the passed LLVMOrcSymbolStringPoolEntryRef* .
LLVMOrcLookupKind
Lookup kind.
void LLVMOrcDisposeLazyCallThroughManager(LLVMOrcLazyCallThroughManagerRef LCM)
Dispose of an LazyCallThroughManager.
struct LLVMOrcOpaqueObjectTransformLayer * LLVMOrcObjectTransformLayerRef
A reference to an orc::ObjectTransformLayer instance.
LLVMErrorRef LLVMOrcCreateDynamicLibrarySearchGeneratorForPath(LLVMOrcDefinitionGeneratorRef *Result, const char *FileName, char GlobalPrefix, LLVMOrcSymbolPredicate Filter, void *FilterCtx)
Get a LLVMOrcCreateDynamicLibararySearchGeneratorForPath that will reflect library symbols into the J...
void LLVMOrcDisposeThreadSafeModule(LLVMOrcThreadSafeModuleRef TSM)
Dispose of a ThreadSafeModule.
LLVMOrcDumpObjectsRef LLVMOrcCreateDumpObjects(const char *DumpDir, const char *IdentifierOverride)
Create a DumpObjects instance.
LLVMErrorRef LLVMOrcJITDylibDefine(LLVMOrcJITDylibRef JD, LLVMOrcMaterializationUnitRef MU)
Add the given MaterializationUnit to the given JITDylib.
LLVMErrorRef(* LLVMOrcObjectTransformLayerTransformFunction)(void *Ctx, LLVMMemoryBufferRef *ObjInOut)
A function for applying transformations to an object file buffer.
LLVMOrcSymbolStringPoolEntryRef LLVMOrcMaterializationResponsibilityGetInitializerSymbol(LLVMOrcMaterializationResponsibilityRef MR)
Returns the initialization pseudo-symbol, if any.
void LLVMOrcReleaseSymbolStringPoolEntry(LLVMOrcSymbolStringPoolEntryRef S)
Reduces the ref-count for of a SymbolStringPool entry.
LLVMOrcCSymbolFlagsMapPair * LLVMOrcCSymbolFlagsMapPairs
Represents a list of (SymbolStringPtr, JITSymbolFlags) pairs that can be used to construct a SymbolFl...
void LLVMOrcDisposeIndirectStubsManager(LLVMOrcIndirectStubsManagerRef ISM)
Dispose of an IndirectStubsManager.
void LLVMOrcResourceTrackerTransferTo(LLVMOrcResourceTrackerRef SrcRT, LLVMOrcResourceTrackerRef DstRT)
Transfers tracking of all resources associated with resource tracker SrcRT to resource tracker DstRT.
LLVMOrcMaterializationUnitRef LLVMOrcCreateCustomMaterializationUnit(const char *Name, void *Ctx, LLVMOrcCSymbolFlagsMapPairs Syms, size_t NumSyms, LLVMOrcSymbolStringPoolEntryRef InitSym, LLVMOrcMaterializationUnitMaterializeFunction Materialize, LLVMOrcMaterializationUnitDiscardFunction Discard, LLVMOrcMaterializationUnitDestroyFunction Destroy)
Create a custom MaterializationUnit.
LLVMOrcMaterializationUnitRef LLVMOrcLazyReexports(LLVMOrcLazyCallThroughManagerRef LCTM, LLVMOrcIndirectStubsManagerRef ISM, LLVMOrcJITDylibRef SourceJD, LLVMOrcCSymbolAliasMapPairs CallableAliases, size_t NumPairs)
Create a MaterializationUnit to define lazy re-expots.
LLVMErrorRef LLVMOrcMaterializationResponsibilityNotifyEmitted(LLVMOrcMaterializationResponsibilityRef MR, LLVMOrcCSymbolDependenceGroup *SymbolDepGroups, size_t NumSymbolDepGroups)
Notifies the target JITDylib (and any pending queries on that JITDylib) that all symbols covered by t...
LLVMOrcCSymbolAliasMapPair * LLVMOrcCSymbolAliasMapPairs
Represents a list of (SymbolStringPtr, (SymbolStringPtr, JITSymbolFlags)) pairs that can be used to c...
LLVMOrcCSymbolMapPair * LLVMOrcCSymbolMapPairs
Represents a list of (SymbolStringPtr, JITEvaluatedSymbol) pairs that can be used to construct a Symb...
void LLVMOrcJITDylibAddGenerator(LLVMOrcJITDylibRef JD, LLVMOrcDefinitionGeneratorRef DG)
Add a DefinitionGenerator to the given JITDylib.
LLVMErrorRef LLVMOrcExecutionSessionCreateJITDylib(LLVMOrcExecutionSessionRef ES, LLVMOrcJITDylibRef *Result, const char *Name)
Create a JITDylib.
struct LLVMOrcOpaqueJITTargetMachineBuilder * LLVMOrcJITTargetMachineBuilderRef
A reference to an orc::JITTargetMachineBuilder instance.
LLVMOrcJITDylibRef LLVMOrcMaterializationResponsibilityGetTargetDylib(LLVMOrcMaterializationResponsibilityRef MR)
Returns the target JITDylib that these symbols are being materialized into.
void LLVMOrcRetainSymbolStringPoolEntry(LLVMOrcSymbolStringPoolEntryRef S)
Increments the ref-count for a SymbolStringPool entry.
LLVMErrorRef LLVMOrcMaterializationResponsibilityReplace(LLVMOrcMaterializationResponsibilityRef MR, LLVMOrcMaterializationUnitRef MU)
Transfers responsibility to the given MaterializationUnit for all symbols defined by that Materializa...
void LLVMOrcObjectLayerEmit(LLVMOrcObjectLayerRef ObjLayer, LLVMOrcMaterializationResponsibilityRef R, LLVMMemoryBufferRef ObjBuffer)
Emit an object buffer to an ObjectLayer.
LLVMOrcThreadSafeContextRef LLVMOrcCreateNewThreadSafeContextFromLLVMContext(LLVMContextRef Ctx)
Create a ThreadSafeContextRef from a given LLVMContext, which must not be associated with any existin...
char * LLVMOrcJITTargetMachineBuilderGetTargetTriple(LLVMOrcJITTargetMachineBuilderRef JTMB)
Returns the target triple for the given JITTargetMachineBuilder as a string.
void LLVMOrcLookupStateContinueLookup(LLVMOrcLookupStateRef S, LLVMErrorRef Err)
Continue a lookup that was suspended in a generator (see LLVMOrcCAPIDefinitionGeneratorTryToGenerateF...
LLVMErrorRef LLVMOrcObjectLayerAddObjectFileWithRT(LLVMOrcObjectLayerRef ObjLayer, LLVMOrcResourceTrackerRef RT, LLVMMemoryBufferRef ObjBuffer)
Add an object to an ObjectLayer using the given ResourceTracker.
void(* LLVMOrcErrorReporterFunction)(void *Ctx, LLVMErrorRef Err)
Error reporter function.
void LLVMOrcDisposeObjectLayer(LLVMOrcObjectLayerRef ObjLayer)
Dispose of an ObjectLayer.
void LLVMOrcExecutionSessionLookup(LLVMOrcExecutionSessionRef ES, LLVMOrcLookupKind K, LLVMOrcCJITDylibSearchOrder SearchOrder, size_t SearchOrderSize, LLVMOrcCLookupSet Symbols, size_t SymbolsSize, LLVMOrcExecutionSessionLookupHandleResultFunction HandleResult, void *Ctx)
Look up symbols in an execution session.
struct LLVMOrcOpaqueMaterializationResponsibility * LLVMOrcMaterializationResponsibilityRef
A reference to a uniquely owned orc::MaterializationResponsibility instance.
void LLVMOrcDisposeMaterializationResponsibility(LLVMOrcMaterializationResponsibilityRef MR)
Disposes of the passed MaterializationResponsibility object.
LLVMOrcCSymbolFlagsMapPairs LLVMOrcMaterializationResponsibilityGetSymbols(LLVMOrcMaterializationResponsibilityRef MR, size_t *NumPairs)
Returns the symbol flags map for this responsibility instance.
LLVMOrcJITTargetMachineBuilderRef LLVMOrcJITTargetMachineBuilderCreateFromTargetMachine(LLVMTargetMachineRef TM)
Create a JITTargetMachineBuilder from the given TargetMachine template.
void(* LLVMOrcDisposeCAPIDefinitionGeneratorFunction)(void *Ctx)
Disposer for a custom generator.
struct LLVMOrcOpaqueThreadSafeModule * LLVMOrcThreadSafeModuleRef
A reference to an orc::ThreadSafeModule instance.
struct LLVMOrcOpaqueExecutionSession * LLVMOrcExecutionSessionRef
A reference to an orc::ExecutionSession instance.
LLVMOrcMaterializationUnitRef LLVMOrcAbsoluteSymbols(LLVMOrcCSymbolMapPairs Syms, size_t NumPairs)
Create a MaterializationUnit to define the given symbols as pointing to the corresponding raw address...
struct LLVMOrcOpaqueIndirectStubsManager * LLVMOrcIndirectStubsManagerRef
A reference to an orc::IndirectStubsManager instance.
void(* LLVMOrcExecutionSessionLookupHandleResultFunction)(LLVMErrorRef Err, LLVMOrcCSymbolMapPairs Result, size_t NumPairs, void *Ctx)
Callback type for ExecutionSession lookups.
LLVMErrorRef LLVMOrcJITDylibClear(LLVMOrcJITDylibRef JD)
Calls remove on all trackers associated with this JITDylib, see JITDylib::clear().
LLVMOrcThreadSafeModuleRef LLVMOrcCreateNewThreadSafeModule(LLVMModuleRef M, LLVMOrcThreadSafeContextRef TSCtx)
Create a ThreadSafeModule wrapper around the given LLVM module.
void LLVMOrcReleaseResourceTracker(LLVMOrcResourceTrackerRef RT)
Reduces the ref-count of a ResourceTracker.
LLVMOrcSymbolStringPoolRef LLVMOrcExecutionSessionGetSymbolStringPool(LLVMOrcExecutionSessionRef ES)
Return a reference to the SymbolStringPool for an ExecutionSession.
void LLVMOrcSymbolStringPoolClearDeadEntries(LLVMOrcSymbolStringPoolRef SSP)
Clear all unreferenced symbol string pool entries.
LLVMOrcExecutionSessionRef LLVMOrcMaterializationResponsibilityGetExecutionSession(LLVMOrcMaterializationResponsibilityRef MR)
Returns the ExecutionSession for this MaterializationResponsibility.
LLVMOrcIndirectStubsManagerRef LLVMOrcCreateLocalIndirectStubsManager(const char *TargetTriple)
Create a LocalIndirectStubsManager from the given target triple.
LLVMErrorRef LLVMOrcJITTargetMachineBuilderDetectHost(LLVMOrcJITTargetMachineBuilderRef *Result)
Create a JITTargetMachineBuilder by detecting the host.
LLVMErrorRef(* LLVMOrcCAPIDefinitionGeneratorTryToGenerateFunction)(LLVMOrcDefinitionGeneratorRef GeneratorObj, void *Ctx, LLVMOrcLookupStateRef *LookupState, LLVMOrcLookupKind Kind, LLVMOrcJITDylibRef JD, LLVMOrcJITDylibLookupFlags JDLookupFlags, LLVMOrcCLookupSet LookupSet, size_t LookupSetSize)
A custom generator function.
void LLVMOrcIRTransformLayerEmit(LLVMOrcIRTransformLayerRef IRLayer, LLVMOrcMaterializationResponsibilityRef MR, LLVMOrcThreadSafeModuleRef TSM)
LLVMOrcCJITDylibSearchOrderElement * LLVMOrcCJITDylibSearchOrder
A JITDylib search order.
LLVMErrorRef(* LLVMOrcIRTransformLayerTransformFunction)(void *Ctx, LLVMOrcThreadSafeModuleRef *ModInOut, LLVMOrcMaterializationResponsibilityRef MR)
A function for applying transformations as part of an transform layer.
struct LLVMOrcOpaqueSymbolStringPool * LLVMOrcSymbolStringPoolRef
A reference to an orc::SymbolStringPool.
void(* LLVMOrcMaterializationUnitDestroyFunction)(void *Ctx)
A MaterializationUnit destruction callback.
void LLVMOrcDisposeDumpObjects(LLVMOrcDumpObjectsRef DumpObjects)
Dispose of a DumpObjects instance.
struct LLVMOrcOpaqueResourceTracker * LLVMOrcResourceTrackerRef
A reference to an orc::ResourceTracker instance.
void LLVMOrcIRTransformLayerSetTransform(LLVMOrcIRTransformLayerRef IRTransformLayer, LLVMOrcIRTransformLayerTransformFunction TransformFunction, void *Ctx)
Set the transform function of the provided transform layer, passing through a pointer to user provide...
void LLVMOrcDisposeThreadSafeContext(LLVMOrcThreadSafeContextRef TSCtx)
Dispose of a ThreadSafeContext.
LLVMOrcCDependenceMapPair * LLVMOrcCDependenceMapPairs
Represents a list of (JITDylibRef, (LLVMOrcSymbolStringPoolEntryRef*, size_t)) pairs that can be used...
const char * LLVMOrcSymbolStringPoolEntryStr(LLVMOrcSymbolStringPoolEntryRef S)
Return the c-string for the given symbol.
LLVMErrorRef LLVMOrcThreadSafeModuleWithModuleDo(LLVMOrcThreadSafeModuleRef TSM, LLVMOrcGenericIRModuleOperationFunction F, void *Ctx)
Apply the given function to the module contained in this ThreadSafeModule.
LLVMErrorRef LLVMOrcObjectLayerAddObjectFile(LLVMOrcObjectLayerRef ObjLayer, LLVMOrcJITDylibRef JD, LLVMMemoryBufferRef ObjBuffer)
Add an object to an ObjectLayer to the given JITDylib.
LLVMErrorRef LLVMOrcMaterializationResponsibilityDelegate(LLVMOrcMaterializationResponsibilityRef MR, LLVMOrcSymbolStringPoolEntryRef *Symbols, size_t NumSymbols, LLVMOrcMaterializationResponsibilityRef *Result)
Delegates responsibility for the given symbols to the returned materialization responsibility.
LLVMOrcCLookupSetElement * LLVMOrcCLookupSet
A set of symbols to look up / generate.
LLVMOrcResourceTrackerRef LLVMOrcJITDylibCreateResourceTracker(LLVMOrcJITDylibRef JD)
Return a reference to a newly created resource tracker associated with JD.
struct LLVMOrcOpaqueObjectLayer * LLVMOrcObjectLayerRef
A reference to an orc::ObjectLayer instance.
int(* LLVMOrcSymbolPredicate)(void *Ctx, LLVMOrcSymbolStringPoolEntryRef Sym)
Predicate function for SymbolStringPoolEntries.
void LLVMOrcDisposeJITTargetMachineBuilder(LLVMOrcJITTargetMachineBuilderRef JTMB)
Dispose of a JITTargetMachineBuilder.
void LLVMOrcJITTargetMachineBuilderSetTargetTriple(LLVMOrcJITTargetMachineBuilderRef JTMB, const char *TargetTriple)
Sets the target triple for the given JITTargetMachineBuilder to the given string.
struct LLVMOrcOpaqueDefinitionGenerator * LLVMOrcDefinitionGeneratorRef
A reference to an orc::DefinitionGenerator.
LLVMOrcJITDylibRef LLVMOrcExecutionSessionGetJITDylibByName(LLVMOrcExecutionSessionRef ES, const char *Name)
Returns the JITDylib with the given name, or NULL if no such JITDylib exists.
void LLVMOrcMaterializationResponsibilityFailMaterialization(LLVMOrcMaterializationResponsibilityRef MR)
Notify all not-yet-emitted covered by this MaterializationResponsibility instance that an error has o...
struct LLVMOrcOpaqueSymbolStringPoolEntry * LLVMOrcSymbolStringPoolEntryRef
A reference to an orc::SymbolStringPool table entry.
void LLVMOrcDisposeCSymbolFlagsMap(LLVMOrcCSymbolFlagsMapPairs Pairs)
Disposes of the passed LLVMOrcCSymbolFlagsMap.
LLVMErrorRef LLVMOrcMaterializationResponsibilityDefineMaterializing(LLVMOrcMaterializationResponsibilityRef MR, LLVMOrcCSymbolFlagsMapPairs Syms, size_t NumSyms)
Attempt to claim responsibility for new definitions.
LLVMOrcThreadSafeContextRef LLVMOrcCreateNewThreadSafeContext(void)
Create a ThreadSafeContextRef containing a new LLVMContext.
void(* LLVMOrcMaterializationUnitDiscardFunction)(void *Ctx, LLVMOrcJITDylibRef JD, LLVMOrcSymbolStringPoolEntryRef Symbol)
A MaterializationUnit discard callback.
LLVMOrcResourceTrackerRef LLVMOrcJITDylibGetDefaultResourceTracker(LLVMOrcJITDylibRef JD)
Return a reference to the default resource tracker for the given JITDylib.
LLVMOrcSymbolStringPoolEntryRef * LLVMOrcMaterializationResponsibilityGetRequestedSymbols(LLVMOrcMaterializationResponsibilityRef MR, size_t *NumSymbols)
Returns the names of any symbols covered by this MaterializationResponsibility object that have queri...
void(* LLVMOrcMaterializationUnitMaterializeFunction)(void *Ctx, LLVMOrcMaterializationResponsibilityRef MR)
A MaterializationUnit materialize callback.
struct LLVMOrcOpaqueDumpObjects * LLVMOrcDumpObjectsRef
A reference to an orc::DumpObjects object.
LLVMErrorRef LLVMOrcCreateDynamicLibrarySearchGeneratorForProcess(LLVMOrcDefinitionGeneratorRef *Result, char GlobalPrefix, LLVMOrcSymbolPredicate Filter, void *FilterCtx)
Get a DynamicLibrarySearchGenerator that will reflect process symbols into the JITDylib.
struct LLVMOrcOpaqueIRTransformLayer * LLVMOrcIRTransformLayerRef
A reference to an orc::IRTransformLayer instance.
struct LLVMOrcOpaqueLookupState * LLVMOrcLookupStateRef
An opaque lookup state object.
LLVMOrcDefinitionGeneratorRef LLVMOrcCreateCustomCAPIDefinitionGenerator(LLVMOrcCAPIDefinitionGeneratorTryToGenerateFunction F, void *Ctx, LLVMOrcDisposeCAPIDefinitionGeneratorFunction Dispose)
Create a custom generator.
LLVMErrorRef LLVMOrcMaterializationResponsibilityNotifyResolved(LLVMOrcMaterializationResponsibilityRef MR, LLVMOrcCSymbolMapPairs Symbols, size_t NumSymbols)
Notifies the target JITDylib that the given symbols have been resolved.
LLVMErrorRef LLVMOrcCreateLocalLazyCallThroughManager(const char *TargetTriple, LLVMOrcExecutionSessionRef ES, LLVMOrcJITTargetAddress ErrorHandlerAddr, LLVMOrcLazyCallThroughManagerRef *Result)
void LLVMOrcDisposeMaterializationUnit(LLVMOrcMaterializationUnitRef MU)
Dispose of a MaterializationUnit.
LLVMErrorRef LLVMOrcResourceTrackerRemove(LLVMOrcResourceTrackerRef RT)
Remove all resources associated with the given tracker.
struct LLVMOrcOpaqueMaterializationUnit * LLVMOrcMaterializationUnitRef
A reference to a uniquely owned orc::MaterializationUnit instance.
LLVMOrcJITDylibRef LLVMOrcExecutionSessionCreateBareJITDylib(LLVMOrcExecutionSessionRef ES, const char *Name)
Create a "bare" JITDylib.
LLVMOrcSymbolStringPoolEntryRef LLVMOrcExecutionSessionIntern(LLVMOrcExecutionSessionRef ES, const char *Name)
Intern a string in the ExecutionSession's SymbolStringPool and return a reference to it.
void LLVMOrcExecutionSessionSetErrorReporter(LLVMOrcExecutionSessionRef ES, LLVMOrcErrorReporterFunction ReportError, void *Ctx)
Attach a custom error reporter function to the ExecutionSession.
LLVMErrorRef LLVMOrcDumpObjects_CallOperator(LLVMOrcDumpObjectsRef DumpObjects, LLVMMemoryBufferRef *ObjBuffer)
Dump the contents of the given MemoryBuffer.
struct LLVMOrcOpaqueJITDylib * LLVMOrcJITDylibRef
A reference to an orc::JITDylib instance.
struct LLVMOrcOpaqueThreadSafeContext * LLVMOrcThreadSafeContextRef
A reference to an orc::ThreadSafeContext instance.
LLVMOrcJITDylibLookupFlags
JITDylib lookup flags.
@ LLVMOrcLookupKindStatic
@ LLVMJITSymbolGenericFlagsWeak
@ LLVMJITSymbolGenericFlagsExported
@ LLVMJITSymbolGenericFlagsCallable
@ LLVMJITSymbolGenericFlagsMaterializationSideEffectsOnly
@ LLVMOrcSymbolLookupFlagsRequiredSymbol
@ LLVMOrcSymbolLookupFlagsWeaklyReferencedSymbol
@ LLVMOrcJITDylibLookupFlagsMatchAllSymbols
@ LLVMOrcJITDylibLookupFlagsMatchExportedSymbolsOnly
void(* LLVMMemoryManagerDestroyCallback)(void *Opaque)
LLVMBool(* LLVMMemoryManagerFinalizeMemoryCallback)(void *Opaque, char **ErrMsg)
uint8_t *(* LLVMMemoryManagerAllocateDataSectionCallback)(void *Opaque, uintptr_t Size, unsigned Alignment, unsigned SectionID, const char *SectionName, LLVMBool IsReadOnly)
uint8_t *(* LLVMMemoryManagerAllocateCodeSectionCallback)(void *Opaque, uintptr_t Size, unsigned Alignment, unsigned SectionID, const char *SectionName)
struct LLVMOpaqueMemoryBuffer * LLVMMemoryBufferRef
LLVM uses a polymorphic type hierarchy which C cannot represent, therefore parameters must be passed ...
struct LLVMOpaqueContext * LLVMContextRef
The top-level container for all LLVM global data.
struct LLVMOpaqueModule * LLVMModuleRef
The top-level container for all other LLVM Intermediate Representation (IR) objects.
struct LLVMOpaqueJITEventListener * LLVMJITEventListenerRef
struct LLVMOpaqueTargetMachine * LLVMTargetMachineRef
LLVM_C_ABI void LLVMDisposeTargetMachine(LLVMTargetMachineRef T)
Dispose the LLVMTargetMachineRef instance generated by LLVMCreateTargetMachine.
#define llvm_unreachable(msg)
Marks that the current location is not supposed to be reachable.
static LLVMJITEvaluatedSymbol fromExecutorSymbolDef(const ExecutorSymbolDef &S)
static JITSymbolFlags toJITSymbolFlags(LLVMJITSymbolFlags F)
static SymbolNameSet toSymbolNameSet(LLVMOrcCSymbolsList Symbols)
static JITDylibLookupFlags toJITDylibLookupFlags(LLVMOrcJITDylibLookupFlags LF)
static LLVMOrcSymbolLookupFlags fromSymbolLookupFlags(SymbolLookupFlags SLF)
static SymbolMap toSymbolMap(LLVMOrcCSymbolMapPairs Syms, size_t NumPairs)
static LLVMOrcLookupKind fromLookupKind(LookupKind K)
static LLVMOrcJITDylibLookupFlags fromJITDylibLookupFlags(JITDylibLookupFlags LF)
static SymbolDependenceMap toSymbolDependenceMap(LLVMOrcCDependenceMapPairs Pairs, size_t NumPairs)
static LookupKind toLookupKind(LLVMOrcLookupKind K)
static SymbolLookupFlags toSymbolLookupFlags(LLVMOrcSymbolLookupFlags SLF)
static LLVMJITSymbolFlags fromJITSymbolFlags(JITSymbolFlags JSF)
std::vector< std::pair< JITDylib *, JITDylibLookupFlags > > JITDylibSearchOrder
A list of (JITDylib*, JITDylibLookupFlags) pairs to be used as a search order during symbol lookup.
IntrusiveRefCntPtr< ResourceTracker > ResourceTrackerSP
std::unique_ptr< AbsoluteSymbolsMaterializationUnit > absoluteSymbols(SymbolMap Symbols)
Create an AbsoluteSymbolsMaterializationUnit with the given symbols.
SymbolLookupFlags
Lookup flags that apply to each symbol in a lookup.
JITDylibLookupFlags
Lookup flags that apply to each dylib in the search order for a lookup.
@ MatchExportedSymbolsOnly
DenseMap< SymbolStringPtr, ExecutorSymbolDef > SymbolMap
A map from symbol names (as SymbolStringPtrs) to JITSymbols (address/flags pairs).
LLVM_ABI std::function< std::unique_ptr< IndirectStubsManager >()> createLocalIndirectStubsManagerBuilder(const Triple &T)
Create a local indirect stubs manager builder.
LLVM_ABI Expected< std::unique_ptr< LazyCallThroughManager > > createLocalLazyCallThroughManager(const Triple &T, ExecutionSession &ES, ExecutorAddr ErrorHandlerAddr)
Create a LocalLazyCallThroughManager from the given triple and execution session.
std::unique_ptr< LazyReexportsMaterializationUnit > lazyReexports(LazyCallThroughManager &LCTManager, RedirectableSymbolManager &RSManager, JITDylib &SourceJD, SymbolAliasMap CallableAliases, ImplSymbolMap *SrcJDLoc=nullptr)
Define lazy-reexports based on the given SymbolAliasMap.
LookupKind
Describes the kind of lookup being performed.
LLVM_ABI RegisterDependenciesFunction NoDependenciesToRegister
This can be used as the value for a RegisterDependenciesFunction if there are no dependants to regist...
DenseMap< JITDylib *, SymbolNameSet > SymbolDependenceMap
A map from JITDylibs to sets of symbols.
DenseSet< SymbolStringPtr > SymbolNameSet
A set of symbol names (represented by SymbolStringPtrs for.
@ Ready
Emitted to memory, but waiting on transitive dependencies.
DenseMap< SymbolStringPtr, SymbolAliasMapEntry > SymbolAliasMap
A map of Symbols to (Symbol, Flags) pairs.
DenseMap< SymbolStringPtr, JITSymbolFlags > SymbolFlagsMap
A map from symbol names (as SymbolStringPtrs) to JITSymbolFlags.
This is an optimization pass for GlobalISel generic memory operations.
decltype(auto) get(const PointerIntPair< PointerTy, IntBits, IntType, PtrTraits, Info > &Pair)
LLVM_ATTRIBUTE_RETURNS_NONNULL void * safe_malloc(size_t Sz)
Attribute unwrap(LLVMAttributeRef Attr)
void replace(R &&Range, const T &OldValue, const T &NewValue)
Provide wrappers to std::replace which take ranges instead of having to pass begin/end explicitly.
OutputIt move(R &&Range, OutputIt Out)
Provide wrappers to std::move which take ranges instead of having to pass begin/end explicitly.
LLVMAttributeRef wrap(Attribute Attr)
Implement std::hash so that hash_code can be used in STL containers.
void swap(llvm::BitVector &LHS, llvm::BitVector &RHS)
Implement std::swap in terms of BitVector swap.
Represents an evaluated symbol address and flags.
Represents the linkage flags for a symbol definition.
LLVMOrcCSymbolsList Names
A set of symbols that share dependencies.
Represents a pair of a symbol name and LLVMJITSymbolFlags.
Represents a pair of a symbol name and an evaluated symbol.
Represents a list of LLVMOrcSymbolStringPoolEntryRef and the associated length.
LLVMOrcSymbolStringPoolEntryRef * Symbols
A set of symbols and the their dependencies.