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