Path: blob/main/contrib/llvm-project/llvm/include/llvm-c/Orc.h
35233 views
/*===---------------- llvm-c/Orc.h - OrcV2 C bindings -----------*- C++ -*-===*\1|* *|2|* Part of the LLVM Project, under the Apache License v2.0 with LLVM *|3|* Exceptions. *|4|* See https://llvm.org/LICENSE.txt for license information. *|5|* SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception *|6|* *|7|*===----------------------------------------------------------------------===*|8|* *|9|* This header declares the C interface to libLLVMOrcJIT.a, which implements *|10|* JIT compilation of LLVM IR. Minimal documentation of C API specific issues *|11|* (especially memory ownership rules) is provided. Core Orc concepts are *|12|* documented in llvm/docs/ORCv2.rst and APIs are documented in the C++ *|13|* headers *|14|* *|15|* Many exotic languages can interoperate with C code but have a harder time *|16|* with C++ due to name mangling. So in addition to C, this interface enables *|17|* tools written in such languages. *|18|* *|19|* Note: This interface is experimental. It is *NOT* stable, and may be *|20|* changed without warning. Only C API usage documentation is *|21|* provided. See the C++ documentation for all higher level ORC API *|22|* details. *|23|* *|24\*===----------------------------------------------------------------------===*/2526#ifndef LLVM_C_ORC_H27#define LLVM_C_ORC_H2829#include "llvm-c/Error.h"30#include "llvm-c/TargetMachine.h"31#include "llvm-c/Types.h"3233LLVM_C_EXTERN_C_BEGIN3435/**36* @defgroup LLVMCExecutionEngineORC On-Request-Compilation37* @ingroup LLVMCExecutionEngine38*39* @{40*/4142/**43* Represents an address in the executor process.44*/45typedef uint64_t LLVMOrcJITTargetAddress;4647/**48* Represents an address in the executor process.49*/50typedef uint64_t LLVMOrcExecutorAddress;5152/**53* Represents generic linkage flags for a symbol definition.54*/55typedef enum {56LLVMJITSymbolGenericFlagsNone = 0,57LLVMJITSymbolGenericFlagsExported = 1U << 0,58LLVMJITSymbolGenericFlagsWeak = 1U << 1,59LLVMJITSymbolGenericFlagsCallable = 1U << 2,60LLVMJITSymbolGenericFlagsMaterializationSideEffectsOnly = 1U << 361} LLVMJITSymbolGenericFlags;6263/**64* Represents target specific flags for a symbol definition.65*/66typedef uint8_t LLVMJITSymbolTargetFlags;6768/**69* Represents the linkage flags for a symbol definition.70*/71typedef struct {72uint8_t GenericFlags;73uint8_t TargetFlags;74} LLVMJITSymbolFlags;7576/**77* Represents an evaluated symbol address and flags.78*/79typedef struct {80LLVMOrcExecutorAddress Address;81LLVMJITSymbolFlags Flags;82} LLVMJITEvaluatedSymbol;8384/**85* A reference to an orc::ExecutionSession instance.86*/87typedef struct LLVMOrcOpaqueExecutionSession *LLVMOrcExecutionSessionRef;8889/**90* Error reporter function.91*/92typedef void (*LLVMOrcErrorReporterFunction)(void *Ctx, LLVMErrorRef Err);9394/**95* A reference to an orc::SymbolStringPool.96*/97typedef struct LLVMOrcOpaqueSymbolStringPool *LLVMOrcSymbolStringPoolRef;9899/**100* A reference to an orc::SymbolStringPool table entry.101*/102typedef struct LLVMOrcOpaqueSymbolStringPoolEntry103*LLVMOrcSymbolStringPoolEntryRef;104105/**106* Represents a pair of a symbol name and LLVMJITSymbolFlags.107*/108typedef struct {109LLVMOrcSymbolStringPoolEntryRef Name;110LLVMJITSymbolFlags Flags;111} LLVMOrcCSymbolFlagsMapPair;112113/**114* Represents a list of (SymbolStringPtr, JITSymbolFlags) pairs that can be used115* to construct a SymbolFlagsMap.116*/117typedef LLVMOrcCSymbolFlagsMapPair *LLVMOrcCSymbolFlagsMapPairs;118119/**120* Represents a pair of a symbol name and an evaluated symbol.121*/122typedef struct {123LLVMOrcSymbolStringPoolEntryRef Name;124LLVMJITEvaluatedSymbol Sym;125} LLVMOrcCSymbolMapPair;126127/**128* Represents a list of (SymbolStringPtr, JITEvaluatedSymbol) pairs that can be129* used to construct a SymbolMap.130*/131typedef LLVMOrcCSymbolMapPair *LLVMOrcCSymbolMapPairs;132133/**134* Represents a SymbolAliasMapEntry135*/136typedef struct {137LLVMOrcSymbolStringPoolEntryRef Name;138LLVMJITSymbolFlags Flags;139} LLVMOrcCSymbolAliasMapEntry;140141/**142* Represents a pair of a symbol name and SymbolAliasMapEntry.143*/144typedef struct {145LLVMOrcSymbolStringPoolEntryRef Name;146LLVMOrcCSymbolAliasMapEntry Entry;147} LLVMOrcCSymbolAliasMapPair;148149/**150* Represents a list of (SymbolStringPtr, (SymbolStringPtr, JITSymbolFlags))151* pairs that can be used to construct a SymbolFlagsMap.152*/153typedef LLVMOrcCSymbolAliasMapPair *LLVMOrcCSymbolAliasMapPairs;154155/**156* A reference to an orc::JITDylib instance.157*/158typedef struct LLVMOrcOpaqueJITDylib *LLVMOrcJITDylibRef;159160/**161* Represents a list of LLVMOrcSymbolStringPoolEntryRef and the associated162* length.163*/164typedef struct {165LLVMOrcSymbolStringPoolEntryRef *Symbols;166size_t Length;167} LLVMOrcCSymbolsList;168169/**170* Represents a pair of a JITDylib and LLVMOrcCSymbolsList.171*/172typedef struct {173LLVMOrcJITDylibRef JD;174LLVMOrcCSymbolsList Names;175} LLVMOrcCDependenceMapPair;176177/**178* Represents a list of (JITDylibRef, (LLVMOrcSymbolStringPoolEntryRef*,179* size_t)) pairs that can be used to construct a SymbolDependenceMap.180*/181typedef LLVMOrcCDependenceMapPair *LLVMOrcCDependenceMapPairs;182183/**184* A set of symbols that share dependencies.185*/186typedef struct {187LLVMOrcCSymbolsList Symbols;188LLVMOrcCDependenceMapPairs Dependencies;189size_t NumDependencies;190} LLVMOrcCSymbolDependenceGroup;191192/**193* Lookup kind. This can be used by definition generators when deciding whether194* to produce a definition for a requested symbol.195*196* This enum should be kept in sync with llvm::orc::LookupKind.197*/198typedef enum {199LLVMOrcLookupKindStatic,200LLVMOrcLookupKindDLSym201} LLVMOrcLookupKind;202203/**204* JITDylib lookup flags. This can be used by definition generators when205* deciding whether to produce a definition for a requested symbol.206*207* This enum should be kept in sync with llvm::orc::JITDylibLookupFlags.208*/209typedef enum {210LLVMOrcJITDylibLookupFlagsMatchExportedSymbolsOnly,211LLVMOrcJITDylibLookupFlagsMatchAllSymbols212} LLVMOrcJITDylibLookupFlags;213214/**215* An element type for a JITDylib search order.216*/217typedef struct {218LLVMOrcJITDylibRef JD;219LLVMOrcJITDylibLookupFlags JDLookupFlags;220} LLVMOrcCJITDylibSearchOrderElement;221222/**223* A JITDylib search order.224*225* The list is terminated with an element containing a null pointer for the JD226* field.227*/228typedef LLVMOrcCJITDylibSearchOrderElement *LLVMOrcCJITDylibSearchOrder;229230/**231* Symbol lookup flags for lookup sets. This should be kept in sync with232* llvm::orc::SymbolLookupFlags.233*/234typedef enum {235LLVMOrcSymbolLookupFlagsRequiredSymbol,236LLVMOrcSymbolLookupFlagsWeaklyReferencedSymbol237} LLVMOrcSymbolLookupFlags;238239/**240* An element type for a symbol lookup set.241*/242typedef struct {243LLVMOrcSymbolStringPoolEntryRef Name;244LLVMOrcSymbolLookupFlags LookupFlags;245} LLVMOrcCLookupSetElement;246247/**248* A set of symbols to look up / generate.249*250* The list is terminated with an element containing a null pointer for the251* Name field.252*253* If a client creates an instance of this type then they are responsible for254* freeing it, and for ensuring that all strings have been retained over the255* course of its life. Clients receiving a copy from a callback are not256* responsible for managing lifetime or retain counts.257*/258typedef LLVMOrcCLookupSetElement *LLVMOrcCLookupSet;259260/**261* A reference to a uniquely owned orc::MaterializationUnit instance.262*/263typedef struct LLVMOrcOpaqueMaterializationUnit *LLVMOrcMaterializationUnitRef;264265/**266* A reference to a uniquely owned orc::MaterializationResponsibility instance.267*268* Ownership must be passed to a lower-level layer in a JIT stack.269*/270typedef struct LLVMOrcOpaqueMaterializationResponsibility271*LLVMOrcMaterializationResponsibilityRef;272273/**274* A MaterializationUnit materialize callback.275*276* Ownership of the Ctx and MR arguments passes to the callback which must277* adhere to the LLVMOrcMaterializationResponsibilityRef contract (see comment278* for that type).279*280* If this callback is called then the LLVMOrcMaterializationUnitDestroy281* callback will NOT be called.282*/283typedef void (*LLVMOrcMaterializationUnitMaterializeFunction)(284void *Ctx, LLVMOrcMaterializationResponsibilityRef MR);285286/**287* A MaterializationUnit discard callback.288*289* Ownership of JD and Symbol remain with the caller: These arguments should290* not be disposed of or released.291*/292typedef void (*LLVMOrcMaterializationUnitDiscardFunction)(293void *Ctx, LLVMOrcJITDylibRef JD, LLVMOrcSymbolStringPoolEntryRef Symbol);294295/**296* A MaterializationUnit destruction callback.297*298* If a custom MaterializationUnit is destroyed before its Materialize299* function is called then this function will be called to provide an300* opportunity for the underlying program representation to be destroyed.301*/302typedef void (*LLVMOrcMaterializationUnitDestroyFunction)(void *Ctx);303304/**305* A reference to an orc::ResourceTracker instance.306*/307typedef struct LLVMOrcOpaqueResourceTracker *LLVMOrcResourceTrackerRef;308309/**310* A reference to an orc::DefinitionGenerator.311*/312typedef struct LLVMOrcOpaqueDefinitionGenerator313*LLVMOrcDefinitionGeneratorRef;314315/**316* An opaque lookup state object. Instances of this type can be captured to317* suspend a lookup while a custom generator function attempts to produce a318* definition.319*320* If a client captures a lookup state object then they must eventually call321* LLVMOrcLookupStateContinueLookup to restart the lookup. This is required322* in order to release memory allocated for the lookup state, even if errors323* have occurred while the lookup was suspended (if these errors have made the324* lookup impossible to complete then it will issue its own error before325* destruction).326*/327typedef struct LLVMOrcOpaqueLookupState *LLVMOrcLookupStateRef;328329/**330* A custom generator function. This can be used to create a custom generator331* object using LLVMOrcCreateCustomCAPIDefinitionGenerator. The resulting332* object can be attached to a JITDylib, via LLVMOrcJITDylibAddGenerator, to333* receive callbacks when lookups fail to match existing definitions.334*335* GeneratorObj will contain the address of the custom generator object.336*337* Ctx will contain the context object passed to338* LLVMOrcCreateCustomCAPIDefinitionGenerator.339*340* LookupState will contain a pointer to an LLVMOrcLookupStateRef object. This341* can optionally be modified to make the definition generation process342* asynchronous: If the LookupStateRef value is copied, and the original343* LLVMOrcLookupStateRef set to null, the lookup will be suspended. Once the344* asynchronous definition process has been completed clients must call345* LLVMOrcLookupStateContinueLookup to continue the lookup (this should be346* done unconditionally, even if errors have occurred in the mean time, to347* free the lookup state memory and notify the query object of the failures).348* If LookupState is captured this function must return LLVMErrorSuccess.349*350* The Kind argument can be inspected to determine the lookup kind (e.g.351* as-if-during-static-link, or as-if-during-dlsym).352*353* The JD argument specifies which JITDylib the definitions should be generated354* into.355*356* The JDLookupFlags argument can be inspected to determine whether the original357* lookup included non-exported symbols.358*359* Finally, the LookupSet argument contains the set of symbols that could not360* be found in JD already (the set of generation candidates).361*/362typedef LLVMErrorRef (*LLVMOrcCAPIDefinitionGeneratorTryToGenerateFunction)(363LLVMOrcDefinitionGeneratorRef GeneratorObj, void *Ctx,364LLVMOrcLookupStateRef *LookupState, LLVMOrcLookupKind Kind,365LLVMOrcJITDylibRef JD, LLVMOrcJITDylibLookupFlags JDLookupFlags,366LLVMOrcCLookupSet LookupSet, size_t LookupSetSize);367368/**369* Disposer for a custom generator.370*371* Will be called by ORC when the JITDylib that the generator is attached to372* is destroyed.373*/374typedef void (*LLVMOrcDisposeCAPIDefinitionGeneratorFunction)(void *Ctx);375376/**377* Predicate function for SymbolStringPoolEntries.378*/379typedef int (*LLVMOrcSymbolPredicate)(void *Ctx,380LLVMOrcSymbolStringPoolEntryRef Sym);381382/**383* A reference to an orc::ThreadSafeContext instance.384*/385typedef struct LLVMOrcOpaqueThreadSafeContext *LLVMOrcThreadSafeContextRef;386387/**388* A reference to an orc::ThreadSafeModule instance.389*/390typedef struct LLVMOrcOpaqueThreadSafeModule *LLVMOrcThreadSafeModuleRef;391392/**393* A function for inspecting/mutating IR modules, suitable for use with394* LLVMOrcThreadSafeModuleWithModuleDo.395*/396typedef LLVMErrorRef (*LLVMOrcGenericIRModuleOperationFunction)(397void *Ctx, LLVMModuleRef M);398399/**400* A reference to an orc::JITTargetMachineBuilder instance.401*/402typedef struct LLVMOrcOpaqueJITTargetMachineBuilder403*LLVMOrcJITTargetMachineBuilderRef;404405/**406* A reference to an orc::ObjectLayer instance.407*/408typedef struct LLVMOrcOpaqueObjectLayer *LLVMOrcObjectLayerRef;409410/**411* A reference to an orc::ObjectLinkingLayer instance.412*/413typedef struct LLVMOrcOpaqueObjectLinkingLayer *LLVMOrcObjectLinkingLayerRef;414415/**416* A reference to an orc::IRTransformLayer instance.417*/418typedef struct LLVMOrcOpaqueIRTransformLayer *LLVMOrcIRTransformLayerRef;419420/**421* A function for applying transformations as part of an transform layer.422*423* Implementations of this type are responsible for managing the lifetime424* of the Module pointed to by ModInOut: If the LLVMModuleRef value is425* overwritten then the function is responsible for disposing of the incoming426* module. If the module is simply accessed/mutated in-place then ownership427* returns to the caller and the function does not need to do any lifetime428* management.429*430* Clients can call LLVMOrcLLJITGetIRTransformLayer to obtain the transform431* layer of a LLJIT instance, and use LLVMOrcIRTransformLayerSetTransform432* to set the function. This can be used to override the default transform433* layer.434*/435typedef LLVMErrorRef (*LLVMOrcIRTransformLayerTransformFunction)(436void *Ctx, LLVMOrcThreadSafeModuleRef *ModInOut,437LLVMOrcMaterializationResponsibilityRef MR);438439/**440* A reference to an orc::ObjectTransformLayer instance.441*/442typedef struct LLVMOrcOpaqueObjectTransformLayer443*LLVMOrcObjectTransformLayerRef;444445/**446* A function for applying transformations to an object file buffer.447*448* Implementations of this type are responsible for managing the lifetime449* of the memory buffer pointed to by ObjInOut: If the LLVMMemoryBufferRef450* value is overwritten then the function is responsible for disposing of the451* incoming buffer. If the buffer is simply accessed/mutated in-place then452* ownership returns to the caller and the function does not need to do any453* lifetime management.454*455* The transform is allowed to return an error, in which case the ObjInOut456* buffer should be disposed of and set to null.457*/458typedef LLVMErrorRef (*LLVMOrcObjectTransformLayerTransformFunction)(459void *Ctx, LLVMMemoryBufferRef *ObjInOut);460461/**462* A reference to an orc::IndirectStubsManager instance.463*/464typedef struct LLVMOrcOpaqueIndirectStubsManager465*LLVMOrcIndirectStubsManagerRef;466467/**468* A reference to an orc::LazyCallThroughManager instance.469*/470typedef struct LLVMOrcOpaqueLazyCallThroughManager471*LLVMOrcLazyCallThroughManagerRef;472473/**474* A reference to an orc::DumpObjects object.475*476* Can be used to dump object files to disk with unique names. Useful as an477* ObjectTransformLayer transform.478*/479typedef struct LLVMOrcOpaqueDumpObjects *LLVMOrcDumpObjectsRef;480481/**482* Attach a custom error reporter function to the ExecutionSession.483*484* The error reporter will be called to deliver failure notices that can not be485* directly reported to a caller. For example, failure to resolve symbols in486* the JIT linker is typically reported via the error reporter (callers487* requesting definitions from the JIT will typically be delivered a488* FailureToMaterialize error instead).489*/490void LLVMOrcExecutionSessionSetErrorReporter(491LLVMOrcExecutionSessionRef ES, LLVMOrcErrorReporterFunction ReportError,492void *Ctx);493494/**495* Return a reference to the SymbolStringPool for an ExecutionSession.496*497* Ownership of the pool remains with the ExecutionSession: The caller is498* not required to free the pool.499*/500LLVMOrcSymbolStringPoolRef501LLVMOrcExecutionSessionGetSymbolStringPool(LLVMOrcExecutionSessionRef ES);502503/**504* Clear all unreferenced symbol string pool entries.505*506* This can be called at any time to release unused entries in the507* ExecutionSession's string pool. Since it locks the pool (preventing508* interning of any new strings) it is recommended that it only be called509* infrequently, ideally when the caller has reason to believe that some510* entries will have become unreferenced, e.g. after removing a module or511* closing a JITDylib.512*/513void LLVMOrcSymbolStringPoolClearDeadEntries(LLVMOrcSymbolStringPoolRef SSP);514515/**516* Intern a string in the ExecutionSession's SymbolStringPool and return a517* reference to it. This increments the ref-count of the pool entry, and the518* returned value should be released once the client is done with it by519* calling LLVMOrcReleaseSymbolStringPoolEntry.520*521* Since strings are uniqued within the SymbolStringPool522* LLVMOrcSymbolStringPoolEntryRefs can be compared by value to test string523* equality.524*525* Note that this function does not perform linker-mangling on the string.526*/527LLVMOrcSymbolStringPoolEntryRef528LLVMOrcExecutionSessionIntern(LLVMOrcExecutionSessionRef ES, const char *Name);529530/**531* Callback type for ExecutionSession lookups.532*533* If Err is LLVMErrorSuccess then Result will contain a pointer to a534* list of ( SymbolStringPtr, JITEvaluatedSymbol ) pairs of length NumPairs.535*536* If Err is a failure value then Result and Ctx are undefined and should537* not be accessed. The Callback is responsible for handling the error538* value (e.g. by calling LLVMGetErrorMessage + LLVMDisposeErrorMessage).539*540* The caller retains ownership of the Result array and will release all541* contained symbol names. Clients are responsible for retaining any symbol542* names that they wish to hold after the function returns.543*/544typedef void (*LLVMOrcExecutionSessionLookupHandleResultFunction)(545LLVMErrorRef Err, LLVMOrcCSymbolMapPairs Result, size_t NumPairs,546void *Ctx);547548/**549* Look up symbols in an execution session.550*551* This is a wrapper around the general ExecutionSession::lookup function.552*553* The SearchOrder argument contains a list of (JITDylibs, JITDylibSearchFlags)554* pairs that describe the search order. The JITDylibs will be searched in the555* given order to try to find the symbols in the Symbols argument.556*557* The Symbols argument should contain a null-terminated array of558* (SymbolStringPtr, SymbolLookupFlags) pairs describing the symbols to be559* searched for. This function takes ownership of the elements of the Symbols560* array. The Name fields of the Symbols elements are taken to have been561* retained by the client for this function. The client should *not* release the562* Name fields, but are still responsible for destroying the array itself.563*564* The HandleResult function will be called once all searched for symbols have565* been found, or an error occurs. The HandleResult function will be passed an566* LLVMErrorRef indicating success or failure, and (on success) a567* null-terminated LLVMOrcCSymbolMapPairs array containing the function result,568* and the Ctx value passed to the lookup function.569*570* The client is fully responsible for managing the lifetime of the Ctx object.571* A common idiom is to allocate the context prior to the lookup and deallocate572* it in the handler.573*574* THIS API IS EXPERIMENTAL AND LIKELY TO CHANGE IN THE NEAR FUTURE!575*/576void LLVMOrcExecutionSessionLookup(577LLVMOrcExecutionSessionRef ES, LLVMOrcLookupKind K,578LLVMOrcCJITDylibSearchOrder SearchOrder, size_t SearchOrderSize,579LLVMOrcCLookupSet Symbols, size_t SymbolsSize,580LLVMOrcExecutionSessionLookupHandleResultFunction HandleResult, void *Ctx);581582/**583* Increments the ref-count for a SymbolStringPool entry.584*/585void LLVMOrcRetainSymbolStringPoolEntry(LLVMOrcSymbolStringPoolEntryRef S);586587/**588* Reduces the ref-count for of a SymbolStringPool entry.589*/590void LLVMOrcReleaseSymbolStringPoolEntry(LLVMOrcSymbolStringPoolEntryRef S);591592/**593* Return the c-string for the given symbol. This string will remain valid until594* the entry is freed (once all LLVMOrcSymbolStringPoolEntryRefs have been595* released).596*/597const char *LLVMOrcSymbolStringPoolEntryStr(LLVMOrcSymbolStringPoolEntryRef S);598599/**600* Reduces the ref-count of a ResourceTracker.601*/602void LLVMOrcReleaseResourceTracker(LLVMOrcResourceTrackerRef RT);603604/**605* Transfers tracking of all resources associated with resource tracker SrcRT606* to resource tracker DstRT.607*/608void LLVMOrcResourceTrackerTransferTo(LLVMOrcResourceTrackerRef SrcRT,609LLVMOrcResourceTrackerRef DstRT);610611/**612* Remove all resources associated with the given tracker. See613* ResourceTracker::remove().614*/615LLVMErrorRef LLVMOrcResourceTrackerRemove(LLVMOrcResourceTrackerRef RT);616617/**618* Dispose of a JITDylib::DefinitionGenerator. This should only be called if619* ownership has not been passed to a JITDylib (e.g. because some error620* prevented the client from calling LLVMOrcJITDylibAddGenerator).621*/622void LLVMOrcDisposeDefinitionGenerator(LLVMOrcDefinitionGeneratorRef DG);623624/**625* Dispose of a MaterializationUnit.626*/627void LLVMOrcDisposeMaterializationUnit(LLVMOrcMaterializationUnitRef MU);628629/**630* Create a custom MaterializationUnit.631*632* Name is a name for this MaterializationUnit to be used for identification633* and logging purposes (e.g. if this MaterializationUnit produces an634* object buffer then the name of that buffer will be derived from this name).635*636* The Syms list contains the names and linkages of the symbols provided by this637* unit. This function takes ownership of the elements of the Syms array. The638* Name fields of the array elements are taken to have been retained for this639* function. The client should *not* release the elements of the array, but is640* still responsible for destroying the array itself.641*642* The InitSym argument indicates whether or not this MaterializationUnit643* contains static initializers. If three are no static initializers (the common644* case) then this argument should be null. If there are static initializers645* then InitSym should be set to a unique name that also appears in the Syms646* list with the LLVMJITSymbolGenericFlagsMaterializationSideEffectsOnly flag647* set. This function takes ownership of the InitSym, which should have been648* retained twice on behalf of this function: once for the Syms entry and once649* for InitSym. If clients wish to use the InitSym value after this function650* returns they must retain it once more for themselves.651*652* If any of the symbols in the Syms list is looked up then the Materialize653* function will be called.654*655* If any of the symbols in the Syms list is overridden then the Discard656* function will be called.657*658* The caller owns the underling MaterializationUnit and is responsible for659* either passing it to a JITDylib (via LLVMOrcJITDylibDefine) or disposing660* of it by calling LLVMOrcDisposeMaterializationUnit.661*/662LLVMOrcMaterializationUnitRef LLVMOrcCreateCustomMaterializationUnit(663const char *Name, void *Ctx, LLVMOrcCSymbolFlagsMapPairs Syms,664size_t NumSyms, LLVMOrcSymbolStringPoolEntryRef InitSym,665LLVMOrcMaterializationUnitMaterializeFunction Materialize,666LLVMOrcMaterializationUnitDiscardFunction Discard,667LLVMOrcMaterializationUnitDestroyFunction Destroy);668669/**670* Create a MaterializationUnit to define the given symbols as pointing to671* the corresponding raw addresses.672*673* This function takes ownership of the elements of the Syms array. The Name674* fields of the array elements are taken to have been retained for this675* function. This allows the following pattern...676*677* size_t NumPairs;678* LLVMOrcCSymbolMapPairs Sym;679* -- Build Syms array --680* LLVMOrcMaterializationUnitRef MU =681* LLVMOrcAbsoluteSymbols(Syms, NumPairs);682*683* ... without requiring cleanup of the elements of the Sym array afterwards.684*685* The client is still responsible for deleting the Sym array itself.686*687* If a client wishes to reuse elements of the Sym array after this call they688* must explicitly retain each of the elements for themselves.689*/690LLVMOrcMaterializationUnitRef691LLVMOrcAbsoluteSymbols(LLVMOrcCSymbolMapPairs Syms, size_t NumPairs);692693/**694* Create a MaterializationUnit to define lazy re-expots. These are callable695* entry points that call through to the given symbols.696*697* This function takes ownership of the CallableAliases array. The Name698* fields of the array elements are taken to have been retained for this699* function. This allows the following pattern...700*701* size_t NumPairs;702* LLVMOrcCSymbolAliasMapPairs CallableAliases;703* -- Build CallableAliases array --704* LLVMOrcMaterializationUnitRef MU =705* LLVMOrcLazyReexports(LCTM, ISM, JD, CallableAliases, NumPairs);706*707* ... without requiring cleanup of the elements of the CallableAliases array afterwards.708*709* The client is still responsible for deleting the CallableAliases array itself.710*711* If a client wishes to reuse elements of the CallableAliases array after this call they712* must explicitly retain each of the elements for themselves.713*/714LLVMOrcMaterializationUnitRef LLVMOrcLazyReexports(715LLVMOrcLazyCallThroughManagerRef LCTM, LLVMOrcIndirectStubsManagerRef ISM,716LLVMOrcJITDylibRef SourceRef, LLVMOrcCSymbolAliasMapPairs CallableAliases,717size_t NumPairs);718// TODO: ImplSymbolMad SrcJDLoc719720/**721* Disposes of the passed MaterializationResponsibility object.722*723* This should only be done after the symbols covered by the object have either724* been resolved and emitted (via725* LLVMOrcMaterializationResponsibilityNotifyResolved and726* LLVMOrcMaterializationResponsibilityNotifyEmitted) or failed (via727* LLVMOrcMaterializationResponsibilityFailMaterialization).728*/729void LLVMOrcDisposeMaterializationResponsibility(730LLVMOrcMaterializationResponsibilityRef MR);731732/**733* Returns the target JITDylib that these symbols are being materialized into.734*/735LLVMOrcJITDylibRef LLVMOrcMaterializationResponsibilityGetTargetDylib(736LLVMOrcMaterializationResponsibilityRef MR);737738/**739* Returns the ExecutionSession for this MaterializationResponsibility.740*/741LLVMOrcExecutionSessionRef742LLVMOrcMaterializationResponsibilityGetExecutionSession(743LLVMOrcMaterializationResponsibilityRef MR);744745/**746* Returns the symbol flags map for this responsibility instance.747*748* The length of the array is returned in NumPairs and the caller is responsible749* for the returned memory and needs to call LLVMOrcDisposeCSymbolFlagsMap.750*751* To use the returned symbols beyond the livetime of the752* MaterializationResponsibility requires the caller to retain the symbols753* explicitly.754*/755LLVMOrcCSymbolFlagsMapPairs LLVMOrcMaterializationResponsibilityGetSymbols(756LLVMOrcMaterializationResponsibilityRef MR, size_t *NumPairs);757758/**759* Disposes of the passed LLVMOrcCSymbolFlagsMap.760*761* Does not release the entries themselves.762*/763void LLVMOrcDisposeCSymbolFlagsMap(LLVMOrcCSymbolFlagsMapPairs Pairs);764765/**766* Returns the initialization pseudo-symbol, if any. This symbol will also767* be present in the SymbolFlagsMap for this MaterializationResponsibility768* object.769*770* The returned symbol is not retained over any mutating operation of the771* MaterializationResponsbility or beyond the lifetime thereof.772*/773LLVMOrcSymbolStringPoolEntryRef774LLVMOrcMaterializationResponsibilityGetInitializerSymbol(775LLVMOrcMaterializationResponsibilityRef MR);776777/**778* Returns the names of any symbols covered by this779* MaterializationResponsibility object that have queries pending. This780* information can be used to return responsibility for unrequested symbols781* back to the JITDylib via the delegate method.782*/783LLVMOrcSymbolStringPoolEntryRef *784LLVMOrcMaterializationResponsibilityGetRequestedSymbols(785LLVMOrcMaterializationResponsibilityRef MR, size_t *NumSymbols);786787/**788* Disposes of the passed LLVMOrcSymbolStringPoolEntryRef* .789*790* Does not release the symbols themselves.791*/792void LLVMOrcDisposeSymbols(LLVMOrcSymbolStringPoolEntryRef *Symbols);793794/**795* Notifies the target JITDylib that the given symbols have been resolved.796* This will update the given symbols' addresses in the JITDylib, and notify797* any pending queries on the given symbols of their resolution. The given798* symbols must be ones covered by this MaterializationResponsibility799* instance. Individual calls to this method may resolve a subset of the800* symbols, but all symbols must have been resolved prior to calling emit.801*802* This method will return an error if any symbols being resolved have been803* moved to the error state due to the failure of a dependency. If this804* method returns an error then clients should log it and call805* LLVMOrcMaterializationResponsibilityFailMaterialization. If no dependencies806* have been registered for the symbols covered by this807* MaterializationResponsibility then this method is guaranteed to return808* LLVMErrorSuccess.809*/810LLVMErrorRef LLVMOrcMaterializationResponsibilityNotifyResolved(811LLVMOrcMaterializationResponsibilityRef MR, LLVMOrcCSymbolMapPairs Symbols,812size_t NumPairs);813814/**815* Notifies the target JITDylib (and any pending queries on that JITDylib)816* that all symbols covered by this MaterializationResponsibility instance817* have been emitted.818*819* This function takes ownership of the symbols in the Dependencies struct.820* This allows the following pattern...821*822* LLVMOrcSymbolStringPoolEntryRef Names[] = {...};823* LLVMOrcCDependenceMapPair Dependence = {JD, {Names, sizeof(Names)}}824* LLVMOrcMaterializationResponsibilityAddDependencies(JD, Name, &Dependence,825* 1);826*827* ... without requiring cleanup of the elements of the Names array afterwards.828*829* The client is still responsible for deleting the Dependencies.Names arrays,830* and the Dependencies array itself.831*832* This method will return an error if any symbols being resolved have been833* moved to the error state due to the failure of a dependency. If this834* method returns an error then clients should log it and call835* LLVMOrcMaterializationResponsibilityFailMaterialization.836* If no dependencies have been registered for the symbols covered by this837* MaterializationResponsibility then this method is guaranteed to return838* LLVMErrorSuccess.839*/840LLVMErrorRef LLVMOrcMaterializationResponsibilityNotifyEmitted(841LLVMOrcMaterializationResponsibilityRef MR,842LLVMOrcCSymbolDependenceGroup *SymbolDepGroups, size_t NumSymbolDepGroups);843844/**845* Attempt to claim responsibility for new definitions. This method can be846* used to claim responsibility for symbols that are added to a847* materialization unit during the compilation process (e.g. literal pool848* symbols). Symbol linkage rules are the same as for symbols that are849* defined up front: duplicate strong definitions will result in errors.850* Duplicate weak definitions will be discarded (in which case they will851* not be added to this responsibility instance).852*853* This method can be used by materialization units that want to add854* additional symbols at materialization time (e.g. stubs, compile855* callbacks, metadata)856*/857LLVMErrorRef LLVMOrcMaterializationResponsibilityDefineMaterializing(858LLVMOrcMaterializationResponsibilityRef MR,859LLVMOrcCSymbolFlagsMapPairs Pairs, size_t NumPairs);860861/**862* Notify all not-yet-emitted covered by this MaterializationResponsibility863* instance that an error has occurred.864* This will remove all symbols covered by this MaterializationResponsibility865* from the target JITDylib, and send an error to any queries waiting on866* these symbols.867*/868void LLVMOrcMaterializationResponsibilityFailMaterialization(869LLVMOrcMaterializationResponsibilityRef MR);870871/**872* Transfers responsibility to the given MaterializationUnit for all873* symbols defined by that MaterializationUnit. This allows874* materializers to break up work based on run-time information (e.g.875* by introspecting which symbols have actually been looked up and876* materializing only those).877*/878LLVMErrorRef LLVMOrcMaterializationResponsibilityReplace(879LLVMOrcMaterializationResponsibilityRef MR,880LLVMOrcMaterializationUnitRef MU);881882/**883* Delegates responsibility for the given symbols to the returned884* materialization responsibility. Useful for breaking up work between885* threads, or different kinds of materialization processes.886*887* The caller retains responsibility of the the passed888* MaterializationResponsibility.889*/890LLVMErrorRef LLVMOrcMaterializationResponsibilityDelegate(891LLVMOrcMaterializationResponsibilityRef MR,892LLVMOrcSymbolStringPoolEntryRef *Symbols, size_t NumSymbols,893LLVMOrcMaterializationResponsibilityRef *Result);894895/**896* Create a "bare" JITDylib.897*898* The client is responsible for ensuring that the JITDylib's name is unique,899* e.g. by calling LLVMOrcExecutionSessionGetJTIDylibByName first.900*901* This call does not install any library code or symbols into the newly902* created JITDylib. The client is responsible for all configuration.903*/904LLVMOrcJITDylibRef905LLVMOrcExecutionSessionCreateBareJITDylib(LLVMOrcExecutionSessionRef ES,906const char *Name);907908/**909* Create a JITDylib.910*911* The client is responsible for ensuring that the JITDylib's name is unique,912* e.g. by calling LLVMOrcExecutionSessionGetJTIDylibByName first.913*914* If a Platform is attached to the ExecutionSession then915* Platform::setupJITDylib will be called to install standard platform symbols916* (e.g. standard library interposes). If no Platform is installed then this917* call is equivalent to LLVMExecutionSessionRefCreateBareJITDylib and will918* always return success.919*/920LLVMErrorRef921LLVMOrcExecutionSessionCreateJITDylib(LLVMOrcExecutionSessionRef ES,922LLVMOrcJITDylibRef *Result,923const char *Name);924925/**926* Returns the JITDylib with the given name, or NULL if no such JITDylib927* exists.928*/929LLVMOrcJITDylibRef930LLVMOrcExecutionSessionGetJITDylibByName(LLVMOrcExecutionSessionRef ES,931const char *Name);932933/**934* Return a reference to a newly created resource tracker associated with JD.935* The tracker is returned with an initial ref-count of 1, and must be released936* with LLVMOrcReleaseResourceTracker when no longer needed.937*/938LLVMOrcResourceTrackerRef939LLVMOrcJITDylibCreateResourceTracker(LLVMOrcJITDylibRef JD);940941/**942* Return a reference to the default resource tracker for the given JITDylib.943* This operation will increase the retain count of the tracker: Clients should944* call LLVMOrcReleaseResourceTracker when the result is no longer needed.945*/946LLVMOrcResourceTrackerRef947LLVMOrcJITDylibGetDefaultResourceTracker(LLVMOrcJITDylibRef JD);948949/**950* Add the given MaterializationUnit to the given JITDylib.951*952* If this operation succeeds then JITDylib JD will take ownership of MU.953* If the operation fails then ownership remains with the caller who should954* call LLVMOrcDisposeMaterializationUnit to destroy it.955*/956LLVMErrorRef LLVMOrcJITDylibDefine(LLVMOrcJITDylibRef JD,957LLVMOrcMaterializationUnitRef MU);958959/**960* Calls remove on all trackers associated with this JITDylib, see961* JITDylib::clear().962*/963LLVMErrorRef LLVMOrcJITDylibClear(LLVMOrcJITDylibRef JD);964965/**966* Add a DefinitionGenerator to the given JITDylib.967*968* The JITDylib will take ownership of the given generator: The client is no969* longer responsible for managing its memory.970*/971void LLVMOrcJITDylibAddGenerator(LLVMOrcJITDylibRef JD,972LLVMOrcDefinitionGeneratorRef DG);973974/**975* Create a custom generator.976*977* The F argument will be used to implement the DefinitionGenerator's978* tryToGenerate method (see979* LLVMOrcCAPIDefinitionGeneratorTryToGenerateFunction).980*981* Ctx is a context object that will be passed to F. This argument is982* permitted to be null.983*984* Dispose is the disposal function for Ctx. This argument is permitted to be985* null (in which case the client is responsible for the lifetime of Ctx).986*/987LLVMOrcDefinitionGeneratorRef LLVMOrcCreateCustomCAPIDefinitionGenerator(988LLVMOrcCAPIDefinitionGeneratorTryToGenerateFunction F, void *Ctx,989LLVMOrcDisposeCAPIDefinitionGeneratorFunction Dispose);990991/**992* Continue a lookup that was suspended in a generator (see993* LLVMOrcCAPIDefinitionGeneratorTryToGenerateFunction).994*/995void LLVMOrcLookupStateContinueLookup(LLVMOrcLookupStateRef S,996LLVMErrorRef Err);997998/**999* Get a DynamicLibrarySearchGenerator that will reflect process symbols into1000* the JITDylib. On success the resulting generator is owned by the client.1001* Ownership is typically transferred by adding the instance to a JITDylib1002* using LLVMOrcJITDylibAddGenerator,1003*1004* The GlobalPrefix argument specifies the character that appears on the front1005* of linker-mangled symbols for the target platform (e.g. '_' on MachO).1006* If non-null, this character will be stripped from the start of all symbol1007* strings before passing the remaining substring to dlsym.1008*1009* The optional Filter and Ctx arguments can be used to supply a symbol name1010* filter: Only symbols for which the filter returns true will be visible to1011* JIT'd code. If the Filter argument is null then all process symbols will1012* be visible to JIT'd code. Note that the symbol name passed to the Filter1013* function is the full mangled symbol: The client is responsible for stripping1014* the global prefix if present.1015*/1016LLVMErrorRef LLVMOrcCreateDynamicLibrarySearchGeneratorForProcess(1017LLVMOrcDefinitionGeneratorRef *Result, char GlobalPrefx,1018LLVMOrcSymbolPredicate Filter, void *FilterCtx);10191020/**1021* Get a LLVMOrcCreateDynamicLibararySearchGeneratorForPath that will reflect1022* library symbols into the JITDylib. On success the resulting generator is1023* owned by the client. Ownership is typically transferred by adding the1024* instance to a JITDylib using LLVMOrcJITDylibAddGenerator,1025*1026* The GlobalPrefix argument specifies the character that appears on the front1027* of linker-mangled symbols for the target platform (e.g. '_' on MachO).1028* If non-null, this character will be stripped from the start of all symbol1029* strings before passing the remaining substring to dlsym.1030*1031* The optional Filter and Ctx arguments can be used to supply a symbol name1032* filter: Only symbols for which the filter returns true will be visible to1033* JIT'd code. If the Filter argument is null then all library symbols will1034* be visible to JIT'd code. Note that the symbol name passed to the Filter1035* function is the full mangled symbol: The client is responsible for stripping1036* the global prefix if present.1037*1038* THIS API IS EXPERIMENTAL AND LIKELY TO CHANGE IN THE NEAR FUTURE!1039*1040*/1041LLVMErrorRef LLVMOrcCreateDynamicLibrarySearchGeneratorForPath(1042LLVMOrcDefinitionGeneratorRef *Result, const char *FileName,1043char GlobalPrefix, LLVMOrcSymbolPredicate Filter, void *FilterCtx);10441045/**1046* Get a LLVMOrcCreateStaticLibrarySearchGeneratorForPath that will reflect1047* static library symbols into the JITDylib. On success the resulting1048* generator is owned by the client. Ownership is typically transferred by1049* adding the instance to a JITDylib using LLVMOrcJITDylibAddGenerator,1050*1051* Call with the optional TargetTriple argument will succeed if the file at1052* the given path is a static library or a MachO universal binary containing a1053* static library that is compatible with the given triple. Otherwise it will1054* return an error.1055*1056* THIS API IS EXPERIMENTAL AND LIKELY TO CHANGE IN THE NEAR FUTURE!1057*1058*/1059LLVMErrorRef LLVMOrcCreateStaticLibrarySearchGeneratorForPath(1060LLVMOrcDefinitionGeneratorRef *Result, LLVMOrcObjectLayerRef ObjLayer,1061const char *FileName, const char *TargetTriple);10621063/**1064* Create a ThreadSafeContext containing a new LLVMContext.1065*1066* Ownership of the underlying ThreadSafeContext data is shared: Clients1067* can and should dispose of their ThreadSafeContext as soon as they no longer1068* need to refer to it directly. Other references (e.g. from ThreadSafeModules)1069* will keep the data alive as long as it is needed.1070*/1071LLVMOrcThreadSafeContextRef LLVMOrcCreateNewThreadSafeContext(void);10721073/**1074* Get a reference to the wrapped LLVMContext.1075*/1076LLVMContextRef1077LLVMOrcThreadSafeContextGetContext(LLVMOrcThreadSafeContextRef TSCtx);10781079/**1080* Dispose of a ThreadSafeContext.1081*/1082void LLVMOrcDisposeThreadSafeContext(LLVMOrcThreadSafeContextRef TSCtx);10831084/**1085* Create a ThreadSafeModule wrapper around the given LLVM module. This takes1086* ownership of the M argument which should not be disposed of or referenced1087* after this function returns.1088*1089* Ownership of the ThreadSafeModule is unique: If it is transferred to the JIT1090* (e.g. by LLVMOrcLLJITAddLLVMIRModule) then the client is no longer1091* responsible for it. If it is not transferred to the JIT then the client1092* should call LLVMOrcDisposeThreadSafeModule to dispose of it.1093*/1094LLVMOrcThreadSafeModuleRef1095LLVMOrcCreateNewThreadSafeModule(LLVMModuleRef M,1096LLVMOrcThreadSafeContextRef TSCtx);10971098/**1099* Dispose of a ThreadSafeModule. This should only be called if ownership has1100* not been passed to LLJIT (e.g. because some error prevented the client from1101* adding this to the JIT).1102*/1103void LLVMOrcDisposeThreadSafeModule(LLVMOrcThreadSafeModuleRef TSM);11041105/**1106* Apply the given function to the module contained in this ThreadSafeModule.1107*/1108LLVMErrorRef1109LLVMOrcThreadSafeModuleWithModuleDo(LLVMOrcThreadSafeModuleRef TSM,1110LLVMOrcGenericIRModuleOperationFunction F,1111void *Ctx);11121113/**1114* Create a JITTargetMachineBuilder by detecting the host.1115*1116* On success the client owns the resulting JITTargetMachineBuilder. It must be1117* passed to a consuming operation (e.g.1118* LLVMOrcLLJITBuilderSetJITTargetMachineBuilder) or disposed of by calling1119* LLVMOrcDisposeJITTargetMachineBuilder.1120*/1121LLVMErrorRef LLVMOrcJITTargetMachineBuilderDetectHost(1122LLVMOrcJITTargetMachineBuilderRef *Result);11231124/**1125* Create a JITTargetMachineBuilder from the given TargetMachine template.1126*1127* This operation takes ownership of the given TargetMachine and destroys it1128* before returing. The resulting JITTargetMachineBuilder is owned by the client1129* and must be passed to a consuming operation (e.g.1130* LLVMOrcLLJITBuilderSetJITTargetMachineBuilder) or disposed of by calling1131* LLVMOrcDisposeJITTargetMachineBuilder.1132*/1133LLVMOrcJITTargetMachineBuilderRef1134LLVMOrcJITTargetMachineBuilderCreateFromTargetMachine(LLVMTargetMachineRef TM);11351136/**1137* Dispose of a JITTargetMachineBuilder.1138*/1139void LLVMOrcDisposeJITTargetMachineBuilder(1140LLVMOrcJITTargetMachineBuilderRef JTMB);11411142/**1143* Returns the target triple for the given JITTargetMachineBuilder as a string.1144*1145* The caller owns the resulting string as must dispose of it by calling1146* LLVMDisposeMessage1147*/1148char *LLVMOrcJITTargetMachineBuilderGetTargetTriple(1149LLVMOrcJITTargetMachineBuilderRef JTMB);11501151/**1152* Sets the target triple for the given JITTargetMachineBuilder to the given1153* string.1154*/1155void LLVMOrcJITTargetMachineBuilderSetTargetTriple(1156LLVMOrcJITTargetMachineBuilderRef JTMB, const char *TargetTriple);11571158/**1159* Add an object to an ObjectLayer to the given JITDylib.1160*1161* Adds a buffer representing an object file to the given JITDylib using the1162* given ObjectLayer instance. This operation transfers ownership of the buffer1163* to the ObjectLayer instance. The buffer should not be disposed of or1164* referenced once this function returns.1165*1166* Resources associated with the given object will be tracked by the given1167* JITDylib's default ResourceTracker.1168*/1169LLVMErrorRef LLVMOrcObjectLayerAddObjectFile(LLVMOrcObjectLayerRef ObjLayer,1170LLVMOrcJITDylibRef JD,1171LLVMMemoryBufferRef ObjBuffer);11721173/**1174* Add an object to an ObjectLayer using the given ResourceTracker.1175*1176* Adds a buffer representing an object file to the given ResourceTracker's1177* JITDylib using the given ObjectLayer instance. This operation transfers1178* ownership of the buffer to the ObjectLayer instance. The buffer should not1179* be disposed of or referenced once this function returns.1180*1181* Resources associated with the given object will be tracked by1182* ResourceTracker RT.1183*/1184LLVMErrorRef1185LLVMOrcObjectLayerAddObjectFileWithRT(LLVMOrcObjectLayerRef ObjLayer,1186LLVMOrcResourceTrackerRef RT,1187LLVMMemoryBufferRef ObjBuffer);11881189/**1190* Emit an object buffer to an ObjectLayer.1191*1192* Ownership of the responsibility object and object buffer pass to this1193* function. The client is not responsible for cleanup.1194*/1195void LLVMOrcObjectLayerEmit(LLVMOrcObjectLayerRef ObjLayer,1196LLVMOrcMaterializationResponsibilityRef R,1197LLVMMemoryBufferRef ObjBuffer);11981199/**1200* Dispose of an ObjectLayer.1201*/1202void LLVMOrcDisposeObjectLayer(LLVMOrcObjectLayerRef ObjLayer);12031204void LLVMOrcIRTransformLayerEmit(LLVMOrcIRTransformLayerRef IRTransformLayer,1205LLVMOrcMaterializationResponsibilityRef MR,1206LLVMOrcThreadSafeModuleRef TSM);12071208/**1209* Set the transform function of the provided transform layer, passing through a1210* pointer to user provided context.1211*/1212void LLVMOrcIRTransformLayerSetTransform(1213LLVMOrcIRTransformLayerRef IRTransformLayer,1214LLVMOrcIRTransformLayerTransformFunction TransformFunction, void *Ctx);12151216/**1217* Set the transform function on an LLVMOrcObjectTransformLayer.1218*/1219void LLVMOrcObjectTransformLayerSetTransform(1220LLVMOrcObjectTransformLayerRef ObjTransformLayer,1221LLVMOrcObjectTransformLayerTransformFunction TransformFunction, void *Ctx);12221223/**1224* Create a LocalIndirectStubsManager from the given target triple.1225*1226* The resulting IndirectStubsManager is owned by the client1227* and must be disposed of by calling LLVMOrcDisposeDisposeIndirectStubsManager.1228*/1229LLVMOrcIndirectStubsManagerRef1230LLVMOrcCreateLocalIndirectStubsManager(const char *TargetTriple);12311232/**1233* Dispose of an IndirectStubsManager.1234*/1235void LLVMOrcDisposeIndirectStubsManager(LLVMOrcIndirectStubsManagerRef ISM);12361237LLVMErrorRef LLVMOrcCreateLocalLazyCallThroughManager(1238const char *TargetTriple, LLVMOrcExecutionSessionRef ES,1239LLVMOrcJITTargetAddress ErrorHandlerAddr,1240LLVMOrcLazyCallThroughManagerRef *LCTM);12411242/**1243* Dispose of an LazyCallThroughManager.1244*/1245void LLVMOrcDisposeLazyCallThroughManager(1246LLVMOrcLazyCallThroughManagerRef LCTM);12471248/**1249* Create a DumpObjects instance.1250*1251* DumpDir specifies the path to write dumped objects to. DumpDir may be empty1252* in which case files will be dumped to the working directory.1253*1254* IdentifierOverride specifies a file name stem to use when dumping objects.1255* If empty then each MemoryBuffer's identifier will be used (with a .o suffix1256* added if not already present). If an identifier override is supplied it will1257* be used instead, along with an incrementing counter (since all buffers will1258* use the same identifier, the resulting files will be named <ident>.o,1259* <ident>.2.o, <ident>.3.o, and so on). IdentifierOverride should not contain1260* an extension, as a .o suffix will be added by DumpObjects.1261*/1262LLVMOrcDumpObjectsRef LLVMOrcCreateDumpObjects(const char *DumpDir,1263const char *IdentifierOverride);12641265/**1266* Dispose of a DumpObjects instance.1267*/1268void LLVMOrcDisposeDumpObjects(LLVMOrcDumpObjectsRef DumpObjects);12691270/**1271* Dump the contents of the given MemoryBuffer.1272*/1273LLVMErrorRef LLVMOrcDumpObjects_CallOperator(LLVMOrcDumpObjectsRef DumpObjects,1274LLVMMemoryBufferRef *ObjBuffer);12751276/**1277* @}1278*/12791280LLVM_C_EXTERN_C_END12811282#endif /* LLVM_C_ORC_H */128312841285