LLVM  16.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  * @defgroup LLVMCExecutionEngineORC On-Request-Compilation
38  * @ingroup LLVMCExecutionEngine
39  *
40  * @{
41  */
42 
43 /**
44  * Represents an address in the executor process.
45  */
47 
48 /**
49  * Represents an address in the executor process.
50  */
52 
53 /**
54  * Represents generic linkage flags for a symbol definition.
55  */
56 typedef enum {
63 
64 /**
65  * Represents target specific flags for a symbol definition.
66  */
67 typedef uint8_t LLVMJITSymbolTargetFlags;
68 
69 /**
70  * Represents the linkage flags for a symbol definition.
71  */
72 typedef struct {
73  uint8_t GenericFlags;
74  uint8_t TargetFlags;
76 
77 /**
78  * Represents an evaluated symbol address and flags.
79  */
80 typedef struct {
84 
85 /**
86  * A reference to an orc::ExecutionSession instance.
87  */
88 typedef struct LLVMOrcOpaqueExecutionSession *LLVMOrcExecutionSessionRef;
89 
90 /**
91  * Error reporter function.
92  */
93 typedef void (*LLVMOrcErrorReporterFunction)(void *Ctx, LLVMErrorRef Err);
94 
95 /**
96  * A reference to an orc::SymbolStringPool.
97  */
98 typedef struct LLVMOrcOpaqueSymbolStringPool *LLVMOrcSymbolStringPoolRef;
99 
100 /**
101  * A reference to an orc::SymbolStringPool table entry.
102  */
103 typedef struct LLVMOrcOpaqueSymbolStringPoolEntry
105 
106 /**
107  * Represents a pair of a symbol name and LLVMJITSymbolFlags.
108  */
109 typedef struct {
113 
114 /**
115  * Represents a list of (SymbolStringPtr, JITSymbolFlags) pairs that can be used
116  * to construct a SymbolFlagsMap.
117  */
119 
120 /**
121  * Represents a pair of a symbol name and an evaluated symbol.
122  */
123 typedef struct {
127 
128 /**
129  * Represents a list of (SymbolStringPtr, JITEvaluatedSymbol) pairs that can be
130  * used to construct a SymbolMap.
131  */
133 
134 /**
135  * Represents a SymbolAliasMapEntry
136  */
137 typedef struct {
141 
142 /**
143  * Represents a pair of a symbol name and SymbolAliasMapEntry.
144  */
145 typedef struct {
149 
150 /**
151  * Represents a list of (SymbolStringPtr, (SymbolStringPtr, JITSymbolFlags))
152  * pairs that can be used to construct a SymbolFlagsMap.
153  */
155 
156 /**
157  * A reference to an orc::JITDylib instance.
158  */
159 typedef struct LLVMOrcOpaqueJITDylib *LLVMOrcJITDylibRef;
160 
161 /**
162  * Represents a list of LLVMOrcSymbolStringPoolEntryRef and the associated
163  * length.
164  */
165 typedef struct {
167  size_t Length;
169 
170 /**
171  * Represents a pair of a JITDylib and LLVMOrcCSymbolsList.
172  */
173 typedef struct {
177 
178 /**
179  * Represents a list of (JITDylibRef, (LLVMOrcSymbolStringPoolEntryRef*,
180  * size_t)) pairs that can be used to construct a SymbolDependenceMap.
181  */
183 
184 /**
185  * Lookup kind. This can be used by definition generators when deciding whether
186  * to produce a definition for a requested symbol.
187  *
188  * This enum should be kept in sync with llvm::orc::LookupKind.
189  */
190 typedef enum {
194 
195 /**
196  * JITDylib lookup flags. This can be used by definition generators when
197  * deciding whether to produce a definition for a requested symbol.
198  *
199  * This enum should be kept in sync with llvm::orc::JITDylibLookupFlags.
200  */
201 typedef enum {
205 
206 /**
207  * An element type for a JITDylib search order.
208  */
209 typedef struct {
213 
214 /**
215  * A JITDylib search order.
216  *
217  * The list is terminated with an element containing a null pointer for the JD
218  * field.
219  */
221 
222 /**
223  * Symbol lookup flags for lookup sets. This should be kept in sync with
224  * llvm::orc::SymbolLookupFlags.
225  */
226 typedef enum {
230 
231 /**
232  * An element type for a symbol lookup set.
233  */
234 typedef struct {
238 
239 /**
240  * A set of symbols to look up / generate.
241  *
242  * The list is terminated with an element containing a null pointer for the
243  * Name field.
244  *
245  * If a client creates an instance of this type then they are responsible for
246  * freeing it, and for ensuring that all strings have been retained over the
247  * course of its life. Clients receiving a copy from a callback are not
248  * responsible for managing lifetime or retain counts.
249  */
251 
252 /**
253  * A reference to a uniquely owned orc::MaterializationUnit instance.
254  */
255 typedef struct LLVMOrcOpaqueMaterializationUnit *LLVMOrcMaterializationUnitRef;
256 
257 /**
258  * A reference to a uniquely owned orc::MaterializationResponsibility instance.
259  *
260  * Ownership must be passed to a lower-level layer in a JIT stack.
261  */
262 typedef struct LLVMOrcOpaqueMaterializationResponsibility
264 
265 /**
266  * A MaterializationUnit materialize callback.
267  *
268  * Ownership of the Ctx and MR arguments passes to the callback which must
269  * adhere to the LLVMOrcMaterializationResponsibilityRef contract (see comment
270  * for that type).
271  *
272  * If this callback is called then the LLVMOrcMaterializationUnitDestroy
273  * callback will NOT be called.
274  */
277 
278 /**
279  * A MaterializationUnit discard callback.
280  *
281  * Ownership of JD and Symbol remain with the caller: These arguments should
282  * not be disposed of or released.
283  */
286 
287 /**
288  * A MaterializationUnit destruction callback.
289  *
290  * If a custom MaterializationUnit is destroyed before its Materialize
291  * function is called then this function will be called to provide an
292  * opportunity for the underlying program representation to be destroyed.
293  */
294 typedef void (*LLVMOrcMaterializationUnitDestroyFunction)(void *Ctx);
295 
296 /**
297  * A reference to an orc::ResourceTracker instance.
298  */
299 typedef struct LLVMOrcOpaqueResourceTracker *LLVMOrcResourceTrackerRef;
300 
301 /**
302  * A reference to an orc::DefinitionGenerator.
303  */
304 typedef struct LLVMOrcOpaqueDefinitionGenerator
306 
307 /**
308  * An opaque lookup state object. Instances of this type can be captured to
309  * suspend a lookup while a custom generator function attempts to produce a
310  * definition.
311  *
312  * If a client captures a lookup state object then they must eventually call
313  * LLVMOrcLookupStateContinueLookup to restart the lookup. This is required
314  * in order to release memory allocated for the lookup state, even if errors
315  * have occurred while the lookup was suspended (if these errors have made the
316  * lookup impossible to complete then it will issue its own error before
317  * destruction).
318  */
319 typedef struct LLVMOrcOpaqueLookupState *LLVMOrcLookupStateRef;
320 
321 /**
322  * A custom generator function. This can be used to create a custom generator
323  * object using LLVMOrcCreateCustomCAPIDefinitionGenerator. The resulting
324  * object can be attached to a JITDylib, via LLVMOrcJITDylibAddGenerator, to
325  * receive callbacks when lookups fail to match existing definitions.
326  *
327  * GeneratorObj will contain the address of the custom generator object.
328  *
329  * Ctx will contain the context object passed to
330  * LLVMOrcCreateCustomCAPIDefinitionGenerator.
331  *
332  * LookupState will contain a pointer to an LLVMOrcLookupStateRef object. This
333  * can optionally be modified to make the definition generation process
334  * asynchronous: If the LookupStateRef value is copied, and the original
335  * LLVMOrcLookupStateRef set to null, the lookup will be suspended. Once the
336  * asynchronous definition process has been completed clients must call
337  * LLVMOrcLookupStateContinueLookup to continue the lookup (this should be
338  * done unconditionally, even if errors have occurred in the mean time, to
339  * free the lookup state memory and notify the query object of the failures).
340  * If LookupState is captured this function must return LLVMErrorSuccess.
341  *
342  * The Kind argument can be inspected to determine the lookup kind (e.g.
343  * as-if-during-static-link, or as-if-during-dlsym).
344  *
345  * The JD argument specifies which JITDylib the definitions should be generated
346  * into.
347  *
348  * The JDLookupFlags argument can be inspected to determine whether the original
349  * lookup included non-exported symobls.
350  *
351  * Finally, the LookupSet argument contains the set of symbols that could not
352  * be found in JD already (the set of generation candidates).
353  */
355  LLVMOrcDefinitionGeneratorRef GeneratorObj, void *Ctx,
358  LLVMOrcCLookupSet LookupSet, size_t LookupSetSize);
359 
360 /**
361  * Disposer for a custom generator.
362  *
363  * Will be called by ORC when the JITDylib that the generator is attached to
364  * is destroyed.
365  */
367 
368 /**
369  * Predicate function for SymbolStringPoolEntries.
370  */
371 typedef int (*LLVMOrcSymbolPredicate)(void *Ctx,
373 
374 /**
375  * A reference to an orc::ThreadSafeContext instance.
376  */
377 typedef struct LLVMOrcOpaqueThreadSafeContext *LLVMOrcThreadSafeContextRef;
378 
379 /**
380  * A reference to an orc::ThreadSafeModule instance.
381  */
382 typedef struct LLVMOrcOpaqueThreadSafeModule *LLVMOrcThreadSafeModuleRef;
383 
384 /**
385  * A function for inspecting/mutating IR modules, suitable for use with
386  * LLVMOrcThreadSafeModuleWithModuleDo.
387  */
389  void *Ctx, LLVMModuleRef M);
390 
391 /**
392  * A reference to an orc::JITTargetMachineBuilder instance.
393  */
394 typedef struct LLVMOrcOpaqueJITTargetMachineBuilder
396 
397 /**
398  * A reference to an orc::ObjectLayer instance.
399  */
400 typedef struct LLVMOrcOpaqueObjectLayer *LLVMOrcObjectLayerRef;
401 
402 /**
403  * A reference to an orc::ObjectLinkingLayer instance.
404  */
405 typedef struct LLVMOrcOpaqueObjectLinkingLayer *LLVMOrcObjectLinkingLayerRef;
406 
407 /**
408  * A reference to an orc::IRTransformLayer instance.
409  */
410 typedef struct LLVMOrcOpaqueIRTransformLayer *LLVMOrcIRTransformLayerRef;
411 
412 /**
413  * A function for applying transformations as part of an transform layer.
414  *
415  * Implementations of this type are responsible for managing the lifetime
416  * of the Module pointed to by ModInOut: If the LLVMModuleRef value is
417  * overwritten then the function is responsible for disposing of the incoming
418  * module. If the module is simply accessed/mutated in-place then ownership
419  * returns to the caller and the function does not need to do any lifetime
420  * management.
421  *
422  * Clients can call LLVMOrcLLJITGetIRTransformLayer to obtain the transform
423  * layer of a LLJIT instance, and use LLVMOrcIRTransformLayerSetTransform
424  * to set the function. This can be used to override the default transform
425  * layer.
426  */
428  void *Ctx, LLVMOrcThreadSafeModuleRef *ModInOut,
430 
431 /**
432  * A reference to an orc::ObjectTransformLayer instance.
433  */
434 typedef struct LLVMOrcOpaqueObjectTransformLayer
436 
437 /**
438  * A function for applying transformations to an object file buffer.
439  *
440  * Implementations of this type are responsible for managing the lifetime
441  * of the memory buffer pointed to by ObjInOut: If the LLVMMemoryBufferRef
442  * value is overwritten then the function is responsible for disposing of the
443  * incoming buffer. If the buffer is simply accessed/mutated in-place then
444  * ownership returns to the caller and the function does not need to do any
445  * lifetime management.
446  *
447  * The transform is allowed to return an error, in which case the ObjInOut
448  * buffer should be disposed of and set to null.
449  */
451  void *Ctx, LLVMMemoryBufferRef *ObjInOut);
452 
453 /**
454  * A reference to an orc::IndirectStubsManager instance.
455  */
456 typedef struct LLVMOrcOpaqueIndirectStubsManager
458 
459 /**
460  * A reference to an orc::LazyCallThroughManager instance.
461  */
462 typedef struct LLVMOrcOpaqueLazyCallThroughManager
464 
465 /**
466  * A reference to an orc::DumpObjects object.
467  *
468  * Can be used to dump object files to disk with unique names. Useful as an
469  * ObjectTransformLayer transform.
470  */
471 typedef struct LLVMOrcOpaqueDumpObjects *LLVMOrcDumpObjectsRef;
472 
473 /**
474  * Attach a custom error reporter function to the ExecutionSession.
475  *
476  * The error reporter will be called to deliver failure notices that can not be
477  * directly reported to a caller. For example, failure to resolve symbols in
478  * the JIT linker is typically reported via the error reporter (callers
479  * requesting definitions from the JIT will typically be delivered a
480  * FailureToMaterialize error instead).
481  */
484  void *Ctx);
485 
486 /**
487  * Return a reference to the SymbolStringPool for an ExecutionSession.
488  *
489  * Ownership of the pool remains with the ExecutionSession: The caller is
490  * not required to free the pool.
491  */
494 
495 /**
496  * Clear all unreferenced symbol string pool entries.
497  *
498  * This can be called at any time to release unused entries in the
499  * ExecutionSession's string pool. Since it locks the pool (preventing
500  * interning of any new strings) it is recommended that it only be called
501  * infrequently, ideally when the caller has reason to believe that some
502  * entries will have become unreferenced, e.g. after removing a module or
503  * closing a JITDylib.
504  */
506 
507 /**
508  * Intern a string in the ExecutionSession's SymbolStringPool and return a
509  * reference to it. This increments the ref-count of the pool entry, and the
510  * returned value should be released once the client is done with it by
511  * calling LLVMOrReleaseSymbolStringPoolEntry.
512  *
513  * Since strings are uniqued within the SymbolStringPool
514  * LLVMOrcSymbolStringPoolEntryRefs can be compared by value to test string
515  * equality.
516  *
517  * Note that this function does not perform linker-mangling on the string.
518  */
521 
522 /**
523  * Callback type for ExecutionSession lookups.
524  *
525  * If Err is LLVMErrorSuccess then Result will contain a pointer to a
526  * list of ( SymbolStringPtr, JITEvaluatedSymbol ) pairs of length NumPairs.
527  *
528  * If Err is a failure value then Result and Ctx are undefined and should
529  * not be accessed. The Callback is responsible for handling the error
530  * value (e.g. by calling LLVMGetErrorMessage + LLVMDisposeErrorMessage).
531  *
532  * The caller retains ownership of the Result array and will release all
533  * contained symbol names. Clients are responsible for retaining any symbol
534  * names that they wish to hold after the function returns.
535  */
537  LLVMErrorRef Err, LLVMOrcCSymbolMapPairs Result, size_t NumPairs,
538  void *Ctx);
539 
540 /**
541  * Look up symbols in an execution session.
542  *
543  * This is a wrapper around the general ExecutionSession::lookup function.
544  *
545  * The SearchOrder argument contains a list of (JITDylibs, JITDylibSearchFlags)
546  * pairs that describe the search order. The JITDylibs will be searched in the
547  * given order to try to find the symbols in the Symbols argument.
548  *
549  * The Symbols argument should contain a null-terminated array of
550  * (SymbolStringPtr, SymbolLookupFlags) pairs describing the symbols to be
551  * searched for. This function takes ownership of the elements of the Symbols
552  * array. The Name fields of the Symbols elements are taken to have been
553  * retained by the client for this function. The client should *not* release the
554  * Name fields, but are still responsible for destroying the array itself.
555  *
556  * The HandleResult function will be called once all searched for symbols have
557  * been found, or an error occurs. The HandleResult function will be passed an
558  * LLVMErrorRef indicating success or failure, and (on success) a
559  * null-terminated LLVMOrcCSymbolMapPairs array containing the function result,
560  * and the Ctx value passed to the lookup function.
561  *
562  * The client is fully responsible for managing the lifetime of the Ctx object.
563  * A common idiom is to allocate the context prior to the lookup and deallocate
564  * it in the handler.
565  *
566  * THIS API IS EXPERIMENTAL AND LIKELY TO CHANGE IN THE NEAR FUTURE!
567  */
570  LLVMOrcCJITDylibSearchOrder SearchOrder, size_t SearchOrderSize,
571  LLVMOrcCLookupSet Symbols, size_t SymbolsSize,
572  LLVMOrcExecutionSessionLookupHandleResultFunction HandleResult, void *Ctx);
573 
574 /**
575  * Increments the ref-count for a SymbolStringPool entry.
576  */
578 
579 /**
580  * Reduces the ref-count for of a SymbolStringPool entry.
581  */
583 
584 /**
585  * Return the c-string for the given symbol. This string will remain valid until
586  * the entry is freed (once all LLVMOrcSymbolStringPoolEntryRefs have been
587  * released).
588  */
590 
591 /**
592  * Reduces the ref-count of a ResourceTracker.
593  */
595 
596 /**
597  * Transfers tracking of all resources associated with resource tracker SrcRT
598  * to resource tracker DstRT.
599  */
602 
603 /**
604  * Remove all resources associated with the given tracker. See
605  * ResourceTracker::remove().
606  */
608 
609 /**
610  * Dispose of a JITDylib::DefinitionGenerator. This should only be called if
611  * ownership has not been passed to a JITDylib (e.g. because some error
612  * prevented the client from calling LLVMOrcJITDylibAddGenerator).
613  */
615 
616 /**
617  * Dispose of a MaterializationUnit.
618  */
620 
621 /**
622  * Create a custom MaterializationUnit.
623  *
624  * Name is a name for this MaterializationUnit to be used for identification
625  * and logging purposes (e.g. if this MaterializationUnit produces an
626  * object buffer then the name of that buffer will be derived from this name).
627  *
628  * The Syms list contains the names and linkages of the symbols provided by this
629  * unit. This function takes ownership of the elements of the Syms array. The
630  * Name fields of the array elements are taken to have been retained for this
631  * function. The client should *not* release the elements of the array, but is
632  * still responsible for destroying the array itself.
633  *
634  * The InitSym argument indicates whether or not this MaterializationUnit
635  * contains static initializers. If three are no static initializers (the common
636  * case) then this argument should be null. If there are static initializers
637  * then InitSym should be set to a unique name that also appears in the Syms
638  * list with the LLVMJITSymbolGenericFlagsMaterializationSideEffectsOnly flag
639  * set. This function takes ownership of the InitSym, which should have been
640  * retained twice on behalf of this function: once for the Syms entry and once
641  * for InitSym. If clients wish to use the InitSym value after this function
642  * returns they must retain it once more for themselves.
643  *
644  * If any of the symbols in the Syms list is looked up then the Materialize
645  * function will be called.
646  *
647  * If any of the symbols in the Syms list is overridden then the Discard
648  * function will be called.
649  *
650  * The caller owns the underling MaterializationUnit and is responsible for
651  * either passing it to a JITDylib (via LLVMOrcJITDylibDefine) or disposing
652  * of it by calling LLVMOrcDisposeMaterializationUnit.
653  */
655  const char *Name, void *Ctx, LLVMOrcCSymbolFlagsMapPairs Syms,
656  size_t NumSyms, LLVMOrcSymbolStringPoolEntryRef InitSym,
660 
661 /**
662  * Create a MaterializationUnit to define the given symbols as pointing to
663  * the corresponding raw addresses.
664  *
665  * This function takes ownership of the elements of the Syms array. The Name
666  * fields of the array elements are taken to have been retained for this
667  * function. This allows the following pattern...
668  *
669  * size_t NumPairs;
670  * LLVMOrcCSymbolMapPairs Sym;
671  * -- Build Syms array --
672  * LLVMOrcMaterializationUnitRef MU =
673  * LLVMOrcAbsoluteSymbols(Syms, NumPairs);
674  *
675  * ... without requiring cleanup of the elements of the Sym array afterwards.
676  *
677  * The client is still responsible for deleting the Sym array itself.
678  *
679  * If a client wishes to reuse elements of the Sym array after this call they
680  * must explicitly retain each of the elements for themselves.
681  */
683 LLVMOrcAbsoluteSymbols(LLVMOrcCSymbolMapPairs Syms, size_t NumPairs);
684 
685 /**
686  * Create a MaterializationUnit to define lazy re-expots. These are callable
687  * entry points that call through to the given symbols.
688  *
689  * This function takes ownership of the CallableAliases array. The Name
690  * fields of the array elements are taken to have been retained for this
691  * function. This allows the following pattern...
692  *
693  * size_t NumPairs;
694  * LLVMOrcCSymbolAliasMapPairs CallableAliases;
695  * -- Build CallableAliases array --
696  * LLVMOrcMaterializationUnitRef MU =
697  * LLVMOrcLazyReexports(LCTM, ISM, JD, CallableAliases, NumPairs);
698  *
699  * ... without requiring cleanup of the elements of the CallableAliases array afterwards.
700  *
701  * The client is still responsible for deleting the CallableAliases array itself.
702  *
703  * If a client wishes to reuse elements of the CallableAliases array after this call they
704  * must explicitly retain each of the elements for themselves.
705  */
709  size_t NumPairs);
710 // TODO: ImplSymbolMad SrcJDLoc
711 
712 /**
713  * Disposes of the passed MaterializationResponsibility object.
714  *
715  * This should only be done after the symbols covered by the object have either
716  * been resolved and emitted (via
717  * LLVMOrcMaterializationResponsibilityNotifyResolved and
718  * LLVMOrcMaterializationResponsibilityNotifyEmitted) or failed (via
719  * LLVMOrcMaterializationResponsibilityFailMaterialization).
720  */
723 
724 /**
725  * Returns the target JITDylib that these symbols are being materialized into.
726  */
729 
730 /**
731  * Returns the ExecutionSession for this MaterializationResponsibility.
732  */
736 
737 /**
738  * Returns the symbol flags map for this responsibility instance.
739  *
740  * The length of the array is returned in NumPairs and the caller is responsible
741  * for the returned memory and needs to call LLVMOrcDisposeCSymbolFlagsMap.
742  *
743  * To use the returned symbols beyond the livetime of the
744  * MaterializationResponsibility requires the caller to retain the symbols
745  * explicitly.
746  */
748  LLVMOrcMaterializationResponsibilityRef MR, size_t *NumPairs);
749 
750 /**
751  * Disposes of the passed LLVMOrcCSymbolFlagsMap.
752  *
753  * Does not release the entries themselves.
754  */
756 
757 /**
758  * Returns the initialization pseudo-symbol, if any. This symbol will also
759  * be present in the SymbolFlagsMap for this MaterializationResponsibility
760  * object.
761  *
762  * The returned symbol is not retained over any mutating operation of the
763  * MaterializationResponsbility or beyond the lifetime thereof.
764  */
768 
769 /**
770  * Returns the names of any symbols covered by this
771  * MaterializationResponsibility object that have queries pending. This
772  * information can be used to return responsibility for unrequested symbols
773  * back to the JITDylib via the delegate method.
774  */
777  LLVMOrcMaterializationResponsibilityRef MR, size_t *NumSymbols);
778 
779 /**
780  * Disposes of the passed LLVMOrcSymbolStringPoolEntryRef* .
781  *
782  * Does not release the symbols themselves.
783  */
785 
786 /**
787  * Notifies the target JITDylib that the given symbols have been resolved.
788  * This will update the given symbols' addresses in the JITDylib, and notify
789  * any pending queries on the given symbols of their resolution. The given
790  * symbols must be ones covered by this MaterializationResponsibility
791  * instance. Individual calls to this method may resolve a subset of the
792  * symbols, but all symbols must have been resolved prior to calling emit.
793  *
794  * This method will return an error if any symbols being resolved have been
795  * moved to the error state due to the failure of a dependency. If this
796  * method returns an error then clients should log it and call
797  * LLVMOrcMaterializationResponsibilityFailMaterialization. If no dependencies
798  * have been registered for the symbols covered by this
799  * MaterializationResponsibiility then this method is guaranteed to return
800  * LLVMErrorSuccess.
801  */
804  size_t NumPairs);
805 
806 /**
807  * Notifies the target JITDylib (and any pending queries on that JITDylib)
808  * that all symbols covered by this MaterializationResponsibility instance
809  * have been emitted.
810  *
811  * This method will return an error if any symbols being resolved have been
812  * moved to the error state due to the failure of a dependency. If this
813  * method returns an error then clients should log it and call
814  * LLVMOrcMaterializationResponsibilityFailMaterialization.
815  * If no dependencies have been registered for the symbols covered by this
816  * MaterializationResponsibiility then this method is guaranteed to return
817  * LLVMErrorSuccess.
818  */
821 
822 /**
823  * Attempt to claim responsibility for new definitions. This method can be
824  * used to claim responsibility for symbols that are added to a
825  * materialization unit during the compilation process (e.g. literal pool
826  * symbols). Symbol linkage rules are the same as for symbols that are
827  * defined up front: duplicate strong definitions will result in errors.
828  * Duplicate weak definitions will be discarded (in which case they will
829  * not be added to this responsibility instance).
830  *
831  * This method can be used by materialization units that want to add
832  * additional symbols at materialization time (e.g. stubs, compile
833  * callbacks, metadata)
834  */
837  LLVMOrcCSymbolFlagsMapPairs Pairs, size_t NumPairs);
838 
839 /**
840  * Notify all not-yet-emitted covered by this MaterializationResponsibility
841  * instance that an error has occurred.
842  * This will remove all symbols covered by this MaterializationResponsibilty
843  * from the target JITDylib, and send an error to any queries waiting on
844  * these symbols.
845  */
848 
849 /**
850  * Transfers responsibility to the given MaterializationUnit for all
851  * symbols defined by that MaterializationUnit. This allows
852  * materializers to break up work based on run-time information (e.g.
853  * by introspecting which symbols have actually been looked up and
854  * materializing only those).
855  */
859 
860 /**
861  * Delegates responsibility for the given symbols to the returned
862  * materialization responsibility. Useful for breaking up work between
863  * threads, or different kinds of materialization processes.
864  *
865  * The caller retains responsibility of the the passed
866  * MaterializationResponsibility.
867  */
870  LLVMOrcSymbolStringPoolEntryRef *Symbols, size_t NumSymbols,
872 
873 /**
874  * Adds dependencies to a symbol that the MaterializationResponsibility is
875  * responsible for.
876  *
877  * This function takes ownership of Dependencies struct. The Names
878  * array have been retained for this function. This allows the following
879  * pattern...
880  *
881  * LLVMOrcSymbolStringPoolEntryRef Names[] = {...};
882  * LLVMOrcCDependenceMapPair Dependence = {JD, {Names, sizeof(Names)}}
883  * LLVMOrcMaterializationResponsibilityAddDependencies(JD, Name, &Dependence,
884  * 1);
885  *
886  * ... without requiring cleanup of the elements of the Names array afterwards.
887  *
888  * The client is still responsible for deleting the Dependencies.Names array
889  * itself.
890  */
894  LLVMOrcCDependenceMapPairs Dependencies, size_t NumPairs);
895 
896 /**
897  * Adds dependencies to all symbols that the MaterializationResponsibility is
898  * responsible for. See LLVMOrcMaterializationResponsibilityAddDependencies for
899  * notes about memory responsibility.
900  */
903  LLVMOrcCDependenceMapPairs Dependencies, size_t NumPairs);
904 
905 /**
906  * Create a "bare" JITDylib.
907  *
908  * The client is responsible for ensuring that the JITDylib's name is unique,
909  * e.g. by calling LLVMOrcExecutionSessionGetJTIDylibByName first.
910  *
911  * This call does not install any library code or symbols into the newly
912  * created JITDylib. The client is responsible for all configuration.
913  */
916  const char *Name);
917 
918 /**
919  * Create a JITDylib.
920  *
921  * The client is responsible for ensuring that the JITDylib's name is unique,
922  * e.g. by calling LLVMOrcExecutionSessionGetJTIDylibByName first.
923  *
924  * If a Platform is attached to the ExecutionSession then
925  * Platform::setupJITDylib will be called to install standard platform symbols
926  * (e.g. standard library interposes). If no Platform is installed then this
927  * call is equivalent to LLVMExecutionSessionRefCreateBareJITDylib and will
928  * always return success.
929  */
932  LLVMOrcJITDylibRef *Result,
933  const char *Name);
934 
935 /**
936  * Returns the JITDylib with the given name, or NULL if no such JITDylib
937  * exists.
938  */
941  const char *Name);
942 
943 /**
944  * Return a reference to a newly created resource tracker associated with JD.
945  * The tracker is returned with an initial ref-count of 1, and must be released
946  * with LLVMOrcReleaseResourceTracker when no longer needed.
947  */
950 
951 /**
952  * Return a reference to the default resource tracker for the given JITDylib.
953  * This operation will increase the retain count of the tracker: Clients should
954  * call LLVMOrcReleaseResourceTracker when the result is no longer needed.
955  */
958 
959 /**
960  * Add the given MaterializationUnit to the given JITDylib.
961  *
962  * If this operation succeeds then JITDylib JD will take ownership of MU.
963  * If the operation fails then ownership remains with the caller who should
964  * call LLVMOrcDisposeMaterializationUnit to destroy it.
965  */
968 
969 /**
970  * Calls remove on all trackers associated with this JITDylib, see
971  * JITDylib::clear().
972  */
974 
975 /**
976  * Add a DefinitionGenerator to the given JITDylib.
977  *
978  * The JITDylib will take ownership of the given generator: The client is no
979  * longer responsible for managing its memory.
980  */
983 
984 /**
985  * Create a custom generator.
986  *
987  * The F argument will be used to implement the DefinitionGenerator's
988  * tryToGenerate method (see
989  * LLVMOrcCAPIDefinitionGeneratorTryToGenerateFunction).
990  *
991  * Ctx is a context object that will be passed to F. This argument is
992  * permitted to be null.
993  *
994  * Dispose is the disposal function for Ctx. This argument is permitted to be
995  * null (in which case the client is responsible for the lifetime of Ctx).
996  */
1000 
1001 /**
1002  * Continue a lookup that was suspended in a generator (see
1003  * LLVMOrcCAPIDefinitionGeneratorTryToGenerateFunction).
1004  */
1006  LLVMErrorRef Err);
1007 
1008 /**
1009  * Get a DynamicLibrarySearchGenerator that will reflect process symbols into
1010  * the JITDylib. On success the resulting generator is owned by the client.
1011  * Ownership is typically transferred by adding the instance to a JITDylib
1012  * using LLVMOrcJITDylibAddGenerator,
1013  *
1014  * The GlobalPrefix argument specifies the character that appears on the front
1015  * of linker-mangled symbols for the target platform (e.g. '_' on MachO).
1016  * If non-null, this character will be stripped from the start of all symbol
1017  * strings before passing the remaining substring to dlsym.
1018  *
1019  * The optional Filter and Ctx arguments can be used to supply a symbol name
1020  * filter: Only symbols for which the filter returns true will be visible to
1021  * JIT'd code. If the Filter argument is null then all process symbols will
1022  * be visible to JIT'd code. Note that the symbol name passed to the Filter
1023  * function is the full mangled symbol: The client is responsible for stripping
1024  * the global prefix if present.
1025  */
1027  LLVMOrcDefinitionGeneratorRef *Result, char GlobalPrefx,
1028  LLVMOrcSymbolPredicate Filter, void *FilterCtx);
1029 
1030 /**
1031  * Get a LLVMOrcCreateDynamicLibararySearchGeneratorForPath that will reflect
1032  * library symbols into the JITDylib. On success the resulting generator is
1033  * owned by the client. Ownership is typically transferred by adding the
1034  * instance to a JITDylib using LLVMOrcJITDylibAddGenerator,
1035  *
1036  * The GlobalPrefix argument specifies the character that appears on the front
1037  * of linker-mangled symbols for the target platform (e.g. '_' on MachO).
1038  * If non-null, this character will be stripped from the start of all symbol
1039  * strings before passing the remaining substring to dlsym.
1040  *
1041  * The optional Filter and Ctx arguments can be used to supply a symbol name
1042  * filter: Only symbols for which the filter returns true will be visible to
1043  * JIT'd code. If the Filter argument is null then all library symbols will
1044  * be visible to JIT'd code. Note that the symbol name passed to the Filter
1045  * function is the full mangled symbol: The client is responsible for stripping
1046  * the global prefix if present.
1047  *
1048  * THIS API IS EXPERIMENTAL AND LIKELY TO CHANGE IN THE NEAR FUTURE!
1049  *
1050  */
1052  LLVMOrcDefinitionGeneratorRef *Result, const char *FileName,
1053  char GlobalPrefix, LLVMOrcSymbolPredicate Filter, void *FilterCtx);
1054 
1055 /**
1056  * Get a LLVMOrcCreateStaticLibrarySearchGeneratorForPath that will reflect
1057  * static library symbols into the JITDylib. On success the resulting
1058  * generator is owned by the client. Ownership is typically transferred by
1059  * adding the instance to a JITDylib using LLVMOrcJITDylibAddGenerator,
1060  *
1061  * Call with the optional TargetTriple argument will succeed if the file at
1062  * the given path is a static library or a MachO universal binary containing a
1063  * static library that is compatible with the given triple. Otherwise it will
1064  * return an error.
1065  *
1066  * THIS API IS EXPERIMENTAL AND LIKELY TO CHANGE IN THE NEAR FUTURE!
1067  *
1068  */
1071  const char *FileName, const char *TargetTriple);
1072 
1073 /**
1074  * Create a ThreadSafeContext containing a new LLVMContext.
1075  *
1076  * Ownership of the underlying ThreadSafeContext data is shared: Clients
1077  * can and should dispose of their ThreadSafeContext as soon as they no longer
1078  * need to refer to it directly. Other references (e.g. from ThreadSafeModules)
1079  * will keep the data alive as long as it is needed.
1080  */
1082 
1083 /**
1084  * Get a reference to the wrapped LLVMContext.
1085  */
1088 
1089 /**
1090  * Dispose of a ThreadSafeContext.
1091  */
1093 
1094 /**
1095  * Create a ThreadSafeModule wrapper around the given LLVM module. This takes
1096  * ownership of the M argument which should not be disposed of or referenced
1097  * after this function returns.
1098  *
1099  * Ownership of the ThreadSafeModule is unique: If it is transferred to the JIT
1100  * (e.g. by LLVMOrcLLJITAddLLVMIRModule) then the client is no longer
1101  * responsible for it. If it is not transferred to the JIT then the client
1102  * should call LLVMOrcDisposeThreadSafeModule to dispose of it.
1103  */
1107 
1108 /**
1109  * Dispose of a ThreadSafeModule. This should only be called if ownership has
1110  * not been passed to LLJIT (e.g. because some error prevented the client from
1111  * adding this to the JIT).
1112  */
1114 
1115 /**
1116  * Apply the given function to the module contained in this ThreadSafeModule.
1117  */
1121  void *Ctx);
1122 
1123 /**
1124  * Create a JITTargetMachineBuilder by detecting the host.
1125  *
1126  * On success the client owns the resulting JITTargetMachineBuilder. It must be
1127  * passed to a consuming operation (e.g.
1128  * LLVMOrcLLJITBuilderSetJITTargetMachineBuilder) or disposed of by calling
1129  * LLVMOrcDisposeJITTargetMachineBuilder.
1130  */
1133 
1134 /**
1135  * Create a JITTargetMachineBuilder from the given TargetMachine template.
1136  *
1137  * This operation takes ownership of the given TargetMachine and destroys it
1138  * before returing. The resulting JITTargetMachineBuilder is owned by the client
1139  * and must be passed to a consuming operation (e.g.
1140  * LLVMOrcLLJITBuilderSetJITTargetMachineBuilder) or disposed of by calling
1141  * LLVMOrcDisposeJITTargetMachineBuilder.
1142  */
1145 
1146 /**
1147  * Dispose of a JITTargetMachineBuilder.
1148  */
1151 
1152 /**
1153  * Returns the target triple for the given JITTargetMachineBuilder as a string.
1154  *
1155  * The caller owns the resulting string as must dispose of it by calling
1156  * LLVMDisposeMessage
1157  */
1160 
1161 /**
1162  * Sets the target triple for the given JITTargetMachineBuilder to the given
1163  * string.
1164  */
1166  LLVMOrcJITTargetMachineBuilderRef JTMB, const char *TargetTriple);
1167 
1168 /**
1169  * Add an object to an ObjectLayer to the given JITDylib.
1170  *
1171  * Adds a buffer representing an object file to the given JITDylib using the
1172  * given ObjectLayer instance. This operation transfers ownership of the buffer
1173  * to the ObjectLayer instance. The buffer should not be disposed of or
1174  * referenced once this function returns.
1175  *
1176  * Resources associated with the given object will be tracked by the given
1177  * JITDylib's default ResourceTracker.
1178  */
1180  LLVMOrcJITDylibRef JD,
1181  LLVMMemoryBufferRef ObjBuffer);
1182 
1183 /**
1184  * Add an object to an ObjectLayer using the given ResourceTracker.
1185  *
1186  * Adds a buffer representing an object file to the given ResourceTracker's
1187  * JITDylib using the given ObjectLayer instance. This operation transfers
1188  * ownership of the buffer to the ObjectLayer instance. The buffer should not
1189  * be disposed of or referenced once this function returns.
1190  *
1191  * Resources associated with the given object will be tracked by
1192  * ResourceTracker RT.
1193  */
1197  LLVMMemoryBufferRef ObjBuffer);
1198 
1199 /**
1200  * Emit an object buffer to an ObjectLayer.
1201  *
1202  * Ownership of the responsibility object and object buffer pass to this
1203  * function. The client is not responsible for cleanup.
1204  */
1207  LLVMMemoryBufferRef ObjBuffer);
1208 
1209 /**
1210  * Dispose of an ObjectLayer.
1211  */
1213 
1217 
1218 /**
1219  * Set the transform function of the provided transform layer, passing through a
1220  * pointer to user provided context.
1221  */
1223  LLVMOrcIRTransformLayerRef IRTransformLayer,
1224  LLVMOrcIRTransformLayerTransformFunction TransformFunction, void *Ctx);
1225 
1226 /**
1227  * Set the transform function on an LLVMOrcObjectTransformLayer.
1228  */
1230  LLVMOrcObjectTransformLayerRef ObjTransformLayer,
1231  LLVMOrcObjectTransformLayerTransformFunction TransformFunction, void *Ctx);
1232 
1233 /**
1234  * Create a LocalIndirectStubsManager from the given target triple.
1235  *
1236  * The resulting IndirectStubsManager is owned by the client
1237  * and must be disposed of by calling LLVMOrcDisposeDisposeIndirectStubsManager.
1238  */
1240 LLVMOrcCreateLocalIndirectStubsManager(const char *TargetTriple);
1241 
1242 /**
1243  * Dispose of an IndirectStubsManager.
1244  */
1246 
1248  const char *TargetTriple, LLVMOrcExecutionSessionRef ES,
1249  LLVMOrcJITTargetAddress ErrorHandlerAddr,
1251 
1252 /**
1253  * Dispose of an LazyCallThroughManager.
1254  */
1257 
1258 /**
1259  * Create a DumpObjects instance.
1260  *
1261  * DumpDir specifies the path to write dumped objects to. DumpDir may be empty
1262  * in which case files will be dumped to the working directory.
1263  *
1264  * IdentifierOverride specifies a file name stem to use when dumping objects.
1265  * If empty then each MemoryBuffer's identifier will be used (with a .o suffix
1266  * added if not already present). If an identifier override is supplied it will
1267  * be used instead, along with an incrementing counter (since all buffers will
1268  * use the same identifier, the resulting files will be named <ident>.o,
1269  * <ident>.2.o, <ident>.3.o, and so on). IdentifierOverride should not contain
1270  * an extension, as a .o suffix will be added by DumpObjects.
1271  */
1273  const char *IdentifierOverride);
1274 
1275 /**
1276  * Dispose of a DumpObjects instance.
1277  */
1279 
1280 /**
1281  * Dump the contents of the given MemoryBuffer.
1282  */
1284  LLVMMemoryBufferRef *ObjBuffer);
1285 
1286 /**
1287  * @}
1288  */
1289 
1291 
1292 #endif /* LLVM_C_ORC_H */
LLVMOrcCLookupSetElement
An element type for a symbol lookup set.
Definition: Orc.h:234
LLVMJITSymbolGenericFlagsMaterializationSideEffectsOnly
@ LLVMJITSymbolGenericFlagsMaterializationSideEffectsOnly
Definition: Orc.h:61
LLVMOrcCDependenceMapPair::JD
LLVMOrcJITDylibRef JD
Definition: Orc.h:174
LLVMOrcLookupStateRef
struct LLVMOrcOpaqueLookupState * LLVMOrcLookupStateRef
An opaque lookup state object.
Definition: Orc.h:319
LLVMOrcMaterializationResponsibilityGetRequestedSymbols
LLVMOrcSymbolStringPoolEntryRef * LLVMOrcMaterializationResponsibilityGetRequestedSymbols(LLVMOrcMaterializationResponsibilityRef MR, size_t *NumSymbols)
Returns the names of any symbols covered by this MaterializationResponsibility object that have queri...
Definition: OrcV2CBindings.cpp:535
LLVMOrcDisposeJITTargetMachineBuilder
void LLVMOrcDisposeJITTargetMachineBuilder(LLVMOrcJITTargetMachineBuilderRef JTMB)
Dispose of a JITTargetMachineBuilder.
Definition: OrcV2CBindings.cpp:837
LLVMOrcDisposeThreadSafeModule
void LLVMOrcDisposeThreadSafeModule(LLVMOrcThreadSafeModuleRef TSM)
Dispose of a ThreadSafeModule.
Definition: OrcV2CBindings.cpp:799
LLVMOrcCDependenceMapPair
Represents a pair of a JITDylib and LLVMOrcCSymbolsList.
Definition: Orc.h:173
LLVMOrcObjectLayerRef
struct LLVMOrcOpaqueObjectLayer * LLVMOrcObjectLayerRef
A reference to an orc::ObjectLayer instance.
Definition: Orc.h:400
LLVMOrcMaterializationResponsibilityAddDependenciesForAll
void LLVMOrcMaterializationResponsibilityAddDependenciesForAll(LLVMOrcMaterializationResponsibilityRef MR, LLVMOrcCDependenceMapPairs Dependencies, size_t NumPairs)
Adds dependencies to all symbols that the MaterializationResponsibility is responsible for.
Definition: OrcV2CBindings.cpp:612
LLVMContextRef
struct LLVMOpaqueContext * LLVMContextRef
The top-level container for all LLVM global data.
Definition: Types.h:53
M
We currently emits eax Perhaps this is what we really should generate is Is imull three or four cycles eax eax The current instruction priority is based on pattern complexity The former is more complex because it folds a load so the latter will not be emitted Perhaps we should use AddedComplexity to give LEA32r a higher priority We should always try to match LEA first since the LEA matching code does some estimate to determine whether the match is profitable if we care more about code then imull is better It s two bytes shorter than movl leal On a Pentium M
Definition: README.txt:252
LLVMOrcCreateDynamicLibrarySearchGeneratorForPath
LLVMErrorRef LLVMOrcCreateDynamicLibrarySearchGeneratorForPath(LLVMOrcDefinitionGeneratorRef *Result, const char *FileName, char GlobalPrefix, LLVMOrcSymbolPredicate Filter, void *FilterCtx)
Get a LLVMOrcCreateDynamicLibararySearchGeneratorForPath that will reflect library symbols into the J...
Definition: OrcV2CBindings.cpp:716
LLVMOrcCSymbolsList::Symbols
LLVMOrcSymbolStringPoolEntryRef * Symbols
Definition: Orc.h:166
LLVMOrcSymbolPredicate
int(* LLVMOrcSymbolPredicate)(void *Ctx, LLVMOrcSymbolStringPoolEntryRef Sym)
Predicate function for SymbolStringPoolEntries.
Definition: Orc.h:371
LLVMOrcIRTransformLayerRef
struct LLVMOrcOpaqueIRTransformLayer * LLVMOrcIRTransformLayerRef
A reference to an orc::IRTransformLayer instance.
Definition: Orc.h:410
LLVMOrcCSymbolAliasMapPair::Entry
LLVMOrcCSymbolAliasMapEntry Entry
Definition: Orc.h:147
LLVMOrcJITDylibClear
LLVMErrorRef LLVMOrcJITDylibClear(LLVMOrcJITDylibRef JD)
Calls remove on all trackers associated with this JITDylib, see JITDylib::clear().
Definition: OrcV2CBindings.cpp:668
LLVMOrcSymbolStringPoolRef
struct LLVMOrcOpaqueSymbolStringPool * LLVMOrcSymbolStringPoolRef
A reference to an orc::SymbolStringPool.
Definition: Orc.h:98
LLVMOrcCreateCustomCAPIDefinitionGenerator
LLVMOrcDefinitionGeneratorRef LLVMOrcCreateCustomCAPIDefinitionGenerator(LLVMOrcCAPIDefinitionGeneratorTryToGenerateFunction F, void *Ctx, LLVMOrcDisposeCAPIDefinitionGeneratorFunction Dispose)
Create a custom generator.
Definition: OrcV2CBindings.cpp:677
LLVMOrcIndirectStubsManagerRef
struct LLVMOrcOpaqueIndirectStubsManager * LLVMOrcIndirectStubsManagerRef
A reference to an orc::IndirectStubsManager instance.
Definition: Orc.h:456
LLVMOrcJITTargetMachineBuilderDetectHost
LLVMErrorRef LLVMOrcJITTargetMachineBuilderDetectHost(LLVMOrcJITTargetMachineBuilderRef *Result)
Create a JITTargetMachineBuilder by detecting the host.
Definition: OrcV2CBindings.cpp:803
Types.h
GlobalPrefix
@ GlobalPrefix
Definition: AsmWriter.cpp:349
LLVMOrcCAPIDefinitionGeneratorTryToGenerateFunction
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:354
LLVMOrcObjectTransformLayerSetTransform
void LLVMOrcObjectTransformLayerSetTransform(LLVMOrcObjectTransformLayerRef ObjTransformLayer, LLVMOrcObjectTransformLayerTransformFunction TransformFunction, void *Ctx)
Set the transform function on an LLVMOrcObjectTransformLayer.
Definition: OrcV2CBindings.cpp:902
LLVMOrcLookupKindDLSym
@ LLVMOrcLookupKindDLSym
Definition: Orc.h:192
LLVMOrcDisposeLazyCallThroughManager
void LLVMOrcDisposeLazyCallThroughManager(LLVMOrcLazyCallThroughManagerRef LCTM)
Dispose of an LazyCallThroughManager.
Definition: OrcV2CBindings.cpp:1112
LLVMOrcThreadSafeModuleWithModuleDo
LLVMErrorRef LLVMOrcThreadSafeModuleWithModuleDo(LLVMOrcThreadSafeModuleRef TSM, LLVMOrcGenericIRModuleOperationFunction F, void *Ctx)
Apply the given function to the module contained in this ThreadSafeModule.
Definition: OrcV2CBindings.cpp:785
LLVMOrcLookupKind
LLVMOrcLookupKind
Lookup kind.
Definition: Orc.h:190
LLVMOrcMaterializationUnitDiscardFunction
void(* LLVMOrcMaterializationUnitDiscardFunction)(void *Ctx, LLVMOrcJITDylibRef JD, LLVMOrcSymbolStringPoolEntryRef Symbol)
A MaterializationUnit discard callback.
Definition: Orc.h:284
LLVMOrcMaterializationResponsibilityRef
struct LLVMOrcOpaqueMaterializationResponsibility * LLVMOrcMaterializationResponsibilityRef
A reference to a uniquely owned orc::MaterializationResponsibility instance.
Definition: Orc.h:262
LLVMOrcExecutionSessionGetSymbolStringPool
LLVMOrcSymbolStringPoolRef LLVMOrcExecutionSessionGetSymbolStringPool(LLVMOrcExecutionSessionRef ES)
Return a reference to the SymbolStringPool for an ExecutionSession.
Definition: OrcV2CBindings.cpp:345
LLVMOrcCSymbolAliasMapEntry::Flags
LLVMJITSymbolFlags Flags
Definition: Orc.h:139
LLVMOrcMaterializationResponsibilityNotifyEmitted
LLVMErrorRef LLVMOrcMaterializationResponsibilityNotifyEmitted(LLVMOrcMaterializationResponsibilityRef MR)
Notifies the target JITDylib (and any pending queries on that JITDylib) that all symbols covered by t...
Definition: OrcV2CBindings.cpp:562
LLVMOrcJITDylibLookupFlagsMatchAllSymbols
@ LLVMOrcJITDylibLookupFlagsMatchAllSymbols
Definition: Orc.h:203
LLVMOrcLookupStateContinueLookup
void LLVMOrcLookupStateContinueLookup(LLVMOrcLookupStateRef S, LLVMErrorRef Err)
Continue a lookup that was suspended in a generator (see LLVMOrcCAPIDefinitionGeneratorTryToGenerateF...
Definition: OrcV2CBindings.cpp:684
F
#define F(x, y, z)
Definition: MD5.cpp:55
llvm::RISCVFenceField::R
@ R
Definition: RISCVBaseInfo.h:265
LLVMOrcExecutorAddress
uint64_t LLVMOrcExecutorAddress
Represents an address in the executor process.
Definition: Orc.h:51
LLVMOrcIRTransformLayerEmit
void LLVMOrcIRTransformLayerEmit(LLVMOrcIRTransformLayerRef IRTransformLayer, LLVMOrcMaterializationResponsibilityRef MR, LLVMOrcThreadSafeModuleRef TSM)
Definition: OrcV2CBindings.cpp:625
LLVMOrcCSymbolFlagsMapPair
Represents a pair of a symbol name and LLVMJITSymbolFlags.
Definition: Orc.h:109
LLVMOrcExecutionSessionLookup
void LLVMOrcExecutionSessionLookup(LLVMOrcExecutionSessionRef ES, LLVMOrcLookupKind K, LLVMOrcCJITDylibSearchOrder SearchOrder, size_t SearchOrderSize, LLVMOrcCLookupSet Symbols, size_t SymbolsSize, LLVMOrcExecutionSessionLookupHandleResultFunction HandleResult, void *Ctx)
Look up symbols in an execution session.
Definition: OrcV2CBindings.cpp:360
LLVMOrcLazyReexports
LLVMOrcMaterializationUnitRef LLVMOrcLazyReexports(LLVMOrcLazyCallThroughManagerRef LCTM, LLVMOrcIndirectStubsManagerRef ISM, LLVMOrcJITDylibRef SourceRef, LLVMOrcCSymbolAliasMapPairs CallableAliases, size_t NumPairs)
Create a MaterializationUnit to define lazy re-expots.
Definition: OrcV2CBindings.cpp:470
LLVMOrcJITDylibGetDefaultResourceTracker
LLVMOrcResourceTrackerRef LLVMOrcJITDylibGetDefaultResourceTracker(LLVMOrcJITDylibRef JD)
Return a reference to the default resource tracker for the given JITDylib.
Definition: OrcV2CBindings.cpp:417
LLVMOrcJITDylibLookupFlags
LLVMOrcJITDylibLookupFlags
JITDylib lookup flags.
Definition: Orc.h:201
LLVMOrcDisposeCSymbolFlagsMap
void LLVMOrcDisposeCSymbolFlagsMap(LLVMOrcCSymbolFlagsMapPairs Pairs)
Disposes of the passed LLVMOrcCSymbolFlagsMap.
Definition: OrcV2CBindings.cpp:523
LLVMOrcCSymbolMapPair
Represents a pair of a symbol name and an evaluated symbol.
Definition: Orc.h:123
LLVMOrcCreateCustomMaterializationUnit
LLVMOrcMaterializationUnitRef LLVMOrcCreateCustomMaterializationUnit(const char *Name, void *Ctx, LLVMOrcCSymbolFlagsMapPairs Syms, size_t NumSyms, LLVMOrcSymbolStringPoolEntryRef InitSym, LLVMOrcMaterializationUnitMaterializeFunction Materialize, LLVMOrcMaterializationUnitDiscardFunction Discard, LLVMOrcMaterializationUnitDestroyFunction Destroy)
Create a custom MaterializationUnit.
Definition: OrcV2CBindings.cpp:447
LLVMOrcSymbolStringPoolEntryRef
struct LLVMOrcOpaqueSymbolStringPoolEntry * LLVMOrcSymbolStringPoolEntryRef
A reference to an orc::SymbolStringPool table entry.
Definition: Orc.h:103
LLVMOrcIRTransformLayerSetTransform
void LLVMOrcIRTransformLayerSetTransform(LLVMOrcIRTransformLayerRef IRTransformLayer, LLVMOrcIRTransformLayerTransformFunction TransformFunction, void *Ctx)
Set the transform function of the provided transform layer, passing through a pointer to user provide...
Definition: OrcV2CBindings.cpp:882
LLVMOrcDumpObjects_CallOperator
LLVMErrorRef LLVMOrcDumpObjects_CallOperator(LLVMOrcDumpObjectsRef DumpObjects, LLVMMemoryBufferRef *ObjBuffer)
Dump the contents of the given MemoryBuffer.
Definition: OrcV2CBindings.cpp:928
LLVMOrcLookupKindStatic
@ LLVMOrcLookupKindStatic
Definition: Orc.h:191
LLVMJITEvaluatedSymbol
Represents an evaluated symbol address and flags.
Definition: Orc.h:80
LLVMOrcMaterializationUnitRef
struct LLVMOrcOpaqueMaterializationUnit * LLVMOrcMaterializationUnitRef
A reference to a uniquely owned orc::MaterializationUnit instance.
Definition: Orc.h:255
int
Clang compiles this i1 i64 store i64 i64 store i64 i64 store i64 i64 store i64 align Which gets codegen d xmm0 movaps rbp movaps rbp movaps rbp movaps rbp rbp rbp rbp rbp It would be better to have movq s of instead of the movaps s LLVM produces ret int
Definition: README.txt:536
LLVMOrcCSymbolMapPairs
LLVMOrcCSymbolMapPair * LLVMOrcCSymbolMapPairs
Represents a list of (SymbolStringPtr, JITEvaluatedSymbol) pairs that can be used to construct a Symb...
Definition: Orc.h:132
LLVMOrcExecutionSessionCreateBareJITDylib
LLVMOrcJITDylibRef LLVMOrcExecutionSessionCreateBareJITDylib(LLVMOrcExecutionSessionRef ES, const char *Name)
Create a "bare" JITDylib.
Definition: OrcV2CBindings.cpp:635
LLVMOrcCSymbolFlagsMapPairs
LLVMOrcCSymbolFlagsMapPair * LLVMOrcCSymbolFlagsMapPairs
Represents a list of (SymbolStringPtr, JITSymbolFlags) pairs that can be used to construct a SymbolFl...
Definition: Orc.h:118
LLVMOrcThreadSafeModuleRef
struct LLVMOrcOpaqueThreadSafeModule * LLVMOrcThreadSafeModuleRef
A reference to an orc::ThreadSafeModule instance.
Definition: Orc.h:382
LLVMJITSymbolGenericFlagsCallable
@ LLVMJITSymbolGenericFlagsCallable
Definition: Orc.h:60
LLVMOrcCSymbolMapPair::Name
LLVMOrcSymbolStringPoolEntryRef Name
Definition: Orc.h:124
LLVMOrcLazyCallThroughManagerRef
struct LLVMOrcOpaqueLazyCallThroughManager * LLVMOrcLazyCallThroughManagerRef
A reference to an orc::LazyCallThroughManager instance.
Definition: Orc.h:462
LLVMOrcDisposeDumpObjects
void LLVMOrcDisposeDumpObjects(LLVMOrcDumpObjectsRef DumpObjects)
Dispose of a DumpObjects instance.
Definition: OrcV2CBindings.cpp:924
LLVMJITSymbolGenericFlagsExported
@ LLVMJITSymbolGenericFlagsExported
Definition: Orc.h:58
LLVMOrcThreadSafeContextGetContext
LLVMContextRef LLVMOrcThreadSafeContextGetContext(LLVMOrcThreadSafeContextRef TSCtx)
Get a reference to the wrapped LLVMContext.
Definition: OrcV2CBindings.cpp:776
LLVMOrcObjectTransformLayerRef
struct LLVMOrcOpaqueObjectTransformLayer * LLVMOrcObjectTransformLayerRef
A reference to an orc::ObjectTransformLayer instance.
Definition: Orc.h:434
LLVMOrcMaterializationResponsibilityAddDependencies
void LLVMOrcMaterializationResponsibilityAddDependencies(LLVMOrcMaterializationResponsibilityRef MR, LLVMOrcSymbolStringPoolEntryRef Name, LLVMOrcCDependenceMapPairs Dependencies, size_t NumPairs)
Adds dependencies to a symbol that the MaterializationResponsibility is responsible for.
Definition: OrcV2CBindings.cpp:602
LLVMOrcCSymbolsList::Length
size_t Length
Definition: Orc.h:167
LLVMOrcMaterializationUnitMaterializeFunction
void(* LLVMOrcMaterializationUnitMaterializeFunction)(void *Ctx, LLVMOrcMaterializationResponsibilityRef MR)
A MaterializationUnit materialize callback.
Definition: Orc.h:275
LLVMOrcMaterializationResponsibilityGetSymbols
LLVMOrcCSymbolFlagsMapPairs LLVMOrcMaterializationResponsibilityGetSymbols(LLVMOrcMaterializationResponsibilityRef MR, size_t *NumPairs)
Returns the symbol flags map for this responsibility instance.
Definition: OrcV2CBindings.cpp:506
LLVMOrcCSymbolFlagsMapPair::Name
LLVMOrcSymbolStringPoolEntryRef Name
Definition: Orc.h:110
LLVMOrcMaterializationResponsibilityGetTargetDylib
LLVMOrcJITDylibRef LLVMOrcMaterializationResponsibilityGetTargetDylib(LLVMOrcMaterializationResponsibilityRef MR)
Returns the target JITDylib that these symbols are being materialized into.
Definition: OrcV2CBindings.cpp:495
LLVMJITEvaluatedSymbol::Address
LLVMOrcExecutorAddress Address
Definition: Orc.h:81
llvm::lltok::Kind
Kind
Definition: LLToken.h:18
LLVMOrcCSymbolAliasMapEntry
Represents a SymbolAliasMapEntry.
Definition: Orc.h:137
LLVMOrcJITTargetMachineBuilderGetTargetTriple
char * LLVMOrcJITTargetMachineBuilderGetTargetTriple(LLVMOrcJITTargetMachineBuilderRef JTMB)
Returns the target triple for the given JITTargetMachineBuilder as a string.
Definition: OrcV2CBindings.cpp:842
LLVMOrcErrorReporterFunction
void(* LLVMOrcErrorReporterFunction)(void *Ctx, LLVMErrorRef Err)
Error reporter function.
Definition: Orc.h:93
LLVMOrcObjectLayerEmit
void LLVMOrcObjectLayerEmit(LLVMOrcObjectLayerRef ObjLayer, LLVMOrcMaterializationResponsibilityRef R, LLVMMemoryBufferRef ObjBuffer)
Emit an object buffer to an ObjectLayer.
Definition: OrcV2CBindings.cpp:870
LLVMOrcJITTargetMachineBuilderCreateFromTargetMachine
LLVMOrcJITTargetMachineBuilderRef LLVMOrcJITTargetMachineBuilderCreateFromTargetMachine(LLVMTargetMachineRef TM)
Create a JITTargetMachineBuilder from the given TargetMachine template.
Definition: OrcV2CBindings.cpp:818
LLVMOrcCLookupSet
LLVMOrcCLookupSetElement * LLVMOrcCLookupSet
A set of symbols to look up / generate.
Definition: Orc.h:250
LLVMOrcJITDylibRef
struct LLVMOrcOpaqueJITDylib * LLVMOrcJITDylibRef
A reference to an orc::JITDylib instance.
Definition: Orc.h:159
LLVMOrcDisposeIndirectStubsManager
void LLVMOrcDisposeIndirectStubsManager(LLVMOrcIndirectStubsManagerRef ISM)
Dispose of an IndirectStubsManager.
Definition: OrcV2CBindings.cpp:1095
LLVMOrcCJITDylibSearchOrder
LLVMOrcCJITDylibSearchOrderElement * LLVMOrcCJITDylibSearchOrder
A JITDylib search order.
Definition: Orc.h:220
LLVMOrcResourceTrackerRef
struct LLVMOrcOpaqueResourceTracker * LLVMOrcResourceTrackerRef
A reference to an orc::ResourceTracker instance.
Definition: Orc.h:299
LLVMJITSymbolGenericFlagsWeak
@ LLVMJITSymbolGenericFlagsWeak
Definition: Orc.h:59
LLVMJITSymbolTargetFlags
uint8_t LLVMJITSymbolTargetFlags
Represents target specific flags for a symbol definition.
Definition: Orc.h:67
uint64_t
LLVMOrcCreateNewThreadSafeModule
LLVMOrcThreadSafeModuleRef LLVMOrcCreateNewThreadSafeModule(LLVMModuleRef M, LLVMOrcThreadSafeContextRef TSCtx)
Create a ThreadSafeModule wrapper around the given LLVM module.
Definition: OrcV2CBindings.cpp:793
LLVMOrcCreateDynamicLibrarySearchGeneratorForProcess
LLVMErrorRef LLVMOrcCreateDynamicLibrarySearchGeneratorForProcess(LLVMOrcDefinitionGeneratorRef *Result, char GlobalPrefx, LLVMOrcSymbolPredicate Filter, void *FilterCtx)
Get a DynamicLibrarySearchGenerator that will reflect process symbols into the JITDylib.
Definition: OrcV2CBindings.cpp:691
LLVMOrcCSymbolAliasMapPair::Name
LLVMOrcSymbolStringPoolEntryRef Name
Definition: Orc.h:146
LLVMOrcExecutionSessionRef
struct LLVMOrcOpaqueExecutionSession * LLVMOrcExecutionSessionRef
A reference to an orc::ExecutionSession instance.
Definition: Orc.h:88
LLVMOrcReleaseSymbolStringPoolEntry
void LLVMOrcReleaseSymbolStringPoolEntry(LLVMOrcSymbolStringPoolEntryRef S)
Reduces the ref-count for of a SymbolStringPool entry.
Definition: OrcV2CBindings.cpp:400
LLVMJITEvaluatedSymbol::Flags
LLVMJITSymbolFlags Flags
Definition: Orc.h:82
LLVMJITSymbolGenericFlags
LLVMJITSymbolGenericFlags
Represents generic linkage flags for a symbol definition.
Definition: Orc.h:56
LLVMOrcMaterializationResponsibilityNotifyResolved
LLVMErrorRef LLVMOrcMaterializationResponsibilityNotifyResolved(LLVMOrcMaterializationResponsibilityRef MR, LLVMOrcCSymbolMapPairs Symbols, size_t NumPairs)
Notifies the target JITDylib that the given symbols have been resolved.
Definition: OrcV2CBindings.cpp:555
LLVMOrcSymbolLookupFlagsRequiredSymbol
@ LLVMOrcSymbolLookupFlagsRequiredSymbol
Definition: Orc.h:227
LLVMOrcMaterializationResponsibilityDelegate
LLVMErrorRef LLVMOrcMaterializationResponsibilityDelegate(LLVMOrcMaterializationResponsibilityRef MR, LLVMOrcSymbolStringPoolEntryRef *Symbols, size_t NumSymbols, LLVMOrcMaterializationResponsibilityRef *Result)
Delegates responsibility for the given symbols to the returned materialization responsibility.
Definition: OrcV2CBindings.cpp:585
LLVMOrcMaterializationResponsibilityReplace
LLVMErrorRef LLVMOrcMaterializationResponsibilityReplace(LLVMOrcMaterializationResponsibilityRef MR, LLVMOrcMaterializationUnitRef MU)
Transfers responsibility to the given MaterializationUnit for all symbols defined by that Materializa...
Definition: OrcV2CBindings.cpp:578
LLVMOrcCJITDylibSearchOrderElement::JD
LLVMOrcJITDylibRef JD
Definition: Orc.h:210
LLVMOrcExecutionSessionCreateJITDylib
LLVMErrorRef LLVMOrcExecutionSessionCreateJITDylib(LLVMOrcExecutionSessionRef ES, LLVMOrcJITDylibRef *Result, const char *Name)
Create a JITDylib.
Definition: OrcV2CBindings.cpp:641
LLVMOrcCSymbolFlagsMapPair::Flags
LLVMJITSymbolFlags Flags
Definition: Orc.h:111
LLVMOrcExecutionSessionLookupHandleResultFunction
void(* LLVMOrcExecutionSessionLookupHandleResultFunction)(LLVMErrorRef Err, LLVMOrcCSymbolMapPairs Result, size_t NumPairs, void *Ctx)
Callback type for ExecutionSession lookups.
Definition: Orc.h:536
LLVMOrcSymbolLookupFlags
LLVMOrcSymbolLookupFlags
Symbol lookup flags for lookup sets.
Definition: Orc.h:226
LLVMOrcCreateDumpObjects
LLVMOrcDumpObjectsRef LLVMOrcCreateDumpObjects(const char *DumpDir, const char *IdentifierOverride)
Create a DumpObjects instance.
Definition: OrcV2CBindings.cpp:917
LLVMOrcExecutionSessionIntern
LLVMOrcSymbolStringPoolEntryRef LLVMOrcExecutionSessionIntern(LLVMOrcExecutionSessionRef ES, const char *Name)
Intern a string in the ExecutionSession's SymbolStringPool and return a reference to it.
Definition: OrcV2CBindings.cpp:355
LLVMOrcJITDylibDefine
LLVMErrorRef LLVMOrcJITDylibDefine(LLVMOrcJITDylibRef JD, LLVMOrcMaterializationUnitRef MU)
Add the given MaterializationUnit to the given JITDylib.
Definition: OrcV2CBindings.cpp:657
LLVMOrcSymbolStringPoolClearDeadEntries
void LLVMOrcSymbolStringPoolClearDeadEntries(LLVMOrcSymbolStringPoolRef SSP)
Clear all unreferenced symbol string pool entries.
Definition: OrcV2CBindings.cpp:350
LLVMOrcObjectLayerAddObjectFile
LLVMErrorRef LLVMOrcObjectLayerAddObjectFile(LLVMOrcObjectLayerRef ObjLayer, LLVMOrcJITDylibRef JD, LLVMMemoryBufferRef ObjBuffer)
Add an object to an ObjectLayer to the given JITDylib.
Definition: OrcV2CBindings.cpp:855
LLVMOrcDisposeObjectLayer
void LLVMOrcDisposeObjectLayer(LLVMOrcObjectLayerRef ObjLayer)
Dispose of an ObjectLayer.
Definition: OrcV2CBindings.cpp:878
LLVMOrcAbsoluteSymbols
LLVMOrcMaterializationUnitRef LLVMOrcAbsoluteSymbols(LLVMOrcCSymbolMapPairs Syms, size_t NumPairs)
Create a MaterializationUnit to define the given symbols as pointing to the corresponding raw address...
Definition: OrcV2CBindings.cpp:465
LLVMOrcExecutionSessionSetErrorReporter
void LLVMOrcExecutionSessionSetErrorReporter(LLVMOrcExecutionSessionRef ES, LLVMOrcErrorReporterFunction ReportError, void *Ctx)
Attach a custom error reporter function to the ExecutionSession.
Definition: OrcV2CBindings.cpp:337
LLVMOrcDisposeMaterializationUnit
void LLVMOrcDisposeMaterializationUnit(LLVMOrcMaterializationUnitRef MU)
Dispose of a MaterializationUnit.
Definition: OrcV2CBindings.cpp:443
LLVMOrcObjectLinkingLayerRef
struct LLVMOrcOpaqueObjectLinkingLayer * LLVMOrcObjectLinkingLayerRef
A reference to an orc::ObjectLinkingLayer instance.
Definition: Orc.h:405
LLVMOrcCSymbolAliasMapPair
Represents a pair of a symbol name and SymbolAliasMapEntry.
Definition: Orc.h:145
LLVMOrcCSymbolAliasMapPairs
LLVMOrcCSymbolAliasMapPair * LLVMOrcCSymbolAliasMapPairs
Represents a list of (SymbolStringPtr, (SymbolStringPtr, JITSymbolFlags)) pairs that can be used to c...
Definition: Orc.h:154
LLVMOrcCreateNewThreadSafeContext
LLVMOrcThreadSafeContextRef LLVMOrcCreateNewThreadSafeContext(void)
Create a ThreadSafeContext containing a new LLVMContext.
Definition: OrcV2CBindings.cpp:771
S
add sub stmia L5 ldr r0 bl L_printf $stub Instead of a and a wouldn t it be better to do three moves *Return an aggregate type is even return S
Definition: README.txt:210
LLVMJITSymbolFlags
Represents the linkage flags for a symbol definition.
Definition: Orc.h:72
LLVMOrcJITDylibAddGenerator
void LLVMOrcJITDylibAddGenerator(LLVMOrcJITDylibRef JD, LLVMOrcDefinitionGeneratorRef DG)
Add a DefinitionGenerator to the given JITDylib.
Definition: OrcV2CBindings.cpp:672
LLVMOrcDisposeThreadSafeContext
void LLVMOrcDisposeThreadSafeContext(LLVMOrcThreadSafeContextRef TSCtx)
Dispose of a ThreadSafeContext.
Definition: OrcV2CBindings.cpp:780
LLVM_C_EXTERN_C_END
#define LLVM_C_EXTERN_C_END
Definition: ExternC.h:36
LLVMOrcObjectTransformLayerTransformFunction
LLVMErrorRef(* LLVMOrcObjectTransformLayerTransformFunction)(void *Ctx, LLVMMemoryBufferRef *ObjInOut)
A function for applying transformations to an object file buffer.
Definition: Orc.h:450
Error.h
LLVMOrcDisposeCAPIDefinitionGeneratorFunction
void(* LLVMOrcDisposeCAPIDefinitionGeneratorFunction)(void *Ctx)
Disposer for a custom generator.
Definition: Orc.h:366
LLVMOrcMaterializationUnitDestroyFunction
void(* LLVMOrcMaterializationUnitDestroyFunction)(void *Ctx)
A MaterializationUnit destruction callback.
Definition: Orc.h:294
LLVMOrcMaterializationResponsibilityDefineMaterializing
LLVMErrorRef LLVMOrcMaterializationResponsibilityDefineMaterializing(LLVMOrcMaterializationResponsibilityRef MR, LLVMOrcCSymbolFlagsMapPairs Pairs, size_t NumPairs)
Attempt to claim responsibility for new definitions.
Definition: OrcV2CBindings.cpp:567
LLVMOrcReleaseResourceTracker
void LLVMOrcReleaseResourceTracker(LLVMOrcResourceTrackerRef RT)
Reduces the ref-count of a ResourceTracker.
Definition: OrcV2CBindings.cpp:423
llvm::GraphProgram::Name
Name
Definition: GraphWriter.h:50
TargetMachine.h
LLVMOrcCDependenceMapPair::Names
LLVMOrcCSymbolsList Names
Definition: Orc.h:175
LLVMOrcDumpObjectsRef
struct LLVMOrcOpaqueDumpObjects * LLVMOrcDumpObjectsRef
A reference to an orc::DumpObjects object.
Definition: Orc.h:471
LLVMOrcGenericIRModuleOperationFunction
LLVMErrorRef(* LLVMOrcGenericIRModuleOperationFunction)(void *Ctx, LLVMModuleRef M)
A function for inspecting/mutating IR modules, suitable for use with LLVMOrcThreadSafeModuleWithModul...
Definition: Orc.h:388
LLVMOrcDisposeMaterializationResponsibility
void LLVMOrcDisposeMaterializationResponsibility(LLVMOrcMaterializationResponsibilityRef MR)
Disposes of the passed MaterializationResponsibility object.
Definition: OrcV2CBindings.cpp:490
llvm::mca::SourceRef
std::pair< unsigned, const Instruction & > SourceRef
Definition: SourceMgr.h:25
LLVMOrcCSymbolAliasMapEntry::Name
LLVMOrcSymbolStringPoolEntryRef Name
Definition: Orc.h:138
LLVM_C_EXTERN_C_BEGIN
#define LLVM_C_EXTERN_C_BEGIN
Definition: ExternC.h:35
LLVMOrcObjectLayerAddObjectFileWithRT
LLVMErrorRef LLVMOrcObjectLayerAddObjectFileWithRT(LLVMOrcObjectLayerRef ObjLayer, LLVMOrcResourceTrackerRef RT, LLVMMemoryBufferRef ObjBuffer)
Add an object to an ObjectLayer using the given ResourceTracker.
LLVMOrcSymbolStringPoolEntryStr
const char * LLVMOrcSymbolStringPoolEntryStr(LLVMOrcSymbolStringPoolEntryRef S)
Return the c-string for the given symbol.
Definition: OrcV2CBindings.cpp:404
LLVMOrcDefinitionGeneratorRef
struct LLVMOrcOpaqueDefinitionGenerator * LLVMOrcDefinitionGeneratorRef
A reference to an orc::DefinitionGenerator.
Definition: Orc.h:304
LLVMOrcCSymbolMapPair::Sym
LLVMJITEvaluatedSymbol Sym
Definition: Orc.h:125
llvm::ARMBuildAttrs::Symbol
@ Symbol
Definition: ARMBuildAttributes.h:83
LLVMOrcResourceTrackerTransferTo
void LLVMOrcResourceTrackerTransferTo(LLVMOrcResourceTrackerRef SrcRT, LLVMOrcResourceTrackerRef DstRT)
Transfers tracking of all resources associated with resource tracker SrcRT to resource tracker DstRT.
Definition: OrcV2CBindings.cpp:428
LLVMJITSymbolGenericFlagsNone
@ LLVMJITSymbolGenericFlagsNone
Definition: Orc.h:57
LLVMOrcJITDylibCreateResourceTracker
LLVMOrcResourceTrackerRef LLVMOrcJITDylibCreateResourceTracker(LLVMOrcJITDylibRef JD)
Return a reference to a newly created resource tracker associated with JD.
Definition: OrcV2CBindings.cpp:409
LLVMOrcMaterializationResponsibilityGetExecutionSession
LLVMOrcExecutionSessionRef LLVMOrcMaterializationResponsibilityGetExecutionSession(LLVMOrcMaterializationResponsibilityRef MR)
Returns the ExecutionSession for this MaterializationResponsibility.
Definition: OrcV2CBindings.cpp:501
LLVMOrcSymbolLookupFlagsWeaklyReferencedSymbol
@ LLVMOrcSymbolLookupFlagsWeaklyReferencedSymbol
Definition: Orc.h:228
LLVMOrcJITTargetMachineBuilderSetTargetTriple
void LLVMOrcJITTargetMachineBuilderSetTargetTriple(LLVMOrcJITTargetMachineBuilderRef JTMB, const char *TargetTriple)
Sets the target triple for the given JITTargetMachineBuilder to the given string.
Definition: OrcV2CBindings.cpp:850
LLVMOrcDisposeDefinitionGenerator
void LLVMOrcDisposeDefinitionGenerator(LLVMOrcDefinitionGeneratorRef DG)
Dispose of a JITDylib::DefinitionGenerator.
Definition: OrcV2CBindings.cpp:439
LLVMOrcCreateLocalIndirectStubsManager
LLVMOrcIndirectStubsManagerRef LLVMOrcCreateLocalIndirectStubsManager(const char *TargetTriple)
Create a LocalIndirectStubsManager from the given target triple.
Definition: OrcV2CBindings.cpp:1090
LLVMOrcCSymbolsList
Represents a list of LLVMOrcSymbolStringPoolEntryRef and the associated length.
Definition: Orc.h:165
LLVMErrorRef
struct LLVMOpaqueError * LLVMErrorRef
Opaque reference to an error instance.
Definition: Error.h:33
LLVMJITSymbolFlags::GenericFlags
uint8_t GenericFlags
Definition: Orc.h:73
LLVMOrcJITTargetMachineBuilderRef
struct LLVMOrcOpaqueJITTargetMachineBuilder * LLVMOrcJITTargetMachineBuilderRef
A reference to an orc::JITTargetMachineBuilder instance.
Definition: Orc.h:394
LLVMOrcJITDylibLookupFlagsMatchExportedSymbolsOnly
@ LLVMOrcJITDylibLookupFlagsMatchExportedSymbolsOnly
Definition: Orc.h:202
LLVMOrcCreateStaticLibrarySearchGeneratorForPath
LLVMErrorRef LLVMOrcCreateStaticLibrarySearchGeneratorForPath(LLVMOrcDefinitionGeneratorRef *Result, LLVMOrcObjectLayerRef ObjLayer, const char *FileName, const char *TargetTriple)
Get a LLVMOrcCreateStaticLibrarySearchGeneratorForPath that will reflect static library symbols into ...
Definition: OrcV2CBindings.cpp:742
LLVMOrcIRTransformLayerTransformFunction
LLVMErrorRef(* LLVMOrcIRTransformLayerTransformFunction)(void *Ctx, LLVMOrcThreadSafeModuleRef *ModInOut, LLVMOrcMaterializationResponsibilityRef MR)
A function for applying transformations as part of an transform layer.
Definition: Orc.h:427
LLVMOrcExecutionSessionGetJITDylibByName
LLVMOrcJITDylibRef LLVMOrcExecutionSessionGetJITDylibByName(LLVMOrcExecutionSessionRef ES, const char *Name)
Returns the JITDylib with the given name, or NULL if no such JITDylib exists.
Definition: OrcV2CBindings.cpp:652
LLVMOrcCLookupSetElement::LookupFlags
LLVMOrcSymbolLookupFlags LookupFlags
Definition: Orc.h:236
LLVMMemoryBufferRef
struct LLVMOpaqueMemoryBuffer * LLVMMemoryBufferRef
LLVM uses a polymorphic type hierarchy which C cannot represent, therefore parameters must be passed ...
Definition: Types.h:48
TM
const char LLVMTargetMachineRef TM
Definition: PassBuilderBindings.cpp:47
LLVMOrcMaterializationResponsibilityFailMaterialization
void LLVMOrcMaterializationResponsibilityFailMaterialization(LLVMOrcMaterializationResponsibilityRef MR)
Notify all not-yet-emitted covered by this MaterializationResponsibility instance that an error has o...
Definition: OrcV2CBindings.cpp:620
LLVMOrcRetainSymbolStringPoolEntry
void LLVMOrcRetainSymbolStringPoolEntry(LLVMOrcSymbolStringPoolEntryRef S)
Increments the ref-count for a SymbolStringPool entry.
Definition: OrcV2CBindings.cpp:396
LLVMOrcDisposeSymbols
void LLVMOrcDisposeSymbols(LLVMOrcSymbolStringPoolEntryRef *Symbols)
Disposes of the passed LLVMOrcSymbolStringPoolEntryRef* .
Definition: OrcV2CBindings.cpp:551
LLVMOrcCLookupSetElement::Name
LLVMOrcSymbolStringPoolEntryRef Name
Definition: Orc.h:235
LLVMOrcCJITDylibSearchOrderElement::JDLookupFlags
LLVMOrcJITDylibLookupFlags JDLookupFlags
Definition: Orc.h:211
LLVMOrcResourceTrackerRemove
LLVMErrorRef LLVMOrcResourceTrackerRemove(LLVMOrcResourceTrackerRef RT)
Remove all resources associated with the given tracker.
Definition: OrcV2CBindings.cpp:434
LLVMOrcThreadSafeContextRef
struct LLVMOrcOpaqueThreadSafeContext * LLVMOrcThreadSafeContextRef
A reference to an orc::ThreadSafeContext instance.
Definition: Orc.h:377
LLVMJITSymbolFlags::TargetFlags
uint8_t TargetFlags
Definition: Orc.h:74
LLVMOrcMaterializationResponsibilityGetInitializerSymbol
LLVMOrcSymbolStringPoolEntryRef LLVMOrcMaterializationResponsibilityGetInitializerSymbol(LLVMOrcMaterializationResponsibilityRef MR)
Returns the initialization pseudo-symbol, if any.
Definition: OrcV2CBindings.cpp:528
LLVMOrcCJITDylibSearchOrderElement
An element type for a JITDylib search order.
Definition: Orc.h:209
LLVMOrcCDependenceMapPairs
LLVMOrcCDependenceMapPair * LLVMOrcCDependenceMapPairs
Represents a list of (JITDylibRef, (LLVMOrcSymbolStringPoolEntryRef*, size_t)) pairs that can be used...
Definition: Orc.h:182
LLVMTargetMachineRef
struct LLVMOpaqueTargetMachine * LLVMTargetMachineRef
Definition: TargetMachine.h:34
LLVMModuleRef
struct LLVMOpaqueModule * LLVMModuleRef
The top-level container for all other LLVM Intermediate Representation (IR) objects.
Definition: Types.h:61
LLVMOrcJITTargetAddress
uint64_t LLVMOrcJITTargetAddress
Represents an address in the executor process.
Definition: Orc.h:46
LLVMOrcCreateLocalLazyCallThroughManager
LLVMErrorRef LLVMOrcCreateLocalLazyCallThroughManager(const char *TargetTriple, LLVMOrcExecutionSessionRef ES, LLVMOrcJITTargetAddress ErrorHandlerAddr, LLVMOrcLazyCallThroughManagerRef *LCTM)
Definition: OrcV2CBindings.cpp:1099