LLVM  7.0.0
Core.h
Go to the documentation of this file.
1 /*===-- llvm-c/Core.h - Core Library C Interface ------------------*- C -*-===*\
2 |* *|
3 |* The LLVM Compiler Infrastructure *|
4 |* *|
5 |* This file is distributed under the University of Illinois Open Source *|
6 |* License. See LICENSE.TXT for details. *|
7 |* *|
8 |*===----------------------------------------------------------------------===*|
9 |* *|
10 |* This header declares the C interface to libLLVMCore.a, which implements *|
11 |* the LLVM intermediate representation. *|
12 |* *|
13 \*===----------------------------------------------------------------------===*/
14 
15 #ifndef LLVM_C_CORE_H
16 #define LLVM_C_CORE_H
17 
18 #include "llvm-c/ErrorHandling.h"
19 #include "llvm-c/Types.h"
20 
21 #ifdef __cplusplus
22 extern "C" {
23 #endif
24 
25 /**
26  * @defgroup LLVMC LLVM-C: C interface to LLVM
27  *
28  * This module exposes parts of the LLVM library as a C API.
29  *
30  * @{
31  */
32 
33 /**
34  * @defgroup LLVMCTransforms Transforms
35  */
36 
37 /**
38  * @defgroup LLVMCCore Core
39  *
40  * This modules provide an interface to libLLVMCore, which implements
41  * the LLVM intermediate representation as well as other related types
42  * and utilities.
43  *
44  * Many exotic languages can interoperate with C code but have a harder time
45  * with C++ due to name mangling. So in addition to C, this interface enables
46  * tools written in such languages.
47  *
48  * @{
49  */
50 
51 /**
52  * @defgroup LLVMCCoreTypes Types and Enumerations
53  *
54  * @{
55  */
56 
57 typedef enum {
58  /* Terminator Instructions */
59  LLVMRet = 1,
60  LLVMBr = 2,
64  /* removed 6 due to API changes */
66 
67  /* Standard Binary Operators */
68  LLVMAdd = 8,
69  LLVMFAdd = 9,
70  LLVMSub = 10,
71  LLVMFSub = 11,
72  LLVMMul = 12,
73  LLVMFMul = 13,
74  LLVMUDiv = 14,
75  LLVMSDiv = 15,
76  LLVMFDiv = 16,
77  LLVMURem = 17,
78  LLVMSRem = 18,
79  LLVMFRem = 19,
80 
81  /* Logical Operators */
82  LLVMShl = 20,
83  LLVMLShr = 21,
84  LLVMAShr = 22,
85  LLVMAnd = 23,
86  LLVMOr = 24,
87  LLVMXor = 25,
88 
89  /* Memory Operators */
90  LLVMAlloca = 26,
91  LLVMLoad = 27,
92  LLVMStore = 28,
94 
95  /* Cast Operators */
96  LLVMTrunc = 30,
97  LLVMZExt = 31,
98  LLVMSExt = 32,
99  LLVMFPToUI = 33,
104  LLVMFPExt = 38,
109 
110  /* Other Operators */
111  LLVMICmp = 42,
112  LLVMFCmp = 43,
113  LLVMPHI = 44,
114  LLVMCall = 45,
118  LLVMVAArg = 49,
124 
125  /* Atomic operators */
126  LLVMFence = 55,
129 
130  /* Exception Handling Operators */
138 } LLVMOpcode;
139 
140 typedef enum {
141  LLVMVoidTypeKind, /**< type with no size */
142  LLVMHalfTypeKind, /**< 16 bit floating point type */
143  LLVMFloatTypeKind, /**< 32 bit floating point type */
144  LLVMDoubleTypeKind, /**< 64 bit floating point type */
145  LLVMX86_FP80TypeKind, /**< 80 bit floating point type (X87) */
146  LLVMFP128TypeKind, /**< 128 bit floating point type (112-bit mantissa)*/
147  LLVMPPC_FP128TypeKind, /**< 128 bit floating point type (two 64-bits) */
148  LLVMLabelTypeKind, /**< Labels */
149  LLVMIntegerTypeKind, /**< Arbitrary bit width integers */
150  LLVMFunctionTypeKind, /**< Functions */
151  LLVMStructTypeKind, /**< Structures */
152  LLVMArrayTypeKind, /**< Arrays */
153  LLVMPointerTypeKind, /**< Pointers */
154  LLVMVectorTypeKind, /**< SIMD 'packed' format, or other vector type */
155  LLVMMetadataTypeKind, /**< Metadata */
156  LLVMX86_MMXTypeKind, /**< X86 MMX */
157  LLVMTokenTypeKind /**< Tokens */
158 } LLVMTypeKind;
159 
160 typedef enum {
161  LLVMExternalLinkage, /**< Externally visible function */
163  LLVMLinkOnceAnyLinkage, /**< Keep one copy of function when linking (inline)*/
164  LLVMLinkOnceODRLinkage, /**< Same, but only replaced by something
165  equivalent. */
167  LLVMWeakAnyLinkage, /**< Keep one copy of function when linking (weak) */
168  LLVMWeakODRLinkage, /**< Same, but only replaced by something
169  equivalent. */
170  LLVMAppendingLinkage, /**< Special purpose, only applies to global arrays */
171  LLVMInternalLinkage, /**< Rename collisions when linking (static
172  functions) */
173  LLVMPrivateLinkage, /**< Like Internal, but omit from symbol table */
174  LLVMDLLImportLinkage, /**< Obsolete */
175  LLVMDLLExportLinkage, /**< Obsolete */
176  LLVMExternalWeakLinkage,/**< ExternalWeak linkage description */
177  LLVMGhostLinkage, /**< Obsolete */
178  LLVMCommonLinkage, /**< Tentative definitions */
179  LLVMLinkerPrivateLinkage, /**< Like Private, but linker removes. */
180  LLVMLinkerPrivateWeakLinkage /**< Like LinkerPrivate, but is weak. */
181 } LLVMLinkage;
182 
183 typedef enum {
184  LLVMDefaultVisibility, /**< The GV is visible */
185  LLVMHiddenVisibility, /**< The GV is hidden */
186  LLVMProtectedVisibility /**< The GV is protected */
188 
189 typedef enum {
190  LLVMNoUnnamedAddr, /**< Address of the GV is significant. */
191  LLVMLocalUnnamedAddr, /**< Address of the GV is locally insignificant. */
192  LLVMGlobalUnnamedAddr /**< Address of the GV is globally insignificant. */
194 
195 typedef enum {
197  LLVMDLLImportStorageClass = 1, /**< Function to be imported from DLL. */
198  LLVMDLLExportStorageClass = 2 /**< Function to be accessible from DLL. */
200 
201 typedef enum {
244 } LLVMCallConv;
245 
246 typedef enum {
252 
262 
271 
274 
276 } LLVMValueKind;
277 
278 typedef enum {
279  LLVMIntEQ = 32, /**< equal */
280  LLVMIntNE, /**< not equal */
281  LLVMIntUGT, /**< unsigned greater than */
282  LLVMIntUGE, /**< unsigned greater or equal */
283  LLVMIntULT, /**< unsigned less than */
284  LLVMIntULE, /**< unsigned less or equal */
285  LLVMIntSGT, /**< signed greater than */
286  LLVMIntSGE, /**< signed greater or equal */
287  LLVMIntSLT, /**< signed less than */
288  LLVMIntSLE /**< signed less or equal */
290 
291 typedef enum {
292  LLVMRealPredicateFalse, /**< Always false (always folded) */
293  LLVMRealOEQ, /**< True if ordered and equal */
294  LLVMRealOGT, /**< True if ordered and greater than */
295  LLVMRealOGE, /**< True if ordered and greater than or equal */
296  LLVMRealOLT, /**< True if ordered and less than */
297  LLVMRealOLE, /**< True if ordered and less than or equal */
298  LLVMRealONE, /**< True if ordered and operands are unequal */
299  LLVMRealORD, /**< True if ordered (no nans) */
300  LLVMRealUNO, /**< True if unordered: isnan(X) | isnan(Y) */
301  LLVMRealUEQ, /**< True if unordered or equal */
302  LLVMRealUGT, /**< True if unordered or greater than */
303  LLVMRealUGE, /**< True if unordered, greater than, or equal */
304  LLVMRealULT, /**< True if unordered or less than */
305  LLVMRealULE, /**< True if unordered, less than, or equal */
306  LLVMRealUNE, /**< True if unordered or not equal */
307  LLVMRealPredicateTrue /**< Always true (always folded) */
309 
310 typedef enum {
311  LLVMLandingPadCatch, /**< A catch clause */
312  LLVMLandingPadFilter /**< A filter clause */
314 
315 typedef enum {
322 
323 typedef enum {
324  LLVMAtomicOrderingNotAtomic = 0, /**< A load or store which is not atomic */
325  LLVMAtomicOrderingUnordered = 1, /**< Lowest level of atomicity, guarantees
326  somewhat sane results, lock free. */
327  LLVMAtomicOrderingMonotonic = 2, /**< guarantees that if you take all the
328  operations affecting a specific address,
329  a consistent ordering exists */
330  LLVMAtomicOrderingAcquire = 4, /**< Acquire provides a barrier of the sort
331  necessary to acquire a lock to access other
332  memory with normal loads and stores. */
333  LLVMAtomicOrderingRelease = 5, /**< Release is similar to Acquire, but with
334  a barrier of the sort necessary to release
335  a lock. */
336  LLVMAtomicOrderingAcquireRelease = 6, /**< provides both an Acquire and a
337  Release barrier (for fences and
338  operations which both read and write
339  memory). */
340  LLVMAtomicOrderingSequentiallyConsistent = 7 /**< provides Acquire semantics
341  for loads and Release
342  semantics for stores.
343  Additionally, it guarantees
344  that a total ordering exists
345  between all
346  SequentiallyConsistent
347  operations. */
349 
350 typedef enum {
351  LLVMAtomicRMWBinOpXchg, /**< Set the new value and return the one old */
352  LLVMAtomicRMWBinOpAdd, /**< Add a value and return the old one */
353  LLVMAtomicRMWBinOpSub, /**< Subtract a value and return the old one */
354  LLVMAtomicRMWBinOpAnd, /**< And a value and return the old one */
355  LLVMAtomicRMWBinOpNand, /**< Not-And a value and return the old one */
356  LLVMAtomicRMWBinOpOr, /**< OR a value and return the old one */
357  LLVMAtomicRMWBinOpXor, /**< Xor a value and return the old one */
358  LLVMAtomicRMWBinOpMax, /**< Sets the value if it's greater than the
359  original using a signed comparison and return
360  the old one */
361  LLVMAtomicRMWBinOpMin, /**< Sets the value if it's Smaller than the
362  original using a signed comparison and return
363  the old one */
364  LLVMAtomicRMWBinOpUMax, /**< Sets the value if it's greater than the
365  original using an unsigned comparison and return
366  the old one */
367  LLVMAtomicRMWBinOpUMin /**< Sets the value if it's greater than the
368  original using an unsigned comparison and return
369  the old one */
371 
372 typedef enum {
378 
379 typedef enum {
383 
384 typedef enum {
385  /**
386  * Emits an error if two values disagree, otherwise the resulting value is
387  * that of the operands.
388  *
389  * @see Module::ModFlagBehavior::Error
390  */
392  /**
393  * Emits a warning if two values disagree. The result value will be the
394  * operand for the flag from the first module being linked.
395  *
396  * @see Module::ModFlagBehavior::Warning
397  */
399  /**
400  * Adds a requirement that another module flag be present and have a
401  * specified value after linking is performed. The value must be a metadata
402  * pair, where the first element of the pair is the ID of the module flag
403  * to be restricted, and the second element of the pair is the value the
404  * module flag should be restricted to. This behavior can be used to
405  * restrict the allowable results (via triggering of an error) of linking
406  * IDs with the **Override** behavior.
407  *
408  * @see Module::ModFlagBehavior::Require
409  */
411  /**
412  * Uses the specified value, regardless of the behavior or value of the
413  * other module. If both modules specify **Override**, but the values
414  * differ, an error will be emitted.
415  *
416  * @see Module::ModFlagBehavior::Override
417  */
419  /**
420  * Appends the two values, which are required to be metadata nodes.
421  *
422  * @see Module::ModFlagBehavior::Append
423  */
425  /**
426  * Appends the two values, which are required to be metadata
427  * nodes. However, duplicate entries in the second list are dropped
428  * during the append operation.
429  *
430  * @see Module::ModFlagBehavior::AppendUnique
431  */
434 
435 /**
436  * Attribute index are either LLVMAttributeReturnIndex,
437  * LLVMAttributeFunctionIndex or a parameter number from 1 to N.
438  */
439 enum {
441  // ISO C restricts enumerator values to range of 'int'
442  // (4294967295 is too large)
443  // LLVMAttributeFunctionIndex = ~0U,
445 };
446 
447 typedef unsigned LLVMAttributeIndex;
448 
449 /**
450  * @}
451  */
452 
454 
455 /** Deallocate and destroy all ManagedStatic variables.
456  @see llvm::llvm_shutdown
457  @see ManagedStatic */
458 void LLVMShutdown(void);
459 
460 /*===-- Error handling ----------------------------------------------------===*/
461 
462 char *LLVMCreateMessage(const char *Message);
463 void LLVMDisposeMessage(char *Message);
464 
465 /**
466  * @defgroup LLVMCCoreContext Contexts
467  *
468  * Contexts are execution states for the core LLVM IR system.
469  *
470  * Most types are tied to a context instance. Multiple contexts can
471  * exist simultaneously. A single context is not thread safe. However,
472  * different contexts can execute on different threads simultaneously.
473  *
474  * @{
475  */
476 
478 typedef void (*LLVMYieldCallback)(LLVMContextRef, void *);
479 
480 /**
481  * Create a new context.
482  *
483  * Every call to this function should be paired with a call to
484  * LLVMContextDispose() or the context will leak memory.
485  */
486 LLVMContextRef LLVMContextCreate(void);
487 
488 /**
489  * Obtain the global context instance.
490  */
491 LLVMContextRef LLVMGetGlobalContext(void);
492 
493 /**
494  * Set the diagnostic handler for this context.
495  */
496 void LLVMContextSetDiagnosticHandler(LLVMContextRef C,
497  LLVMDiagnosticHandler Handler,
498  void *DiagnosticContext);
499 
500 /**
501  * Get the diagnostic handler of this context.
502  */
504 
505 /**
506  * Get the diagnostic context of this context.
507  */
508 void *LLVMContextGetDiagnosticContext(LLVMContextRef C);
509 
510 /**
511  * Set the yield callback function for this context.
512  *
513  * @see LLVMContext::setYieldCallback()
514  */
515 void LLVMContextSetYieldCallback(LLVMContextRef C, LLVMYieldCallback Callback,
516  void *OpaqueHandle);
517 
518 /**
519  * Destroy a context instance.
520  *
521  * This should be called for every call to LLVMContextCreate() or memory
522  * will be leaked.
523  */
524 void LLVMContextDispose(LLVMContextRef C);
525 
526 /**
527  * Return a string representation of the DiagnosticInfo. Use
528  * LLVMDisposeMessage to free the string.
529  *
530  * @see DiagnosticInfo::print()
531  */
532 char *LLVMGetDiagInfoDescription(LLVMDiagnosticInfoRef DI);
533 
534 /**
535  * Return an enum LLVMDiagnosticSeverity.
536  *
537  * @see DiagnosticInfo::getSeverity()
538  */
539 LLVMDiagnosticSeverity LLVMGetDiagInfoSeverity(LLVMDiagnosticInfoRef DI);
540 
541 unsigned LLVMGetMDKindIDInContext(LLVMContextRef C, const char *Name,
542  unsigned SLen);
543 unsigned LLVMGetMDKindID(const char *Name, unsigned SLen);
544 
545 /**
546  * Return an unique id given the name of a enum attribute,
547  * or 0 if no attribute by that name exists.
548  *
549  * See http://llvm.org/docs/LangRef.html#parameter-attributes
550  * and http://llvm.org/docs/LangRef.html#function-attributes
551  * for the list of available attributes.
552  *
553  * NB: Attribute names and/or id are subject to change without
554  * going through the C API deprecation cycle.
555  */
556 unsigned LLVMGetEnumAttributeKindForName(const char *Name, size_t SLen);
557 unsigned LLVMGetLastEnumAttributeKind(void);
558 
559 /**
560  * Create an enum attribute.
561  */
562 LLVMAttributeRef LLVMCreateEnumAttribute(LLVMContextRef C, unsigned KindID,
563  uint64_t Val);
564 
565 /**
566  * Get the unique id corresponding to the enum attribute
567  * passed as argument.
568  */
570 
571 /**
572  * Get the enum attribute's value. 0 is returned if none exists.
573  */
575 
576 /**
577  * Create a string attribute.
578  */
580  const char *K, unsigned KLength,
581  const char *V, unsigned VLength);
582 
583 /**
584  * Get the string attribute's kind.
585  */
586 const char *LLVMGetStringAttributeKind(LLVMAttributeRef A, unsigned *Length);
587 
588 /**
589  * Get the string attribute's value.
590  */
591 const char *LLVMGetStringAttributeValue(LLVMAttributeRef A, unsigned *Length);
592 
593 /**
594  * Check for the different types of attributes.
595  */
598 
599 /**
600  * @}
601  */
602 
603 /**
604  * @defgroup LLVMCCoreModule Modules
605  *
606  * Modules represent the top-level structure in an LLVM program. An LLVM
607  * module is effectively a translation unit or a collection of
608  * translation units merged together.
609  *
610  * @{
611  */
612 
613 /**
614  * Create a new, empty module in the global context.
615  *
616  * This is equivalent to calling LLVMModuleCreateWithNameInContext with
617  * LLVMGetGlobalContext() as the context parameter.
618  *
619  * Every invocation should be paired with LLVMDisposeModule() or memory
620  * will be leaked.
621  */
622 LLVMModuleRef LLVMModuleCreateWithName(const char *ModuleID);
623 
624 /**
625  * Create a new, empty module in a specific context.
626  *
627  * Every invocation should be paired with LLVMDisposeModule() or memory
628  * will be leaked.
629  */
631  LLVMContextRef C);
632 /**
633  * Return an exact copy of the specified module.
634  */
636 
637 /**
638  * Destroy a module instance.
639  *
640  * This must be called for every created module or memory will be
641  * leaked.
642  */
644 
645 /**
646  * Obtain the identifier of a module.
647  *
648  * @param M Module to obtain identifier of
649  * @param Len Out parameter which holds the length of the returned string.
650  * @return The identifier of M.
651  * @see Module::getModuleIdentifier()
652  */
653 const char *LLVMGetModuleIdentifier(LLVMModuleRef M, size_t *Len);
654 
655 /**
656  * Set the identifier of a module to a string Ident with length Len.
657  *
658  * @param M The module to set identifier
659  * @param Ident The string to set M's identifier to
660  * @param Len Length of Ident
661  * @see Module::setModuleIdentifier()
662  */
663 void LLVMSetModuleIdentifier(LLVMModuleRef M, const char *Ident, size_t Len);
664 
665 /**
666  * Obtain the module's original source file name.
667  *
668  * @param M Module to obtain the name of
669  * @param Len Out parameter which holds the length of the returned string
670  * @return The original source file name of M
671  * @see Module::getSourceFileName()
672  */
673 const char *LLVMGetSourceFileName(LLVMModuleRef M, size_t *Len);
674 
675 /**
676  * Set the original source file name of a module to a string Name with length
677  * Len.
678  *
679  * @param M The module to set the source file name of
680  * @param Name The string to set M's source file name to
681  * @param Len Length of Name
682  * @see Module::setSourceFileName()
683  */
684 void LLVMSetSourceFileName(LLVMModuleRef M, const char *Name, size_t Len);
685 
686 /**
687  * Obtain the data layout for a module.
688  *
689  * @see Module::getDataLayoutStr()
690  *
691  * LLVMGetDataLayout is DEPRECATED, as the name is not only incorrect,
692  * but match the name of another method on the module. Prefer the use
693  * of LLVMGetDataLayoutStr, which is not ambiguous.
694  */
695 const char *LLVMGetDataLayoutStr(LLVMModuleRef M);
696 const char *LLVMGetDataLayout(LLVMModuleRef M);
697 
698 /**
699  * Set the data layout for a module.
700  *
701  * @see Module::setDataLayout()
702  */
703 void LLVMSetDataLayout(LLVMModuleRef M, const char *DataLayoutStr);
704 
705 /**
706  * Obtain the target triple for a module.
707  *
708  * @see Module::getTargetTriple()
709  */
710 const char *LLVMGetTarget(LLVMModuleRef M);
711 
712 /**
713  * Set the target triple for a module.
714  *
715  * @see Module::setTargetTriple()
716  */
717 void LLVMSetTarget(LLVMModuleRef M, const char *Triple);
718 
719 /**
720  * Returns the module flags as an array of flag-key-value triples. The caller
721  * is responsible for freeing this array by calling
722  * \c LLVMDisposeModuleFlagsMetadata.
723  *
724  * @see Module::getModuleFlagsMetadata()
725  */
727 
728 /**
729  * Destroys module flags metadata entries.
730  */
732 
733 /**
734  * Returns the flag behavior for a module flag entry at a specific index.
735  *
736  * @see Module::ModuleFlagEntry::Behavior
737  */
738 LLVMModuleFlagBehavior
740  unsigned Index);
741 
742 /**
743  * Returns the key for a module flag entry at a specific index.
744  *
745  * @see Module::ModuleFlagEntry::Key
746  */
748  unsigned Index, size_t *Len);
749 
750 /**
751  * Returns the metadata for a module flag entry at a specific index.
752  *
753  * @see Module::ModuleFlagEntry::Val
754  */
756  unsigned Index);
757 
758 /**
759  * Add a module-level flag to the module-level flags metadata if it doesn't
760  * already exist.
761  *
762  * @see Module::getModuleFlag()
763  */
765  const char *Key, size_t KeyLen);
766 
767 /**
768  * Add a module-level flag to the module-level flags metadata if it doesn't
769  * already exist.
770  *
771  * @see Module::addModuleFlag()
772  */
773 void LLVMAddModuleFlag(LLVMModuleRef M, LLVMModuleFlagBehavior Behavior,
774  const char *Key, size_t KeyLen,
775  LLVMMetadataRef Val);
776 
777 /**
778  * Dump a representation of a module to stderr.
779  *
780  * @see Module::dump()
781  */
783 
784 /**
785  * Print a representation of a module to a file. The ErrorMessage needs to be
786  * disposed with LLVMDisposeMessage. Returns 0 on success, 1 otherwise.
787  *
788  * @see Module::print()
789  */
790 LLVMBool LLVMPrintModuleToFile(LLVMModuleRef M, const char *Filename,
791  char **ErrorMessage);
792 
793 /**
794  * Return a string representation of the module. Use
795  * LLVMDisposeMessage to free the string.
796  *
797  * @see Module::print()
798  */
800 
801 /**
802  * Get inline assembly for a module.
803  *
804  * @see Module::getModuleInlineAsm()
805  */
806 const char *LLVMGetModuleInlineAsm(LLVMModuleRef M, size_t *Len);
807 
808 /**
809  * Set inline assembly for a module.
810  *
811  * @see Module::setModuleInlineAsm()
812  */
813 void LLVMSetModuleInlineAsm2(LLVMModuleRef M, const char *Asm, size_t Len);
814 
815 /**
816  * Append inline assembly to a module.
817  *
818  * @see Module::appendModuleInlineAsm()
819  */
820 void LLVMAppendModuleInlineAsm(LLVMModuleRef M, const char *Asm, size_t Len);
821 
822 /**
823  * Create the specified uniqued inline asm string.
824  *
825  * @see InlineAsm::get()
826  */
828  char *AsmString, size_t AsmStringSize,
829  char *Constraints, size_t ConstraintsSize,
830  LLVMBool HasSideEffects, LLVMBool IsAlignStack,
831  LLVMInlineAsmDialect Dialect);
832 
833 /**
834  * Obtain the context to which this module is associated.
835  *
836  * @see Module::getContext()
837  */
838 LLVMContextRef LLVMGetModuleContext(LLVMModuleRef M);
839 
840 /**
841  * Obtain a Type from a module by its registered name.
842  */
844 
845 /**
846  * Obtain the number of operands for named metadata in a module.
847  *
848  * @see llvm::Module::getNamedMetadata()
849  */
850 unsigned LLVMGetNamedMetadataNumOperands(LLVMModuleRef M, const char *Name);
851 
852 /**
853  * Obtain the named metadata operands for a module.
854  *
855  * The passed LLVMValueRef pointer should refer to an array of
856  * LLVMValueRef at least LLVMGetNamedMetadataNumOperands long. This
857  * array will be populated with the LLVMValueRef instances. Each
858  * instance corresponds to a llvm::MDNode.
859  *
860  * @see llvm::Module::getNamedMetadata()
861  * @see llvm::MDNode::getOperand()
862  */
864  LLVMValueRef *Dest);
865 
866 /**
867  * Add an operand to named metadata.
868  *
869  * @see llvm::Module::getNamedMetadata()
870  * @see llvm::MDNode::addOperand()
871  */
873  LLVMValueRef Val);
874 
875 /**
876  * Add a function to a module under a specified name.
877  *
878  * @see llvm::Function::Create()
879  */
881  LLVMTypeRef FunctionTy);
882 
883 /**
884  * Obtain a Function value from a Module by its name.
885  *
886  * The returned value corresponds to a llvm::Function value.
887  *
888  * @see llvm::Module::getFunction()
889  */
891 
892 /**
893  * Obtain an iterator to the first Function in a Module.
894  *
895  * @see llvm::Module::begin()
896  */
898 
899 /**
900  * Obtain an iterator to the last Function in a Module.
901  *
902  * @see llvm::Module::end()
903  */
905 
906 /**
907  * Advance a Function iterator to the next Function.
908  *
909  * Returns NULL if the iterator was already at the end and there are no more
910  * functions.
911  */
913 
914 /**
915  * Decrement a Function iterator to the previous Function.
916  *
917  * Returns NULL if the iterator was already at the beginning and there are
918  * no previous functions.
919  */
921 
922 /** Deprecated: Use LLVMSetModuleInlineAsm2 instead. */
923 void LLVMSetModuleInlineAsm(LLVMModuleRef M, const char *Asm);
924 
925 /**
926  * @}
927  */
928 
929 /**
930  * @defgroup LLVMCCoreType Types
931  *
932  * Types represent the type of a value.
933  *
934  * Types are associated with a context instance. The context internally
935  * deduplicates types so there is only 1 instance of a specific type
936  * alive at a time. In other words, a unique type is shared among all
937  * consumers within a context.
938  *
939  * A Type in the C API corresponds to llvm::Type.
940  *
941  * Types have the following hierarchy:
942  *
943  * types:
944  * integer type
945  * real type
946  * function type
947  * sequence types:
948  * array type
949  * pointer type
950  * vector type
951  * void type
952  * label type
953  * opaque type
954  *
955  * @{
956  */
957 
958 /**
959  * Obtain the enumerated type of a Type instance.
960  *
961  * @see llvm::Type:getTypeID()
962  */
963 LLVMTypeKind LLVMGetTypeKind(LLVMTypeRef Ty);
964 
965 /**
966  * Whether the type has a known size.
967  *
968  * Things that don't have a size are abstract types, labels, and void.a
969  *
970  * @see llvm::Type::isSized()
971  */
973 
974 /**
975  * Obtain the context to which this type instance is associated.
976  *
977  * @see llvm::Type::getContext()
978  */
979 LLVMContextRef LLVMGetTypeContext(LLVMTypeRef Ty);
980 
981 /**
982  * Dump a representation of a type to stderr.
983  *
984  * @see llvm::Type::dump()
985  */
986 void LLVMDumpType(LLVMTypeRef Val);
987 
988 /**
989  * Return a string representation of the type. Use
990  * LLVMDisposeMessage to free the string.
991  *
992  * @see llvm::Type::print()
993  */
995 
996 /**
997  * @defgroup LLVMCCoreTypeInt Integer Types
998  *
999  * Functions in this section operate on integer types.
1000  *
1001  * @{
1002  */
1003 
1004 /**
1005  * Obtain an integer type from a context with specified bit width.
1006  */
1007 LLVMTypeRef LLVMInt1TypeInContext(LLVMContextRef C);
1008 LLVMTypeRef LLVMInt8TypeInContext(LLVMContextRef C);
1009 LLVMTypeRef LLVMInt16TypeInContext(LLVMContextRef C);
1010 LLVMTypeRef LLVMInt32TypeInContext(LLVMContextRef C);
1011 LLVMTypeRef LLVMInt64TypeInContext(LLVMContextRef C);
1012 LLVMTypeRef LLVMInt128TypeInContext(LLVMContextRef C);
1013 LLVMTypeRef LLVMIntTypeInContext(LLVMContextRef C, unsigned NumBits);
1014 
1015 /**
1016  * Obtain an integer type from the global context with a specified bit
1017  * width.
1018  */
1025 LLVMTypeRef LLVMIntType(unsigned NumBits);
1026 unsigned LLVMGetIntTypeWidth(LLVMTypeRef IntegerTy);
1027 
1028 /**
1029  * @}
1030  */
1031 
1032 /**
1033  * @defgroup LLVMCCoreTypeFloat Floating Point Types
1034  *
1035  * @{
1036  */
1037 
1038 /**
1039  * Obtain a 16-bit floating point type from a context.
1040  */
1041 LLVMTypeRef LLVMHalfTypeInContext(LLVMContextRef C);
1042 
1043 /**
1044  * Obtain a 32-bit floating point type from a context.
1045  */
1046 LLVMTypeRef LLVMFloatTypeInContext(LLVMContextRef C);
1047 
1048 /**
1049  * Obtain a 64-bit floating point type from a context.
1050  */
1051 LLVMTypeRef LLVMDoubleTypeInContext(LLVMContextRef C);
1052 
1053 /**
1054  * Obtain a 80-bit floating point type (X87) from a context.
1055  */
1056 LLVMTypeRef LLVMX86FP80TypeInContext(LLVMContextRef C);
1057 
1058 /**
1059  * Obtain a 128-bit floating point type (112-bit mantissa) from a
1060  * context.
1061  */
1062 LLVMTypeRef LLVMFP128TypeInContext(LLVMContextRef C);
1063 
1064 /**
1065  * Obtain a 128-bit floating point type (two 64-bits) from a context.
1066  */
1067 LLVMTypeRef LLVMPPCFP128TypeInContext(LLVMContextRef C);
1068 
1069 /**
1070  * Obtain a floating point type from the global context.
1071  *
1072  * These map to the functions in this group of the same name.
1073  */
1080 
1081 /**
1082  * @}
1083  */
1084 
1085 /**
1086  * @defgroup LLVMCCoreTypeFunction Function Types
1087  *
1088  * @{
1089  */
1090 
1091 /**
1092  * Obtain a function type consisting of a specified signature.
1093  *
1094  * The function is defined as a tuple of a return Type, a list of
1095  * parameter types, and whether the function is variadic.
1096  */
1098  LLVMTypeRef *ParamTypes, unsigned ParamCount,
1099  LLVMBool IsVarArg);
1100 
1101 /**
1102  * Returns whether a function type is variadic.
1103  */
1105 
1106 /**
1107  * Obtain the Type this function Type returns.
1108  */
1110 
1111 /**
1112  * Obtain the number of parameters this function accepts.
1113  */
1114 unsigned LLVMCountParamTypes(LLVMTypeRef FunctionTy);
1115 
1116 /**
1117  * Obtain the types of a function's parameters.
1118  *
1119  * The Dest parameter should point to a pre-allocated array of
1120  * LLVMTypeRef at least LLVMCountParamTypes() large. On return, the
1121  * first LLVMCountParamTypes() entries in the array will be populated
1122  * with LLVMTypeRef instances.
1123  *
1124  * @param FunctionTy The function type to operate on.
1125  * @param Dest Memory address of an array to be filled with result.
1126  */
1127 void LLVMGetParamTypes(LLVMTypeRef FunctionTy, LLVMTypeRef *Dest);
1128 
1129 /**
1130  * @}
1131  */
1132 
1133 /**
1134  * @defgroup LLVMCCoreTypeStruct Structure Types
1135  *
1136  * These functions relate to LLVMTypeRef instances.
1137  *
1138  * @see llvm::StructType
1139  *
1140  * @{
1141  */
1142 
1143 /**
1144  * Create a new structure type in a context.
1145  *
1146  * A structure is specified by a list of inner elements/types and
1147  * whether these can be packed together.
1148  *
1149  * @see llvm::StructType::create()
1150  */
1151 LLVMTypeRef LLVMStructTypeInContext(LLVMContextRef C, LLVMTypeRef *ElementTypes,
1152  unsigned ElementCount, LLVMBool Packed);
1153 
1154 /**
1155  * Create a new structure type in the global context.
1156  *
1157  * @see llvm::StructType::create()
1158  */
1159 LLVMTypeRef LLVMStructType(LLVMTypeRef *ElementTypes, unsigned ElementCount,
1160  LLVMBool Packed);
1161 
1162 /**
1163  * Create an empty structure in a context having a specified name.
1164  *
1165  * @see llvm::StructType::create()
1166  */
1167 LLVMTypeRef LLVMStructCreateNamed(LLVMContextRef C, const char *Name);
1168 
1169 /**
1170  * Obtain the name of a structure.
1171  *
1172  * @see llvm::StructType::getName()
1173  */
1174 const char *LLVMGetStructName(LLVMTypeRef Ty);
1175 
1176 /**
1177  * Set the contents of a structure type.
1178  *
1179  * @see llvm::StructType::setBody()
1180  */
1181 void LLVMStructSetBody(LLVMTypeRef StructTy, LLVMTypeRef *ElementTypes,
1182  unsigned ElementCount, LLVMBool Packed);
1183 
1184 /**
1185  * Get the number of elements defined inside the structure.
1186  *
1187  * @see llvm::StructType::getNumElements()
1188  */
1189 unsigned LLVMCountStructElementTypes(LLVMTypeRef StructTy);
1190 
1191 /**
1192  * Get the elements within a structure.
1193  *
1194  * The function is passed the address of a pre-allocated array of
1195  * LLVMTypeRef at least LLVMCountStructElementTypes() long. After
1196  * invocation, this array will be populated with the structure's
1197  * elements. The objects in the destination array will have a lifetime
1198  * of the structure type itself, which is the lifetime of the context it
1199  * is contained in.
1200  */
1201 void LLVMGetStructElementTypes(LLVMTypeRef StructTy, LLVMTypeRef *Dest);
1202 
1203 /**
1204  * Get the type of the element at a given index in the structure.
1205  *
1206  * @see llvm::StructType::getTypeAtIndex()
1207  */
1208 LLVMTypeRef LLVMStructGetTypeAtIndex(LLVMTypeRef StructTy, unsigned i);
1209 
1210 /**
1211  * Determine whether a structure is packed.
1212  *
1213  * @see llvm::StructType::isPacked()
1214  */
1216 
1217 /**
1218  * Determine whether a structure is opaque.
1219  *
1220  * @see llvm::StructType::isOpaque()
1221  */
1223 
1224 /**
1225  * @}
1226  */
1227 
1228 /**
1229  * @defgroup LLVMCCoreTypeSequential Sequential Types
1230  *
1231  * Sequential types represents "arrays" of types. This is a super class
1232  * for array, vector, and pointer types.
1233  *
1234  * @{
1235  */
1236 
1237 /**
1238  * Obtain the type of elements within a sequential type.
1239  *
1240  * This works on array, vector, and pointer types.
1241  *
1242  * @see llvm::SequentialType::getElementType()
1243  */
1245 
1246 /**
1247  * Returns type's subtypes
1248  *
1249  * @see llvm::Type::subtypes()
1250  */
1251 void LLVMGetSubtypes(LLVMTypeRef Tp, LLVMTypeRef *Arr);
1252 
1253 /**
1254  * Return the number of types in the derived type.
1255  *
1256  * @see llvm::Type::getNumContainedTypes()
1257  */
1259 
1260 /**
1261  * Create a fixed size array type that refers to a specific type.
1262  *
1263  * The created type will exist in the context that its element type
1264  * exists in.
1265  *
1266  * @see llvm::ArrayType::get()
1267  */
1268 LLVMTypeRef LLVMArrayType(LLVMTypeRef ElementType, unsigned ElementCount);
1269 
1270 /**
1271  * Obtain the length of an array type.
1272  *
1273  * This only works on types that represent arrays.
1274  *
1275  * @see llvm::ArrayType::getNumElements()
1276  */
1277 unsigned LLVMGetArrayLength(LLVMTypeRef ArrayTy);
1278 
1279 /**
1280  * Create a pointer type that points to a defined type.
1281  *
1282  * The created type will exist in the context that its pointee type
1283  * exists in.
1284  *
1285  * @see llvm::PointerType::get()
1286  */
1287 LLVMTypeRef LLVMPointerType(LLVMTypeRef ElementType, unsigned AddressSpace);
1288 
1289 /**
1290  * Obtain the address space of a pointer type.
1291  *
1292  * This only works on types that represent pointers.
1293  *
1294  * @see llvm::PointerType::getAddressSpace()
1295  */
1297 
1298 /**
1299  * Create a vector type that contains a defined type and has a specific
1300  * number of elements.
1301  *
1302  * The created type will exist in the context thats its element type
1303  * exists in.
1304  *
1305  * @see llvm::VectorType::get()
1306  */
1307 LLVMTypeRef LLVMVectorType(LLVMTypeRef ElementType, unsigned ElementCount);
1308 
1309 /**
1310  * Obtain the number of elements in a vector type.
1311  *
1312  * This only works on types that represent vectors.
1313  *
1314  * @see llvm::VectorType::getNumElements()
1315  */
1316 unsigned LLVMGetVectorSize(LLVMTypeRef VectorTy);
1317 
1318 /**
1319  * @}
1320  */
1321 
1322 /**
1323  * @defgroup LLVMCCoreTypeOther Other Types
1324  *
1325  * @{
1326  */
1327 
1328 /**
1329  * Create a void type in a context.
1330  */
1331 LLVMTypeRef LLVMVoidTypeInContext(LLVMContextRef C);
1332 
1333 /**
1334  * Create a label type in a context.
1335  */
1336 LLVMTypeRef LLVMLabelTypeInContext(LLVMContextRef C);
1337 
1338 /**
1339  * Create a X86 MMX type in a context.
1340  */
1341 LLVMTypeRef LLVMX86MMXTypeInContext(LLVMContextRef C);
1342 
1343 /**
1344  * Create a token type in a context.
1345  */
1346 LLVMTypeRef LLVMTokenTypeInContext(LLVMContextRef C);
1347 
1348 /**
1349  * Create a metadata type in a context.
1350  */
1351 LLVMTypeRef LLVMMetadataTypeInContext(LLVMContextRef C);
1352 
1353 /**
1354  * These are similar to the above functions except they operate on the
1355  * global context.
1356  */
1360 
1361 /**
1362  * @}
1363  */
1364 
1365 /**
1366  * @}
1367  */
1368 
1369 /**
1370  * @defgroup LLVMCCoreValues Values
1371  *
1372  * The bulk of LLVM's object model consists of values, which comprise a very
1373  * rich type hierarchy.
1374  *
1375  * LLVMValueRef essentially represents llvm::Value. There is a rich
1376  * hierarchy of classes within this type. Depending on the instance
1377  * obtained, not all APIs are available.
1378  *
1379  * Callers can determine the type of an LLVMValueRef by calling the
1380  * LLVMIsA* family of functions (e.g. LLVMIsAArgument()). These
1381  * functions are defined by a macro, so it isn't obvious which are
1382  * available by looking at the Doxygen source code. Instead, look at the
1383  * source definition of LLVM_FOR_EACH_VALUE_SUBCLASS and note the list
1384  * of value names given. These value names also correspond to classes in
1385  * the llvm::Value hierarchy.
1386  *
1387  * @{
1388  */
1389 
1390 #define LLVM_FOR_EACH_VALUE_SUBCLASS(macro) \
1391  macro(Argument) \
1392  macro(BasicBlock) \
1393  macro(InlineAsm) \
1394  macro(User) \
1395  macro(Constant) \
1396  macro(BlockAddress) \
1397  macro(ConstantAggregateZero) \
1398  macro(ConstantArray) \
1399  macro(ConstantDataSequential) \
1400  macro(ConstantDataArray) \
1401  macro(ConstantDataVector) \
1402  macro(ConstantExpr) \
1403  macro(ConstantFP) \
1404  macro(ConstantInt) \
1405  macro(ConstantPointerNull) \
1406  macro(ConstantStruct) \
1407  macro(ConstantTokenNone) \
1408  macro(ConstantVector) \
1409  macro(GlobalValue) \
1410  macro(GlobalAlias) \
1411  macro(GlobalObject) \
1412  macro(Function) \
1413  macro(GlobalVariable) \
1414  macro(UndefValue) \
1415  macro(Instruction) \
1416  macro(BinaryOperator) \
1417  macro(CallInst) \
1418  macro(IntrinsicInst) \
1419  macro(DbgInfoIntrinsic) \
1420  macro(DbgDeclareInst) \
1421  macro(MemIntrinsic) \
1422  macro(MemCpyInst) \
1423  macro(MemMoveInst) \
1424  macro(MemSetInst) \
1425  macro(CmpInst) \
1426  macro(FCmpInst) \
1427  macro(ICmpInst) \
1428  macro(ExtractElementInst) \
1429  macro(GetElementPtrInst) \
1430  macro(InsertElementInst) \
1431  macro(InsertValueInst) \
1432  macro(LandingPadInst) \
1433  macro(PHINode) \
1434  macro(SelectInst) \
1435  macro(ShuffleVectorInst) \
1436  macro(StoreInst) \
1437  macro(TerminatorInst) \
1438  macro(BranchInst) \
1439  macro(IndirectBrInst) \
1440  macro(InvokeInst) \
1441  macro(ReturnInst) \
1442  macro(SwitchInst) \
1443  macro(UnreachableInst) \
1444  macro(ResumeInst) \
1445  macro(CleanupReturnInst) \
1446  macro(CatchReturnInst) \
1447  macro(FuncletPadInst) \
1448  macro(CatchPadInst) \
1449  macro(CleanupPadInst) \
1450  macro(UnaryInstruction) \
1451  macro(AllocaInst) \
1452  macro(CastInst) \
1453  macro(AddrSpaceCastInst) \
1454  macro(BitCastInst) \
1455  macro(FPExtInst) \
1456  macro(FPToSIInst) \
1457  macro(FPToUIInst) \
1458  macro(FPTruncInst) \
1459  macro(IntToPtrInst) \
1460  macro(PtrToIntInst) \
1461  macro(SExtInst) \
1462  macro(SIToFPInst) \
1463  macro(TruncInst) \
1464  macro(UIToFPInst) \
1465  macro(ZExtInst) \
1466  macro(ExtractValueInst) \
1467  macro(LoadInst) \
1468  macro(VAArgInst)
1469 
1470 /**
1471  * @defgroup LLVMCCoreValueGeneral General APIs
1472  *
1473  * Functions in this section work on all LLVMValueRef instances,
1474  * regardless of their sub-type. They correspond to functions available
1475  * on llvm::Value.
1476  *
1477  * @{
1478  */
1479 
1480 /**
1481  * Obtain the type of a value.
1482  *
1483  * @see llvm::Value::getType()
1484  */
1486 
1487 /**
1488  * Obtain the enumerated type of a Value instance.
1489  *
1490  * @see llvm::Value::getValueID()
1491  */
1492 LLVMValueKind LLVMGetValueKind(LLVMValueRef Val);
1493 
1494 /**
1495  * Obtain the string name of a value.
1496  *
1497  * @see llvm::Value::getName()
1498  */
1499 const char *LLVMGetValueName2(LLVMValueRef Val, size_t *Length);
1500 
1501 /**
1502  * Set the string name of a value.
1503  *
1504  * @see llvm::Value::setName()
1505  */
1506 void LLVMSetValueName2(LLVMValueRef Val, const char *Name, size_t NameLen);
1507 
1508 /**
1509  * Dump a representation of a value to stderr.
1510  *
1511  * @see llvm::Value::dump()
1512  */
1513 void LLVMDumpValue(LLVMValueRef Val);
1514 
1515 /**
1516  * Return a string representation of the value. Use
1517  * LLVMDisposeMessage to free the string.
1518  *
1519  * @see llvm::Value::print()
1520  */
1522 
1523 /**
1524  * Replace all uses of a value with another one.
1525  *
1526  * @see llvm::Value::replaceAllUsesWith()
1527  */
1528 void LLVMReplaceAllUsesWith(LLVMValueRef OldVal, LLVMValueRef NewVal);
1529 
1530 /**
1531  * Determine whether the specified value instance is constant.
1532  */
1534 
1535 /**
1536  * Determine whether a value instance is undefined.
1537  */
1539 
1540 /**
1541  * Convert value instances between types.
1542  *
1543  * Internally, an LLVMValueRef is "pinned" to a specific type. This
1544  * series of functions allows you to cast an instance to a specific
1545  * type.
1546  *
1547  * If the cast is not valid for the specified type, NULL is returned.
1548  *
1549  * @see llvm::dyn_cast_or_null<>
1550  */
1551 #define LLVM_DECLARE_VALUE_CAST(name) \
1552  LLVMValueRef LLVMIsA##name(LLVMValueRef Val);
1554 
1557 
1558 /** Deprecated: Use LLVMGetValueName2 instead. */
1559 const char *LLVMGetValueName(LLVMValueRef Val);
1560 /** Deprecated: Use LLVMSetValueName2 instead. */
1561 void LLVMSetValueName(LLVMValueRef Val, const char *Name);
1562 
1563 /**
1564  * @}
1565  */
1566 
1567 /**
1568  * @defgroup LLVMCCoreValueUses Usage
1569  *
1570  * This module defines functions that allow you to inspect the uses of a
1571  * LLVMValueRef.
1572  *
1573  * It is possible to obtain an LLVMUseRef for any LLVMValueRef instance.
1574  * Each LLVMUseRef (which corresponds to a llvm::Use instance) holds a
1575  * llvm::User and llvm::Value.
1576  *
1577  * @{
1578  */
1579 
1580 /**
1581  * Obtain the first use of a value.
1582  *
1583  * Uses are obtained in an iterator fashion. First, call this function
1584  * to obtain a reference to the first use. Then, call LLVMGetNextUse()
1585  * on that instance and all subsequently obtained instances until
1586  * LLVMGetNextUse() returns NULL.
1587  *
1588  * @see llvm::Value::use_begin()
1589  */
1591 
1592 /**
1593  * Obtain the next use of a value.
1594  *
1595  * This effectively advances the iterator. It returns NULL if you are on
1596  * the final use and no more are available.
1597  */
1599 
1600 /**
1601  * Obtain the user value for a user.
1602  *
1603  * The returned value corresponds to a llvm::User type.
1604  *
1605  * @see llvm::Use::getUser()
1606  */
1608 
1609 /**
1610  * Obtain the value this use corresponds to.
1611  *
1612  * @see llvm::Use::get().
1613  */
1615 
1616 /**
1617  * @}
1618  */
1619 
1620 /**
1621  * @defgroup LLVMCCoreValueUser User value
1622  *
1623  * Function in this group pertain to LLVMValueRef instances that descent
1624  * from llvm::User. This includes constants, instructions, and
1625  * operators.
1626  *
1627  * @{
1628  */
1629 
1630 /**
1631  * Obtain an operand at a specific index in a llvm::User value.
1632  *
1633  * @see llvm::User::getOperand()
1634  */
1636 
1637 /**
1638  * Obtain the use of an operand at a specific index in a llvm::User value.
1639  *
1640  * @see llvm::User::getOperandUse()
1641  */
1643 
1644 /**
1645  * Set an operand at a specific index in a llvm::User value.
1646  *
1647  * @see llvm::User::setOperand()
1648  */
1649 void LLVMSetOperand(LLVMValueRef User, unsigned Index, LLVMValueRef Val);
1650 
1651 /**
1652  * Obtain the number of operands in a llvm::User value.
1653  *
1654  * @see llvm::User::getNumOperands()
1655  */
1657 
1658 /**
1659  * @}
1660  */
1661 
1662 /**
1663  * @defgroup LLVMCCoreValueConstant Constants
1664  *
1665  * This section contains APIs for interacting with LLVMValueRef that
1666  * correspond to llvm::Constant instances.
1667  *
1668  * These functions will work for any LLVMValueRef in the llvm::Constant
1669  * class hierarchy.
1670  *
1671  * @{
1672  */
1673 
1674 /**
1675  * Obtain a constant value referring to the null instance of a type.
1676  *
1677  * @see llvm::Constant::getNullValue()
1678  */
1679 LLVMValueRef LLVMConstNull(LLVMTypeRef Ty); /* all zeroes */
1680 
1681 /**
1682  * Obtain a constant value referring to the instance of a type
1683  * consisting of all ones.
1684  *
1685  * This is only valid for integer types.
1686  *
1687  * @see llvm::Constant::getAllOnesValue()
1688  */
1690 
1691 /**
1692  * Obtain a constant value referring to an undefined value of a type.
1693  *
1694  * @see llvm::UndefValue::get()
1695  */
1697 
1698 /**
1699  * Determine whether a value instance is null.
1700  *
1701  * @see llvm::Constant::isNullValue()
1702  */
1704 
1705 /**
1706  * Obtain a constant that is a constant pointer pointing to NULL for a
1707  * specified type.
1708  */
1710 
1711 /**
1712  * @defgroup LLVMCCoreValueConstantScalar Scalar constants
1713  *
1714  * Functions in this group model LLVMValueRef instances that correspond
1715  * to constants referring to scalar types.
1716  *
1717  * For integer types, the LLVMTypeRef parameter should correspond to a
1718  * llvm::IntegerType instance and the returned LLVMValueRef will
1719  * correspond to a llvm::ConstantInt.
1720  *
1721  * For floating point types, the LLVMTypeRef returned corresponds to a
1722  * llvm::ConstantFP.
1723  *
1724  * @{
1725  */
1726 
1727 /**
1728  * Obtain a constant value for an integer type.
1729  *
1730  * The returned value corresponds to a llvm::ConstantInt.
1731  *
1732  * @see llvm::ConstantInt::get()
1733  *
1734  * @param IntTy Integer type to obtain value of.
1735  * @param N The value the returned instance should refer to.
1736  * @param SignExtend Whether to sign extend the produced value.
1737  */
1738 LLVMValueRef LLVMConstInt(LLVMTypeRef IntTy, unsigned long long N,
1739  LLVMBool SignExtend);
1740 
1741 /**
1742  * Obtain a constant value for an integer of arbitrary precision.
1743  *
1744  * @see llvm::ConstantInt::get()
1745  */
1747  unsigned NumWords,
1748  const uint64_t Words[]);
1749 
1750 /**
1751  * Obtain a constant value for an integer parsed from a string.
1752  *
1753  * A similar API, LLVMConstIntOfStringAndSize is also available. If the
1754  * string's length is available, it is preferred to call that function
1755  * instead.
1756  *
1757  * @see llvm::ConstantInt::get()
1758  */
1759 LLVMValueRef LLVMConstIntOfString(LLVMTypeRef IntTy, const char *Text,
1760  uint8_t Radix);
1761 
1762 /**
1763  * Obtain a constant value for an integer parsed from a string with
1764  * specified length.
1765  *
1766  * @see llvm::ConstantInt::get()
1767  */
1768 LLVMValueRef LLVMConstIntOfStringAndSize(LLVMTypeRef IntTy, const char *Text,
1769  unsigned SLen, uint8_t Radix);
1770 
1771 /**
1772  * Obtain a constant value referring to a double floating point value.
1773  */
1774 LLVMValueRef LLVMConstReal(LLVMTypeRef RealTy, double N);
1775 
1776 /**
1777  * Obtain a constant for a floating point value parsed from a string.
1778  *
1779  * A similar API, LLVMConstRealOfStringAndSize is also available. It
1780  * should be used if the input string's length is known.
1781  */
1782 LLVMValueRef LLVMConstRealOfString(LLVMTypeRef RealTy, const char *Text);
1783 
1784 /**
1785  * Obtain a constant for a floating point value parsed from a string.
1786  */
1787 LLVMValueRef LLVMConstRealOfStringAndSize(LLVMTypeRef RealTy, const char *Text,
1788  unsigned SLen);
1789 
1790 /**
1791  * Obtain the zero extended value for an integer constant value.
1792  *
1793  * @see llvm::ConstantInt::getZExtValue()
1794  */
1795 unsigned long long LLVMConstIntGetZExtValue(LLVMValueRef ConstantVal);
1796 
1797 /**
1798  * Obtain the sign extended value for an integer constant value.
1799  *
1800  * @see llvm::ConstantInt::getSExtValue()
1801  */
1802 long long LLVMConstIntGetSExtValue(LLVMValueRef ConstantVal);
1803 
1804 /**
1805  * Obtain the double value for an floating point constant value.
1806  * losesInfo indicates if some precision was lost in the conversion.
1807  *
1808  * @see llvm::ConstantFP::getDoubleValue
1809  */
1810 double LLVMConstRealGetDouble(LLVMValueRef ConstantVal, LLVMBool *losesInfo);
1811 
1812 /**
1813  * @}
1814  */
1815 
1816 /**
1817  * @defgroup LLVMCCoreValueConstantComposite Composite Constants
1818  *
1819  * Functions in this group operate on composite constants.
1820  *
1821  * @{
1822  */
1823 
1824 /**
1825  * Create a ConstantDataSequential and initialize it with a string.
1826  *
1827  * @see llvm::ConstantDataArray::getString()
1828  */
1829 LLVMValueRef LLVMConstStringInContext(LLVMContextRef C, const char *Str,
1830  unsigned Length, LLVMBool DontNullTerminate);
1831 
1832 /**
1833  * Create a ConstantDataSequential with string content in the global context.
1834  *
1835  * This is the same as LLVMConstStringInContext except it operates on the
1836  * global context.
1837  *
1838  * @see LLVMConstStringInContext()
1839  * @see llvm::ConstantDataArray::getString()
1840  */
1841 LLVMValueRef LLVMConstString(const char *Str, unsigned Length,
1842  LLVMBool DontNullTerminate);
1843 
1844 /**
1845  * Returns true if the specified constant is an array of i8.
1846  *
1847  * @see ConstantDataSequential::getAsString()
1848  */
1850 
1851 /**
1852  * Get the given constant data sequential as a string.
1853  *
1854  * @see ConstantDataSequential::getAsString()
1855  */
1856 const char *LLVMGetAsString(LLVMValueRef c, size_t *Length);
1857 
1858 /**
1859  * Create an anonymous ConstantStruct with the specified values.
1860  *
1861  * @see llvm::ConstantStruct::getAnon()
1862  */
1863 LLVMValueRef LLVMConstStructInContext(LLVMContextRef C,
1864  LLVMValueRef *ConstantVals,
1865  unsigned Count, LLVMBool Packed);
1866 
1867 /**
1868  * Create a ConstantStruct in the global Context.
1869  *
1870  * This is the same as LLVMConstStructInContext except it operates on the
1871  * global Context.
1872  *
1873  * @see LLVMConstStructInContext()
1874  */
1875 LLVMValueRef LLVMConstStruct(LLVMValueRef *ConstantVals, unsigned Count,
1876  LLVMBool Packed);
1877 
1878 /**
1879  * Create a ConstantArray from values.
1880  *
1881  * @see llvm::ConstantArray::get()
1882  */
1884  LLVMValueRef *ConstantVals, unsigned Length);
1885 
1886 /**
1887  * Create a non-anonymous ConstantStruct from values.
1888  *
1889  * @see llvm::ConstantStruct::get()
1890  */
1892  LLVMValueRef *ConstantVals,
1893  unsigned Count);
1894 
1895 /**
1896  * Get an element at specified index as a constant.
1897  *
1898  * @see ConstantDataSequential::getElementAsConstant()
1899  */
1901 
1902 /**
1903  * Create a ConstantVector from values.
1904  *
1905  * @see llvm::ConstantVector::get()
1906  */
1907 LLVMValueRef LLVMConstVector(LLVMValueRef *ScalarConstantVals, unsigned Size);
1908 
1909 /**
1910  * @}
1911  */
1912 
1913 /**
1914  * @defgroup LLVMCCoreValueConstantExpressions Constant Expressions
1915  *
1916  * Functions in this group correspond to APIs on llvm::ConstantExpr.
1917  *
1918  * @see llvm::ConstantExpr.
1919  *
1920  * @{
1921  */
1930 LLVMValueRef LLVMConstAdd(LLVMValueRef LHSConstant, LLVMValueRef RHSConstant);
1931 LLVMValueRef LLVMConstNSWAdd(LLVMValueRef LHSConstant, LLVMValueRef RHSConstant);
1932 LLVMValueRef LLVMConstNUWAdd(LLVMValueRef LHSConstant, LLVMValueRef RHSConstant);
1933 LLVMValueRef LLVMConstFAdd(LLVMValueRef LHSConstant, LLVMValueRef RHSConstant);
1934 LLVMValueRef LLVMConstSub(LLVMValueRef LHSConstant, LLVMValueRef RHSConstant);
1935 LLVMValueRef LLVMConstNSWSub(LLVMValueRef LHSConstant, LLVMValueRef RHSConstant);
1936 LLVMValueRef LLVMConstNUWSub(LLVMValueRef LHSConstant, LLVMValueRef RHSConstant);
1937 LLVMValueRef LLVMConstFSub(LLVMValueRef LHSConstant, LLVMValueRef RHSConstant);
1938 LLVMValueRef LLVMConstMul(LLVMValueRef LHSConstant, LLVMValueRef RHSConstant);
1939 LLVMValueRef LLVMConstNSWMul(LLVMValueRef LHSConstant, LLVMValueRef RHSConstant);
1940 LLVMValueRef LLVMConstNUWMul(LLVMValueRef LHSConstant, LLVMValueRef RHSConstant);
1941 LLVMValueRef LLVMConstFMul(LLVMValueRef LHSConstant, LLVMValueRef RHSConstant);
1942 LLVMValueRef LLVMConstUDiv(LLVMValueRef LHSConstant, LLVMValueRef RHSConstant);
1943 LLVMValueRef LLVMConstExactUDiv(LLVMValueRef LHSConstant, LLVMValueRef RHSConstant);
1944 LLVMValueRef LLVMConstSDiv(LLVMValueRef LHSConstant, LLVMValueRef RHSConstant);
1945 LLVMValueRef LLVMConstExactSDiv(LLVMValueRef LHSConstant, LLVMValueRef RHSConstant);
1946 LLVMValueRef LLVMConstFDiv(LLVMValueRef LHSConstant, LLVMValueRef RHSConstant);
1947 LLVMValueRef LLVMConstURem(LLVMValueRef LHSConstant, LLVMValueRef RHSConstant);
1948 LLVMValueRef LLVMConstSRem(LLVMValueRef LHSConstant, LLVMValueRef RHSConstant);
1949 LLVMValueRef LLVMConstFRem(LLVMValueRef LHSConstant, LLVMValueRef RHSConstant);
1950 LLVMValueRef LLVMConstAnd(LLVMValueRef LHSConstant, LLVMValueRef RHSConstant);
1951 LLVMValueRef LLVMConstOr(LLVMValueRef LHSConstant, LLVMValueRef RHSConstant);
1952 LLVMValueRef LLVMConstXor(LLVMValueRef LHSConstant, LLVMValueRef RHSConstant);
1953 LLVMValueRef LLVMConstICmp(LLVMIntPredicate Predicate,
1954  LLVMValueRef LHSConstant, LLVMValueRef RHSConstant);
1955 LLVMValueRef LLVMConstFCmp(LLVMRealPredicate Predicate,
1956  LLVMValueRef LHSConstant, LLVMValueRef RHSConstant);
1957 LLVMValueRef LLVMConstShl(LLVMValueRef LHSConstant, LLVMValueRef RHSConstant);
1958 LLVMValueRef LLVMConstLShr(LLVMValueRef LHSConstant, LLVMValueRef RHSConstant);
1959 LLVMValueRef LLVMConstAShr(LLVMValueRef LHSConstant, LLVMValueRef RHSConstant);
1961  LLVMValueRef *ConstantIndices, unsigned NumIndices);
1963  LLVMValueRef *ConstantIndices,
1964  unsigned NumIndices);
1966 LLVMValueRef LLVMConstSExt(LLVMValueRef ConstantVal, LLVMTypeRef ToType);
1967 LLVMValueRef LLVMConstZExt(LLVMValueRef ConstantVal, LLVMTypeRef ToType);
1979  LLVMTypeRef ToType);
1981  LLVMTypeRef ToType);
1983  LLVMTypeRef ToType);
1985  LLVMTypeRef ToType);
1987  LLVMBool isSigned);
1989 LLVMValueRef LLVMConstSelect(LLVMValueRef ConstantCondition,
1990  LLVMValueRef ConstantIfTrue,
1991  LLVMValueRef ConstantIfFalse);
1993  LLVMValueRef IndexConstant);
1995  LLVMValueRef ElementValueConstant,
1996  LLVMValueRef IndexConstant);
1998  LLVMValueRef VectorBConstant,
1999  LLVMValueRef MaskConstant);
2000 LLVMValueRef LLVMConstExtractValue(LLVMValueRef AggConstant, unsigned *IdxList,
2001  unsigned NumIdx);
2003  LLVMValueRef ElementValueConstant,
2004  unsigned *IdxList, unsigned NumIdx);
2006 
2007 /** Deprecated: Use LLVMGetInlineAsm instead. */
2009  const char *AsmString, const char *Constraints,
2010  LLVMBool HasSideEffects, LLVMBool IsAlignStack);
2011 
2012 /**
2013  * @}
2014  */
2015 
2016 /**
2017  * @defgroup LLVMCCoreValueConstantGlobals Global Values
2018  *
2019  * This group contains functions that operate on global values. Functions in
2020  * this group relate to functions in the llvm::GlobalValue class tree.
2021  *
2022  * @see llvm::GlobalValue
2023  *
2024  * @{
2025  */
2026 
2029 LLVMLinkage LLVMGetLinkage(LLVMValueRef Global);
2030 void LLVMSetLinkage(LLVMValueRef Global, LLVMLinkage Linkage);
2031 const char *LLVMGetSection(LLVMValueRef Global);
2032 void LLVMSetSection(LLVMValueRef Global, const char *Section);
2033 LLVMVisibility LLVMGetVisibility(LLVMValueRef Global);
2034 void LLVMSetVisibility(LLVMValueRef Global, LLVMVisibility Viz);
2037 LLVMUnnamedAddr LLVMGetUnnamedAddress(LLVMValueRef Global);
2038 void LLVMSetUnnamedAddress(LLVMValueRef Global, LLVMUnnamedAddr UnnamedAddr);
2039 
2040 /** Deprecated: Use LLVMGetUnnamedAddress instead. */
2042 /** Deprecated: Use LLVMSetUnnamedAddress instead. */
2043 void LLVMSetUnnamedAddr(LLVMValueRef Global, LLVMBool HasUnnamedAddr);
2044 
2045 /**
2046  * @defgroup LLVMCCoreValueWithAlignment Values with alignment
2047  *
2048  * Functions in this group only apply to values with alignment, i.e.
2049  * global variables, load and store instructions.
2050  */
2051 
2052 /**
2053  * Obtain the preferred alignment of the value.
2054  * @see llvm::AllocaInst::getAlignment()
2055  * @see llvm::LoadInst::getAlignment()
2056  * @see llvm::StoreInst::getAlignment()
2057  * @see llvm::GlobalValue::getAlignment()
2058  */
2059 unsigned LLVMGetAlignment(LLVMValueRef V);
2060 
2061 /**
2062  * Set the preferred alignment of the value.
2063  * @see llvm::AllocaInst::setAlignment()
2064  * @see llvm::LoadInst::setAlignment()
2065  * @see llvm::StoreInst::setAlignment()
2066  * @see llvm::GlobalValue::setAlignment()
2067  */
2068 void LLVMSetAlignment(LLVMValueRef V, unsigned Bytes);
2069 
2070 /**
2071  * @}
2072  */
2073 
2074 /**
2075  * @defgroup LLVMCoreValueConstantGlobalVariable Global Variables
2076  *
2077  * This group contains functions that operate on global variable values.
2078  *
2079  * @see llvm::GlobalVariable
2080  *
2081  * @{
2082  */
2085  const char *Name,
2086  unsigned AddressSpace);
2096 void LLVMSetThreadLocal(LLVMValueRef GlobalVar, LLVMBool IsThreadLocal);
2099 LLVMThreadLocalMode LLVMGetThreadLocalMode(LLVMValueRef GlobalVar);
2100 void LLVMSetThreadLocalMode(LLVMValueRef GlobalVar, LLVMThreadLocalMode Mode);
2103 
2104 /**
2105  * @}
2106  */
2107 
2108 /**
2109  * @defgroup LLVMCoreValueConstantGlobalAlias Global Aliases
2110  *
2111  * This group contains function that operate on global alias values.
2112  *
2113  * @see llvm::GlobalAlias
2114  *
2115  * @{
2116  */
2118  const char *Name);
2119 
2120 /**
2121  * Obtain a GlobalAlias value from a Module by its name.
2122  *
2123  * The returned value corresponds to a llvm::GlobalAlias value.
2124  *
2125  * @see llvm::Module::getNamedAlias()
2126  */
2128  const char *Name, size_t NameLen);
2129 
2130 /**
2131  * Obtain an iterator to the first GlobalAlias in a Module.
2132  *
2133  * @see llvm::Module::alias_begin()
2134  */
2136 
2137 /**
2138  * Obtain an iterator to the last GlobalAlias in a Module.
2139  *
2140  * @see llvm::Module::alias_end()
2141  */
2143 
2144 /**
2145  * Advance a GlobalAlias iterator to the next GlobalAlias.
2146  *
2147  * Returns NULL if the iterator was already at the end and there are no more
2148  * global aliases.
2149  */
2151 
2152 /**
2153  * Decrement a GlobalAlias iterator to the previous GlobalAlias.
2154  *
2155  * Returns NULL if the iterator was already at the beginning and there are
2156  * no previous global aliases.
2157  */
2159 
2160 /**
2161  * Retrieve the target value of an alias.
2162  */
2164 
2165 /**
2166  * Set the target value of an alias.
2167  */
2168 void LLVMAliasSetAliasee(LLVMValueRef Alias, LLVMValueRef Aliasee);
2169 
2170 /**
2171  * @}
2172  */
2173 
2174 /**
2175  * @defgroup LLVMCCoreValueFunction Function values
2176  *
2177  * Functions in this group operate on LLVMValueRef instances that
2178  * correspond to llvm::Function instances.
2179  *
2180  * @see llvm::Function
2181  *
2182  * @{
2183  */
2184 
2185 /**
2186  * Remove a function from its containing module and deletes it.
2187  *
2188  * @see llvm::Function::eraseFromParent()
2189  */
2191 
2192 /**
2193  * Check whether the given function has a personality function.
2194  *
2195  * @see llvm::Function::hasPersonalityFn()
2196  */
2198 
2199 /**
2200  * Obtain the personality function attached to the function.
2201  *
2202  * @see llvm::Function::getPersonalityFn()
2203  */
2205 
2206 /**
2207  * Set the personality function attached to the function.
2208  *
2209  * @see llvm::Function::setPersonalityFn()
2210  */
2211 void LLVMSetPersonalityFn(LLVMValueRef Fn, LLVMValueRef PersonalityFn);
2212 
2213 /**
2214  * Obtain the ID number from a function instance.
2215  *
2216  * @see llvm::Function::getIntrinsicID()
2217  */
2218 unsigned LLVMGetIntrinsicID(LLVMValueRef Fn);
2219 
2220 /**
2221  * Obtain the calling function of a function.
2222  *
2223  * The returned value corresponds to the LLVMCallConv enumeration.
2224  *
2225  * @see llvm::Function::getCallingConv()
2226  */
2228 
2229 /**
2230  * Set the calling convention of a function.
2231  *
2232  * @see llvm::Function::setCallingConv()
2233  *
2234  * @param Fn Function to operate on
2235  * @param CC LLVMCallConv to set calling convention to
2236  */
2237 void LLVMSetFunctionCallConv(LLVMValueRef Fn, unsigned CC);
2238 
2239 /**
2240  * Obtain the name of the garbage collector to use during code
2241  * generation.
2242  *
2243  * @see llvm::Function::getGC()
2244  */
2245 const char *LLVMGetGC(LLVMValueRef Fn);
2246 
2247 /**
2248  * Define the garbage collector to use during code generation.
2249  *
2250  * @see llvm::Function::setGC()
2251  */
2252 void LLVMSetGC(LLVMValueRef Fn, const char *Name);
2253 
2254 /**
2255  * Add an attribute to a function.
2256  *
2257  * @see llvm::Function::addAttribute()
2258  */
2259 void LLVMAddAttributeAtIndex(LLVMValueRef F, LLVMAttributeIndex Idx,
2261 unsigned LLVMGetAttributeCountAtIndex(LLVMValueRef F, LLVMAttributeIndex Idx);
2262 void LLVMGetAttributesAtIndex(LLVMValueRef F, LLVMAttributeIndex Idx,
2265  LLVMAttributeIndex Idx,
2266  unsigned KindID);
2268  LLVMAttributeIndex Idx,
2269  const char *K, unsigned KLen);
2270 void LLVMRemoveEnumAttributeAtIndex(LLVMValueRef F, LLVMAttributeIndex Idx,
2271  unsigned KindID);
2272 void LLVMRemoveStringAttributeAtIndex(LLVMValueRef F, LLVMAttributeIndex Idx,
2273  const char *K, unsigned KLen);
2274 
2275 /**
2276  * Add a target-dependent attribute to a function
2277  * @see llvm::AttrBuilder::addAttribute()
2278  */
2280  const char *V);
2281 
2282 /**
2283  * @defgroup LLVMCCoreValueFunctionParameters Function Parameters
2284  *
2285  * Functions in this group relate to arguments/parameters on functions.
2286  *
2287  * Functions in this group expect LLVMValueRef instances that correspond
2288  * to llvm::Function instances.
2289  *
2290  * @{
2291  */
2292 
2293 /**
2294  * Obtain the number of parameters in a function.
2295  *
2296  * @see llvm::Function::arg_size()
2297  */
2298 unsigned LLVMCountParams(LLVMValueRef Fn);
2299 
2300 /**
2301  * Obtain the parameters in a function.
2302  *
2303  * The takes a pointer to a pre-allocated array of LLVMValueRef that is
2304  * at least LLVMCountParams() long. This array will be filled with
2305  * LLVMValueRef instances which correspond to the parameters the
2306  * function receives. Each LLVMValueRef corresponds to a llvm::Argument
2307  * instance.
2308  *
2309  * @see llvm::Function::arg_begin()
2310  */
2311 void LLVMGetParams(LLVMValueRef Fn, LLVMValueRef *Params);
2312 
2313 /**
2314  * Obtain the parameter at the specified index.
2315  *
2316  * Parameters are indexed from 0.
2317  *
2318  * @see llvm::Function::arg_begin()
2319  */
2321 
2322 /**
2323  * Obtain the function to which this argument belongs.
2324  *
2325  * Unlike other functions in this group, this one takes an LLVMValueRef
2326  * that corresponds to a llvm::Attribute.
2327  *
2328  * The returned LLVMValueRef is the llvm::Function to which this
2329  * argument belongs.
2330  */
2332 
2333 /**
2334  * Obtain the first parameter to a function.
2335  *
2336  * @see llvm::Function::arg_begin()
2337  */
2339 
2340 /**
2341  * Obtain the last parameter to a function.
2342  *
2343  * @see llvm::Function::arg_end()
2344  */
2346 
2347 /**
2348  * Obtain the next parameter to a function.
2349  *
2350  * This takes an LLVMValueRef obtained from LLVMGetFirstParam() (which is
2351  * actually a wrapped iterator) and obtains the next parameter from the
2352  * underlying iterator.
2353  */
2355 
2356 /**
2357  * Obtain the previous parameter to a function.
2358  *
2359  * This is the opposite of LLVMGetNextParam().
2360  */
2362 
2363 /**
2364  * Set the alignment for a function parameter.
2365  *
2366  * @see llvm::Argument::addAttr()
2367  * @see llvm::AttrBuilder::addAlignmentAttr()
2368  */
2370 
2371 /**
2372  * @}
2373  */
2374 
2375 /**
2376  * @}
2377  */
2378 
2379 /**
2380  * @}
2381  */
2382 
2383 /**
2384  * @}
2385  */
2386 
2387 /**
2388  * @defgroup LLVMCCoreValueMetadata Metadata
2389  *
2390  * @{
2391  */
2392 
2393 /**
2394  * Obtain a MDString value from a context.
2395  *
2396  * The returned instance corresponds to the llvm::MDString class.
2397  *
2398  * The instance is specified by string data of a specified length. The
2399  * string content is copied, so the backing memory can be freed after
2400  * this function returns.
2401  */
2402 LLVMValueRef LLVMMDStringInContext(LLVMContextRef C, const char *Str,
2403  unsigned SLen);
2404 
2405 /**
2406  * Obtain a MDString value from the global context.
2407  */
2408 LLVMValueRef LLVMMDString(const char *Str, unsigned SLen);
2409 
2410 /**
2411  * Obtain a MDNode value from a context.
2412  *
2413  * The returned value corresponds to the llvm::MDNode class.
2414  */
2415 LLVMValueRef LLVMMDNodeInContext(LLVMContextRef C, LLVMValueRef *Vals,
2416  unsigned Count);
2417 
2418 /**
2419  * Obtain a MDNode value from the global context.
2420  */
2421 LLVMValueRef LLVMMDNode(LLVMValueRef *Vals, unsigned Count);
2422 
2423 /**
2424  * Obtain a Metadata as a Value.
2425  */
2427 
2428 /**
2429  * Obtain a Value as a Metadata.
2430  */
2432 
2433 /**
2434  * Obtain the underlying string from a MDString value.
2435  *
2436  * @param V Instance to obtain string from.
2437  * @param Length Memory address which will hold length of returned string.
2438  * @return String data in MDString.
2439  */
2440 const char *LLVMGetMDString(LLVMValueRef V, unsigned *Length);
2441 
2442 /**
2443  * Obtain the number of operands from an MDNode value.
2444  *
2445  * @param V MDNode to get number of operands from.
2446  * @return Number of operands of the MDNode.
2447  */
2449 
2450 /**
2451  * Obtain the given MDNode's operands.
2452  *
2453  * The passed LLVMValueRef pointer should point to enough memory to hold all of
2454  * the operands of the given MDNode (see LLVMGetMDNodeNumOperands) as
2455  * LLVMValueRefs. This memory will be populated with the LLVMValueRefs of the
2456  * MDNode's operands.
2457  *
2458  * @param V MDNode to get the operands from.
2459  * @param Dest Destination array for operands.
2460  */
2462 
2463 /**
2464  * @}
2465  */
2466 
2467 /**
2468  * @defgroup LLVMCCoreValueBasicBlock Basic Block
2469  *
2470  * A basic block represents a single entry single exit section of code.
2471  * Basic blocks contain a list of instructions which form the body of
2472  * the block.
2473  *
2474  * Basic blocks belong to functions. They have the type of label.
2475  *
2476  * Basic blocks are themselves values. However, the C API models them as
2477  * LLVMBasicBlockRef.
2478  *
2479  * @see llvm::BasicBlock
2480  *
2481  * @{
2482  */
2483 
2484 /**
2485  * Convert a basic block instance to a value type.
2486  */
2488 
2489 /**
2490  * Determine whether an LLVMValueRef is itself a basic block.
2491  */
2493 
2494 /**
2495  * Convert an LLVMValueRef to an LLVMBasicBlockRef instance.
2496  */
2498 
2499 /**
2500  * Obtain the string name of a basic block.
2501  */
2503 
2504 /**
2505  * Obtain the function to which a basic block belongs.
2506  *
2507  * @see llvm::BasicBlock::getParent()
2508  */
2510 
2511 /**
2512  * Obtain the terminator instruction for a basic block.
2513  *
2514  * If the basic block does not have a terminator (it is not well-formed
2515  * if it doesn't), then NULL is returned.
2516  *
2517  * The returned LLVMValueRef corresponds to a llvm::TerminatorInst.
2518  *
2519  * @see llvm::BasicBlock::getTerminator()
2520  */
2522 
2523 /**
2524  * Obtain the number of basic blocks in a function.
2525  *
2526  * @param Fn Function value to operate on.
2527  */
2528 unsigned LLVMCountBasicBlocks(LLVMValueRef Fn);
2529 
2530 /**
2531  * Obtain all of the basic blocks in a function.
2532  *
2533  * This operates on a function value. The BasicBlocks parameter is a
2534  * pointer to a pre-allocated array of LLVMBasicBlockRef of at least
2535  * LLVMCountBasicBlocks() in length. This array is populated with
2536  * LLVMBasicBlockRef instances.
2537  */
2538 void LLVMGetBasicBlocks(LLVMValueRef Fn, LLVMBasicBlockRef *BasicBlocks);
2539 
2540 /**
2541  * Obtain the first basic block in a function.
2542  *
2543  * The returned basic block can be used as an iterator. You will likely
2544  * eventually call into LLVMGetNextBasicBlock() with it.
2545  *
2546  * @see llvm::Function::begin()
2547  */
2549 
2550 /**
2551  * Obtain the last basic block in a function.
2552  *
2553  * @see llvm::Function::end()
2554  */
2556 
2557 /**
2558  * Advance a basic block iterator.
2559  */
2561 
2562 /**
2563  * Go backwards in a basic block iterator.
2564  */
2566 
2567 /**
2568  * Obtain the basic block that corresponds to the entry point of a
2569  * function.
2570  *
2571  * @see llvm::Function::getEntryBlock()
2572  */
2574 
2575 /**
2576  * Append a basic block to the end of a function.
2577  *
2578  * @see llvm::BasicBlock::Create()
2579  */
2581  LLVMValueRef Fn,
2582  const char *Name);
2583 
2584 /**
2585  * Append a basic block to the end of a function using the global
2586  * context.
2587  *
2588  * @see llvm::BasicBlock::Create()
2589  */
2591 
2592 /**
2593  * Insert a basic block in a function before another basic block.
2594  *
2595  * The function to add to is determined by the function of the
2596  * passed basic block.
2597  *
2598  * @see llvm::BasicBlock::Create()
2599  */
2601  LLVMBasicBlockRef BB,
2602  const char *Name);
2603 
2604 /**
2605  * Insert a basic block in a function using the global context.
2606  *
2607  * @see llvm::BasicBlock::Create()
2608  */
2610  const char *Name);
2611 
2612 /**
2613  * Remove a basic block from a function and delete it.
2614  *
2615  * This deletes the basic block from its containing function and deletes
2616  * the basic block itself.
2617  *
2618  * @see llvm::BasicBlock::eraseFromParent()
2619  */
2621 
2622 /**
2623  * Remove a basic block from a function.
2624  *
2625  * This deletes the basic block from its containing function but keep
2626  * the basic block alive.
2627  *
2628  * @see llvm::BasicBlock::removeFromParent()
2629  */
2631 
2632 /**
2633  * Move a basic block to before another one.
2634  *
2635  * @see llvm::BasicBlock::moveBefore()
2636  */
2638 
2639 /**
2640  * Move a basic block to after another one.
2641  *
2642  * @see llvm::BasicBlock::moveAfter()
2643  */
2645 
2646 /**
2647  * Obtain the first instruction in a basic block.
2648  *
2649  * The returned LLVMValueRef corresponds to a llvm::Instruction
2650  * instance.
2651  */
2653 
2654 /**
2655  * Obtain the last instruction in a basic block.
2656  *
2657  * The returned LLVMValueRef corresponds to an LLVM:Instruction.
2658  */
2660 
2661 /**
2662  * @}
2663  */
2664 
2665 /**
2666  * @defgroup LLVMCCoreValueInstruction Instructions
2667  *
2668  * Functions in this group relate to the inspection and manipulation of
2669  * individual instructions.
2670  *
2671  * In the C++ API, an instruction is modeled by llvm::Instruction. This
2672  * class has a large number of descendents. llvm::Instruction is a
2673  * llvm::Value and in the C API, instructions are modeled by
2674  * LLVMValueRef.
2675  *
2676  * This group also contains sub-groups which operate on specific
2677  * llvm::Instruction types, e.g. llvm::CallInst.
2678  *
2679  * @{
2680  */
2681 
2682 /**
2683  * Determine whether an instruction has any metadata attached.
2684  */
2685 int LLVMHasMetadata(LLVMValueRef Val);
2686 
2687 /**
2688  * Return metadata associated with an instruction value.
2689  */
2690 LLVMValueRef LLVMGetMetadata(LLVMValueRef Val, unsigned KindID);
2691 
2692 /**
2693  * Set metadata associated with an instruction value.
2694  */
2695 void LLVMSetMetadata(LLVMValueRef Val, unsigned KindID, LLVMValueRef Node);
2696 
2697 /**
2698  * Obtain the basic block to which an instruction belongs.
2699  *
2700  * @see llvm::Instruction::getParent()
2701  */
2703 
2704 /**
2705  * Obtain the instruction that occurs after the one specified.
2706  *
2707  * The next instruction will be from the same basic block.
2708  *
2709  * If this is the last instruction in a basic block, NULL will be
2710  * returned.
2711  */
2713 
2714 /**
2715  * Obtain the instruction that occurred before this one.
2716  *
2717  * If the instruction is the first instruction in a basic block, NULL
2718  * will be returned.
2719  */
2721 
2722 /**
2723  * Remove and delete an instruction.
2724  *
2725  * The instruction specified is removed from its containing building
2726  * block but is kept alive.
2727  *
2728  * @see llvm::Instruction::removeFromParent()
2729  */
2731 
2732 /**
2733  * Remove and delete an instruction.
2734  *
2735  * The instruction specified is removed from its containing building
2736  * block and then deleted.
2737  *
2738  * @see llvm::Instruction::eraseFromParent()
2739  */
2741 
2742 /**
2743  * Obtain the code opcode for an individual instruction.
2744  *
2745  * @see llvm::Instruction::getOpCode()
2746  */
2748 
2749 /**
2750  * Obtain the predicate of an instruction.
2751  *
2752  * This is only valid for instructions that correspond to llvm::ICmpInst
2753  * or llvm::ConstantExpr whose opcode is llvm::Instruction::ICmp.
2754  *
2755  * @see llvm::ICmpInst::getPredicate()
2756  */
2757 LLVMIntPredicate LLVMGetICmpPredicate(LLVMValueRef Inst);
2758 
2759 /**
2760  * Obtain the float predicate of an instruction.
2761  *
2762  * This is only valid for instructions that correspond to llvm::FCmpInst
2763  * or llvm::ConstantExpr whose opcode is llvm::Instruction::FCmp.
2764  *
2765  * @see llvm::FCmpInst::getPredicate()
2766  */
2767 LLVMRealPredicate LLVMGetFCmpPredicate(LLVMValueRef Inst);
2768 
2769 /**
2770  * Create a copy of 'this' instruction that is identical in all ways
2771  * except the following:
2772  * * The instruction has no parent
2773  * * The instruction has no name
2774  *
2775  * @see llvm::Instruction::clone()
2776  */
2778 
2779 /**
2780  * @defgroup LLVMCCoreValueInstructionCall Call Sites and Invocations
2781  *
2782  * Functions in this group apply to instructions that refer to call
2783  * sites and invocations. These correspond to C++ types in the
2784  * llvm::CallInst class tree.
2785  *
2786  * @{
2787  */
2788 
2789 /**
2790  * Obtain the argument count for a call instruction.
2791  *
2792  * This expects an LLVMValueRef that corresponds to a llvm::CallInst,
2793  * llvm::InvokeInst, or llvm:FuncletPadInst.
2794  *
2795  * @see llvm::CallInst::getNumArgOperands()
2796  * @see llvm::InvokeInst::getNumArgOperands()
2797  * @see llvm::FuncletPadInst::getNumArgOperands()
2798  */
2799 unsigned LLVMGetNumArgOperands(LLVMValueRef Instr);
2800 
2801 /**
2802  * Set the calling convention for a call instruction.
2803  *
2804  * This expects an LLVMValueRef that corresponds to a llvm::CallInst or
2805  * llvm::InvokeInst.
2806  *
2807  * @see llvm::CallInst::setCallingConv()
2808  * @see llvm::InvokeInst::setCallingConv()
2809  */
2810 void LLVMSetInstructionCallConv(LLVMValueRef Instr, unsigned CC);
2811 
2812 /**
2813  * Obtain the calling convention for a call instruction.
2814  *
2815  * This is the opposite of LLVMSetInstructionCallConv(). Reads its
2816  * usage.
2817  *
2818  * @see LLVMSetInstructionCallConv()
2819  */
2821 
2822 void LLVMSetInstrParamAlignment(LLVMValueRef Instr, unsigned index,
2823  unsigned Align);
2824 
2825 void LLVMAddCallSiteAttribute(LLVMValueRef C, LLVMAttributeIndex Idx,
2827 unsigned LLVMGetCallSiteAttributeCount(LLVMValueRef C, LLVMAttributeIndex Idx);
2828 void LLVMGetCallSiteAttributes(LLVMValueRef C, LLVMAttributeIndex Idx,
2831  LLVMAttributeIndex Idx,
2832  unsigned KindID);
2834  LLVMAttributeIndex Idx,
2835  const char *K, unsigned KLen);
2836 void LLVMRemoveCallSiteEnumAttribute(LLVMValueRef C, LLVMAttributeIndex Idx,
2837  unsigned KindID);
2838 void LLVMRemoveCallSiteStringAttribute(LLVMValueRef C, LLVMAttributeIndex Idx,
2839  const char *K, unsigned KLen);
2840 
2841 /**
2842  * Obtain the pointer to the function invoked by this instruction.
2843  *
2844  * This expects an LLVMValueRef that corresponds to a llvm::CallInst or
2845  * llvm::InvokeInst.
2846  *
2847  * @see llvm::CallInst::getCalledValue()
2848  * @see llvm::InvokeInst::getCalledValue()
2849  */
2851 
2852 /**
2853  * Obtain whether a call instruction is a tail call.
2854  *
2855  * This only works on llvm::CallInst instructions.
2856  *
2857  * @see llvm::CallInst::isTailCall()
2858  */
2860 
2861 /**
2862  * Set whether a call instruction is a tail call.
2863  *
2864  * This only works on llvm::CallInst instructions.
2865  *
2866  * @see llvm::CallInst::setTailCall()
2867  */
2868 void LLVMSetTailCall(LLVMValueRef CallInst, LLVMBool IsTailCall);
2869 
2870 /**
2871  * Return the normal destination basic block.
2872  *
2873  * This only works on llvm::InvokeInst instructions.
2874  *
2875  * @see llvm::InvokeInst::getNormalDest()
2876  */
2878 
2879 /**
2880  * Return the unwind destination basic block.
2881  *
2882  * Works on llvm::InvokeInst, llvm::CleanupReturnInst, and
2883  * llvm::CatchSwitchInst instructions.
2884  *
2885  * @see llvm::InvokeInst::getUnwindDest()
2886  * @see llvm::CleanupReturnInst::getUnwindDest()
2887  * @see llvm::CatchSwitchInst::getUnwindDest()
2888  */
2890 
2891 /**
2892  * Set the normal destination basic block.
2893  *
2894  * This only works on llvm::InvokeInst instructions.
2895  *
2896  * @see llvm::InvokeInst::setNormalDest()
2897  */
2899 
2900 /**
2901  * Set the unwind destination basic block.
2902  *
2903  * Works on llvm::InvokeInst, llvm::CleanupReturnInst, and
2904  * llvm::CatchSwitchInst instructions.
2905  *
2906  * @see llvm::InvokeInst::setUnwindDest()
2907  * @see llvm::CleanupReturnInst::setUnwindDest()
2908  * @see llvm::CatchSwitchInst::setUnwindDest()
2909  */
2911 
2912 /**
2913  * @}
2914  */
2915 
2916 /**
2917  * @defgroup LLVMCCoreValueInstructionTerminator Terminators
2918  *
2919  * Functions in this group only apply to instructions that map to
2920  * llvm::TerminatorInst instances.
2921  *
2922  * @{
2923  */
2924 
2925 /**
2926  * Return the number of successors that this terminator has.
2927  *
2928  * @see llvm::TerminatorInst::getNumSuccessors
2929  */
2930 unsigned LLVMGetNumSuccessors(LLVMValueRef Term);
2931 
2932 /**
2933  * Return the specified successor.
2934  *
2935  * @see llvm::TerminatorInst::getSuccessor
2936  */
2938 
2939 /**
2940  * Update the specified successor to point at the provided block.
2941  *
2942  * @see llvm::TerminatorInst::setSuccessor
2943  */
2944 void LLVMSetSuccessor(LLVMValueRef Term, unsigned i, LLVMBasicBlockRef block);
2945 
2946 /**
2947  * Return if a branch is conditional.
2948  *
2949  * This only works on llvm::BranchInst instructions.
2950  *
2951  * @see llvm::BranchInst::isConditional
2952  */
2954 
2955 /**
2956  * Return the condition of a branch instruction.
2957  *
2958  * This only works on llvm::BranchInst instructions.
2959  *
2960  * @see llvm::BranchInst::getCondition
2961  */
2963 
2964 /**
2965  * Set the condition of a branch instruction.
2966  *
2967  * This only works on llvm::BranchInst instructions.
2968  *
2969  * @see llvm::BranchInst::setCondition
2970  */
2972 
2973 /**
2974  * Obtain the default destination basic block of a switch instruction.
2975  *
2976  * This only works on llvm::SwitchInst instructions.
2977  *
2978  * @see llvm::SwitchInst::getDefaultDest()
2979  */
2981 
2982 /**
2983  * @}
2984  */
2985 
2986 /**
2987  * @defgroup LLVMCCoreValueInstructionAlloca Allocas
2988  *
2989  * Functions in this group only apply to instructions that map to
2990  * llvm::AllocaInst instances.
2991  *
2992  * @{
2993  */
2994 
2995 /**
2996  * Obtain the type that is being allocated by the alloca instruction.
2997  */
2999 
3000 /**
3001  * @}
3002  */
3003 
3004 /**
3005  * @defgroup LLVMCCoreValueInstructionGetElementPointer GEPs
3006  *
3007  * Functions in this group only apply to instructions that map to
3008  * llvm::GetElementPtrInst instances.
3009  *
3010  * @{
3011  */
3012 
3013 /**
3014  * Check whether the given GEP instruction is inbounds.
3015  */
3017 
3018 /**
3019  * Set the given GEP instruction to be inbounds or not.
3020  */
3021 void LLVMSetIsInBounds(LLVMValueRef GEP, LLVMBool InBounds);
3022 
3023 /**
3024  * @}
3025  */
3026 
3027 /**
3028  * @defgroup LLVMCCoreValueInstructionPHINode PHI Nodes
3029  *
3030  * Functions in this group only apply to instructions that map to
3031  * llvm::PHINode instances.
3032  *
3033  * @{
3034  */
3035 
3036 /**
3037  * Add an incoming value to the end of a PHI list.
3038  */
3039 void LLVMAddIncoming(LLVMValueRef PhiNode, LLVMValueRef *IncomingValues,
3040  LLVMBasicBlockRef *IncomingBlocks, unsigned Count);
3041 
3042 /**
3043  * Obtain the number of incoming basic blocks to a PHI node.
3044  */
3045 unsigned LLVMCountIncoming(LLVMValueRef PhiNode);
3046 
3047 /**
3048  * Obtain an incoming value to a PHI node as an LLVMValueRef.
3049  */
3051 
3052 /**
3053  * Obtain an incoming value to a PHI node as an LLVMBasicBlockRef.
3054  */
3056 
3057 /**
3058  * @}
3059  */
3060 
3061 /**
3062  * @defgroup LLVMCCoreValueInstructionExtractValue ExtractValue
3063  * @defgroup LLVMCCoreValueInstructionInsertValue InsertValue
3064  *
3065  * Functions in this group only apply to instructions that map to
3066  * llvm::ExtractValue and llvm::InsertValue instances.
3067  *
3068  * @{
3069  */
3070 
3071 /**
3072  * Obtain the number of indices.
3073  * NB: This also works on GEP.
3074  */
3075 unsigned LLVMGetNumIndices(LLVMValueRef Inst);
3076 
3077 /**
3078  * Obtain the indices as an array.
3079  */
3080 const unsigned *LLVMGetIndices(LLVMValueRef Inst);
3081 
3082 /**
3083  * @}
3084  */
3085 
3086 /**
3087  * @}
3088  */
3089 
3090 /**
3091  * @}
3092  */
3093 
3094 /**
3095  * @defgroup LLVMCCoreInstructionBuilder Instruction Builders
3096  *
3097  * An instruction builder represents a point within a basic block and is
3098  * the exclusive means of building instructions using the C interface.
3099  *
3100  * @{
3101  */
3102 
3106  LLVMValueRef Instr);
3113  const char *Name);
3114 void LLVMDisposeBuilder(LLVMBuilderRef Builder);
3115 
3116 /* Metadata */
3120 
3121 /* Terminators */
3125  unsigned N);
3130  LLVMBasicBlockRef Else, unsigned NumCases);
3132  unsigned NumDests);
3134  LLVMValueRef *Args, unsigned NumArgs,
3136  const char *Name);
3138 
3139 /* Exception Handling */
3142  LLVMValueRef PersFn, unsigned NumClauses,
3143  const char *Name);
3145  LLVMBasicBlockRef BB);
3147  LLVMBasicBlockRef BB);
3149  LLVMValueRef *Args, unsigned NumArgs,
3150  const char *Name);
3152  LLVMValueRef *Args, unsigned NumArgs,
3153  const char *Name);
3155  LLVMBasicBlockRef UnwindBB,
3156  unsigned NumHandlers, const char *Name);
3157 
3158 /* Add a case to the switch instruction */
3159 void LLVMAddCase(LLVMValueRef Switch, LLVMValueRef OnVal,
3160  LLVMBasicBlockRef Dest);
3161 
3162 /* Add a destination to the indirectbr instruction */
3163 void LLVMAddDestination(LLVMValueRef IndirectBr, LLVMBasicBlockRef Dest);
3164 
3165 /* Get the number of clauses on the landingpad instruction */
3166 unsigned LLVMGetNumClauses(LLVMValueRef LandingPad);
3167 
3168 /* Get the value of the clause at idnex Idx on the landingpad instruction */
3169 LLVMValueRef LLVMGetClause(LLVMValueRef LandingPad, unsigned Idx);
3170 
3171 /* Add a catch or filter clause to the landingpad instruction */
3172 void LLVMAddClause(LLVMValueRef LandingPad, LLVMValueRef ClauseVal);
3173 
3174 /* Get the 'cleanup' flag in the landingpad instruction */
3175 LLVMBool LLVMIsCleanup(LLVMValueRef LandingPad);
3176 
3177 /* Set the 'cleanup' flag in the landingpad instruction */
3178 void LLVMSetCleanup(LLVMValueRef LandingPad, LLVMBool Val);
3179 
3180 /* Add a destination to the catchswitch instruction */
3181 void LLVMAddHandler(LLVMValueRef CatchSwitch, LLVMBasicBlockRef Dest);
3182 
3183 /* Get the number of handlers on the catchswitch instruction */
3184 unsigned LLVMGetNumHandlers(LLVMValueRef CatchSwitch);
3185 
3186 /**
3187  * Obtain the basic blocks acting as handlers for a catchswitch instruction.
3188  *
3189  * The Handlers parameter should point to a pre-allocated array of
3190  * LLVMBasicBlockRefs at least LLVMGetNumHandlers() large. On return, the
3191  * first LLVMGetNumHandlers() entries in the array will be populated
3192  * with LLVMBasicBlockRef instances.
3193  *
3194  * @param CatchSwitch The catchswitch instruction to operate on.
3195  * @param Handlers Memory address of an array to be filled with basic blocks.
3196  */
3197 void LLVMGetHandlers(LLVMValueRef CatchSwitch, LLVMBasicBlockRef *Handlers);
3198 
3199 /* Funclets */
3200 
3201 /* Get the number of funcletpad arguments. */
3202 LLVMValueRef LLVMGetArgOperand(LLVMValueRef Funclet, unsigned i);
3203 
3204 /* Set a funcletpad argument at the given index. */
3205 void LLVMSetArgOperand(LLVMValueRef Funclet, unsigned i, LLVMValueRef value);
3206 
3207 /**
3208  * Get the parent catchswitch instruction of a catchpad instruction.
3209  *
3210  * This only works on llvm::CatchPadInst instructions.
3211  *
3212  * @see llvm::CatchPadInst::getCatchSwitch()
3213  */
3215 
3216 /**
3217  * Set the parent catchswitch instruction of a catchpad instruction.
3218  *
3219  * This only works on llvm::CatchPadInst instructions.
3220  *
3221  * @see llvm::CatchPadInst::setCatchSwitch()
3222  */
3223 void LLVMSetParentCatchSwitch(LLVMValueRef CatchPad, LLVMValueRef CatchSwitch);
3224 
3225 /* Arithmetic */
3227  const char *Name);
3229  const char *Name);
3231  const char *Name);
3233  const char *Name);
3235  const char *Name);
3237  const char *Name);
3239  const char *Name);
3241  const char *Name);
3243  const char *Name);
3245  const char *Name);
3247  const char *Name);
3249  const char *Name);
3251  const char *Name);
3253  const char *Name);
3255  const char *Name);
3257  const char *Name);
3259  const char *Name);
3261  const char *Name);
3263  const char *Name);
3265  const char *Name);
3267  const char *Name);
3269  const char *Name);
3271  const char *Name);
3273  const char *Name);
3275  const char *Name);
3277  const char *Name);
3279  LLVMValueRef LHS, LLVMValueRef RHS,
3280  const char *Name);
3283  const char *Name);
3285  const char *Name);
3288 
3289 /* Memory */
3292  LLVMValueRef Val, const char *Name);
3295  LLVMValueRef Val, const char *Name);
3298  const char *Name);
3301  LLVMValueRef *Indices, unsigned NumIndices,
3302  const char *Name);
3304  LLVMValueRef *Indices, unsigned NumIndices,
3305  const char *Name);
3307  unsigned Idx, const char *Name);
3309  const char *Name);
3311  const char *Name);
3312 LLVMBool LLVMGetVolatile(LLVMValueRef MemoryAccessInst);
3313 void LLVMSetVolatile(LLVMValueRef MemoryAccessInst, LLVMBool IsVolatile);
3315 void LLVMSetOrdering(LLVMValueRef MemoryAccessInst, LLVMAtomicOrdering Ordering);
3316 
3317 /* Casts */
3319  LLVMTypeRef DestTy, const char *Name);
3321  LLVMTypeRef DestTy, const char *Name);
3323  LLVMTypeRef DestTy, const char *Name);
3325  LLVMTypeRef DestTy, const char *Name);
3327  LLVMTypeRef DestTy, const char *Name);
3329  LLVMTypeRef DestTy, const char *Name);
3331  LLVMTypeRef DestTy, const char *Name);
3333  LLVMTypeRef DestTy, const char *Name);
3335  LLVMTypeRef DestTy, const char *Name);
3337  LLVMTypeRef DestTy, const char *Name);
3339  LLVMTypeRef DestTy, const char *Name);
3341  LLVMTypeRef DestTy, const char *Name);
3343  LLVMTypeRef DestTy, const char *Name);
3345  LLVMTypeRef DestTy, const char *Name);
3347  LLVMTypeRef DestTy, const char *Name);
3349  LLVMTypeRef DestTy, const char *Name);
3351  LLVMTypeRef DestTy, const char *Name);
3353  LLVMTypeRef DestTy, const char *Name);
3355  LLVMTypeRef DestTy, const char *Name);
3357  LLVMTypeRef DestTy, const char *Name);
3358 
3359 /* Comparisons */
3360 LLVMValueRef LLVMBuildICmp(LLVMBuilderRef, LLVMIntPredicate Op,
3361  LLVMValueRef LHS, LLVMValueRef RHS,
3362  const char *Name);
3363 LLVMValueRef LLVMBuildFCmp(LLVMBuilderRef, LLVMRealPredicate Op,
3364  LLVMValueRef LHS, LLVMValueRef RHS,
3365  const char *Name);
3366 
3367 /* Miscellaneous instructions */
3370  LLVMValueRef *Args, unsigned NumArgs,
3371  const char *Name);
3373  LLVMValueRef Then, LLVMValueRef Else,
3374  const char *Name);
3376  const char *Name);
3378  LLVMValueRef Index, const char *Name);
3381  const char *Name);
3384  const char *Name);
3386  unsigned Index, const char *Name);
3388  LLVMValueRef EltVal, unsigned Index,
3389  const char *Name);
3390 
3392  const char *Name);
3394  const char *Name);
3396  LLVMValueRef RHS, const char *Name);
3398  LLVMBool singleThread, const char *Name);
3399 LLVMValueRef LLVMBuildAtomicRMW(LLVMBuilderRef B, LLVMAtomicRMWBinOp op,
3400  LLVMValueRef PTR, LLVMValueRef Val,
3401  LLVMAtomicOrdering ordering,
3402  LLVMBool singleThread);
3404  LLVMValueRef Cmp, LLVMValueRef New,
3405  LLVMAtomicOrdering SuccessOrdering,
3406  LLVMAtomicOrdering FailureOrdering,
3408 
3411 
3414  LLVMAtomicOrdering Ordering);
3417  LLVMAtomicOrdering Ordering);
3418 
3419 /**
3420  * @}
3421  */
3422 
3423 /**
3424  * @defgroup LLVMCCoreModuleProvider Module Providers
3425  *
3426  * @{
3427  */
3428 
3429 /**
3430  * Changes the type of M so it can be passed to FunctionPassManagers and the
3431  * JIT. They take ModuleProviders for historical reasons.
3432  */
3435 
3436 /**
3437  * Destroys the module M.
3438  */
3440 
3441 /**
3442  * @}
3443  */
3444 
3445 /**
3446  * @defgroup LLVMCCoreMemoryBuffers Memory Buffers
3447  *
3448  * @{
3449  */
3450 
3452  LLVMMemoryBufferRef *OutMemBuf,
3453  char **OutMessage);
3455  char **OutMessage);
3457  size_t InputDataLength,
3458  const char *BufferName,
3459  LLVMBool RequiresNullTerminator);
3461  size_t InputDataLength,
3462  const char *BufferName);
3463 const char *LLVMGetBufferStart(LLVMMemoryBufferRef MemBuf);
3464 size_t LLVMGetBufferSize(LLVMMemoryBufferRef MemBuf);
3466 
3467 /**
3468  * @}
3469  */
3470 
3471 /**
3472  * @defgroup LLVMCCorePassRegistry Pass Registry
3473  *
3474  * @{
3475  */
3476 
3477 /** Return the global pass registry, for use with initialization functions.
3478  @see llvm::PassRegistry::getPassRegistry */
3480 
3481 /**
3482  * @}
3483  */
3484 
3485 /**
3486  * @defgroup LLVMCCorePassManagers Pass Managers
3487  *
3488  * @{
3489  */
3490 
3491 /** Constructs a new whole-module pass pipeline. This type of pipeline is
3492  suitable for link-time optimization and whole-module transformations.
3493  @see llvm::PassManager::PassManager */
3495 
3496 /** Constructs a new function-by-function pass pipeline over the module
3497  provider. It does not take ownership of the module provider. This type of
3498  pipeline is suitable for code generation and JIT compilation tasks.
3499  @see llvm::FunctionPassManager::FunctionPassManager */
3501 
3502 /** Deprecated: Use LLVMCreateFunctionPassManagerForModule instead. */
3504 
3505 /** Initializes, executes on the provided module, and finalizes all of the
3506  passes scheduled in the pass manager. Returns 1 if any of the passes
3507  modified the module, 0 otherwise.
3508  @see llvm::PassManager::run(Module&) */
3510 
3511 /** Initializes all of the function passes scheduled in the function pass
3512  manager. Returns 1 if any of the passes modified the module, 0 otherwise.
3513  @see llvm::FunctionPassManager::doInitialization */
3515 
3516 /** Executes all of the function passes scheduled in the function pass manager
3517  on the provided function. Returns 1 if any of the passes modified the
3518  function, false otherwise.
3519  @see llvm::FunctionPassManager::run(Function&) */
3521 
3522 /** Finalizes all of the function passes scheduled in the function pass
3523  manager. Returns 1 if any of the passes modified the module, 0 otherwise.
3524  @see llvm::FunctionPassManager::doFinalization */
3526 
3527 /** Frees the memory of a pass pipeline. For function pipelines, does not free
3528  the module provider.
3529  @see llvm::PassManagerBase::~PassManagerBase. */
3531 
3532 /**
3533  * @}
3534  */
3535 
3536 /**
3537  * @defgroup LLVMCCoreThreading Threading
3538  *
3539  * Handle the structures needed to make LLVM safe for multithreading.
3540  *
3541  * @{
3542  */
3543 
3544 /** Deprecated: Multi-threading can only be enabled/disabled with the compile
3545  time define LLVM_ENABLE_THREADS. This function always returns
3546  LLVMIsMultithreaded(). */
3548 
3549 /** Deprecated: Multi-threading can only be enabled/disabled with the compile
3550  time define LLVM_ENABLE_THREADS. */
3551 void LLVMStopMultithreaded(void);
3552 
3553 /** Check whether LLVM is executing in thread-safe mode or not.
3554  @see llvm::llvm_is_multithreaded */
3556 
3557 /**
3558  * @}
3559  */
3560 
3561 /**
3562  * @}
3563  */
3564 
3565 /**
3566  * @}
3567  */
3568 
3569 #ifdef __cplusplus
3570 }
3571 #endif
3572 
3573 #endif /* LLVM_C_CORE_H */
True if unordered or equal.
Definition: Core.h:301
LLVMValueRef LLVMConstExactSDiv(LLVMValueRef LHSConstant, LLVMValueRef RHSConstant)
Definition: Core.cpp:1382
LLVMValueRef LLVMConstInlineAsm(LLVMTypeRef Ty, const char *AsmString, const char *Constraints, LLVMBool HasSideEffects, LLVMBool IsAlignStack)
Deprecated: Use LLVMGetInlineAsm instead.
Definition: Core.cpp:1614
Subtract a value and return the old one.
Definition: Core.h:353
const char * LLVMGetBufferStart(LLVMMemoryBufferRef MemBuf)
Definition: Core.cpp:3491
void LLVMDisposeBuilder(LLVMBuilderRef Builder)
Definition: Core.cpp:2646
uint64_t CallInst * C
unsigned LLVMGetMDNodeNumOperands(LLVMValueRef V)
Obtain the number of operands from an MDNode value.
Definition: Core.cpp:1061
X86 MMX.
Definition: Core.h:156
Adds a requirement that another module flag be present and have a specified value after linking is pe...
Definition: Core.h:410
Synchronized with respect to signal handlers executing in the same thread.
Definition: LLVMContext.h:56
LLVMValueRef LLVMConstNamedStruct(LLVMTypeRef StructTy, LLVMValueRef *ConstantVals, unsigned Count)
Create a non-anonymous ConstantStruct from values.
Definition: Core.cpp:1229
LLVMValueRef LLVMInstructionClone(LLVMValueRef Inst)
Create a copy of &#39;this&#39; instruction that is identical in all ways except the following: ...
Definition: Core.cpp:2388
LLVMRealPredicate LLVMGetFCmpPredicate(LLVMValueRef Inst)
Obtain the float predicate of an instruction.
Definition: Core.cpp:2373
constexpr char Align[]
Key for Kernel::Arg::Metadata::mAlign.
equal
Definition: Core.h:279
Definition: Core.h:69
LLVMBasicBlockRef LLVMInsertBasicBlockInContext(LLVMContextRef C, LLVMBasicBlockRef BB, const char *Name)
Insert a basic block in a function before another basic block.
Definition: Core.cpp:2290
void LLVMGetStructElementTypes(LLVMTypeRef StructTy, LLVMTypeRef *Dest)
Get the elements within a structure.
Definition: Core.cpp:689
void LLVMGetParams(LLVMValueRef Fn, LLVMValueRef *Params)
Obtain the parameters in a function.
Definition: Core.cpp:2156
LLVMValueRef LLVMGetInitializer(LLVMValueRef GlobalVar)
Definition: Core.cpp:1883
LLVMValueRef LLVMBuildICmp(LLVMBuilderRef, LLVMIntPredicate Op, LLVMValueRef LHS, LLVMValueRef RHS, const char *Name)
Definition: Core.cpp:3264
void LLVMGetHandlers(LLVMValueRef CatchSwitch, LLVMBasicBlockRef *Handlers)
Obtain the basic blocks acting as handlers for a catchswitch instruction.
Definition: Core.cpp:2813
void LLVMSetCmpXchgFailureOrdering(LLVMValueRef CmpXchgInst, LLVMAtomicOrdering Ordering)
Definition: Core.cpp:3423
unsigned LLVMGetPointerAddressSpace(LLVMTypeRef PointerTy)
Obtain the address space of a pointer type.
Definition: Core.cpp:750
LLVMBool LLVMHasPersonalityFn(LLVMValueRef Fn)
Check whether the given function has a personality function.
Definition: Core.cpp:2061
The GV is protected.
Definition: Core.h:186
LLVMValueRef LLVMBuildArrayAlloca(LLVMBuilderRef, LLVMTypeRef Ty, LLVMValueRef Val, const char *Name)
Definition: Core.cpp:3029
LLVMValueRef LLVMConstXor(LLVMValueRef LHSConstant, LLVMValueRef RHSConstant)
Definition: Core.cpp:1418
LLVMValueRef LLVMBuildZExt(LLVMBuilderRef, LLVMValueRef Val, LLVMTypeRef DestTy, const char *Name)
Definition: Core.cpp:3162
LLVMBasicBlockRef LLVMGetEntryBasicBlock(LLVMValueRef Fn)
Obtain the basic block that corresponds to the entry point of a function.
Definition: Core.cpp:2244
LLVMValueRef LLVMGetLastFunction(LLVMModuleRef M)
Obtain an iterator to the last Function in a Module.
Definition: Core.cpp:2033
LLVMValueRef LLVMConstBitCast(LLVMValueRef ConstantVal, LLVMTypeRef ToType)
Definition: Core.cpp:1524
Definition: Core.h:91
Not-And a value and return the old one.
Definition: Core.h:355
LLVMValueRef LLVMBuildAtomicCmpXchg(LLVMBuilderRef B, LLVMValueRef Ptr, LLVMValueRef Cmp, LLVMValueRef New, LLVMAtomicOrdering SuccessOrdering, LLVMAtomicOrdering FailureOrdering, LLVMBool SingleThread)
Definition: Core.cpp:3374
LLVMValueRef LLVMConstUDiv(LLVMValueRef LHSConstant, LLVMValueRef RHSConstant)
Definition: Core.cpp:1366
Externally visible function.
Definition: Core.h:161
SI Whole Quad Mode
LLVMBool LLVMTypeIsSized(LLVMTypeRef Ty)
Whether the type has a known size.
Definition: Core.cpp:501
LLVMValueRef LLVMConstSDiv(LLVMValueRef LHSConstant, LLVMValueRef RHSConstant)
Definition: Core.cpp:1377
void LLVMSetSection(LLVMValueRef Global, const char *Section)
Definition: Core.cpp:1736
void LLVMSetValueName2(LLVMValueRef Val, const char *Name, size_t NameLen)
Set the string name of a value.
Definition: Core.cpp:805
True if unordered, less than, or equal.
Definition: Core.h:305
unsigned LLVMAttributeIndex
Definition: Core.h:447
The GV is visible.
Definition: Core.h:184
True if unordered or less than.
Definition: Core.h:304
struct LLVMOpaqueModule * LLVMModuleRef
The top-level container for all other LLVM Intermediate Representation (IR) objects.
Definition: Types.h:62
LLVMMemoryBufferRef LLVMCreateMemoryBufferWithMemoryRangeCopy(const char *InputData, size_t InputDataLength, const char *BufferName)
Definition: Core.cpp:3481
LLVMValueRef LLVMMDNode(LLVMValueRef *Vals, unsigned Count)
Obtain a MDNode value from the global context.
Definition: Core.cpp:1034
provides both an Acquire and a Release barrier (for fences and operations which both read and write m...
Definition: Core.h:336
const char * LLVMGetAsString(LLVMValueRef c, size_t *Length)
Get the given constant data sequential as a string.
Definition: Core.cpp:1203
LLVMValueRef LLVMGetIncomingValue(LLVMValueRef PhiNode, unsigned Index)
Obtain an incoming value to a PHI node as an LLVMValueRef.
Definition: Core.cpp:2569
Definition: Core.h:60
LLVMValueRef LLVMConstIntOfString(LLVMTypeRef IntTy, const char *Text, uint8_t Radix)
Obtain a constant value for an integer parsed from a string.
struct LLVMOpaqueMemoryBuffer * LLVMMemoryBufferRef
LLVM uses a polymorphic type hierarchy which C cannot represent, therefore parameters must be passed ...
Definition: Types.h:49
void LLVMSetSuccessor(LLVMValueRef Term, unsigned i, LLVMBasicBlockRef block)
Update the specified successor to point at the provided block.
Definition: Core.cpp:2516
LLVMValueRef LLVMBuildAdd(LLVMBuilderRef, LLVMValueRef LHS, LLVMValueRef RHS, const char *Name)
Definition: Core.cpp:2841
LLVMBuilderRef LLVMCreateBuilder(void)
Definition: Core.cpp:2608
Obsolete.
Definition: Core.h:174
LLVMValueRef LLVMGetNextParam(LLVMValueRef Arg)
Obtain the next parameter to a function.
Definition: Core.cpp:2188
constexpr char IsVolatile[]
Key for Kernel::Arg::Metadata::mIsVolatile.
unsigned greater or equal
Definition: Core.h:282
LLVMValueRef LLVMBuildNUWAdd(LLVMBuilderRef, LLVMValueRef LHS, LLVMValueRef RHS, const char *Name)
Definition: Core.cpp:2851
LLVMValueRef LLVMBuildStructGEP(LLVMBuilderRef B, LLVMValueRef Pointer, unsigned Idx, const char *Name)
Definition: Core.cpp:3107
LLVMAttributeRef LLVMGetEnumAttributeAtIndex(LLVMValueRef F, LLVMAttributeIndex Idx, unsigned KindID)
Definition: Core.cpp:2118
LLVMValueRef LLVMGetNamedGlobal(LLVMModuleRef M, const char *Name)
Definition: Core.cpp:1843
LLVMBool LLVMIsOpaqueStruct(LLVMTypeRef StructTy)
Determine whether a structure is opaque.
Definition: Core.cpp:705
LLVMMemoryBufferRef LLVMCreateMemoryBufferWithMemoryRange(const char *InputData, size_t InputDataLength, const char *BufferName, LLVMBool RequiresNullTerminator)
Definition: Core.cpp:3470
LLVMValueRef LLVMGetFirstParam(LLVMValueRef Fn)
Obtain the first parameter to a function.
Definition: Core.cpp:2172
LLVMValueRef LLVMGetNextGlobalAlias(LLVMValueRef GA)
Advance a GlobalAlias iterator to the next GlobalAlias.
Definition: Core.cpp:1989
LLVMValueRef LLVMBuildSExt(LLVMBuilderRef, LLVMValueRef Val, LLVMTypeRef DestTy, const char *Name)
Definition: Core.cpp:3167
LLVMValueRef LLVMAddAlias(LLVMModuleRef M, LLVMTypeRef Ty, LLVMValueRef Aliasee, const char *Name)
Definition: Core.cpp:1960
LLVMAttributeRef LLVMCreateStringAttribute(LLVMContextRef C, const char *K, unsigned KLength, const char *V, unsigned VLength)
Create a string attribute.
Definition: Core.cpp:150
LLVMValueRef LLVMAlignOf(LLVMTypeRef Ty)
Definition: Core.cpp:1271
LLVMBool LLVMHasUnnamedAddr(LLVMValueRef Global)
Deprecated: Use LLVMGetUnnamedAddress instead.
Definition: Core.cpp:1785
void LLVMStopMultithreaded(void)
Deprecated: Multi-threading can only be enabled/disabled with the compile time define LLVM_ENABLE_THR...
Definition: Core.cpp:3550
LLVMOpcode
Definition: Core.h:57
A catch clause.
Definition: Core.h:311
void LLVMSetValueName(LLVMValueRef Val, const char *Name)
Deprecated: Use LLVMSetValueName2 instead.
Definition: Core.cpp:813
True if unordered or not equal.
Definition: Core.h:306
LLVMValueRef LLVMConstFPToUI(LLVMValueRef ConstantVal, LLVMTypeRef ToType)
Definition: Core.cpp:1504
Emits an error if two values disagree, otherwise the resulting value is that of the operands...
Definition: Core.h:391
const char * LLVMGetGC(LLVMValueRef Fn)
Obtain the name of the garbage collector to use during code generation.
Definition: Core.cpp:2088
LLVMPassManagerRef LLVMCreateFunctionPassManager(LLVMModuleProviderRef MP)
Deprecated: Use LLVMCreateFunctionPassManagerForModule instead.
Definition: Core.cpp:3519
LLVMValueRef LLVMAddGlobal(LLVMModuleRef M, LLVMTypeRef Ty, const char *Name)
Definition: Core.cpp:1829
LLVMTypeRef LLVMGetAllocatedType(LLVMValueRef Alloca)
Obtain the type that is being allocated by the alloca instruction.
Definition: Core.cpp:2542
LLVMTypeRef LLVMHalfType(void)
Obtain a floating point type from the global context.
Definition: Core.cpp:602
LLVMValueRef LLVMBuildRet(LLVMBuilderRef, LLVMValueRef V)
Definition: Core.cpp:2675
LLVMAttributeRef LLVMCreateEnumAttribute(LLVMContextRef C, unsigned KindID, uint64_t Val)
Create an enum attribute.
Definition: Core.cpp:134
LLVMBasicBlockRef LLVMGetNextBasicBlock(LLVMBasicBlockRef BB)
Advance a basic block iterator.
Definition: Core.cpp:2264
LLVMBool LLVMCreateMemoryBufferWithContentsOfFile(const char *Path, LLVMMemoryBufferRef *OutMemBuf, char **OutMessage)
Definition: Core.cpp:3445
char * LLVMCreateMessage(const char *Message)
Definition: Core.cpp:66
LLVMPassManagerRef LLVMCreatePassManager(void)
Constructs a new whole-module pass pipeline.
Definition: Core.cpp:3511
LLVMInlineAsmDialect
Definition: Core.h:379
LLVMTypeRef LLVMFP128Type(void)
Definition: Core.cpp:614
LLVMValueRef LLVMGetClause(LLVMValueRef LandingPad, unsigned Idx)
Definition: Core.cpp:2788
True if ordered and greater than or equal.
Definition: Core.h:295
LLVMValueRef LLVMBuildFPToUI(LLVMBuilderRef, LLVMValueRef Val, LLVMTypeRef DestTy, const char *Name)
Definition: Core.cpp:3172
#define LLVM_FOR_EACH_VALUE_SUBCLASS(macro)
Definition: Core.h:1390
unsigned LLVMGetVectorSize(LLVMTypeRef VectorTy)
Obtain the number of elements in a vector type.
Definition: Core.cpp:754
LLVMMetadataRef LLVMModuleFlagEntriesGetMetadata(LLVMModuleFlagEntry *Entries, unsigned Index)
Returns the metadata for a module flag entry at a specific index.
Definition: Core.cpp:353
LLVMDiagnosticSeverity LLVMGetDiagInfoSeverity(LLVMDiagnosticInfoRef DI)
Return an enum LLVMDiagnosticSeverity.
Definition: Core.cpp:191
Definition: Core.h:82
LLVMBool LLVMIsAtomicSingleThread(LLVMValueRef AtomicInst)
Definition: Core.cpp:3387
const char * LLVMGetDataLayoutStr(LLVMModuleRef M)
Obtain the data layout for a module.
Definition: Core.cpp:248
LLVMValueRef LLVMBuildCondBr(LLVMBuilderRef, LLVMValueRef If, LLVMBasicBlockRef Then, LLVMBasicBlockRef Else)
Definition: Core.cpp:2688
Definition: Core.h:111
LLVMTypeRef LLVMX86MMXType(void)
Definition: Core.cpp:620
Definition: Core.h:98
LLVMValueRef LLVMBuildFNeg(LLVMBuilderRef, LLVMValueRef V, const char *Name)
Definition: Core.cpp:2992
LLVMValueRef LLVMBuildTruncOrBitCast(LLVMBuilderRef, LLVMValueRef Val, LLVMTypeRef DestTy, const char *Name)
Definition: Core.cpp:3234
struct LLVMOpaquePassRegistry * LLVMPassRegistryRef
Definition: Types.h:117
unsigned LLVMGetNumArgOperands(LLVMValueRef Instr)
Obtain the argument count for a call instruction.
Definition: Core.cpp:2394
struct LLVMOpaqueBuilder * LLVMBuilderRef
Represents an LLVM basic block builder.
Definition: Types.h:97
LLVMValueRef LLVMBuildSDiv(LLVMBuilderRef, LLVMValueRef LHS, LLVMValueRef RHS, const char *Name)
Definition: Core.cpp:2911
unsigned LLVMGetLastEnumAttributeKind(void)
Definition: Core.cpp:130
LLVMTypeRef LLVMX86FP80Type(void)
Definition: Core.cpp:611
LLVMUseRef LLVMGetFirstUse(LLVMValueRef Val)
Obtain the first use of a value.
Definition: Core.cpp:896
LLVMValueRef LLVMConstRealOfStringAndSize(LLVMTypeRef RealTy, const char *Text, unsigned SLen)
Obtain a constant for a floating point value parsed from a string.
void LLVMClearInsertionPosition(LLVMBuilderRef Builder)
Definition: Core.cpp:2633
LLVMValueRef LLVMGetNextGlobal(LLVMValueRef GlobalVar)
Definition: Core.cpp:1863
F(f)
LLVMTypeRef LLVMVectorType(LLVMTypeRef ElementType, unsigned ElementCount)
Create a vector type that contains a defined type and has a specific number of elements.
Definition: Core.cpp:731
LLVMValueRef LLVMConstAnd(LLVMValueRef LHSConstant, LLVMValueRef RHSConstant)
Definition: Core.cpp:1408
unsigned LLVMGetMDKindIDInContext(LLVMContextRef C, const char *Name, unsigned SLen)
Definition: Core.cpp:114
LLVMPassRegistryRef LLVMGetGlobalPassRegistry(void)
Return the global pass registry, for use with initialization functions.
Definition: Core.cpp:3505
LLVMValueRef LLVMBuildCast(LLVMBuilderRef B, LLVMOpcode Op, LLVMValueRef Val, LLVMTypeRef DestTy, const char *Name)
Definition: Core.cpp:3240
LLVMValueRef LLVMBuildFRem(LLVMBuilderRef, LLVMValueRef LHS, LLVMValueRef RHS, const char *Name)
Definition: Core.cpp:2936
LLVMValueRef LLVMConstSelect(LLVMValueRef ConstantCondition, LLVMValueRef ConstantIfTrue, LLVMValueRef ConstantIfFalse)
Definition: Core.cpp:1570
LLVMValueRef LLVMConstTrunc(LLVMValueRef ConstantVal, LLVMTypeRef ToType)
Definition: Core.cpp:1469
LLVMBool LLVMValueIsBasicBlock(LLVMValueRef Val)
Determine whether an LLVMValueRef is itself a basic block.
Definition: Core.cpp:2214
LLVMTypeRef LLVMStructTypeInContext(LLVMContextRef C, LLVMTypeRef *ElementTypes, unsigned ElementCount, LLVMBool Packed)
Create a new structure type in a context.
Definition: Core.cpp:654
Appends the two values, which are required to be metadata nodes.
Definition: Core.h:432
Hexagon Common GEP
LLVMBasicBlockRef LLVMInsertBasicBlock(LLVMBasicBlockRef InsertBeforeBB, const char *Name)
Insert a basic block in a function using the global context.
Definition: Core.cpp:2297
int LLVMHasMetadata(LLVMValueRef Val)
Determine whether an instruction has any metadata attached.
Definition: Core.cpp:839
const char * LLVMGetSection(LLVMValueRef Global)
Definition: Core.cpp:1730
LLVMTypeRef LLVMInt16TypeInContext(LLVMContextRef C)
Definition: Core.cpp:536
LLVMValueRef LLVMMDNodeInContext(LLVMContextRef C, LLVMValueRef *Vals, unsigned Count)
Obtain a MDNode value from a context.
Definition: Core.cpp:1007
LLVMTypeRef LLVMTokenTypeInContext(LLVMContextRef C)
Create a token type in a context.
Definition: Core.cpp:766
#define op(i)
LLVMValueRef LLVMBuildFence(LLVMBuilderRef B, LLVMAtomicOrdering ordering, LLVMBool singleThread, const char *Name)
Definition: Core.cpp:3083
LLVMAttributeRef LLVMGetStringAttributeAtIndex(LLVMValueRef F, LLVMAttributeIndex Idx, const char *K, unsigned KLen)
Definition: Core.cpp:2125
LLVMValueRef LLVMGetPreviousGlobalAlias(LLVMValueRef GA)
Decrement a GlobalAlias iterator to the previous GlobalAlias.
Definition: Core.cpp:1997
LLVMAtomicRMWBinOp
Definition: Core.h:350
LLVMValueRef LLVMConstAddrSpaceCast(LLVMValueRef ConstantVal, LLVMTypeRef ToType)
Definition: Core.cpp:1529
Lowest level of atomicity, guarantees somewhat sane results, lock free.
Definition: Core.h:325
Appends the two values, which are required to be metadata nodes.
Definition: Core.h:424
void LLVMContextDispose(LLVMContextRef C)
Destroy a context instance.
Definition: Core.cpp:110
128 bit floating point type (112-bit mantissa)
Definition: Core.h:146
Definition: Core.h:85
void LLVMAddModuleFlag(LLVMModuleRef M, LLVMModuleFlagBehavior Behavior, const char *Key, size_t KeyLen, LLVMMetadataRef Val)
Add a module-level flag to the module-level flags metadata if it doesn&#39;t already exist.
Definition: Core.cpp:365
void LLVMSetGlobalConstant(LLVMValueRef GlobalVar, LLVMBool IsConstant)
Definition: Core.cpp:1907
void LLVMSetThreadLocal(LLVMValueRef GlobalVar, LLVMBool IsThreadLocal)
Definition: Core.cpp:1899
void LLVMSetModuleIdentifier(LLVMModuleRef M, const char *Ident, size_t Len)
Set the identifier of a module to a string Ident with length Len.
Definition: Core.cpp:233
ExternalWeak linkage description.
Definition: Core.h:176
LLVMValueRef LLVMConstNull(LLVMTypeRef Ty)
Obtain a constant value referring to the null instance of a type.
Definition: Core.cpp:964
LLVMLandingPadClauseTy
Definition: Core.h:310
LLVMValueRef LLVMConstReal(LLVMTypeRef RealTy, double N)
Obtain a constant value referring to a double floating point value.
Definition: Core.cpp:1136
LLVMValueRef LLVMBuildPointerCast(LLVMBuilderRef, LLVMValueRef Val, LLVMTypeRef DestTy, const char *Name)
Definition: Core.cpp:3246
LLVMBool LLVMInitializeFunctionPassManager(LLVMPassManagerRef FPM)
Initializes all of the function passes scheduled in the function pass manager.
Definition: Core.cpp:3528
void LLVMRemoveCallSiteStringAttribute(LLVMValueRef C, LLVMAttributeIndex Idx, const char *K, unsigned KLen)
Definition: Core.cpp:2459
void LLVMSetOperand(LLVMValueRef User, unsigned Index, LLVMValueRef Val)
Set an operand at a specific index in a llvm::User value.
Definition: Core.cpp:950
long long LLVMConstIntGetSExtValue(LLVMValueRef ConstantVal)
Obtain the sign extended value for an integer constant value.
Definition: Core.cpp:1153
void(* LLVMYieldCallback)(LLVMContextRef, void *)
Definition: Core.h:478
void LLVMSetInstrParamAlignment(LLVMValueRef Instr, unsigned index, unsigned Align)
Definition: Core.cpp:2412
LLVMTypeRef LLVMStructGetTypeAtIndex(LLVMTypeRef StructTy, unsigned i)
Get the type of the element at a given index in the structure.
Definition: Core.cpp:696
LLVMOpcode LLVMGetInstructionOpcode(LLVMValueRef Inst)
Obtain the code opcode for an individual instruction.
Definition: Core.cpp:2382
LLVMTypeRef LLVMFP128TypeInContext(LLVMContextRef C)
Obtain a 128-bit floating point type (112-bit mantissa) from a context.
Definition: Core.cpp:592
const char * LLVMGetStructName(LLVMTypeRef Ty)
Obtain the name of a structure.
Definition: Core.cpp:671
LLVMValueRef LLVMBuildCleanupPad(LLVMBuilderRef B, LLVMValueRef ParentPad, LLVMValueRef *Args, unsigned NumArgs, const char *Name)
Definition: Core.cpp:2732
LLVMBasicBlockRef LLVMGetLastBasicBlock(LLVMValueRef Fn)
Obtain the last basic block in a function.
Definition: Core.cpp:2256
Same, but only replaced by something equivalent.
Definition: Core.h:168
void * PointerTy
Definition: GenericValue.h:22
LLVMValueRef LLVMBasicBlockAsValue(LLVMBasicBlockRef BB)
Convert a basic block instance to a value type.
Definition: Core.cpp:2210
LLVMValueRef LLVMGetParentCatchSwitch(LLVMValueRef CatchPad)
Get the parent catchswitch instruction of a catchpad instruction.
Definition: Core.cpp:2820
LLVMTypeRef LLVMLabelTypeInContext(LLVMContextRef C)
Create a label type in a context.
Definition: Core.cpp:763
LLVMMetadataRef LLVMValueAsMetadata(LLVMValueRef Val)
Obtain a Value as a Metadata.
Definition: Core.cpp:1042
LLVMTypeRef LLVMDoubleTypeInContext(LLVMContextRef C)
Obtain a 64-bit floating point type from a context.
Definition: Core.cpp:586
LLVMValueRef LLVMGetNamedGlobalAlias(LLVMModuleRef M, const char *Name, size_t NameLen)
Obtain a GlobalAlias value from a Module by its name.
Definition: Core.cpp:1968
LLVMValueRef LLVMConstVector(LLVMValueRef *ScalarConstantVals, unsigned Size)
Create a ConstantVector from values.
Definition: Core.cpp:1238
Set the new value and return the one old.
Definition: Core.h:351
LLVMValueRef LLVMBuildExactSDiv(LLVMBuilderRef, LLVMValueRef LHS, LLVMValueRef RHS, const char *Name)
Definition: Core.cpp:2916
LLVMValueRef LLVMSizeOf(LLVMTypeRef Ty)
Definition: Core.cpp:1275
LLVMBool LLVMIsNull(LLVMValueRef Val)
Determine whether a value instance is null.
Definition: Core.cpp:980
LLVMValueRef LLVMConstShuffleVector(LLVMValueRef VectorAConstant, LLVMValueRef VectorBConstant, LLVMValueRef MaskConstant)
Definition: Core.cpp:1592
LLVMBasicBlockRef LLVMGetSwitchDefaultDest(LLVMValueRef SwitchInstr)
Obtain the default destination basic block of a switch instruction.
Definition: Core.cpp:2536
LLVMValueRef LLVMConstRealOfString(LLVMTypeRef RealTy, const char *Text)
Obtain a constant for a floating point value parsed from a string.
Definition: Core.cpp:1140
LLVMValueRef LLVMBuildAggregateRet(LLVMBuilderRef, LLVMValueRef *RetVals, unsigned N)
Definition: Core.cpp:2679
Sets the value if it&#39;s greater than the original using an unsigned comparison and return the old one...
Definition: Core.h:364
Address of the GV is globally insignificant.
Definition: Core.h:192
Add a value and return the old one.
Definition: Core.h:352
void LLVMPositionBuilder(LLVMBuilderRef Builder, LLVMBasicBlockRef Block, LLVMValueRef Instr)
Definition: Core.cpp:2612
LLVMTypeRef LLVMInt8TypeInContext(LLVMContextRef C)
Definition: Core.cpp:533
unsigned LLVMGetFunctionCallConv(LLVMValueRef Fn)
Obtain the calling function of a function.
Definition: Core.cpp:2079
LLVMValueRef LLVMConstIntCast(LLVMValueRef ConstantVal, LLVMTypeRef ToType, LLVMBool isSigned)
Definition: Core.cpp:1559
LLVMValueRef LLVMConstNUWAdd(LLVMValueRef LHSConstant, LLVMValueRef RHSConstant)
Definition: Core.cpp:1311
void LLVMSetDataLayout(LLVMModuleRef M, const char *DataLayoutStr)
Set the data layout for a module.
Definition: Core.cpp:256
LLVMValueRef LLVMConstFSub(LLVMValueRef LHSConstant, LLVMValueRef RHSConstant)
Definition: Core.cpp:1339
unsigned LLVMGetIntTypeWidth(LLVMTypeRef IntegerTy)
Definition: Core.cpp:574
LLVMBool LLVMIsExternallyInitialized(LLVMValueRef GlobalVar)
Definition: Core.cpp:1950
Pointers.
Definition: Core.h:153
LLVMValueRef LLVMConstAShr(LLVMValueRef LHSConstant, LLVMValueRef RHSConstant)
Definition: Core.cpp:1447
LLVMValueRef LLVMGetBasicBlockParent(LLVMBasicBlockRef BB)
Obtain the function to which a basic block belongs.
Definition: Core.cpp:2226
void LLVMSetCondition(LLVMValueRef Branch, LLVMValueRef Cond)
Set the condition of a branch instruction.
Definition: Core.cpp:2530
LLVMValueRef LLVMGetLastParam(LLVMValueRef Fn)
Obtain the last parameter to a function.
Definition: Core.cpp:2180
LLVMValueRef LLVMConstICmp(LLVMIntPredicate Predicate, LLVMValueRef LHSConstant, LLVMValueRef RHSConstant)
Definition: Core.cpp:1423
LLVMValueRef LLVMGetUndef(LLVMTypeRef Ty)
Obtain a constant value referring to an undefined value of a type.
Definition: Core.cpp:972
Rename collisions when linking (static functions)
Definition: Core.h:171
uint64_t LLVMGetEnumAttributeValue(LLVMAttributeRef A)
Get the enum attribute&#39;s value.
Definition: Core.cpp:143
LLVMValueRef LLVMGetInlineAsm(LLVMTypeRef Ty, char *AsmString, size_t AsmStringSize, char *Constraints, size_t ConstraintsSize, LLVMBool HasSideEffects, LLVMBool IsAlignStack, LLVMInlineAsmDialect Dialect)
Create the specified uniqued inline asm string.
Definition: Core.cpp:430
LLVMBool LLVMIsCleanup(LLVMValueRef LandingPad)
Definition: Core.cpp:2797
void LLVMGetSubtypes(LLVMTypeRef Tp, LLVMTypeRef *Arr)
Returns type&#39;s subtypes.
Definition: Core.cpp:715
not equal
Definition: Core.h:280
Arrays.
Definition: Core.h:152
void LLVMSetVisibility(LLVMValueRef Global, LLVMVisibility Viz)
Definition: Core.cpp:1745
void LLVMSetNormalDest(LLVMValueRef InvokeInst, LLVMBasicBlockRef B)
Set the normal destination basic block.
Definition: Core.cpp:2493
LLVMValueRef LLVMConstSExt(LLVMValueRef ConstantVal, LLVMTypeRef ToType)
Definition: Core.cpp:1474
void LLVMContextSetDiagnosticHandler(LLVMContextRef C, LLVMDiagnosticHandler Handler, void *DiagnosticContext)
Set the diagnostic handler for this context.
Definition: Core.cpp:85
LLVMValueRef LLVMGetPreviousGlobal(LLVMValueRef GlobalVar)
Definition: Core.cpp:1871
LLVMValueRef LLVMBuildNSWAdd(LLVMBuilderRef, LLVMValueRef LHS, LLVMValueRef RHS, const char *Name)
Definition: Core.cpp:2846
LLVMBool LLVMIsStringAttribute(LLVMAttributeRef A)
Definition: Core.cpp:176
SIMD &#39;packed&#39; format, or other vector type.
Definition: Core.h:154
LLVMValueRef LLVMGetFirstInstruction(LLVMBasicBlockRef BB)
Obtain the first instruction in a basic block.
Definition: Core.cpp:2324
LLVMTypeRef LLVMFloatType(void)
Definition: Core.cpp:605
LLVMUnnamedAddr
Definition: Core.h:189
void LLVMDisposeMessage(char *Message)
Definition: Core.cpp:70
A load or store which is not atomic.
Definition: Core.h:324
LLVMValueRef LLVMConstFPCast(LLVMValueRef ConstantVal, LLVMTypeRef ToType)
Definition: Core.cpp:1565
LLVMValueRef LLVMBuildSRem(LLVMBuilderRef, LLVMValueRef LHS, LLVMValueRef RHS, const char *Name)
Definition: Core.cpp:2931
struct LLVMOpaqueType * LLVMTypeRef
Each value in the LLVM IR has a type, an LLVMTypeRef.
Definition: Types.h:69
True if ordered and operands are unequal.
Definition: Core.h:298
LLVMValueRef LLVMGetPreviousInstruction(LLVMValueRef Inst)
Obtain the instruction that occurred before this one.
Definition: Core.cpp:2348
True if ordered and equal.
Definition: Core.h:293
void LLVMContextSetYieldCallback(LLVMContextRef C, LLVMYieldCallback Callback, void *OpaqueHandle)
Set the yield callback function for this context.
Definition: Core.cpp:103
Key
PAL metadata keys.
signed greater than
Definition: Core.h:285
void LLVMMoveBasicBlockBefore(LLVMBasicBlockRef BB, LLVMBasicBlockRef MovePos)
Move a basic block to before another one.
Definition: Core.cpp:2310
LLVMValueRef LLVMConstInsertElement(LLVMValueRef VectorConstant, LLVMValueRef ElementValueConstant, LLVMValueRef IndexConstant)
Definition: Core.cpp:1584
void LLVMGetParamTypes(LLVMTypeRef FunctionTy, LLVMTypeRef *Dest)
Obtain the types of a function&#39;s parameters.
Definition: Core.cpp:645
char * LLVMPrintModuleToString(LLVMModuleRef M)
Return a string representation of the module.
Definition: Core.cpp:401
LLVMValueRef LLVMMetadataAsValue(LLVMContextRef C, LLVMMetadataRef MD)
Obtain a Metadata as a Value.
Definition: Core.cpp:1038
void LLVMDisposeModuleFlagsMetadata(LLVMModuleFlagEntry *Entries)
Destroys module flags metadata entries.
Definition: Core.cpp:333
void LLVMDisposeModule(LLVMModuleRef M)
Destroy a module instance.
Definition: Core.cpp:223
LLVMValueRef LLVMBuildCatchSwitch(LLVMBuilderRef B, LLVMValueRef ParentPad, LLVMBasicBlockRef UnwindBB, unsigned NumHandlers, const char *Name)
Definition: Core.cpp:2748
void LLVMSetInstDebugLocation(LLVMBuilderRef Builder, LLVMValueRef Inst)
Definition: Core.cpp:2664
LLVMBool LLVMIsGlobalConstant(LLVMValueRef GlobalVar)
Definition: Core.cpp:1903
LLVMValueRef LLVMConstStructInContext(LLVMContextRef C, LLVMValueRef *ConstantVals, unsigned Count, LLVMBool Packed)
Create an anonymous ConstantStruct with the specified values.
Definition: Core.cpp:1215
LLVMBool LLVMIsTailCall(LLVMValueRef CallInst)
Obtain whether a call instruction is a tail call.
Definition: Core.cpp:2470
LLVMValueRef LLVMBlockAddress(LLVMValueRef F, LLVMBasicBlockRef BB)
Definition: Core.cpp:1622
Definition: Core.h:83
LLVMValueRef LLVMConstZExtOrBitCast(LLVMValueRef ConstantVal, LLVMTypeRef ToType)
Definition: Core.cpp:1535
LLVMValueKind
Definition: Core.h:246
LLVMValueRef LLVMConstGEP(LLVMValueRef ConstantVal, LLVMValueRef *ConstantIndices, unsigned NumIndices)
Definition: Core.cpp:1452
struct LLVMOpaqueUse * LLVMUseRef
Used to get the users and usees of a Value.
Definition: Types.h:123
LLVMValueRef LLVMConstInBoundsGEP(LLVMValueRef ConstantVal, LLVMValueRef *ConstantIndices, unsigned NumIndices)
Definition: Core.cpp:1460
Keep one copy of function when linking (inline)
Definition: Core.h:163
LLVMValueRef LLVMBuildOr(LLVMBuilderRef, LLVMValueRef LHS, LLVMValueRef RHS, const char *Name)
Definition: Core.cpp:2961
void LLVMDeleteFunction(LLVMValueRef Fn)
Remove a function from its containing module and deletes it.
Definition: Core.cpp:2057
void LLVMRemoveCallSiteEnumAttribute(LLVMValueRef C, LLVMAttributeIndex Idx, unsigned KindID)
Definition: Core.cpp:2453
struct LLVMOpaqueContext * LLVMContextRef
The top-level container for all LLVM global data.
Definition: Types.h:54
LLVMValueRef LLVMBuildFDiv(LLVMBuilderRef, LLVMValueRef LHS, LLVMValueRef RHS, const char *Name)
Definition: Core.cpp:2921
LLVMValueRef LLVMConstFPToSI(LLVMValueRef ConstantVal, LLVMTypeRef ToType)
Definition: Core.cpp:1509
OR a value and return the old one.
Definition: Core.h:356
LLVMBasicBlockRef LLVMGetPreviousBasicBlock(LLVMBasicBlockRef BB)
Go backwards in a basic block iterator.
Definition: Core.cpp:2272
LLVMValueRef LLVMGetFirstGlobal(LLVMModuleRef M)
Definition: Core.cpp:1847
void LLVMDumpModule(LLVMModuleRef M)
Dump a representation of a module to stderr.
Definition: Core.cpp:374
Function to be imported from DLL.
Definition: Core.h:197
unsigned LLVMCountIncoming(LLVMValueRef PhiNode)
Obtain the number of incoming basic blocks to a PHI node.
Definition: Core.cpp:2565
unsigned greater than
Definition: Core.h:281
LLVMValueRef LLVMBuildIntCast(LLVMBuilderRef, LLVMValueRef Val, LLVMTypeRef DestTy, const char *Name)
Definition: Core.cpp:3251
LLVMTypeRef LLVMFloatTypeInContext(LLVMContextRef C)
Obtain a 32-bit floating point type from a context.
Definition: Core.cpp:583
unsigned long long LLVMConstIntGetZExtValue(LLVMValueRef ConstantVal)
Obtain the zero extended value for an integer constant value.
Definition: Core.cpp:1149
Definition: Core.h:87
void LLVMGetMDNodeOperands(LLVMValueRef V, LLVMValueRef *Dest)
Obtain the given MDNode&#39;s operands.
Definition: Core.cpp:1068
LLVMValueRef LLVMConstFMul(LLVMValueRef LHSConstant, LLVMValueRef RHSConstant)
Definition: Core.cpp:1361
LLVMValueRef LLVMGetLastInstruction(LLVMBasicBlockRef BB)
Obtain the last instruction in a basic block.
Definition: Core.cpp:2332
const char * LLVMModuleFlagEntriesGetKey(LLVMModuleFlagEntry *Entries, unsigned Index, size_t *Len)
Returns the key for a module flag entry at a specific index.
Definition: Core.cpp:345
LLVMValueRef LLVMBuildSub(LLVMBuilderRef, LLVMValueRef LHS, LLVMValueRef RHS, const char *Name)
Definition: Core.cpp:2861
LLVMUseRef LLVMGetNextUse(LLVMUseRef U)
Obtain the next use of a value.
Definition: Core.cpp:904
LLVMValueRef LLVMAddFunction(LLVMModuleRef M, const char *Name, LLVMTypeRef FunctionTy)
Add a function to a module under a specified name.
Definition: Core.cpp:2015
LLVMValueRef LLVMBuildFAdd(LLVMBuilderRef, LLVMValueRef LHS, LLVMValueRef RHS, const char *Name)
Definition: Core.cpp:2856
Keep one copy of function when linking (weak)
Definition: Core.h:167
LLVMValueRef LLVMConstIntOfStringAndSize(LLVMTypeRef IntTy, const char *Text, unsigned SLen, uint8_t Radix)
Obtain a constant value for an integer parsed from a string with specified length.
unsigned LLVMCountParamTypes(LLVMTypeRef FunctionTy)
Obtain the number of parameters this function accepts.
Definition: Core.cpp:641
LLVMIntPredicate
Definition: Core.h:278
constexpr char Attrs[]
Key for Kernel::Metadata::mAttrs.
LLVMValueRef LLVMBuildNUWSub(LLVMBuilderRef, LLVMValueRef LHS, LLVMValueRef RHS, const char *Name)
Definition: Core.cpp:2871
struct LLVMOpaqueAttributeRef * LLVMAttributeRef
Used to represent an attributes.
Definition: Types.h:130
LLVMValueRef LLVMBuildPtrToInt(LLVMBuilderRef, LLVMValueRef Val, LLVMTypeRef DestTy, const char *Name)
Definition: Core.cpp:3202
LLVMDiagnosticSeverity
Definition: Core.h:372
LLVMTypeRef LLVMStructCreateNamed(LLVMContextRef C, const char *Name)
Create an empty structure in a context having a specified name.
Definition: Core.cpp:666
LLVMValueRef LLVMConstInt(LLVMTypeRef IntTy, unsigned long long N, LLVMBool SignExtend)
Obtain a constant value for an integer type.
Definition: Core.cpp:1110
size_t LLVMGetBufferSize(LLVMMemoryBufferRef MemBuf)
Definition: Core.cpp:3495
LLVMValueRef LLVMBuildAnd(LLVMBuilderRef, LLVMValueRef LHS, LLVMValueRef RHS, const char *Name)
Definition: Core.cpp:2956
void LLVMSetCmpXchgSuccessOrdering(LLVMValueRef CmpXchgInst, LLVMAtomicOrdering Ordering)
Definition: Core.cpp:3410
void LLVMSetLinkage(LLVMValueRef Global, LLVMLinkage Linkage)
Definition: Core.cpp:1665
Definition: Core.h:75
unsigned LLVMGetIntrinsicID(LLVMValueRef Fn)
Obtain the ID number from a function instance.
Definition: Core.cpp:2073
void LLVMAddTargetDependentFunctionAttr(LLVMValueRef Fn, const char *A, const char *V)
Add a target-dependent attribute to a function.
Definition: Core.cpp:2141
LLVMBasicBlockRef LLVMGetInstructionParent(LLVMValueRef Inst)
Obtain the basic block to which an instruction belongs.
Definition: Core.cpp:2320
LLVMTypeRef LLVMInt64TypeInContext(LLVMContextRef C)
Definition: Core.cpp:542
void LLVMSetArgOperand(LLVMValueRef Funclet, unsigned i, LLVMValueRef value)
Definition: Core.cpp:2835
LLVMValueRef LLVMGetLastGlobal(LLVMModuleRef M)
Definition: Core.cpp:1855
const char * LLVMGetBasicBlockName(LLVMBasicBlockRef BB)
Obtain the string name of a basic block.
Definition: Core.cpp:2222
LLVMAttributeRef LLVMGetCallSiteStringAttribute(LLVMValueRef C, LLVMAttributeIndex Idx, const char *K, unsigned KLen)
Definition: Core.cpp:2446
LLVMValueRef LLVMConstAdd(LLVMValueRef LHSConstant, LLVMValueRef RHSConstant)
Definition: Core.cpp:1300
unsigned LLVMGetArrayLength(LLVMTypeRef ArrayTy)
Obtain the length of an array type.
Definition: Core.cpp:746
void LLVMDisposePassManager(LLVMPassManagerRef PM)
Frees the memory of a pass pipeline.
Definition: Core.cpp:3540
LLVMValueRef LLVMBuildIsNull(LLVMBuilderRef, LLVMValueRef Val, const char *Name)
Definition: Core.cpp:3336
void LLVMSetVolatile(LLVMValueRef MemoryAccessInst, LLVMBool IsVolatile)
Definition: Core.cpp:3129
LLVMTypeRef LLVMVoidTypeInContext(LLVMContextRef C)
Create a void type in a context.
Definition: Core.cpp:760
True if unordered, greater than, or equal.
Definition: Core.h:303
void LLVMSetUnnamedAddr(LLVMValueRef Global, LLVMBool HasUnnamedAddr)
Deprecated: Use LLVMSetUnnamedAddress instead.
Definition: Core.cpp:1789
LLVMValueRef LLVMConstNSWAdd(LLVMValueRef LHSConstant, LLVMValueRef RHSConstant)
Definition: Core.cpp:1305
LLVMValueRef LLVMConstNSWNeg(LLVMValueRef ConstantVal)
Definition: Core.cpp:1283
void LLVMSetTarget(LLVMModuleRef M, const char *Triple)
Set the target triple for a module.
Definition: Core.cpp:265
LLVMBasicBlockRef LLVMGetFirstBasicBlock(LLVMValueRef Fn)
Obtain the first basic block in a function.
Definition: Core.cpp:2248
LLVMTypeRef LLVMMetadataTypeInContext(LLVMContextRef C)
Create a metadata type in a context.
Definition: Core.cpp:769
LLVMValueRef LLVMBuildNUWNeg(LLVMBuilderRef B, LLVMValueRef V, const char *Name)
Definition: Core.cpp:2987
void LLVMSetCurrentDebugLocation(LLVMBuilderRef Builder, LLVMValueRef L)
Definition: Core.cpp:2652
const unsigned * LLVMGetIndices(LLVMValueRef Inst)
Obtain the indices as an array.
Definition: Core.cpp:2591
signed less than
Definition: Core.h:287
void LLVMPositionBuilderAtEnd(LLVMBuilderRef Builder, LLVMBasicBlockRef Block)
Definition: Core.cpp:2624
void LLVMStructSetBody(LLVMTypeRef StructTy, LLVMTypeRef *ElementTypes, unsigned ElementCount, LLVMBool Packed)
Set the contents of a structure type.
Definition: Core.cpp:679
LLVMValueRef LLVMBuildShl(LLVMBuilderRef, LLVMValueRef LHS, LLVMValueRef RHS, const char *Name)
Definition: Core.cpp:2941
Function to be accessible from DLL.
Definition: Core.h:198
Acquire provides a barrier of the sort necessary to acquire a lock to access other memory with normal...
Definition: Core.h:330
LLVMTypeKind
Definition: Core.h:140
static GCRegistry::Add< OcamlGC > B("ocaml", "ocaml 3.10-compatible GC")
LLVMValueRef LLVMBuildInsertElement(LLVMBuilderRef, LLVMValueRef VecVal, LLVMValueRef EltVal, LLVMValueRef Index, const char *Name)
Definition: Core.cpp:3310
LLVMMetadataRef LLVMGetModuleFlag(LLVMModuleRef M, const char *Key, size_t KeyLen)
Add a module-level flag to the module-level flags metadata if it doesn&#39;t already exist.
Definition: Core.cpp:360
LLVMValueRef LLVMBuildAlloca(LLVMBuilderRef, LLVMTypeRef Ty, const char *Name)
Definition: Core.cpp:3024
LLVMAtomicOrdering
Definition: Core.h:323
LLVMTypeRef LLVMInt32Type(void)
Definition: Core.cpp:561
void LLVMGetAttributesAtIndex(LLVMValueRef F, LLVMAttributeIndex Idx, LLVMAttributeRef *Attrs)
Definition: Core.cpp:2111
LLVMValueRef LLVMBuildPhi(LLVMBuilderRef, LLVMTypeRef Ty, const char *Name)
Definition: Core.cpp:3280
LLVMValueRef LLVMIsAMDString(LLVMValueRef Val)
Definition: Core.cpp:888
Sets the value if it&#39;s greater than the original using an unsigned comparison and return the old one...
Definition: Core.h:367
LLVMValueRef LLVMGetMetadata(LLVMValueRef Val, unsigned KindID)
Return metadata associated with an instruction value.
Definition: Core.cpp:843
void LLVMAddClause(LLVMValueRef LandingPad, LLVMValueRef ClauseVal)
Definition: Core.cpp:2792
unsigned LLVMCountBasicBlocks(LLVMValueRef Fn)
Obtain the number of basic blocks in a function.
Definition: Core.cpp:2234
LLVMBool LLVMIsPackedStruct(LLVMTypeRef StructTy)
Determine whether a structure is packed.
Definition: Core.cpp:701
void LLVMReplaceAllUsesWith(LLVMValueRef OldVal, LLVMValueRef NewVal)
Replace all uses of a value with another one.
Definition: Core.cpp:835
LLVMValueRef LLVMBuildFPToSI(LLVMBuilderRef, LLVMValueRef Val, LLVMTypeRef DestTy, const char *Name)
Definition: Core.cpp:3177
LLVMBool LLVMStartMultithreaded(void)
Deprecated: Multi-threading can only be enabled/disabled with the compile time define LLVM_ENABLE_THR...
Definition: Core.cpp:3546
LLVMDiagnosticHandler LLVMContextGetDiagnosticHandler(LLVMContextRef C)
Get the diagnostic handler of this context.
Definition: Core.cpp:94
LLVMContextRef LLVMGetModuleContext(LLVMModuleRef M)
Obtain the context to which this module is associated.
Definition: Core.cpp:452
LLVMValueRef LLVMConstFDiv(LLVMValueRef LHSConstant, LLVMValueRef RHSConstant)
Definition: Core.cpp:1388
True if unordered or greater than.
Definition: Core.h:302
#define LLVM_DECLARE_VALUE_CAST(name)
Convert value instances between types.
Definition: Core.h:1551
LLVMValueRef LLVMBuildNSWSub(LLVMBuilderRef, LLVMValueRef LHS, LLVMValueRef RHS, const char *Name)
Definition: Core.cpp:2866
LLVMValueRef LLVMGetNamedFunction(LLVMModuleRef M, const char *Name)
Obtain a Function value from a Module by its name.
Definition: Core.cpp:2021
LLVMValueRef LLVMConstFNeg(LLVMValueRef ConstantVal)
Definition: Core.cpp:1292
LLVMValueRef LLVMGetLastGlobalAlias(LLVMModuleRef M)
Obtain an iterator to the last GlobalAlias in a Module.
Definition: Core.cpp:1981
unsigned LLVMCountStructElementTypes(LLVMTypeRef StructTy)
Get the number of elements defined inside the structure.
Definition: Core.cpp:685
LLVMThreadLocalMode LLVMGetThreadLocalMode(LLVMValueRef GlobalVar)
Definition: Core.cpp:1911
Definition: Core.h:77
LLVMValueRef LLVMBuildSIToFP(LLVMBuilderRef, LLVMValueRef Val, LLVMTypeRef DestTy, const char *Name)
Definition: Core.cpp:3187
Definition: Core.h:114
char * LLVMPrintValueToString(LLVMValueRef Val)
Return a string representation of the value.
Definition: Core.cpp:821
LLVMModuleRef LLVMCloneModule(LLVMModuleRef M)
Return an exact copy of the specified module.
LLVMValueRef LLVMBuildExtractElement(LLVMBuilderRef, LLVMValueRef VecVal, LLVMValueRef Index, const char *Name)
Definition: Core.cpp:3304
LLVMValueRef LLVMBuildFMul(LLVMBuilderRef, LLVMValueRef LHS, LLVMValueRef RHS, const char *Name)
Definition: Core.cpp:2896
void LLVMSetDLLStorageClass(LLVMValueRef Global, LLVMDLLStorageClass Class)
Definition: Core.cpp:1755
LLVMTypeRef LLVMPPCFP128TypeInContext(LLVMContextRef C)
Obtain a 128-bit floating point type (two 64-bits) from a context.
Definition: Core.cpp:595
80 bit floating point type (X87)
Definition: Core.h:145
LLVMValueRef LLVMBuildPtrDiff(LLVMBuilderRef, LLVMValueRef LHS, LLVMValueRef RHS, const char *Name)
Definition: Core.cpp:3346
Definition: Core.h:96
LLVMValueRef LLVMBuildInBoundsGEP(LLVMBuilderRef B, LLVMValueRef Pointer, LLVMValueRef *Indices, unsigned NumIndices, const char *Name)
Definition: Core.cpp:3099
void LLVMSetUnnamedAddress(LLVMValueRef Global, LLVMUnnamedAddr UnnamedAddr)
Definition: Core.cpp:1772
LLVMValueRef LLVMConstNUWMul(LLVMValueRef LHSConstant, LLVMValueRef RHSConstant)
Definition: Core.cpp:1355
LLVMValueRef LLVMConstExtractValue(LLVMValueRef AggConstant, unsigned *IdxList, unsigned NumIdx)
Definition: Core.cpp:1600
LLVMValueRef LLVMBuildExactUDiv(LLVMBuilderRef, LLVMValueRef LHS, LLVMValueRef RHS, const char *Name)
Definition: Core.cpp:2906
void LLVMAddDestination(LLVMValueRef IndirectBr, LLVMBasicBlockRef Dest)
Definition: Core.cpp:2780
LLVMValueRef LLVMConstOr(LLVMValueRef LHSConstant, LLVMValueRef RHSConstant)
Definition: Core.cpp:1413
unsigned LLVMGetNumContainedTypes(LLVMTypeRef Tp)
Return the number of types in the derived type.
Definition: Core.cpp:742
void LLVMInstructionEraseFromParent(LLVMValueRef Inst)
Remove and delete an instruction.
Definition: Core.cpp:2360
LLVMModuleFlagBehavior LLVMModuleFlagEntriesGetFlagBehavior(LLVMModuleFlagEntry *Entries, unsigned Index)
Returns the flag behavior for a module flag entry at a specific index.
Definition: Core.cpp:338
LLVMUseRef LLVMGetOperandUse(LLVMValueRef Val, unsigned Index)
Obtain the use of an operand at a specific index in a llvm::User value.
Definition: Core.cpp:945
void LLVMMoveBasicBlockAfter(LLVMBasicBlockRef BB, LLVMBasicBlockRef MovePos)
Move a basic block to after another one.
Definition: Core.cpp:2314
LLVMValueRef LLVMGetUsedValue(LLVMUseRef U)
Obtain the value this use corresponds to.
Definition: Core.cpp:915
LLVMTypeRef LLVMArrayType(LLVMTypeRef ElementType, unsigned ElementCount)
Create a fixed size array type that refers to a specific type.
Definition: Core.cpp:723
Definition: Core.h:74
LLVMValueRef LLVMGetElementAsConstant(LLVMValueRef C, unsigned idx)
Get an element at specified index as a constant.
Definition: Core.cpp:1195
LLVMBool LLVMIsUndef(LLVMValueRef Val)
Determine whether a value instance is undefined.
Definition: Core.cpp:986
char * LLVMGetDiagInfoDescription(LLVMDiagnosticInfoRef DI)
Return a string representation of the DiagnosticInfo.
Definition: Core.cpp:180
void LLVMSetParamAlignment(LLVMValueRef Arg, unsigned Align)
Set the alignment for a function parameter.
Definition: Core.cpp:2203
LLVMValueRef LLVMMDStringInContext(LLVMContextRef C, const char *Str, unsigned SLen)
Obtain a MDString value from a context.
Definition: Core.cpp:996
LLVMValueRef LLVMBuildResume(LLVMBuilderRef B, LLVMValueRef Exn)
Definition: Core.cpp:2744
LLVMValueRef LLVMConstString(const char *Str, unsigned Length, LLVMBool DontNullTerminate)
Create a ConstantDataSequential with string content in the global context.
Definition: Core.cpp:1189
LLVMTypeRef LLVMIntTypeInContext(LLVMContextRef C, unsigned NumBits)
Definition: Core.cpp:548
Functions.
Definition: Core.h:150
LLVMBasicBlockRef LLVMGetSuccessor(LLVMValueRef Term, unsigned i)
Return the specified successor.
Definition: Core.cpp:2512
LLVMValueRef LLVMMDString(const char *Str, unsigned SLen)
Obtain a MDString value from the global context.
Definition: Core.cpp:1003
LLVMValueRef LLVMConstSRem(LLVMValueRef LHSConstant, LLVMValueRef RHSConstant)
Definition: Core.cpp:1398
Definition: Core.h:76
LLVMValueRef LLVMBuildUnreachable(LLVMBuilderRef)
Definition: Core.cpp:2771
True if ordered and less than.
Definition: Core.h:296
LLVMValueRef LLVMBuildInvoke(LLVMBuilderRef, LLVMValueRef Fn, LLVMValueRef *Args, unsigned NumArgs, LLVMBasicBlockRef Then, LLVMBasicBlockRef Catch, const char *Name)
Definition: Core.cpp:2703
void LLVMShutdown(void)
Deallocate and destroy all ManagedStatic variables.
Definition: Core.cpp:60
LLVMTypeRef LLVMPPCFP128Type(void)
Definition: Core.cpp:617
LLVMValueRef LLVMConstIntToPtr(LLVMValueRef ConstantVal, LLVMTypeRef ToType)
Definition: Core.cpp:1519
And a value and return the old one.
Definition: Core.h:354
LLVMBool LLVMIsEnumAttribute(LLVMAttributeRef A)
Check for the different types of attributes.
Definition: Core.cpp:171
LLVMValueRef LLVMConstPointerCast(LLVMValueRef ConstantVal, LLVMTypeRef ToType)
Definition: Core.cpp:1553
LLVMValueRef LLVMBuildNot(LLVMBuilderRef, LLVMValueRef V, const char *Name)
Definition: Core.cpp:2996
LLVMBasicBlockRef LLVMGetInsertBlock(LLVMBuilderRef Builder)
Definition: Core.cpp:2629
const char * LLVMGetTarget(LLVMModuleRef M)
Obtain the target triple for a module.
Definition: Core.cpp:261
const char * LLVMGetValueName2(LLVMValueRef Val, size_t *Length)
Obtain the string name of a value.
Definition: Core.cpp:799
LLVMTypeRef LLVMInt16Type(void)
Definition: Core.cpp:558
Sets the value if it&#39;s greater than the original using a signed comparison and return the old one...
Definition: Core.h:358
unsigned LLVMGetEnumAttributeKind(LLVMAttributeRef A)
Get the unique id corresponding to the enum attribute passed as argument.
Definition: Core.cpp:139
void LLVMPositionBuilderBefore(LLVMBuilderRef Builder, LLVMValueRef Instr)
Definition: Core.cpp:2619
void LLVMSetPersonalityFn(LLVMValueRef Fn, LLVMValueRef PersonalityFn)
Set the personality function attached to the function.
Definition: Core.cpp:2069
LLVMTypeRef LLVMGetTypeByName(LLVMModuleRef M, const char *Name)
Obtain a Type from a module by its registered name.
Definition: Core.cpp:709
LLVMValueRef LLVMGetPersonalityFn(LLVMValueRef Fn)
Obtain the personality function attached to the function.
Definition: Core.cpp:2065
unsigned LLVMGetNumClauses(LLVMValueRef LandingPad)
Definition: Core.cpp:2784
LLVMOpcode LLVMGetConstOpcode(LLVMValueRef ConstantVal)
Definition: Core.cpp:1267
Definition: Core.h:92
unsigned LLVMGetInstructionCallConv(LLVMValueRef Instr)
Obtain the calling convention for a call instruction.
Definition: Core.cpp:2403
void LLVMDumpValue(LLVMValueRef Val)
Dump a representation of a value to stderr.
Definition: Core.cpp:817
LLVMValueRef LLVMConstSub(LLVMValueRef LHSConstant, LLVMValueRef RHSConstant)
Definition: Core.cpp:1322
struct LLVMOpaqueModuleProvider * LLVMModuleProviderRef
Interface used to provide a module to JIT or interpreter.
Definition: Types.h:111
void LLVMGetNamedMetadataOperands(LLVMModuleRef M, const char *Name, LLVMValueRef *Dest)
Obtain the named metadata operands for a module.
Definition: Core.cpp:1088
LLVMValueRef LLVMConstUIToFP(LLVMValueRef ConstantVal, LLVMTypeRef ToType)
Definition: Core.cpp:1494
int LLVMBool
Definition: Types.h:29
int LLVMGetNumOperands(LLVMValueRef Val)
Obtain the number of operands in a llvm::User value.
Definition: Core.cpp:954
void * LLVMContextGetDiagnosticContext(LLVMContextRef C)
Get the diagnostic context of this context.
Definition: Core.cpp:99
unsigned LLVMGetCallSiteAttributeCount(LLVMValueRef C, LLVMAttributeIndex Idx)
Definition: Core.cpp:2424
LLVMValueRef LLVMBuildGEP(LLVMBuilderRef B, LLVMValueRef Pointer, LLVMValueRef *Indices, unsigned NumIndices, const char *Name)
Definition: Core.cpp:3092
LLVMValueRef LLVMAddGlobalInAddressSpace(LLVMModuleRef M, LLVMTypeRef Ty, const char *Name, unsigned AddressSpace)
Definition: Core.cpp:1834
struct LLVMOpaqueDiagnosticInfo * LLVMDiagnosticInfoRef
Definition: Types.h:135
type with no size
Definition: Core.h:141
LLVMValueRef LLVMBuildTrunc(LLVMBuilderRef, LLVMValueRef Val, LLVMTypeRef DestTy, const char *Name)
Definition: Core.cpp:3157
const char * LLVMGetDataLayout(LLVMModuleRef M)
Definition: Core.cpp:252
Like Private, but linker removes.
Definition: Core.h:179
LLVMValueRef LLVMGetParam(LLVMValueRef Fn, unsigned Index)
Obtain the parameter at the specified index.
Definition: Core.cpp:2163
LLVMValueRef LLVMConstStringInContext(LLVMContextRef C, const char *Str, unsigned Length, LLVMBool DontNullTerminate)
Create a ConstantDataSequential and initialize it with a string.
Definition: Core.cpp:1180
LLVMValueRef LLVMConstURem(LLVMValueRef LHSConstant, LLVMValueRef RHSConstant)
Definition: Core.cpp:1393
void LLVMAddHandler(LLVMValueRef CatchSwitch, LLVMBasicBlockRef Dest)
Definition: Core.cpp:2805
LLVMTypeRef LLVMVoidType(void)
These are similar to the above functions except they operate on the global context.
Definition: Core.cpp:773
LLVMValueRef LLVMBuildCall(LLVMBuilderRef, LLVMValueRef Fn, LLVMValueRef *Args, unsigned NumArgs, const char *Name)
Definition: Core.cpp:3284
Definition: Core.h:71
LLVMBasicBlockRef LLVMAppendBasicBlockInContext(LLVMContextRef C, LLVMValueRef Fn, const char *Name)
Append a basic block to the end of a function.
Definition: Core.cpp:2280
LLVMTypeRef LLVMGetElementType(LLVMTypeRef Ty)
Obtain the type of elements within a sequential type.
Definition: Core.cpp:735
LLVMValueRef LLVMBuildNeg(LLVMBuilderRef, LLVMValueRef V, const char *Name)
Definition: Core.cpp:2978
void LLVMDisposeMemoryBuffer(LLVMMemoryBufferRef MemBuf)
Definition: Core.cpp:3499
LLVMValueRef LLVMBuildUIToFP(LLVMBuilderRef, LLVMValueRef Val, LLVMTypeRef DestTy, const char *Name)
Definition: Core.cpp:3182
void LLVMSetFunctionCallConv(LLVMValueRef Fn, unsigned CC)
Set the calling convention of a function.
Definition: Core.cpp:2083
Like Internal, but omit from symbol table.
Definition: Core.h:173
void LLVMGetBasicBlocks(LLVMValueRef Fn, LLVMBasicBlockRef *BasicBlocks)
Obtain all of the basic blocks in a function.
Definition: Core.cpp:2238
Sets the value if it&#39;s Smaller than the original using a signed comparison and return the old one...
Definition: Core.h:361
LLVMContextRef LLVMGetTypeContext(LLVMTypeRef Ty)
Obtain the context to which this type instance is associated.
Definition: Core.cpp:506
A filter clause.
Definition: Core.h:312
LLVMValueRef LLVMGetOperand(LLVMValueRef Val, unsigned Index)
Obtain an operand at a specific index in a llvm::User value.
Definition: Core.cpp:931
LLVMValueRef LLVMConstTruncOrBitCast(LLVMValueRef ConstantVal, LLVMTypeRef ToType)
Definition: Core.cpp:1547
unsigned LLVMCountParams(LLVMValueRef Fn)
Obtain the number of parameters in a function.
Definition: Core.cpp:2150
LLVMModuleProviderRef LLVMCreateModuleProviderForExistingModule(LLVMModuleRef M)
Changes the type of M so it can be passed to FunctionPassManagers and the JIT.
Definition: Core.cpp:3434
void LLVMInsertIntoBuilder(LLVMBuilderRef Builder, LLVMValueRef Instr)
Definition: Core.cpp:2637
LLVMValueRef LLVMBuildFPCast(LLVMBuilderRef, LLVMValueRef Val, LLVMTypeRef DestTy, const char *Name)
Definition: Core.cpp:3257
LLVMValueRef LLVMBuildRetVoid(LLVMBuilderRef)
Definition: Core.cpp:2671
LLVMValueRef LLVMBuildGlobalString(LLVMBuilderRef B, const char *Str, const char *Name)
Definition: Core.cpp:3112
LLVMValueRef LLVMConstPointerNull(LLVMTypeRef Ty)
Obtain a constant that is a constant pointer pointing to NULL for a specified type.
Definition: Core.cpp:990
void LLVMSetInitializer(LLVMValueRef GlobalVar, LLVMValueRef ConstantVal)
Definition: Core.cpp:1890
LLVMThreadLocalMode
Definition: Core.h:315
LLVMVisibility LLVMGetVisibility(LLVMValueRef Global)
Definition: Core.cpp:1740
LLVMValueRef LLVMConstNUWSub(LLVMValueRef LHSConstant, LLVMValueRef RHSConstant)
Definition: Core.cpp:1333
void LLVMInitializeCore(LLVMPassRegistryRef R)
Definition: Core.cpp:56
True if ordered and greater than.
Definition: Core.h:294
LLVMContextRef LLVMContextCreate(void)
Create a new context.
Definition: Core.cpp:79
Labels.
Definition: Core.h:148
LLVMTypeKind LLVMGetTypeKind(LLVMTypeRef Ty)
Obtain the enumerated type of a Type instance.
Definition: Core.cpp:461
LLVMTypeRef LLVMTypeOf(LLVMValueRef Val)
Obtain the type of a value.
Definition: Core.cpp:784
LLVMValueRef LLVMGetFirstGlobalAlias(LLVMModuleRef M)
Obtain an iterator to the first GlobalAlias in a Module.
Definition: Core.cpp:1973
LLVMValueRef LLVMConstAllOnes(LLVMTypeRef Ty)
Obtain a constant value referring to the instance of a type consisting of all ones.
Definition: Core.cpp:968
LLVMValueRef LLVMConstFPTrunc(LLVMValueRef ConstantVal, LLVMTypeRef ToType)
Definition: Core.cpp:1484
LLVMValueRef LLVMGetCalledValue(LLVMValueRef Instr)
Obtain the pointer to the function invoked by this instruction.
Definition: Core.cpp:2464
const char * LLVMGetSourceFileName(LLVMModuleRef M, size_t *Len)
Obtain the module&#39;s original source file name.
Definition: Core.cpp:237
LLVMValueRef LLVMConstInsertValue(LLVMValueRef AggConstant, LLVMValueRef ElementValueConstant, unsigned *IdxList, unsigned NumIdx)
Definition: Core.cpp:1606
LLVMValueRef LLVMBuildURem(LLVMBuilderRef, LLVMValueRef LHS, LLVMValueRef RHS, const char *Name)
Definition: Core.cpp:2926
LLVMTypeRef LLVMLabelType(void)
Definition: Core.cpp:776
Definition: Core.h:97
Arbitrary bit width integers.
Definition: Core.h:149
LLVMValueRef LLVMGetCondition(LLVMValueRef Branch)
Return the condition of a branch instruction.
Definition: Core.cpp:2526
LLVMValueRef LLVMBuildFCmp(LLVMBuilderRef, LLVMRealPredicate Op, LLVMValueRef LHS, LLVMValueRef RHS, const char *Name)
Definition: Core.cpp:3271
Predicate
Predicate - These are "(BI << 5) | BO" for various predicates.
Definition: PPCPredicates.h:27
struct LLVMOpaqueBasicBlock * LLVMBasicBlockRef
Represents a basic block of instructions in LLVM IR.
Definition: Types.h:83
Structures.
Definition: Core.h:151
LLVMValueRef LLVMGetNextInstruction(LLVMValueRef Inst)
Obtain the instruction that occurs after the one specified.
Definition: Core.cpp:2340
Definition: Core.h:113
void LLVMDeleteGlobal(LLVMValueRef GlobalVar)
Definition: Core.cpp:1879
void LLVMSetParentCatchSwitch(LLVMValueRef CatchPad, LLVMValueRef CatchSwitch)
Set the parent catchswitch instruction of a catchpad instruction.
Definition: Core.cpp:2824
Xor a value and return the old one.
Definition: Core.h:357
Definition: Core.h:79
LLVMValueRef LLVMConstSExtOrBitCast(LLVMValueRef ConstantVal, LLVMTypeRef ToType)
Definition: Core.cpp:1541
LLVMValueRef LLVMBuildXor(LLVMBuilderRef, LLVMValueRef LHS, LLVMValueRef RHS, const char *Name)
Definition: Core.cpp:2966
LLVMValueRef LLVMBuildUDiv(LLVMBuilderRef, LLVMValueRef LHS, LLVMValueRef RHS, const char *Name)
Definition: Core.cpp:2901
Emits a warning if two values disagree.
Definition: Core.h:398
signed less or equal
Definition: Core.h:288
LLVMBool LLVMIsFunctionVarArg(LLVMTypeRef FunctionTy)
Returns whether a function type is variadic.
Definition: Core.cpp:633
LLVMValueRef LLVMGetCurrentDebugLocation(LLVMBuilderRef Builder)
Definition: Core.cpp:2658
Uses the specified value, regardless of the behavior or value of the other module.
Definition: Core.h:418
LLVMLinkage
Definition: Core.h:160
unsigned LLVMGetNamedMetadataNumOperands(LLVMModuleRef M, const char *Name)
Obtain the number of operands for named metadata in a module.
Definition: Core.cpp:1081
Definition: Core.h:86
void LLVMSetAtomicSingleThread(LLVMValueRef AtomicInst, LLVMBool SingleThread)
Definition: Core.cpp:3396
LLVMTypeRef LLVMDoubleType(void)
Definition: Core.cpp:608
32 bit floating point type
Definition: Core.h:143
LLVMValueRef LLVMBuildInsertValue(LLVMBuilderRef, LLVMValueRef AggVal, LLVMValueRef EltVal, unsigned Index, const char *Name)
Definition: Core.cpp:3329
LLVMValueRef LLVMGetUser(LLVMUseRef U)
Obtain the user value for a user.
Definition: Core.cpp:911
LLVMValueRef LLVMConstFPExt(LLVMValueRef ConstantVal, LLVMTypeRef ToType)
Definition: Core.cpp:1489
unsigned less than
Definition: Core.h:283
provides Acquire semantics for loads and Release semantics for stores.
Definition: Core.h:340
struct LLVMOpaquePassManager * LLVMPassManagerRef
Definition: Types.h:114
LLVMTypeRef LLVMStructType(LLVMTypeRef *ElementTypes, unsigned ElementCount, LLVMBool Packed)
Create a new structure type in the global context.
Definition: Core.cpp:660
LLVMValueRef LLVMBuildShuffleVector(LLVMBuilderRef, LLVMValueRef V1, LLVMValueRef V2, LLVMValueRef Mask, const char *Name)
Definition: Core.cpp:3317
void LLVMSetSourceFileName(LLVMModuleRef M, const char *Name, size_t Len)
Set the original source file name of a module to a string Name with length Len.
Definition: Core.cpp:243
double LLVMConstRealGetDouble(LLVMValueRef ConstantVal, LLVMBool *losesInfo)
Obtain the double value for an floating point constant value.
Definition: Core.cpp:1157
LLVMValueRef LLVMBuildGlobalStringPtr(LLVMBuilderRef B, const char *Str, const char *Name)
Definition: Core.cpp:3117
void LLVMSetExternallyInitialized(LLVMValueRef GlobalVar, LLVMBool IsExtInit)
Definition: Core.cpp:1954
LLVMValueRef LLVMBuildMalloc(LLVMBuilderRef, LLVMTypeRef Ty, const char *Name)
Definition: Core.cpp:3002
LLVMValueRef LLVMIsAMDNode(LLVMValueRef Val)
Definition: Core.cpp:880
Same, but only replaced by something equivalent.
Definition: Core.h:164
True if ordered and less than or equal.
Definition: Core.h:297
LLVMAttributeRef LLVMGetCallSiteEnumAttribute(LLVMValueRef C, LLVMAttributeIndex Idx, unsigned KindID)
Definition: Core.cpp:2439
LLVMValueRef LLVMBuildFree(LLVMBuilderRef, LLVMValueRef PointerVal)
Definition: Core.cpp:3034
LLVMTypeRef LLVMFunctionType(LLVMTypeRef ReturnType, LLVMTypeRef *ParamTypes, unsigned ParamCount, LLVMBool IsVarArg)
Obtain a function type consisting of a specified signature.
Definition: Core.cpp:626
unsigned less or equal
Definition: Core.h:284
LLVMValueRef LLVMBuildBitCast(LLVMBuilderRef, LLVMValueRef Val, LLVMTypeRef DestTy, const char *Name)
Definition: Core.cpp:3212
LLVMBool LLVMIsThreadLocal(LLVMValueRef GlobalVar)
Definition: Core.cpp:1895
Definition: Core.h:73
void LLVMSetModuleInlineAsm2(LLVMModuleRef M, const char *Asm, size_t Len)
Set inline assembly for a module.
Definition: Core.cpp:412
LLVMValueRef LLVMConstPtrToInt(LLVMValueRef ConstantVal, LLVMTypeRef ToType)
Definition: Core.cpp:1514
LLVMBool LLVMRunPassManager(LLVMPassManagerRef PM, LLVMModuleRef M)
Initializes, executes on the provided module, and finalizes all of the passes scheduled in the pass m...
Definition: Core.cpp:3524
LLVMValueRef LLVMGetBasicBlockTerminator(LLVMBasicBlockRef BB)
Obtain the terminator instruction for a basic block.
Definition: Core.cpp:2230
Metadata.
Definition: Core.h:155
LLVMValueRef LLVMConstStruct(LLVMValueRef *ConstantVals, unsigned Count, LLVMBool Packed)
Create a ConstantStruct in the global Context.
Definition: Core.cpp:1223
LLVMBool LLVMIsConstantString(LLVMValueRef c)
Returns true if the specified constant is an array of i8.
Definition: Core.cpp:1199
LLVMValueRef LLVMConstFCmp(LLVMRealPredicate Predicate, LLVMValueRef LHSConstant, LLVMValueRef RHSConstant)
Definition: Core.cpp:1430
LLVMTypeRef LLVMX86MMXTypeInContext(LLVMContextRef C)
Create a X86 MMX type in a context.
Definition: Core.cpp:598
LLVMValueRef LLVMConstMul(LLVMValueRef LHSConstant, LLVMValueRef RHSConstant)
Definition: Core.cpp:1344
LLVMBool LLVMIsDeclaration(LLVMValueRef Global)
Definition: Core.cpp:1632
void LLVMAppendModuleInlineAsm(LLVMModuleRef M, const char *Asm, size_t Len)
Append inline assembly to a module.
Definition: Core.cpp:420
amdgpu Simplify well known AMD library false Value Value * Arg
LLVMValueRef LLVMAliasGetAliasee(LLVMValueRef Alias)
Retrieve the target value of an alias.
Definition: Core.cpp:2005
LLVMValueRef LLVMBuildFPExt(LLVMBuilderRef, LLVMValueRef Val, LLVMTypeRef DestTy, const char *Name)
Definition: Core.cpp:3197
LLVMValueRef LLVMConstNeg(LLVMValueRef ConstantVal)
Definition: Core.cpp:1279
void LLVMAddIncoming(LLVMValueRef PhiNode, LLVMValueRef *IncomingValues, LLVMBasicBlockRef *IncomingBlocks, unsigned Count)
Add an incoming value to the end of a PHI list.
Definition: Core.cpp:2558
LLVMValueRef LLVMBuildExtractValue(LLVMBuilderRef, LLVMValueRef AggVal, unsigned Index, const char *Name)
Definition: Core.cpp:3324
LLVMValueRef LLVMBuildAShr(LLVMBuilderRef, LLVMValueRef LHS, LLVMValueRef RHS, const char *Name)
Definition: Core.cpp:2951
void LLVMRemoveBasicBlockFromParent(LLVMBasicBlockRef BB)
Remove a basic block from a function.
Definition: Core.cpp:2306
LLVMValueRef LLVMConstFAdd(LLVMValueRef LHSConstant, LLVMValueRef RHSConstant)
Definition: Core.cpp:1317
void(* LLVMDiagnosticHandler)(LLVMDiagnosticInfoRef, void *)
Definition: Core.h:477
LLVMValueRef LLVMConstNSWSub(LLVMValueRef LHSConstant, LLVMValueRef RHSConstant)
Definition: Core.cpp:1327
LLVMValueRef LLVMBuildMul(LLVMBuilderRef, LLVMValueRef LHS, LLVMValueRef RHS, const char *Name)
Definition: Core.cpp:2881
void LLVMAddNamedMetadataOperand(LLVMModuleRef M, const char *Name, LLVMValueRef Val)
Add an operand to named metadata.
Definition: Core.cpp:1098
Always false (always folded)
Definition: Core.h:292
LLVMBool LLVMIsInBounds(LLVMValueRef GEP)
Check whether the given GEP instruction is inbounds.
Definition: Core.cpp:2548
LLVMValueRef LLVMGetPreviousParam(LLVMValueRef Arg)
Obtain the previous parameter to a function.
Definition: Core.cpp:2196
LLVMModuleRef LLVMModuleCreateWithName(const char *ModuleID)
Create a new, empty module in the global context.
Definition: Core.cpp:214
unsigned LLVMGetNumIndices(LLVMValueRef Inst)
Obtain the number of indices.
Definition: Core.cpp:2579
Obsolete.
Definition: Core.h:177
void LLVMAddCase(LLVMValueRef Switch, LLVMValueRef OnVal, LLVMBasicBlockRef Dest)
Definition: Core.cpp:2775
Definition: Core.h:84
LLVMValueRef LLVMBuildArrayMalloc(LLVMBuilderRef, LLVMTypeRef Ty, LLVMValueRef Val, const char *Name)
Definition: Core.cpp:3013
char * LLVMPrintTypeToString(LLVMTypeRef Val)
Return a string representation of the type.
Definition: Core.cpp:514
LLVMBool LLVMIsConditional(LLVMValueRef Branch)
Return if a branch is conditional.
Definition: Core.cpp:2522
void LLVMRemoveEnumAttributeAtIndex(LLVMValueRef F, LLVMAttributeIndex Idx, unsigned KindID)
Definition: Core.cpp:2131
Tentative definitions.
Definition: Core.h:178
LLVMValueRef LLVMBuildIntToPtr(LLVMBuilderRef, LLVMValueRef Val, LLVMTypeRef DestTy, const char *Name)
Definition: Core.cpp:3207
LLVMValueRef LLVMConstIntOfArbitraryPrecision(LLVMTypeRef IntTy, unsigned NumWords, const uint64_t Words[])
Obtain a constant value for an integer of arbitrary precision.
Definition: Core.cpp:1115
LLVMTypeRef LLVMInt64Type(void)
Definition: Core.cpp:564
16 bit floating point type
Definition: Core.h:142
LLVMVisibility
Definition: Core.h:183
unsigned LLVMGetEnumAttributeKindForName(const char *Name, size_t SLen)
Return an unique id given the name of a enum attribute, or 0 if no attribute by that name exists...
Definition: Core.cpp:126
LLVMTypeRef LLVMHalfTypeInContext(LLVMContextRef C)
Obtain a 16-bit floating point type from a context.
Definition: Core.cpp:580
LLVMBasicBlockRef LLVMAppendBasicBlock(LLVMValueRef Fn, const char *Name)
Append a basic block to the end of a function using the global context.
Definition: Core.cpp:2286
const char * LLVMGetStringAttributeValue(LLVMAttributeRef A, unsigned *Length)
Get the string attribute&#39;s value.
Definition: Core.cpp:164
guarantees that if you take all the operations affecting a specific address, a consistent ordering ex...
Definition: Core.h:327
LLVMTypeRef LLVMInt128TypeInContext(LLVMContextRef C)
Definition: Core.cpp:545
LLVMValueRef LLVMConstNUWNeg(LLVMValueRef ConstantVal)
Definition: Core.cpp:1287
LLVMValueRef LLVMBuildAtomicRMW(LLVMBuilderRef B, LLVMAtomicRMWBinOp op, LLVMValueRef PTR, LLVMValueRef Val, LLVMAtomicOrdering ordering, LLVMBool singleThread)
Definition: Core.cpp:3351
LLVMUnnamedAddr LLVMGetUnnamedAddress(LLVMValueRef Global)
Definition: Core.cpp:1760
void LLVMDeleteBasicBlock(LLVMBasicBlockRef BB)
Remove a basic block from a function and delete it.
Definition: Core.cpp:2302
LLVMAtomicOrdering LLVMGetCmpXchgSuccessOrdering(LLVMValueRef CmpXchgInst)
Definition: Core.cpp:3405
LLVMValueRef LLVMBuildLShr(LLVMBuilderRef, LLVMValueRef LHS, LLVMValueRef RHS, const char *Name)
Definition: Core.cpp:2946
unsigned LLVMGetNumSuccessors(LLVMValueRef Term)
Return the number of successors that this terminator has.
Definition: Core.cpp:2508
LLVMValueRef LLVMBuildIsNotNull(LLVMBuilderRef, LLVMValueRef Val, const char *Name)
Definition: Core.cpp:3341
static bool isSigned(Value *V)
Can the given value generate sign bits.
unsigned LLVMGetMDKindID(const char *Name, unsigned SLen)
Definition: Core.cpp:119
const NodeList & List
Definition: RDFGraph.cpp:210
LLVMBool LLVMIsConstant(LLVMValueRef Val)
Determine whether the specified value instance is constant.
Definition: Core.cpp:976
#define N
LLVMBasicBlockRef LLVMGetUnwindDest(LLVMValueRef InvokeInst)
Return the unwind destination basic block.
Definition: Core.cpp:2484
LLVMValueRef LLVMBuildFSub(LLVMBuilderRef, LLVMValueRef LHS, LLVMValueRef RHS, const char *Name)
Definition: Core.cpp:2876
LLVMBasicBlockRef LLVMGetIncomingBlock(LLVMValueRef PhiNode, unsigned Index)
Obtain an incoming value to a PHI node as an LLVMBasicBlockRef.
Definition: Core.cpp:2573
static GCRegistry::Add< ErlangGC > A("erlang", "erlang-compatible garbage collector")
void LLVMSetUnwindDest(LLVMValueRef InvokeInst, LLVMBasicBlockRef B)
Set the unwind destination basic block.
Definition: Core.cpp:2497
LLVMTypeRef LLVMInt1TypeInContext(LLVMContextRef C)
Obtain an integer type from a context with specified bit width.
Definition: Core.cpp:530
LLVMBool LLVMGetVolatile(LLVMValueRef MemoryAccessInst)
Definition: Core.cpp:3122
LLVMTypeRef LLVMInt1Type(void)
Obtain an integer type from the global context with a specified bit width.
Definition: Core.cpp:552
void LLVMGetCallSiteAttributes(LLVMValueRef C, LLVMAttributeIndex Idx, LLVMAttributeRef *Attrs)
Definition: Core.cpp:2431
LLVMTypeRef LLVMIntType(unsigned NumBits)
Definition: Core.cpp:570
void LLVMSetInstructionCallConv(LLVMValueRef Instr, unsigned CC)
Set the calling convention for a call instruction.
Definition: Core.cpp:2407
LLVMPassManagerRef LLVMCreateFunctionPassManagerForModule(LLVMModuleRef M)
Constructs a new function-by-function pass pipeline over the module provider.
Definition: Core.cpp:3515
LLVMModuleRef LLVMModuleCreateWithNameInContext(const char *ModuleID, LLVMContextRef C)
Create a new, empty module in a specific context.
Definition: Core.cpp:218
LLVMValueRef LLVMBuildSwitch(LLVMBuilderRef, LLVMValueRef V, LLVMBasicBlockRef Else, unsigned NumCases)
Definition: Core.cpp:2693
LLVMValueRef LLVMConstArray(LLVMTypeRef ElementTy, LLVMValueRef *ConstantVals, unsigned Length)
Create a ConstantArray from values.
Definition: Core.cpp:1209
128 bit floating point type (two 64-bits)
Definition: Core.h:147
LLVMCallConv
Definition: Core.h:201
void LLVMDumpType(LLVMTypeRef Val)
Dump a representation of a type to stderr.
Definition: Core.cpp:510
Definition: Core.h:78
LLVMTypeRef LLVMInt8Type(void)
Definition: Core.cpp:555
void LLVMAliasSetAliasee(LLVMValueRef Alias, LLVMValueRef Aliasee)
Set the target value of an alias.
Definition: Core.cpp:2009
Special purpose, only applies to global arrays.
Definition: Core.h:170
signed greater or equal
Definition: Core.h:286
The GV is hidden.
Definition: Core.h:185
LLVMValueRef LLVMConstSIToFP(LLVMValueRef ConstantVal, LLVMTypeRef ToType)
Definition: Core.cpp:1499
LLVMValueRef LLVMConstLShr(LLVMValueRef LHSConstant, LLVMValueRef RHSConstant)
Definition: Core.cpp:1442
const char * LLVMGetMDString(LLVMValueRef V, unsigned *Length)
Obtain the underlying string from a MDString value.
Definition: Core.cpp:1051
LLVMBool LLVMFinalizeFunctionPassManager(LLVMPassManagerRef FPM)
Finalizes all of the function passes scheduled in the function pass manager.
Definition: Core.cpp:3536
LLVMIntPredicate LLVMGetICmpPredicate(LLVMValueRef Inst)
Obtain the predicate of an instruction.
Definition: Core.cpp:2364
void LLVMSetCleanup(LLVMValueRef LandingPad, LLVMBool Val)
Definition: Core.cpp:2801
LLVMValueRef LLVMConstShl(LLVMValueRef LHSConstant, LLVMValueRef RHSConstant)
Definition: Core.cpp:1437
LLVMValueRef LLVMBuildNUWMul(LLVMBuilderRef, LLVMValueRef LHS, LLVMValueRef RHS, const char *Name)
Definition: Core.cpp:2891
Like LinkerPrivate, but is weak.
Definition: Core.h:180
LLVMValueRef LLVMConstNot(LLVMValueRef ConstantVal)
Definition: Core.cpp:1296
LLVMValueRef LLVMBuildLandingPad(LLVMBuilderRef B, LLVMTypeRef Ty, LLVMValueRef PersFn, unsigned NumClauses, const char *Name)
Definition: Core.cpp:2712
unsigned LLVMGetAttributeCountAtIndex(LLVMValueRef F, LLVMAttributeIndex Idx)
Definition: Core.cpp:2106
LLVMValueRef LLVMGetFirstFunction(LLVMModuleRef M)
Obtain an iterator to the first Function in a Module.
Definition: Core.cpp:2025
LLVMValueRef LLVMBuildCatchRet(LLVMBuilderRef B, LLVMValueRef CatchPad, LLVMBasicBlockRef BB)
Definition: Core.cpp:2759
struct LLVMOpaqueMetadata * LLVMMetadataRef
Represents an LLVM Metadata.
Definition: Types.h:90
LLVMBool LLVMPrintModuleToFile(LLVMModuleRef M, const char *Filename, char **ErrorMessage)
Print a representation of a module to a file.
Definition: Core.cpp:379
LLVMValueRef LLVMBuildVAArg(LLVMBuilderRef, LLVMValueRef List, LLVMTypeRef Ty, const char *Name)
Definition: Core.cpp:3299
void LLVMSetThreadLocalMode(LLVMValueRef GlobalVar, LLVMThreadLocalMode Mode)
Definition: Core.cpp:1928
Release is similar to Acquire, but with a barrier of the sort necessary to release a lock...
Definition: Core.h:333
Always true (always folded)
Definition: Core.h:307
LLVMBuilderRef LLVMCreateBuilderInContext(LLVMContextRef C)
Definition: Core.cpp:2604
LLVMAtomicOrdering LLVMGetOrdering(LLVMValueRef MemoryAccessInst)
Definition: Core.cpp:3136
void LLVMSetMetadata(LLVMValueRef Val, unsigned KindID, LLVMValueRef Node)
Set metadata associated with an instruction value.
Definition: Core.cpp:865
LLVMValueRef LLVMGetParamParent(LLVMValueRef Inst)
Obtain the function to which this argument belongs.
Definition: Core.cpp:2168
const char * LLVMGetValueName(LLVMValueRef Val)
Deprecated: Use LLVMGetValueName2 instead.
Definition: Core.cpp:809
LLVMValueRef LLVMGetArgOperand(LLVMValueRef Funclet, unsigned i)
Definition: Core.cpp:2831
LLVMValueRef LLVMBuildSExtOrBitCast(LLVMBuilderRef, LLVMValueRef Val, LLVMTypeRef DestTy, const char *Name)
Definition: Core.cpp:3228
LLVMValueRef LLVMBuildBr(LLVMBuilderRef, LLVMBasicBlockRef Dest)
Definition: Core.cpp:2684
void LLVMAddCallSiteAttribute(LLVMValueRef C, LLVMAttributeIndex Idx, LLVMAttributeRef A)
Definition: Core.cpp:2419
Address of the GV is locally insignificant.
Definition: Core.h:191
Definition: Core.h:72
LLVMValueRef LLVMBuildCleanupRet(LLVMBuilderRef B, LLVMValueRef CatchPad, LLVMBasicBlockRef BB)
Definition: Core.cpp:2765
LLVMValueRef LLVMBuildZExtOrBitCast(LLVMBuilderRef, LLVMValueRef Val, LLVMTypeRef DestTy, const char *Name)
Definition: Core.cpp:3222
LLVMBool LLVMCreateMemoryBufferWithSTDIN(LLVMMemoryBufferRef *OutMemBuf, char **OutMessage)
Definition: Core.cpp:3459
LLVMLinkage LLVMGetLinkage(LLVMValueRef Global)
Definition: Core.cpp:1636
constexpr char Size[]
Key for Kernel::Arg::Metadata::mSize.
LLVMDLLStorageClass
Definition: Core.h:195
LLVMBasicBlockRef LLVMValueAsBasicBlock(LLVMValueRef Val)
Convert an LLVMValueRef to an LLVMBasicBlockRef instance.
Definition: Core.cpp:2218
std::underlying_type< E >::type Mask()
Get a bitmask with 1s in all places up to the high-order bit of E&#39;s largest value.
Definition: BitmaskEnum.h:81
LLVMValueRef LLVMGetPreviousFunction(LLVMValueRef Fn)
Decrement a Function iterator to the previous Function.
Definition: Core.cpp:2049
void LLVMSetOrdering(LLVMValueRef MemoryAccessInst, LLVMAtomicOrdering Ordering)
Definition: Core.cpp:3146
LLVMValueRef LLVMBuildIndirectBr(LLVMBuilderRef B, LLVMValueRef Addr, unsigned NumDests)
Definition: Core.cpp:2698
void LLVMSetGC(LLVMValueRef Fn, const char *Name)
Define the garbage collector to use during code generation.
Definition: Core.cpp:2093
LLVMDLLStorageClass LLVMGetDLLStorageClass(LLVMValueRef Global)
Definition: Core.cpp:1750
LLVMValueRef LLVMBuildNSWNeg(LLVMBuilderRef B, LLVMValueRef V, const char *Name)
Definition: Core.cpp:2982
LLVMValueRef LLVMConstExactUDiv(LLVMValueRef LHSConstant, LLVMValueRef RHSConstant)
Definition: Core.cpp:1371
Obsolete.
Definition: Core.h:175
LLVMTypeRef LLVMGetReturnType(LLVMTypeRef FunctionTy)
Obtain the Type this function Type returns.
Definition: Core.cpp:637
Definition: Core.h:70
LLVMValueRef LLVMBuildNSWMul(LLVMBuilderRef, LLVMValueRef LHS, LLVMValueRef RHS, const char *Name)
Definition: Core.cpp:2886
LLVMValueRef LLVMBuildStore(LLVMBuilderRef, LLVMValueRef Val, LLVMValueRef Ptr)
Definition: Core.cpp:3044
LLVMModuleFlagBehavior
Definition: Core.h:384
LLVMValueRef LLVMBuildBinOp(LLVMBuilderRef B, LLVMOpcode Op, LLVMValueRef LHS, LLVMValueRef RHS, const char *Name)
Definition: Core.cpp:2971
True if unordered: isnan(X) | isnan(Y)
Definition: Core.h:300
const char * LLVMGetModuleIdentifier(LLVMModuleRef M, size_t *Len)
Obtain the identifier of a module.
Definition: Core.cpp:227
LLVMValueRef LLVMConstZExt(LLVMValueRef ConstantVal, LLVMTypeRef ToType)
Definition: Core.cpp:1479
LLVMBool LLVMIsMultithreaded(void)
Check whether LLVM is executing in thread-safe mode or not.
Definition: Core.cpp:3553
Definition: Core.h:59
LLVMContextRef LLVMGetGlobalContext(void)
Obtain the global context instance.
Definition: Core.cpp:83
LLVMValueRef LLVMConstNSWMul(LLVMValueRef LHSConstant, LLVMValueRef RHSConstant)
Definition: Core.cpp:1349
LLVMTypeRef LLVMInt32TypeInContext(LLVMContextRef C)
Definition: Core.cpp:539
LLVMAtomicOrdering LLVMGetCmpXchgFailureOrdering(LLVMValueRef CmpXchgInst)
Definition: Core.cpp:3418
LLVMBool LLVMRunFunctionPassManager(LLVMPassManagerRef FPM, LLVMValueRef F)
Executes all of the function passes scheduled in the function pass manager on the provided function...
Definition: Core.cpp:3532
64 bit floating point type
Definition: Core.h:144
AddressSpace
An integer that identifies all of the supported AVR address spaces.
Definition: AVR.h:41
LLVMTypeRef LLVMPointerType(LLVMTypeRef ElementType, unsigned AddressSpace)
Create a pointer type that points to a defined type.
Definition: Core.cpp:727
LLVMValueRef LLVMBuildLoad(LLVMBuilderRef, LLVMValueRef PointerVal, const char *Name)
Definition: Core.cpp:3039
void LLVMInstructionRemoveFromParent(LLVMValueRef Inst)
Remove and delete an instruction.
Definition: Core.cpp:2356
LLVMValueRef LLVMConstExtractElement(LLVMValueRef VectorConstant, LLVMValueRef IndexConstant)
Definition: Core.cpp:1578
void LLVMSetTailCall(LLVMValueRef CallInst, LLVMBool IsTailCall)
Set whether a call instruction is a tail call.
Definition: Core.cpp:2474
void LLVMSetModuleInlineAsm(LLVMModuleRef M, const char *Asm)
Deprecated: Use LLVMSetModuleInlineAsm2 instead.
Definition: Core.cpp:416
LLVMValueRef LLVMBuildAddrSpaceCast(LLVMBuilderRef, LLVMValueRef Val, LLVMTypeRef DestTy, const char *Name)
Definition: Core.cpp:3217
LLVMBasicBlockRef LLVMGetNormalDest(LLVMValueRef InvokeInst)
Return the normal destination basic block.
Definition: Core.cpp:2480
const char * LLVMGetModuleInlineAsm(LLVMModuleRef M, size_t *Len)
Get inline assembly for a module.
Definition: Core.cpp:424
const char * LLVMGetStringAttributeKind(LLVMAttributeRef A, unsigned *Length)
Get the string attribute&#39;s kind.
Definition: Core.cpp:157
LLVMValueRef LLVMConstFRem(LLVMValueRef LHSConstant, LLVMValueRef RHSConstant)
Definition: Core.cpp:1403
LLVMModuleFlagEntry * LLVMCopyModuleFlagsMetadata(LLVMModuleRef M, size_t *Len)
Returns the module flags as an array of flag-key-value triples.
Definition: Core.cpp:316
unsigned LLVMGetAlignment(LLVMValueRef V)
Obtain the preferred alignment of the value.
Definition: Core.cpp:1797
Tokens.
Definition: Core.h:157
LLVMValueRef LLVMGetNextFunction(LLVMValueRef Fn)
Advance a Function iterator to the next Function.
Definition: Core.cpp:2041
void LLVMAddAttributeAtIndex(LLVMValueRef F, LLVMAttributeIndex Idx, LLVMAttributeRef A)
Add an attribute to a function.
Definition: Core.cpp:2101
Definition: Core.h:68
unsigned LLVMGetNumHandlers(LLVMValueRef CatchSwitch)
Definition: Core.cpp:2809
void LLVMDisposeModuleProvider(LLVMModuleProviderRef M)
Destroys the module M.
Definition: Core.cpp:3438
void LLVMRemoveStringAttributeAtIndex(LLVMValueRef F, LLVMAttributeIndex Idx, const char *K, unsigned KLen)
Definition: Core.cpp:2136
LLVMTypeRef LLVMInt128Type(void)
Definition: Core.cpp:567
LLVMValueRef LLVMBuildSelect(LLVMBuilderRef, LLVMValueRef If, LLVMValueRef Then, LLVMValueRef Else, const char *Name)
Definition: Core.cpp:3292
Definition: Core.h:112
constexpr char Args[]
Key for Kernel::Metadata::mArgs.
Address of the GV is significant.
Definition: Core.h:190
LLVMRealPredicate
Definition: Core.h:291
LLVMTypeRef LLVMX86FP80TypeInContext(LLVMContextRef C)
Obtain a 80-bit floating point type (X87) from a context.
Definition: Core.cpp:589
True if ordered (no nans)
Definition: Core.h:299
struct LLVMOpaqueValue * LLVMValueRef
Represents an individual value in LLVM IR.
Definition: Types.h:76
void LLVMInsertIntoBuilderWithName(LLVMBuilderRef Builder, LLVMValueRef Instr, const char *Name)
Definition: Core.cpp:2641
LLVMValueRef LLVMBuildFPTrunc(LLVMBuilderRef, LLVMValueRef Val, LLVMTypeRef DestTy, const char *Name)
Definition: Core.cpp:3192
void LLVMSetIsInBounds(LLVMValueRef GEP, LLVMBool InBounds)
Set the given GEP instruction to be inbounds or not.
Definition: Core.cpp:2552
void LLVMSetAlignment(LLVMValueRef V, unsigned Bytes)
Set the preferred alignment of the value.
Definition: Core.cpp:1812
LLVMValueKind LLVMGetValueKind(LLVMValueRef Val)
Obtain the enumerated type of a Value instance.
Definition: Core.cpp:788
LLVMValueRef LLVMBuildCatchPad(LLVMBuilderRef B, LLVMValueRef ParentPad, LLVMValueRef *Args, unsigned NumArgs, const char *Name)
Definition: Core.cpp:2724
LLVMModuleRef LLVMGetGlobalParent(LLVMValueRef Global)
Definition: Core.cpp:1628