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