LLVM  12.0.0git
Orc.h
Go to the documentation of this file.
1 /*===---------------- llvm-c/Orc.h - OrcV2 C bindings -----------*- C++ -*-===*\
2 |* *|
3 |* Part of the LLVM Project, under the Apache License v2.0 with LLVM *|
4 |* Exceptions. *|
5 |* See https://llvm.org/LICENSE.txt for license information. *|
6 |* SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception *|
7 |* *|
8 |*===----------------------------------------------------------------------===*|
9 |* *|
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++ *|
14 |* headers *|
15 |* *|
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. *|
19 |* *|
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 *|
23 |* details. *|
24 |* *|
25 \*===----------------------------------------------------------------------===*/
26 
27 #ifndef LLVM_C_ORC_H
28 #define LLVM_C_ORC_H
29 
30 #include "llvm-c/Error.h"
31 #include "llvm-c/TargetMachine.h"
32 #include "llvm-c/Types.h"
33 
35 
36 /**
37  * Represents an address in the target process.
38  */
39 typedef uint64_t LLVMOrcJITTargetAddress;
40 
41 /**
42  * Represents generic linkage flags for a symbol definition.
43  */
44 typedef enum {
48 
49 /**
50  * Represents target specific flags for a symbol definition.
51  */
52 typedef uint8_t LLVMJITTargetSymbolFlags;
53 
54 /**
55  * Represents the linkage flags for a symbol definition.
56  */
57 typedef struct {
58  uint8_t GenericFlags;
59  uint8_t TargetFlags;
61 
62 /**
63  * Represents an evaluated symbol address and flags.
64  */
65 typedef struct {
69 
70 /**
71  * A reference to an orc::ExecutionSession instance.
72  */
73 typedef struct LLVMOrcOpaqueExecutionSession *LLVMOrcExecutionSessionRef;
74 
75 /**
76  * Error reporter function.
77  */
78 typedef void (*LLVMOrcErrorReporterFunction)(void *Ctx, LLVMErrorRef Err);
79 
80 /**
81  * A reference to an orc::SymbolStringPool.
82  */
83 typedef struct LLVMOrcOpaqueSymbolStringPool *LLVMOrcSymbolStringPoolRef;
84 
85 /**
86  * A reference to an orc::SymbolStringPool table entry.
87  */
88 typedef struct LLVMOrcOpaqueSymbolStringPoolEntry
90 
91 /**
92  * Represents a pair of a symbol name and an evaluated symbol.
93  */
94 typedef struct {
98 
99 /**
100  * Represents a list of (SymbolStringPtr, JITEvaluatedSymbol) pairs that can be
101  * used to construct a SymbolMap.
102  */
104 
105 /**
106  * Lookup kind. This can be used by definition generators when deciding whether
107  * to produce a definition for a requested symbol.
108  *
109  * This enum should be kept in sync with llvm::orc::LookupKind.
110  */
111 typedef enum {
115 
116 /**
117  * JITDylib lookup flags. This can be used by definition generators when
118  * deciding whether to produce a definition for a requested symbol.
119  *
120  * This enum should be kept in sync with llvm::orc::JITDylibLookupFlags.
121  */
122 typedef enum {
126 
127 /**
128  * Symbol lookup flags for lookup sets. This should be kept in sync with
129  * llvm::orc::SymbolLookupFlags.
130  */
131 typedef enum {
135 
136 /**
137  * An element type for a symbol lookup set.
138  */
139 typedef struct {
143 
144 /**
145  * A set of symbols to look up / generate.
146  *
147  * The list is terminated with an element containing a null pointer for the
148  * Name field.
149  *
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.
154  */
156 
157 /**
158  * A reference to an orc::MaterializationUnit.
159  */
160 typedef struct LLVMOrcOpaqueMaterializationUnit *LLVMOrcMaterializationUnitRef;
161 
162 /**
163  * A reference to an orc::JITDylib instance.
164  */
165 typedef struct LLVMOrcOpaqueJITDylib *LLVMOrcJITDylibRef;
166 
167 /**
168  * A reference to an orc::ResourceTracker instance.
169  */
170 typedef struct LLVMOrcOpaqueResourceTracker *LLVMOrcResourceTrackerRef;
171 
172 /**
173  * A reference to an orc::DefinitionGenerator.
174  */
175 typedef struct LLVMOrcOpaqueDefinitionGenerator
177 
178 /**
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
181  * definition.
182  *
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
188  * destruction).
189  */
190 typedef struct LLVMOrcOpaqueLookupState *LLVMOrcLookupStateRef;
191 
192 /**
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.
197  *
198  * GeneratorObj will contain the address of the custom generator object.
199  *
200  * Ctx will contain the context object passed to
201  * LLVMOrcCreateCustomCAPIDefinitionGenerator.
202  *
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.
212  *
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).
215  *
216  * The JD argument specifies which JITDylib the definitions should be generated
217  * into.
218  *
219  * The JDLookupFlags argument can be inspected to determine whether the original
220  * lookup included non-exported symobls.
221  *
222  * Finally, the LookupSet argument contains the set of symbols that could not
223  * be found in JD already (the set of generation candidates).
224  */
226  LLVMOrcDefinitionGeneratorRef GeneratorObj, void *Ctx,
229  LLVMOrcCLookupSet LookupSet, size_t LookupSetSize);
230 
231 /**
232  * Predicate function for SymbolStringPoolEntries.
233  */
234 typedef int (*LLVMOrcSymbolPredicate)(void *Ctx,
236 
237 /**
238  * A reference to an orc::ThreadSafeContext instance.
239  */
240 typedef struct LLVMOrcOpaqueThreadSafeContext *LLVMOrcThreadSafeContextRef;
241 
242 /**
243  * A reference to an orc::ThreadSafeModule instance.
244  */
245 typedef struct LLVMOrcOpaqueThreadSafeModule *LLVMOrcThreadSafeModuleRef;
246 
247 /**
248  * A reference to an orc::JITTargetMachineBuilder instance.
249  */
250 typedef struct LLVMOrcOpaqueJITTargetMachineBuilder
252 
253 /**
254  * A reference to an orc::ObjectLayer instance.
255  */
256 typedef struct LLVMOrcOpaqueObjectLayer *LLVMOrcObjectLayerRef;
257 
258 /**
259  * Attach a custom error reporter function to the ExecutionSession.
260  *
261  * The error reporter will be called to deliver failure notices that can not be
262  * directly reported to a caller. For example, failure to resolve symbols in
263  * the JIT linker is typically reported via the error reporter (callers
264  * requesting definitions from the JIT will typically be delivered a
265  * FailureToMaterialize error instead).
266  */
269  void *Ctx);
270 
271 /**
272  * Return a reference to the SymbolStringPool for an ExecutionSession.
273  *
274  * Ownership of the pool remains with the ExecutionSession: The caller is
275  * not required to free the pool.
276  */
279 
280 /**
281  * Clear all unreferenced symbol string pool entries.
282  *
283  * This can be called at any time to release unused entries in the
284  * ExecutionSession's string pool. Since it locks the pool (preventing
285  * interning of any new strings) it is recommended that it only be called
286  * infrequently, ideally when the caller has reason to believe that some
287  * entries will have become unreferenced, e.g. after removing a module or
288  * closing a JITDylib.
289  */
291 
292 /**
293  * Intern a string in the ExecutionSession's SymbolStringPool and return a
294  * reference to it. This increments the ref-count of the pool entry, and the
295  * returned value should be released once the client is done with it by
296  * calling LLVMOrReleaseSymbolStringPoolEntry.
297  *
298  * Since strings are uniqued within the SymbolStringPool
299  * LLVMOrcSymbolStringPoolEntryRefs can be compared by value to test string
300  * equality.
301  *
302  * Note that this function does not perform linker-mangling on the string.
303  */
306 
307 /**
308  * Increments the ref-count for a SymbolStringPool entry.
309  */
311 
312 /**
313  * Reduces the ref-count for of a SymbolStringPool entry.
314  */
316 
318 
319 /**
320  * Reduces the ref-count of a ResourceTracker.
321  */
323 
324 /**
325  * Transfers tracking of all resources associated with resource tracker SrcRT
326  * to resource tracker DstRT.
327  */
330 
331 /**
332  * Remove all resources associated with the given tracker. See
333  * ResourceTracker::remove().
334  */
336 
337 /**
338  * Dispose of a JITDylib::DefinitionGenerator. This should only be called if
339  * ownership has not been passed to a JITDylib (e.g. because some error
340  * prevented the client from calling LLVMOrcJITDylibAddGenerator).
341  */
344 
345 /**
346  * Dispose of a MaterializationUnit.
347  */
349 
350 /**
351  * Create a MaterializationUnit to define the given symbols as pointing to
352  * the corresponding raw addresses.
353  */
355 LLVMOrcAbsoluteSymbols(LLVMOrcCSymbolMapPairs Syms, size_t NumPairs);
356 
357 /**
358  * Create a "bare" JITDylib.
359  *
360  * The client is responsible for ensuring that the JITDylib's name is unique,
361  * e.g. by calling LLVMOrcExecutionSessionGetJTIDylibByName first.
362  *
363  * This call does not install any library code or symbols into the newly
364  * created JITDylib. The client is responsible for all configuration.
365  */
368  const char *Name);
369 
370 /**
371  * Create a JITDylib.
372  *
373  * The client is responsible for ensuring that the JITDylib's name is unique,
374  * e.g. by calling LLVMOrcExecutionSessionGetJTIDylibByName first.
375  *
376  * If a Platform is attached to the ExecutionSession then
377  * Platform::setupJITDylib will be called to install standard platform symbols
378  * (e.g. standard library interposes). If no Platform is installed then this
379  * call is equivalent to LLVMExecutionSessionRefCreateBareJITDylib and will
380  * always return success.
381  */
384  LLVMOrcJITDylibRef *Result,
385  const char *Name);
386 
387 /**
388  * Returns the JITDylib with the given name, or NULL if no such JITDylib
389  * exists.
390  */
392 
393 /**
394  * Return a reference to a newly created resource tracker associated with JD.
395  * The tracker is returned with an initial ref-count of 1, and must be released
396  * with LLVMOrcReleaseResourceTracker when no longer needed.
397  */
400 
401 /**
402  * Return a reference to the default resource tracker for the given JITDylib.
403  * This operation will increase the retain count of the tracker: Clients should
404  * call LLVMOrcReleaseResourceTracker when the result is no longer needed.
405  */
408 
409 /**
410  * Add the given MaterializationUnit to the given JITDylib.
411  *
412  * If this operation succeeds then JITDylib JD will take ownership of MU.
413  * If the operation fails then ownership remains with the caller who should
414  * call LLVMOrcDisposeMaterializationUnit to destroy it.
415  */
418 
419 /**
420  * Calls remove on all trackers associated with this JITDylib, see
421  * JITDylib::clear().
422  */
424 
425 /**
426  * Add a DefinitionGenerator to the given JITDylib.
427  *
428  * The JITDylib will take ownership of the given generator: The client is no
429  * longer responsible for managing its memory.
430  */
433 
434 /**
435  * Create a custom generator.
436  */
439 
440 /**
441  * Get a DynamicLibrarySearchGenerator that will reflect process symbols into
442  * the JITDylib. On success the resulting generator is owned by the client.
443  * Ownership is typically transferred by adding the instance to a JITDylib
444  * using LLVMOrcJITDylibAddGenerator,
445  *
446  * The GlobalPrefix argument specifies the character that appears on the front
447  * of linker-mangled symbols for the target platform (e.g. '_' on MachO).
448  * If non-null, this character will be stripped from the start of all symbol
449  * strings before passing the remaining substring to dlsym.
450  *
451  * The optional Filter and Ctx arguments can be used to supply a symbol name
452  * filter: Only symbols for which the filter returns true will be visible to
453  * JIT'd code. If the Filter argument is null then all process symbols will
454  * be visible to JIT'd code. Note that the symbol name passed to the Filter
455  * function is the full mangled symbol: The client is responsible for stripping
456  * the global prefix if present.
457  */
459  LLVMOrcDefinitionGeneratorRef *Result, char GlobalPrefx,
460  LLVMOrcSymbolPredicate Filter, void *FilterCtx);
461 
462 /**
463  * Create a ThreadSafeContext containing a new LLVMContext.
464  *
465  * Ownership of the underlying ThreadSafeContext data is shared: Clients
466  * can and should dispose of their ThreadSafeContext as soon as they no longer
467  * need to refer to it directly. Other references (e.g. from ThreadSafeModules)
468  * will keep the data alive as long as it is needed.
469  */
471 
472 /**
473  * Get a reference to the wrapped LLVMContext.
474  */
477 
478 /**
479  * Dispose of a ThreadSafeContext.
480  */
482 
483 /**
484  * Create a ThreadSafeModule wrapper around the given LLVM module. This takes
485  * ownership of the M argument which should not be disposed of or referenced
486  * after this function returns.
487  *
488  * Ownership of the ThreadSafeModule is unique: If it is transferred to the JIT
489  * (e.g. by LLVMOrcLLJITAddLLVMIRModule) then the client is no longer
490  * responsible for it. If it is not transferred to the JIT then the client
491  * should call LLVMOrcDisposeThreadSafeModule to dispose of it.
492  */
496 
497 /**
498  * Dispose of a ThreadSafeModule. This should only be called if ownership has
499  * not been passed to LLJIT (e.g. because some error prevented the client from
500  * adding this to the JIT).
501  */
503 
504 /**
505  * Create a JITTargetMachineBuilder by detecting the host.
506  *
507  * On success the client owns the resulting JITTargetMachineBuilder. It must be
508  * passed to a consuming operation (e.g. LLVMOrcCreateLLJITBuilder) or disposed
509  * of by calling LLVMOrcDisposeJITTargetMachineBuilder.
510  */
513 
514 /**
515  * Create a JITTargetMachineBuilder from the given TargetMachine template.
516  *
517  * This operation takes ownership of the given TargetMachine and destroys it
518  * before returing. The resulting JITTargetMachineBuilder is owned by the client
519  * and must be passed to a consuming operation (e.g. LLVMOrcCreateLLJITBuilder)
520  * or disposed of by calling LLVMOrcDisposeJITTargetMachineBuilder.
521  */
524 
525 /**
526  * Dispose of a JITTargetMachineBuilder.
527  */
530 
531 /**
532  * Dispose of an ObjectLayer.
533  */
535 
537 
538 #endif /* LLVM_C_ORC_H */
void LLVMOrcJITDylibAddGenerator(LLVMOrcJITDylibRef JD, LLVMOrcDefinitionGeneratorRef DG)
Add a DefinitionGenerator to the given JITDylib.
LLVMJITCSymbolMapPair * LLVMOrcCSymbolMapPairs
Represents a list of (SymbolStringPtr, JITEvaluatedSymbol) pairs that can be used to construct a Symb...
Definition: Orc.h:103
LLVMErrorRef LLVMOrcJITDylibDefine(LLVMOrcJITDylibRef JD, LLVMOrcMaterializationUnitRef MU)
Add the given MaterializationUnit to the given JITDylib.
struct LLVMOpaqueModule * LLVMModuleRef
The top-level container for all other LLVM Intermediate Representation (IR) objects.
Definition: Types.h:61
void LLVMOrcDisposeThreadSafeContext(LLVMOrcThreadSafeContextRef TSCtx)
Dispose of a ThreadSafeContext.
void LLVMOrcRetainSymbolStringPoolEntry(LLVMOrcSymbolStringPoolEntryRef S)
Increments the ref-count for a SymbolStringPool entry.
F(f)
void LLVMOrcDisposeMaterializationUnit(LLVMOrcMaterializationUnitRef MU)
Dispose of a MaterializationUnit.
LLVMOrcJITTargetMachineBuilderRef LLVMOrcJITTargetMachineBuilderCreateFromTargetMachine(LLVMTargetMachineRef TM)
Create a JITTargetMachineBuilder from the given TargetMachine template.
LLVMOrcSymbolStringPoolEntryRef Name
Definition: Orc.h:140
LLVMOrcCLookupSetElement * LLVMOrcCLookupSet
A set of symbols to look up / generate.
Definition: Orc.h:155
struct LLVMOrcOpaqueSymbolStringPool * LLVMOrcSymbolStringPoolRef
A reference to an orc::SymbolStringPool.
Definition: Orc.h:83
LLVMOrcThreadSafeModuleRef LLVMOrcCreateNewThreadSafeModule(LLVMModuleRef M, LLVMOrcThreadSafeContextRef TSCtx)
Create a ThreadSafeModule wrapper around the given LLVM module.
LLVMOrcJITTargetAddress Address
Definition: Orc.h:66
void LLVMOrcExecutionSessionSetErrorReporter(LLVMOrcExecutionSessionRef ES, LLVMOrcErrorReporterFunction ReportError, void *Ctx)
Attach a custom error reporter function to the ExecutionSession.
int(* LLVMOrcSymbolPredicate)(void *Ctx, LLVMOrcSymbolStringPoolEntryRef Sym)
Predicate function for SymbolStringPoolEntries.
Definition: Orc.h:234
LLVMOrcThreadSafeContextRef LLVMOrcCreateNewThreadSafeContext(void)
Create a ThreadSafeContext containing a new LLVMContext.
LLVMOrcLookupKind
Lookup kind.
Definition: Orc.h:111
struct LLVMOpaqueContext * LLVMContextRef
The top-level container for all LLVM global data.
Definition: Types.h:53
void LLVMOrcReleaseSymbolStringPoolEntry(LLVMOrcSymbolStringPoolEntryRef S)
Reduces the ref-count for of a SymbolStringPool entry.
LLVMOrcDefinitionGeneratorRef LLVMOrcCreateCustomCAPIDefinitionGenerator(LLVMOrcCAPIDefinitionGeneratorTryToGenerateFunction F, void *Ctx)
Create a custom generator.
LLVMOrcJITDylibRef LLVMOrcExecutionSessionCreateBareJITDylib(LLVMOrcExecutionSessionRef ES, const char *Name)
Create a "bare" JITDylib.
An element type for a symbol lookup set.
Definition: Orc.h:139
LLVMErrorRef LLVMOrcResourceTrackerRemove(LLVMOrcResourceTrackerRef RT)
Remove all resources associated with the given tracker.
struct LLVMOrcOpaqueThreadSafeContext * LLVMOrcThreadSafeContextRef
A reference to an orc::ThreadSafeContext instance.
Definition: Orc.h:240
struct LLVMOpaqueError * LLVMErrorRef
Opaque reference to an error instance.
Definition: Error.h:26
void LLVMOrcReleaseResourceTracker(LLVMOrcResourceTrackerRef RT)
Reduces the ref-count of a ResourceTracker.
LLVMErrorRef LLVMOrcExecutionSessionCreateJITDylib(LLVMOrcExecutionSessionRef ES, LLVMOrcJITDylibRef *Result, const char *Name)
Create a JITDylib.
struct LLVMOrcOpaqueObjectLayer * LLVMOrcObjectLayerRef
A reference to an orc::ObjectLayer instance.
Definition: Orc.h:256
uint8_t TargetFlags
Definition: Orc.h:59
Represents a pair of a symbol name and an evaluated symbol.
Definition: Orc.h:94
struct LLVMOrcOpaqueResourceTracker * LLVMOrcResourceTrackerRef
A reference to an orc::ResourceTracker instance.
Definition: Orc.h:170
typedefLLVM_C_EXTERN_C_BEGIN struct LLVMOpaqueTargetMachine * LLVMTargetMachineRef
Definition: TargetMachine.h:28
LLVMJITSymbolGenericFlags
Represents generic linkage flags for a symbol definition.
Definition: Orc.h:44
void LLVMOrcDisposeJITTargetMachineBuilder(LLVMOrcJITTargetMachineBuilderRef JTMB)
Dispose of a JITTargetMachineBuilder.
void LLVMOrcResourceTrackerTransferTo(LLVMOrcResourceTrackerRef SrcRT, LLVMOrcResourceTrackerRef DstRT)
Transfers tracking of all resources associated with resource tracker SrcRT to resource tracker DstRT.
void LLVMOrcDisposeThreadSafeModule(LLVMOrcThreadSafeModuleRef TSM)
Dispose of a ThreadSafeModule.
LLVMErrorRef LLVMOrcCreateDynamicLibrarySearchGeneratorForProcess(LLVMOrcDefinitionGeneratorRef *Result, char GlobalPrefx, LLVMOrcSymbolPredicate Filter, void *FilterCtx)
Get a DynamicLibrarySearchGenerator that will reflect process symbols into the JITDylib.
struct LLVMOrcOpaqueDefinitionGenerator * LLVMOrcDefinitionGeneratorRef
A reference to an orc::DefinitionGenerator.
Definition: Orc.h:175
LLVMOrcMaterializationUnitRef LLVMOrcAbsoluteSymbols(LLVMOrcCSymbolMapPairs Syms, size_t NumPairs)
Create a MaterializationUnit to define the given symbols as pointing to the corresponding raw address...
struct LLVMOrcOpaqueJITDylib * LLVMOrcJITDylibRef
A reference to an orc::JITDylib instance.
Definition: Orc.h:165
LLVMErrorRef(* LLVMOrcCAPIDefinitionGeneratorTryToGenerateFunction)(LLVMOrcDefinitionGeneratorRef GeneratorObj, void *Ctx, LLVMOrcLookupStateRef *LookupState, LLVMOrcLookupKind Kind, LLVMOrcJITDylibRef JD, LLVMOrcJITDylibLookupFlags JDLookupFlags, LLVMOrcCLookupSet LookupSet, size_t LookupSetSize)
A custom generator function.
Definition: Orc.h:225
struct LLVMOrcOpaqueLookupState * LLVMOrcLookupStateRef
An opaque lookup state object.
Definition: Orc.h:190
LLVMOrcSymbolStringPoolEntryRef Name
Definition: Orc.h:95
LLVMJITEvaluatedSymbol Sym
Definition: Orc.h:96
struct LLVMOrcOpaqueMaterializationUnit * LLVMOrcMaterializationUnitRef
A reference to an orc::MaterializationUnit.
Definition: Orc.h:160
LLVMOrcResourceTrackerRef LLVMOrcJITDylibGetDefaultResourceTracker(LLVMOrcJITDylibRef JD)
Return a reference to the default resource tracker for the given JITDylib.
LLVMOrcResourceTrackerRef LLVMOrcJITDylibCreateResourceTracker(LLVMOrcJITDylibRef JD)
Return a reference to a newly created resource tracker associated with JD.
LLVM_C_EXTERN_C_BEGIN typedef uint64_t LLVMOrcJITTargetAddress
Represents an address in the target process.
Definition: Orc.h:39
void LLVMOrcDisposeDefinitionGenerator(LLVMOrcDefinitionGeneratorRef DG)
Dispose of a JITDylib::DefinitionGenerator.
struct LLVMOrcOpaqueThreadSafeModule * LLVMOrcThreadSafeModuleRef
A reference to an orc::ThreadSafeModule instance.
Definition: Orc.h:245
uint8_t GenericFlags
Definition: Orc.h:58
LLVMJITSymbolFlags Flags
Definition: Orc.h:67
Represents the linkage flags for a symbol definition.
Definition: Orc.h:57
LLVMOrcJITDylibLookupFlags
JITDylib lookup flags.
Definition: Orc.h:122
struct LLVMOrcOpaqueExecutionSession * LLVMOrcExecutionSessionRef
A reference to an orc::ExecutionSession instance.
Definition: Orc.h:73
LLVMOrcJITDylibRef LLVMOrcExecutionSessionGetJITDylibByName(const char *Name)
Returns the JITDylib with the given name, or NULL if no such JITDylib exists.
LLVMOrcSymbolLookupFlags LookupFlags
Definition: Orc.h:141
LLVMErrorRef LLVMOrcJITDylibClear(LLVMOrcJITDylibRef JD)
Calls remove on all trackers associated with this JITDylib, see JITDylib::clear().
LLVMErrorRef LLVMOrcJITTargetMachineBuilderDetectHost(LLVMOrcJITTargetMachineBuilderRef *Result)
Create a JITTargetMachineBuilder by detecting the host.
LLVMContextRef LLVMOrcThreadSafeContextGetContext(LLVMOrcThreadSafeContextRef TSCtx)
Get a reference to the wrapped LLVMContext.
void LLVMOrcSymbolStringPoolClearDeadEntries(LLVMOrcSymbolStringPoolRef SSP)
Clear all unreferenced symbol string pool entries.
#define LLVM_C_EXTERN_C_END
Definition: ExternC.h:36
#define LLVM_C_EXTERN_C_BEGIN
Definition: ExternC.h:35
LLVMOrcSymbolStringPoolEntryRef LLVMOrcExecutionSessionIntern(LLVMOrcExecutionSessionRef ES, const char *Name)
Intern a string in the ExecutionSession's SymbolStringPool and return a reference to it.
const char * LLVMOrcSymbolStringPoolEntryStr(LLVMOrcSymbolStringPoolEntryRef S)
void LLVMOrcDisposeObjectLayer(LLVMOrcObjectLayerRef ObjLayer)
Dispose of an ObjectLayer.
LLVMOrcSymbolStringPoolRef LLVMOrcExecutionSessionGetSymbolStringPool(LLVMOrcExecutionSessionRef ES)
Return a reference to the SymbolStringPool for an ExecutionSession.
uint8_t LLVMJITTargetSymbolFlags
Represents target specific flags for a symbol definition.
Definition: Orc.h:52
void(* LLVMOrcErrorReporterFunction)(void *Ctx, LLVMErrorRef Err)
Error reporter function.
Definition: Orc.h:78
LLVMOrcSymbolLookupFlags
Symbol lookup flags for lookup sets.
Definition: Orc.h:131
struct LLVMOrcOpaqueJITTargetMachineBuilder * LLVMOrcJITTargetMachineBuilderRef
A reference to an orc::JITTargetMachineBuilder instance.
Definition: Orc.h:250
struct LLVMOrcOpaqueSymbolStringPoolEntry * LLVMOrcSymbolStringPoolEntryRef
A reference to an orc::SymbolStringPool table entry.
Definition: Orc.h:88
Represents an evaluated symbol address and flags.
Definition: Orc.h:65