@@ -38,6 +38,35 @@ LLVM_C_EXTERN_C_BEGIN
38
38
*/
39
39
typedef uint64_t LLVMOrcJITTargetAddress;
40
40
41
+ /* *
42
+ * Represents generic linkage flags for a symbol definition.
43
+ */
44
+ typedef enum {
45
+ LLVMJITSymbolGenericFlagsExported = 1U << 0 ,
46
+ LLVMJITSymbolGenericFlagsWeak = 1U << 1
47
+ } LLVMJITSymbolGenericFlags;
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;
60
+ } LLVMJITSymbolFlags;
61
+
62
+ /* *
63
+ * Represents an evaluated symbol address and flags.
64
+ */
65
+ typedef struct {
66
+ LLVMOrcJITTargetAddress Address;
67
+ LLVMJITSymbolFlags Flags;
68
+ } LLVMJITEvaluatedSymbol;
69
+
41
70
/* *
42
71
* A reference to an orc::ExecutionSession instance.
43
72
*/
@@ -59,6 +88,20 @@ typedef struct LLVMOrcOpaqueSymbolStringPool *LLVMOrcSymbolStringPoolRef;
59
88
typedef struct LLVMOrcOpaqueSymbolStringPoolEntry
60
89
*LLVMOrcSymbolStringPoolEntryRef;
61
90
91
+ /* *
92
+ * Represents a pair of a symbol name and an evaluated symbol.
93
+ */
94
+ typedef struct {
95
+ LLVMOrcSymbolStringPoolEntryRef Name;
96
+ LLVMJITEvaluatedSymbol Sym;
97
+ } LLVMJITCSymbolMapPair;
98
+
99
+ /* *
100
+ * Represents a list of (SymbolStringPtr, JITEvaluatedSymbol) pairs that can be
101
+ * used to construct a SymbolMap.
102
+ */
103
+ typedef LLVMJITCSymbolMapPair *LLVMOrcCSymbolMapPairs;
104
+
62
105
/* *
63
106
* Lookup kind. This can be used by definition generators when deciding whether
64
107
* to produce a definition for a requested symbol.
@@ -111,6 +154,11 @@ typedef struct {
111
154
*/
112
155
typedef LLVMOrcCLookupSetElement *LLVMOrcCLookupSet;
113
156
157
+ /* *
158
+ * A reference to an orc::MaterializationUnit.
159
+ */
160
+ typedef struct LLVMOrcOpaqueMaterializationUnit *LLVMOrcMaterializationUnitRef;
161
+
114
162
/* *
115
163
* A reference to an orc::JITDylib instance.
116
164
*/
@@ -178,7 +226,7 @@ typedef LLVMErrorRef (*LLVMOrcCAPIDefinitionGeneratorTryToGenerateFunction)(
178
226
LLVMOrcDefinitionGeneratorRef GeneratorObj, void *Ctx,
179
227
LLVMOrcLookupStateRef *LookupState, LLVMOrcLookupKind Kind,
180
228
LLVMOrcJITDylibRef JD, LLVMOrcJITDylibLookupFlags JDLookupFlags,
181
- LLVMOrcCLookupSet LookupSet);
229
+ LLVMOrcCLookupSet LookupSet, size_t LookupSetSize );
182
230
183
231
/* *
184
232
* Predicate function for SymbolStringPoolEntries.
@@ -271,22 +319,6 @@ void LLVMOrcRetainSymbolStringPoolEntry(LLVMOrcSymbolStringPoolEntryRef S);
271
319
*/
272
320
void LLVMOrcReleaseSymbolStringPoolEntry (LLVMOrcSymbolStringPoolEntryRef S);
273
321
274
- /* *
275
- * Return a reference to a newly created resource tracker associated with JD.
276
- * The tracker is returned with an initial ref-count of 1, and must be released
277
- * with LLVMOrcReleaseResourceTracker when no longer needed.
278
- */
279
- LLVMOrcResourceTrackerRef
280
- LLVMOrcJITDylibCreateResourceTracker (LLVMOrcJITDylibRef JD);
281
-
282
- /* *
283
- * Return a reference to the default resource tracker for the given JITDylib.
284
- * This operation will increase the retain count of the tracker: Clients should
285
- * call LLVMOrcReleaseResourceTracker when the result is no longer needed.
286
- */
287
- LLVMOrcResourceTrackerRef
288
- LLVMOrcJITDylibGetDefaultResourceTracker (LLVMOrcJITDylibRef JD);
289
-
290
322
/* *
291
323
* Reduces the ref-count of a ResourceTracker.
292
324
*/
@@ -313,6 +345,18 @@ LLVMErrorRef LLVMOrcResourceTrackerRemove(LLVMOrcResourceTrackerRef RT);
313
345
void LLVMOrcDisposeDefinitionGenerator (
314
346
LLVMOrcDefinitionGeneratorRef DG);
315
347
348
+ /* *
349
+ * Dispose of a MaterializationUnit.
350
+ */
351
+ void LLVMOrcDisposeMaterializationUnit (LLVMOrcMaterializationUnitRef MU);
352
+
353
+ /* *
354
+ * Create a MaterializationUnit to define the given symbols as pointing to
355
+ * the corresponding raw addresses.
356
+ */
357
+ LLVMOrcMaterializationUnitRef
358
+ LLVMOrcAbsoluteSymbols (LLVMOrcCSymbolMapPairs Syms, size_t NumPairs);
359
+
316
360
/* *
317
361
* Create a "bare" JITDylib.
318
362
*
@@ -349,6 +393,32 @@ LLVMOrcExecutionSessionCreateJITDylib(LLVMOrcExecutionSessionRef ES,
349
393
*/
350
394
LLVMOrcJITDylibRef LLVMOrcExecutionSessionGetJITDylibByName (const char *Name);
351
395
396
+ /* *
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.
400
+ */
401
+ LLVMOrcResourceTrackerRef
402
+ LLVMOrcJITDylibCreateResourceTracker (LLVMOrcJITDylibRef JD);
403
+
404
+ /* *
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.
408
+ */
409
+ LLVMOrcResourceTrackerRef
410
+ LLVMOrcJITDylibGetDefaultResourceTracker (LLVMOrcJITDylibRef JD);
411
+
412
+ /* *
413
+ * Add the given MaterializationUnit to the given JITDylib.
414
+ *
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.
418
+ */
419
+ LLVMErrorRef LLVMOrcJITDylibDefine (LLVMOrcJITDylibRef JD,
420
+ LLVMOrcMaterializationUnitRef MU);
421
+
352
422
/* *
353
423
* Calls remove on all trackers associated with this JITDylib, see
354
424
* JITDylib::clear().
0 commit comments