1 /*===---------------- llvm-c/Orc.h - OrcV2 C bindings -----------*- C++ -*-===*\
3 |* Part of the LLVM Project, under the Apache License v2.0 with LLVM *|
5 |* See https://llvm.org/LICENSE.txt for license information. *|
6 |* SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception *|
8 |*===----------------------------------------------------------------------===*|
10 |* This header declares the C interface to libLLVMOrcJIT.a, which implements *|
11 |* JIT compilation of LLVM IR. Minimal documentation of C API specific issues *|
12 |* (especially memory ownership rules) is provided. Core Orc concepts are *|
13 |* documented in llvm/docs/ORCv2.rst and APIs are documented in the C++ *|
16 |* Many exotic languages can interoperate with C code but have a harder time *|
17 |* with C++ due to name mangling. So in addition to C, this interface enables *|
18 |* tools written in such languages. *|
20 |* Note: This interface is experimental. It is *NOT* stable, and may be *|
21 |* changed without warning. Only C API usage documentation is *|
22 |* provided. See the C++ documentation for all higher level ORC API *|
25 \*===----------------------------------------------------------------------===*/
30 #include "llvm-c/Error.h"
31 #include "llvm-c/TargetMachine.h"
32 #include "llvm-c/Types.h"
37 * Represents an address in the target process.
39 typedef uint64_t LLVMOrcJITTargetAddress;
42 * Represents generic linkage flags for a symbol definition.
45 LLVMJITSymbolGenericFlagsExported = 1U << 0,
46 LLVMJITSymbolGenericFlagsWeak = 1U << 1
47 } LLVMJITSymbolGenericFlags;
50 * Represents target specific flags for a symbol definition.
52 typedef uint8_t LLVMJITTargetSymbolFlags;
55 * Represents the linkage flags for a symbol definition.
63 * Represents an evaluated symbol address and flags.
66 LLVMOrcJITTargetAddress Address;
67 LLVMJITSymbolFlags Flags;
68 } LLVMJITEvaluatedSymbol;
71 * A reference to an orc::ExecutionSession instance.
73 typedef struct LLVMOrcOpaqueExecutionSession *LLVMOrcExecutionSessionRef;
76 * Error reporter function.
78 typedef void (*LLVMOrcErrorReporterFunction)(void *Ctx, LLVMErrorRef Err);
81 * A reference to an orc::SymbolStringPool.
83 typedef struct LLVMOrcOpaqueSymbolStringPool *LLVMOrcSymbolStringPoolRef;
86 * A reference to an orc::SymbolStringPool table entry.
88 typedef struct LLVMOrcOpaqueSymbolStringPoolEntry
89 *LLVMOrcSymbolStringPoolEntryRef;
92 * Represents a pair of a symbol name and an evaluated symbol.
95 LLVMOrcSymbolStringPoolEntryRef Name;
96 LLVMJITEvaluatedSymbol Sym;
97 } LLVMJITCSymbolMapPair;
100 * Represents a list of (SymbolStringPtr, JITEvaluatedSymbol) pairs that can be
101 * used to construct a SymbolMap.
103 typedef LLVMJITCSymbolMapPair *LLVMOrcCSymbolMapPairs;
106 * Lookup kind. This can be used by definition generators when deciding whether
107 * to produce a definition for a requested symbol.
109 * This enum should be kept in sync with llvm::orc::LookupKind.
112 LLVMOrcLookupKindStatic,
113 LLVMOrcLookupKindDLSym
117 * JITDylib lookup flags. This can be used by definition generators when
118 * deciding whether to produce a definition for a requested symbol.
120 * This enum should be kept in sync with llvm::orc::JITDylibLookupFlags.
123 LLVMOrcJITDylibLookupFlagsMatchExportedSymbolsOnly,
124 LLVMOrcJITDylibLookupFlagsMatchAllSymbols
125 } LLVMOrcJITDylibLookupFlags;
128 * Symbol lookup flags for lookup sets. This should be kept in sync with
129 * llvm::orc::SymbolLookupFlags.
132 LLVMOrcSymbolLookupFlagsRequiredSymbol,
133 LLVMOrcSymbolLookupFlagsWeaklyReferencedSymbol
134 } LLVMOrcSymbolLookupFlags;
137 * An element type for a symbol lookup set.
140 LLVMOrcSymbolStringPoolEntryRef Name;
141 LLVMOrcSymbolLookupFlags LookupFlags;
142 } LLVMOrcCLookupSetElement;
145 * A set of symbols to look up / generate.
147 * The list is terminated with an element containing a null pointer for the
150 * If a client creates an instance of this type then they are responsible for
151 * freeing it, and for ensuring that all strings have been retained over the
152 * course of its life. Clients receiving a copy from a callback are not
153 * responsible for managing lifetime or retain counts.
155 typedef LLVMOrcCLookupSetElement *LLVMOrcCLookupSet;
158 * A reference to an orc::MaterializationUnit.
160 typedef struct LLVMOrcOpaqueMaterializationUnit *LLVMOrcMaterializationUnitRef;
163 * A reference to an orc::JITDylib instance.
165 typedef struct LLVMOrcOpaqueJITDylib *LLVMOrcJITDylibRef;
168 * A reference to an orc::ResourceTracker instance.
170 typedef struct LLVMOrcOpaqueResourceTracker *LLVMOrcResourceTrackerRef;
173 * A reference to an orc::DefinitionGenerator.
175 typedef struct LLVMOrcOpaqueDefinitionGenerator
176 *LLVMOrcDefinitionGeneratorRef;
179 * An opaque lookup state object. Instances of this type can be captured to
180 * suspend a lookup while a custom generator function attempts to produce a
183 * If a client captures a lookup state object then they must eventually call
184 * LLVMOrcLookupStateContinueLookup to restart the lookup. This is required
185 * in order to release memory allocated for the lookup state, even if errors
186 * have occurred while the lookup was suspended (if these errors have made the
187 * lookup impossible to complete then it will issue its own error before
190 typedef struct LLVMOrcOpaqueLookupState *LLVMOrcLookupStateRef;
193 * A custom generator function. This can be used to create a custom generator
194 * object using LLVMOrcCreateCustomCAPIDefinitionGenerator. The resulting
195 * object can be attached to a JITDylib, via LLVMOrcJITDylibAddGenerator, to
196 * receive callbacks when lookups fail to match existing definitions.
198 * GeneratorObj will contain the address of the custom generator object.
200 * Ctx will contain the context object passed to
201 * LLVMOrcCreateCustomCAPIDefinitionGenerator.
203 * LookupState will contain a pointer to an LLVMOrcLookupStateRef object. This
204 * can optionally be modified to make the definition generation process
205 * asynchronous: If the LookupStateRef value is copied, and the original
206 * LLVMOrcLookupStateRef set to null, the lookup will be suspended. Once the
207 * asynchronous definition process has been completed clients must call
208 * LLVMOrcLookupStateContinueLookup to continue the lookup (this should be
209 * done unconditionally, even if errors have occurred in the mean time, to
210 * free the lookup state memory and notify the query object of the failures. If
211 * LookupState is captured this function must return LLVMErrorSuccess.
213 * The Kind argument can be inspected to determine the lookup kind (e.g.
214 * as-if-during-static-link, or as-if-during-dlsym).
216 * The JD argument specifies which JITDylib the definitions should be generated
219 * The JDLookupFlags argument can be inspected to determine whether the original
220 * lookup included non-exported symobls.
222 * Finally, the LookupSet argument contains the set of symbols that could not
223 * be found in JD already (the set of generation candidates).
225 typedef LLVMErrorRef (*LLVMOrcCAPIDefinitionGeneratorTryToGenerateFunction)(
226 LLVMOrcDefinitionGeneratorRef GeneratorObj, void *Ctx,
227 LLVMOrcLookupStateRef *LookupState, LLVMOrcLookupKind Kind,
228 LLVMOrcJITDylibRef JD, LLVMOrcJITDylibLookupFlags JDLookupFlags,
229 LLVMOrcCLookupSet LookupSet, size_t LookupSetSize);
232 * Predicate function for SymbolStringPoolEntries.
234 typedef int (*LLVMOrcSymbolPredicate)(LLVMOrcSymbolStringPoolEntryRef Sym,
238 * A reference to an orc::ThreadSafeContext instance.
240 typedef struct LLVMOrcOpaqueThreadSafeContext *LLVMOrcThreadSafeContextRef;
243 * A reference to an orc::ThreadSafeModule instance.
245 typedef struct LLVMOrcOpaqueThreadSafeModule *LLVMOrcThreadSafeModuleRef;
248 * A reference to an orc::JITTargetMachineBuilder instance.
250 typedef struct LLVMOrcOpaqueJITTargetMachineBuilder
251 *LLVMOrcJITTargetMachineBuilderRef;
254 * A reference to an orc::LLJITBuilder instance.
256 typedef struct LLVMOrcOpaqueLLJITBuilder *LLVMOrcLLJITBuilderRef;
259 * A reference to an orc::LLJIT instance.
261 typedef struct LLVMOrcOpaqueLLJIT *LLVMOrcLLJITRef;
264 * Attach a custom error reporter function to the ExecutionSession.
266 * The error reporter will be called to deliver failure notices that can not be
267 * directly reported to a caller. For example, failure to resolve symbols in
268 * the JIT linker is typically reported via the error reporter (callers
269 * requesting definitions from the JIT will typically be delivered a
270 * FailureToMaterialize error instead).
272 void LLVMOrcExecutionSessionSetErrorReporter(
273 LLVMOrcExecutionSessionRef ES, LLVMOrcErrorReporterFunction ReportError,
277 * Return a reference to the SymbolStringPool for an ExecutionSession.
279 * Ownership of the pool remains with the ExecutionSession: The caller is
280 * not required to free the pool.
282 LLVMOrcSymbolStringPoolRef
283 LLVMOrcExecutionSessionGetSymbolStringPool(LLVMOrcExecutionSessionRef ES);
286 * Clear all unreferenced symbol string pool entries.
288 * This can be called at any time to release unused entries in the
289 * ExecutionSession's string pool. Since it locks the pool (preventing
290 * interning of any new strings) it is recommended that it only be called
291 * infrequently, ideally when the caller has reason to believe that some
292 * entries will have become unreferenced, e.g. after removing a module or
293 * closing a JITDylib.
295 void LLVMOrcSymbolStringPoolClearDeadEntries(LLVMOrcSymbolStringPoolRef SSP);
298 * Intern a string in the ExecutionSession's SymbolStringPool and return a
299 * reference to it. This increments the ref-count of the pool entry, and the
300 * returned value should be released once the client is done with it by
301 * calling LLVMOrReleaseSymbolStringPoolEntry.
303 * Since strings are uniqued within the SymbolStringPool
304 * LLVMOrcSymbolStringPoolEntryRefs can be compared by value to test string
307 * Note that this function does not perform linker-mangling on the string.
309 LLVMOrcSymbolStringPoolEntryRef
310 LLVMOrcExecutionSessionIntern(LLVMOrcExecutionSessionRef ES, const char *Name);
313 * Increments the ref-count for a SymbolStringPool entry.
315 void LLVMOrcRetainSymbolStringPoolEntry(LLVMOrcSymbolStringPoolEntryRef S);
318 * Reduces the ref-count for of a SymbolStringPool entry.
320 void LLVMOrcReleaseSymbolStringPoolEntry(LLVMOrcSymbolStringPoolEntryRef S);
323 * Reduces the ref-count of a ResourceTracker.
325 void LLVMOrcReleaseResourceTracker(LLVMOrcResourceTrackerRef RT);
328 * Transfers tracking of all resources associated with resource tracker SrcRT
329 * to resource tracker DstRT.
331 void LLVMOrcResourceTrackerTransferTo(LLVMOrcResourceTrackerRef SrcRT,
332 LLVMOrcResourceTrackerRef DstRT);
335 * Remove all resources associated with the given tracker. See
336 * ResourceTracker::remove().
338 LLVMErrorRef LLVMOrcResourceTrackerRemove(LLVMOrcResourceTrackerRef RT);
341 * Dispose of a JITDylib::DefinitionGenerator. This should only be called if
342 * ownership has not been passed to a JITDylib (e.g. because some error
343 * prevented the client from calling LLVMOrcJITDylibAddGenerator).
345 void LLVMOrcDisposeDefinitionGenerator(
346 LLVMOrcDefinitionGeneratorRef DG);
349 * Dispose of a MaterializationUnit.
351 void LLVMOrcDisposeMaterializationUnit(LLVMOrcMaterializationUnitRef MU);
354 * Create a MaterializationUnit to define the given symbols as pointing to
355 * the corresponding raw addresses.
357 LLVMOrcMaterializationUnitRef
358 LLVMOrcAbsoluteSymbols(LLVMOrcCSymbolMapPairs Syms, size_t NumPairs);
361 * Create a "bare" JITDylib.
363 * The client is responsible for ensuring that the JITDylib's name is unique,
364 * e.g. by calling LLVMOrcExecutionSessionGetJTIDylibByName first.
366 * This call does not install any library code or symbols into the newly
367 * created JITDylib. The client is responsible for all configuration.
370 LLVMOrcExecutionSessionCreateBareJITDylib(LLVMOrcExecutionSessionRef ES,
376 * The client is responsible for ensuring that the JITDylib's name is unique,
377 * e.g. by calling LLVMOrcExecutionSessionGetJTIDylibByName first.
379 * If a Platform is attached to the ExecutionSession then
380 * Platform::setupJITDylib will be called to install standard platform symbols
381 * (e.g. standard library interposes). If no Platform is installed then this
382 * call is equivalent to LLVMExecutionSessionRefCreateBareJITDylib and will
383 * always return success.
386 LLVMOrcExecutionSessionCreateJITDylib(LLVMOrcExecutionSessionRef ES,
387 LLVMOrcJITDylibRef *Result,
391 * Returns the JITDylib with the given name, or NULL if no such JITDylib
394 LLVMOrcJITDylibRef LLVMOrcExecutionSessionGetJITDylibByName(const char *Name);
397 * Return a reference to a newly created resource tracker associated with JD.
398 * The tracker is returned with an initial ref-count of 1, and must be released
399 * with LLVMOrcReleaseResourceTracker when no longer needed.
401 LLVMOrcResourceTrackerRef
402 LLVMOrcJITDylibCreateResourceTracker(LLVMOrcJITDylibRef JD);
405 * Return a reference to the default resource tracker for the given JITDylib.
406 * This operation will increase the retain count of the tracker: Clients should
407 * call LLVMOrcReleaseResourceTracker when the result is no longer needed.
409 LLVMOrcResourceTrackerRef
410 LLVMOrcJITDylibGetDefaultResourceTracker(LLVMOrcJITDylibRef JD);
413 * Add the given MaterializationUnit to the given JITDylib.
415 * If this operation succeeds then JITDylib JD will take ownership of MU.
416 * If the operation fails then ownership remains with the caller who should
417 * call LLVMOrcDisposeMaterializationUnit to destroy it.
419 LLVMErrorRef LLVMOrcJITDylibDefine(LLVMOrcJITDylibRef JD,
420 LLVMOrcMaterializationUnitRef MU);
423 * Calls remove on all trackers associated with this JITDylib, see
426 LLVMErrorRef LLVMOrcJITDylibClear(LLVMOrcJITDylibRef JD);
429 * Add a DefinitionGenerator to the given JITDylib.
431 * The JITDylib will take ownership of the given generator: The client is no
432 * longer responsible for managing its memory.
434 void LLVMOrcJITDylibAddGenerator(LLVMOrcJITDylibRef JD,
435 LLVMOrcDefinitionGeneratorRef DG);
438 * Create a custom generator.
440 LLVMOrcDefinitionGeneratorRef LLVMOrcCreateCustomCAPIDefinitionGenerator(
441 void *Ctx, LLVMOrcCAPIDefinitionGeneratorTryToGenerateFunction F);
444 * Get a DynamicLibrarySearchGenerator that will reflect process symbols into
445 * the JITDylib. On success the resulting generator is owned by the client.
446 * Ownership is typically transferred by adding the instance to a JITDylib
447 * using LLVMOrcJITDylibAddGenerator,
449 * The GlobalPrefix argument specifies the character that appears on the front
450 * of linker-mangled symbols for the target platform (e.g. '_' on MachO).
451 * If non-null, this character will be stripped from the start of all symbol
452 * strings before passing the remaining substring to dlsym.
454 * The optional Filter and Ctx arguments can be used to supply a symbol name
455 * filter: Only symbols for which the filter returns true will be visible to
456 * JIT'd code. If the Filter argument is null then all process symbols will
457 * be visible to JIT'd code. Note that the symbol name passed to the Filter
458 * function is the full mangled symbol: The client is responsible for stripping
459 * the global prefix if present.
461 LLVMErrorRef LLVMOrcCreateDynamicLibrarySearchGeneratorForProcess(
462 LLVMOrcDefinitionGeneratorRef *Result, char GlobalPrefx,
463 LLVMOrcSymbolPredicate Filter, void *FilterCtx);
466 * Create a ThreadSafeContext containing a new LLVMContext.
468 * Ownership of the underlying ThreadSafeContext data is shared: Clients
469 * can and should dispose of their ThreadSafeContext as soon as they no longer
470 * need to refer to it directly. Other references (e.g. from ThreadSafeModules)
471 * will keep the data alive as long as it is needed.
473 LLVMOrcThreadSafeContextRef LLVMOrcCreateNewThreadSafeContext(void);
476 * Get a reference to the wrapped LLVMContext.
479 LLVMOrcThreadSafeContextGetContext(LLVMOrcThreadSafeContextRef TSCtx);
482 * Dispose of a ThreadSafeContext.
484 void LLVMOrcDisposeThreadSafeContext(LLVMOrcThreadSafeContextRef TSCtx);
487 * Create a ThreadSafeModule wrapper around the given LLVM module. This takes
488 * ownership of the M argument which should not be disposed of or referenced
489 * after this function returns.
491 * Ownership of the ThreadSafeModule is unique: If it is transferred to the JIT
492 * (e.g. by LLVMOrcLLJITAddLLVMIRModule) then the client is no longer
493 * responsible for it. If it is not transferred to the JIT then the client
494 * should call LLVMOrcDisposeThreadSafeModule to dispose of it.
496 LLVMOrcThreadSafeModuleRef
497 LLVMOrcCreateNewThreadSafeModule(LLVMModuleRef M,
498 LLVMOrcThreadSafeContextRef TSCtx);
501 * Dispose of a ThreadSafeModule. This should only be called if ownership has
502 * not been passed to LLJIT (e.g. because some error prevented the client from
503 * adding this to the JIT).
505 void LLVMOrcDisposeThreadSafeModule(LLVMOrcThreadSafeModuleRef TSM);
508 * Create a JITTargetMachineBuilder by detecting the host.
510 * On success the client owns the resulting JITTargetMachineBuilder. It must be
511 * passed to a consuming operation (e.g. LLVMOrcCreateLLJITBuilder) or disposed
512 * of by calling LLVMOrcDisposeJITTargetMachineBuilder.
514 LLVMErrorRef LLVMOrcJITTargetMachineBuilderDetectHost(
515 LLVMOrcJITTargetMachineBuilderRef *Result);
518 * Create a JITTargetMachineBuilder from the given TargetMachine template.
520 * This operation takes ownership of the given TargetMachine and destroys it
521 * before returing. The resulting JITTargetMachineBuilder is owned by the client
522 * and must be passed to a consuming operation (e.g. LLVMOrcCreateLLJITBuilder)
523 * or disposed of by calling LLVMOrcDisposeJITTargetMachineBuilder.
525 LLVMOrcJITTargetMachineBuilderRef
526 LLVMOrcJITTargetMachineBuilderCreateFromTargetMachine(LLVMTargetMachineRef TM);
529 * Dispose of a JITTargetMachineBuilder.
531 void LLVMOrcDisposeJITTargetMachineBuilder(
532 LLVMOrcJITTargetMachineBuilderRef JTMB);
535 * Create an LLJITTargetMachineBuilder.
537 * The client owns the resulting LLJITBuilder and should dispose of it using
538 * LLVMOrcDisposeLLJITBuilder once they are done with it.
540 LLVMOrcLLJITBuilderRef LLVMOrcCreateLLJITBuilder(void);
543 * Dispose of an LLVMOrcLLJITBuilderRef. This should only be called if ownership
544 * has not been passed to LLVMOrcCreateLLJIT (e.g. because some error prevented
545 * that function from being called).
547 void LLVMOrcDisposeLLJITBuilder(LLVMOrcLLJITBuilderRef Builder);
550 * Set the JITTargetMachineBuilder to be used when constructing the LLJIT
551 * instance. Calling this function is optional: if it is not called then the
552 * LLJITBuilder will use JITTargeTMachineBuilder::detectHost to construct a
553 * JITTargetMachineBuilder.
555 void LLVMOrcLLJITBuilderSetJITTargetMachineBuilder(
556 LLVMOrcLLJITBuilderRef Builder, LLVMOrcJITTargetMachineBuilderRef JTMB);
559 * Create an LLJIT instance from an LLJITBuilder.
561 * This operation takes ownership of the Builder argument: clients should not
562 * dispose of the builder after calling this function (even if the function
563 * returns an error). If a null Builder argument is provided then a
564 * default-constructed LLJITBuilder will be used.
566 * On success the resulting LLJIT instance is uniquely owned by the client and
567 * automatically manages the memory of all JIT'd code and all modules that are
568 * transferred to it (e.g. via LLVMOrcLLJITAddLLVMIRModule). Disposing of the
569 * LLJIT instance will free all memory managed by the JIT, including JIT'd code
570 * and not-yet compiled modules.
572 LLVMErrorRef LLVMOrcCreateLLJIT(LLVMOrcLLJITRef *Result,
573 LLVMOrcLLJITBuilderRef Builder);
576 * Dispose of an LLJIT instance.
578 LLVMErrorRef LLVMOrcDisposeLLJIT(LLVMOrcLLJITRef J);
581 * Get a reference to the ExecutionSession for this LLJIT instance.
583 * The ExecutionSession is owned by the LLJIT instance. The client is not
584 * responsible for managing its memory.
586 LLVMOrcExecutionSessionRef LLVMOrcLLJITGetExecutionSession(LLVMOrcLLJITRef J);
589 * Return a reference to the Main JITDylib.
591 * The JITDylib is owned by the LLJIT instance. The client is not responsible
592 * for managing its memory.
594 LLVMOrcJITDylibRef LLVMOrcLLJITGetMainJITDylib(LLVMOrcLLJITRef J);
597 * Return the target triple for this LLJIT instance. This string is owned by
598 * the LLJIT instance and should not be freed by the client.
600 const char *LLVMOrcLLJITGetTripleString(LLVMOrcLLJITRef J);
603 * Returns the global prefix character according to the LLJIT's DataLayout.
605 char LLVMOrcLLJITGetGlobalPrefix(LLVMOrcLLJITRef J);
608 * Mangles the given string according to the LLJIT instance's DataLayout, then
609 * interns the result in the SymbolStringPool and returns a reference to the
610 * pool entry. Clients should call LLVMOrcReleaseSymbolStringPoolEntry to
611 * decrement the ref-count on the pool entry once they are finished with this
614 LLVMOrcSymbolStringPoolEntryRef
615 LLVMOrcLLJITMangleAndIntern(LLVMOrcLLJITRef J, const char *UnmangledName);
618 * Add a buffer representing an object file to the given JITDylib in the given
619 * LLJIT instance. This operation transfers ownership of the buffer to the
620 * LLJIT instance. The buffer should not be disposed of or referenced once this
623 * Resources associated with the given object will be tracked by the given
624 * JITDylib's default resource tracker.
626 LLVMErrorRef LLVMOrcLLJITAddObjectFile(LLVMOrcLLJITRef J, LLVMOrcJITDylibRef JD,
627 LLVMMemoryBufferRef ObjBuffer);
630 * Add a buffer representing an object file to the given ResourceTracker's
631 * JITDylib in the given LLJIT instance. This operation transfers ownership of
632 * the buffer to the LLJIT instance. The buffer should not be disposed of or
633 * referenced once this function returns.
635 * Resources associated with the given object will be tracked by ResourceTracker
638 LLVMErrorRef LLVMOrcLLJITAddObjectFileWithRT(LLVMOrcLLJITRef J,
639 LLVMOrcResourceTrackerRef RT,
640 LLVMMemoryBufferRef ObjBuffer);
643 * Add an IR module to the given JITDylib in the given LLJIT instance. This
644 * operation transfers ownership of the TSM argument to the LLJIT instance.
645 * The TSM argument should not be disposed of or referenced once this
648 * Resources associated with the given Module will be tracked by the given
649 * JITDylib's default resource tracker.
651 LLVMErrorRef LLVMOrcLLJITAddLLVMIRModule(LLVMOrcLLJITRef J,
652 LLVMOrcJITDylibRef JD,
653 LLVMOrcThreadSafeModuleRef TSM);
656 * Add an IR module to the given ResourceTracker's JITDylib in the given LLJIT
657 * instance. This operation transfers ownership of the TSM argument to the LLJIT
658 * instance. The TSM argument should not be disposed of or referenced once this
661 * Resources associated with the given Module will be tracked by ResourceTracker
664 LLVMErrorRef LLVMOrcLLJITAddLLVMIRModuleWithRT(LLVMOrcLLJITRef J,
665 LLVMOrcResourceTrackerRef JD,
666 LLVMOrcThreadSafeModuleRef TSM);
669 * Look up the given symbol in the main JITDylib of the given LLJIT instance.
671 * This operation does not take ownership of the Name argument.
673 LLVMErrorRef LLVMOrcLLJITLookup(LLVMOrcLLJITRef J,
674 LLVMOrcJITTargetAddress *Result,
679 #endif /* LLVM_C_ORC_H */