LLVM 22.0.0git
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/Deprecated.h"
20#include "llvm-c/ExternC.h"
21#include "llvm-c/Visibility.h"
22
23#include "llvm-c/Types.h"
24
26
27/**
28 * @defgroup LLVMC LLVM-C: C interface to LLVM
29 *
30 * This module exposes parts of the LLVM library as a C API.
31 *
32 * @{
33 */
34
35/**
36 * @defgroup LLVMCTransforms Transforms
37 */
38
39/**
40 * @defgroup LLVMCCore Core
41 *
42 * This modules provide an interface to libLLVMCore, which implements
43 * the LLVM intermediate representation as well as other related types
44 * and utilities.
45 *
46 * Many exotic languages can interoperate with C code but have a harder time
47 * with C++ due to name mangling. So in addition to C, this interface enables
48 * tools written in such languages.
49 *
50 * @{
51 */
52
53/**
54 * @defgroup LLVMCCoreTypes Types and Enumerations
55 *
56 * @{
57 */
58
59/// External users depend on the following values being stable. It is not safe
60/// to reorder them.
61typedef enum {
62 /* Terminator Instructions */
64 LLVMBr = 2,
68 /* removed 6 due to API changes */
71
72 /* Standard Unary Operators */
74
75 /* Standard Binary Operators */
78 LLVMSub = 10,
80 LLVMMul = 12,
88
89 /* Logical Operators */
90 LLVMShl = 20,
93 LLVMAnd = 23,
94 LLVMOr = 24,
95 LLVMXor = 25,
96
97 /* Memory Operators */
102
103 /* Cast Operators */
118
119 /* Other Operators */
134
135 /* Atomic operators */
139
140 /* Exception Handling Operators */
148} LLVMOpcode;
149
150typedef enum {
151 LLVMVoidTypeKind = 0, /**< type with no size */
152 LLVMHalfTypeKind = 1, /**< 16 bit floating point type */
153 LLVMFloatTypeKind = 2, /**< 32 bit floating point type */
154 LLVMDoubleTypeKind = 3, /**< 64 bit floating point type */
155 LLVMX86_FP80TypeKind = 4, /**< 80 bit floating point type (X87) */
156 LLVMFP128TypeKind = 5, /**< 128 bit floating point type (112-bit mantissa)*/
157 LLVMPPC_FP128TypeKind = 6, /**< 128 bit floating point type (two 64-bits) */
158 LLVMLabelTypeKind = 7, /**< Labels */
159 LLVMIntegerTypeKind = 8, /**< Arbitrary bit width integers */
160 LLVMFunctionTypeKind = 9, /**< Functions */
161 LLVMStructTypeKind = 10, /**< Structures */
162 LLVMArrayTypeKind = 11, /**< Arrays */
163 LLVMPointerTypeKind = 12, /**< Pointers */
164 LLVMVectorTypeKind = 13, /**< Fixed width SIMD vector type */
165 LLVMMetadataTypeKind = 14, /**< Metadata */
166 /* 15 previously used by LLVMX86_MMXTypeKind */
167 LLVMTokenTypeKind = 16, /**< Tokens */
168 LLVMScalableVectorTypeKind = 17, /**< Scalable SIMD vector type */
169 LLVMBFloatTypeKind = 18, /**< 16 bit brain floating point type */
170 LLVMX86_AMXTypeKind = 19, /**< X86 AMX */
171 LLVMTargetExtTypeKind = 20, /**< Target extension type */
173
174typedef enum {
175 LLVMExternalLinkage, /**< Externally visible function */
177 LLVMLinkOnceAnyLinkage, /**< Keep one copy of function when linking (inline)*/
178 LLVMLinkOnceODRLinkage, /**< Same, but only replaced by something
179 equivalent. */
181 LLVMWeakAnyLinkage, /**< Keep one copy of function when linking (weak) */
182 LLVMWeakODRLinkage, /**< Same, but only replaced by something
183 equivalent. */
184 LLVMAppendingLinkage, /**< Special purpose, only applies to global arrays */
185 LLVMInternalLinkage, /**< Rename collisions when linking (static
186 functions) */
187 LLVMPrivateLinkage, /**< Like Internal, but omit from symbol table */
188 LLVMDLLImportLinkage, /**< Obsolete */
189 LLVMDLLExportLinkage, /**< Obsolete */
190 LLVMExternalWeakLinkage,/**< ExternalWeak linkage description */
191 LLVMGhostLinkage, /**< Obsolete */
192 LLVMCommonLinkage, /**< Tentative definitions */
193 LLVMLinkerPrivateLinkage, /**< Like Private, but linker removes. */
194 LLVMLinkerPrivateWeakLinkage /**< Like LinkerPrivate, but is weak. */
196
197typedef enum {
198 LLVMDefaultVisibility, /**< The GV is visible */
199 LLVMHiddenVisibility, /**< The GV is hidden */
200 LLVMProtectedVisibility /**< The GV is protected */
202
203typedef enum {
204 LLVMNoUnnamedAddr, /**< Address of the GV is significant. */
205 LLVMLocalUnnamedAddr, /**< Address of the GV is locally insignificant. */
206 LLVMGlobalUnnamedAddr /**< Address of the GV is globally insignificant. */
208
209typedef enum {
211 LLVMDLLImportStorageClass = 1, /**< Function to be imported from DLL. */
212 LLVMDLLExportStorageClass = 2 /**< Function to be accessible from DLL. */
214
258
293
294typedef enum {
295 LLVMIntEQ = 32, /**< equal */
296 LLVMIntNE, /**< not equal */
297 LLVMIntUGT, /**< unsigned greater than */
298 LLVMIntUGE, /**< unsigned greater or equal */
299 LLVMIntULT, /**< unsigned less than */
300 LLVMIntULE, /**< unsigned less or equal */
301 LLVMIntSGT, /**< signed greater than */
302 LLVMIntSGE, /**< signed greater or equal */
303 LLVMIntSLT, /**< signed less than */
304 LLVMIntSLE /**< signed less or equal */
306
307typedef enum {
308 LLVMRealPredicateFalse, /**< Always false (always folded) */
309 LLVMRealOEQ, /**< True if ordered and equal */
310 LLVMRealOGT, /**< True if ordered and greater than */
311 LLVMRealOGE, /**< True if ordered and greater than or equal */
312 LLVMRealOLT, /**< True if ordered and less than */
313 LLVMRealOLE, /**< True if ordered and less than or equal */
314 LLVMRealONE, /**< True if ordered and operands are unequal */
315 LLVMRealORD, /**< True if ordered (no nans) */
316 LLVMRealUNO, /**< True if unordered: isnan(X) | isnan(Y) */
317 LLVMRealUEQ, /**< True if unordered or equal */
318 LLVMRealUGT, /**< True if unordered or greater than */
319 LLVMRealUGE, /**< True if unordered, greater than, or equal */
320 LLVMRealULT, /**< True if unordered or less than */
321 LLVMRealULE, /**< True if unordered, less than, or equal */
322 LLVMRealUNE, /**< True if unordered or not equal */
323 LLVMRealPredicateTrue /**< Always true (always folded) */
325
333
334typedef enum {
335 LLVMAtomicOrderingNotAtomic = 0, /**< A load or store which is not atomic */
336 LLVMAtomicOrderingUnordered = 1, /**< Lowest level of atomicity, guarantees
337 somewhat sane results, lock free. */
338 LLVMAtomicOrderingMonotonic = 2, /**< guarantees that if you take all the
339 operations affecting a specific address,
340 a consistent ordering exists */
341 LLVMAtomicOrderingAcquire = 4, /**< Acquire provides a barrier of the sort
342 necessary to acquire a lock to access other
343 memory with normal loads and stores. */
344 LLVMAtomicOrderingRelease = 5, /**< Release is similar to Acquire, but with
345 a barrier of the sort necessary to release
346 a lock. */
347 LLVMAtomicOrderingAcquireRelease = 6, /**< provides both an Acquire and a
348 Release barrier (for fences and
349 operations which both read and write
350 memory). */
351 LLVMAtomicOrderingSequentiallyConsistent = 7 /**< provides Acquire semantics
352 for loads and Release
353 semantics for stores.
354 Additionally, it guarantees
355 that a total ordering exists
356 between all
357 SequentiallyConsistent
358 operations. */
360
361typedef enum {
362 LLVMAtomicRMWBinOpXchg, /**< Set the new value and return the one old */
363 LLVMAtomicRMWBinOpAdd, /**< Add a value and return the old one */
364 LLVMAtomicRMWBinOpSub, /**< Subtract a value and return the old one */
365 LLVMAtomicRMWBinOpAnd, /**< And a value and return the old one */
366 LLVMAtomicRMWBinOpNand, /**< Not-And a value and return the old one */
367 LLVMAtomicRMWBinOpOr, /**< OR a value and return the old one */
368 LLVMAtomicRMWBinOpXor, /**< Xor a value and return the old one */
369 LLVMAtomicRMWBinOpMax, /**< Sets the value if it's greater than the
370 original using a signed comparison and return
371 the old one */
372 LLVMAtomicRMWBinOpMin, /**< Sets the value if it's Smaller than the
373 original using a signed comparison and return
374 the old one */
375 LLVMAtomicRMWBinOpUMax, /**< Sets the value if it's greater than the
376 original using an unsigned comparison and return
377 the old one */
378 LLVMAtomicRMWBinOpUMin, /**< Sets the value if it's greater than the
379 original using an unsigned comparison and return
380 the old one */
381 LLVMAtomicRMWBinOpFAdd, /**< Add a floating point value and return the
382 old one */
383 LLVMAtomicRMWBinOpFSub, /**< Subtract a floating point value and return the
384 old one */
385 LLVMAtomicRMWBinOpFMax, /**< Sets the value if it's greater than the
386 original using an floating point comparison and
387 return the old one */
388 LLVMAtomicRMWBinOpFMin, /**< Sets the value if it's smaller than the
389 original using an floating point comparison and
390 return the old one */
391 LLVMAtomicRMWBinOpUIncWrap, /**< Increments the value, wrapping back to zero
392 when incremented above input value */
393 LLVMAtomicRMWBinOpUDecWrap, /**< Decrements the value, wrapping back to
394 the input value when decremented below zero */
395 LLVMAtomicRMWBinOpUSubCond, /**<Subtracts the value only if no unsigned
396 overflow */
397 LLVMAtomicRMWBinOpUSubSat, /**<Subtracts the value, clamping to zero */
398 LLVMAtomicRMWBinOpFMaximum, /**< Sets the value if it's greater than the
399 original using an floating point comparison and
400 return the old one */
401 LLVMAtomicRMWBinOpFMinimum, /**< Sets the value if it's smaller than the
402 original using an floating point comparison and
403 return the old one */
405
412
417
418typedef enum {
419 /**
420 * Emits an error if two values disagree, otherwise the resulting value is
421 * that of the operands.
422 *
423 * @see Module::ModFlagBehavior::Error
424 */
426 /**
427 * Emits a warning if two values disagree. The result value will be the
428 * operand for the flag from the first module being linked.
429 *
430 * @see Module::ModFlagBehavior::Warning
431 */
433 /**
434 * Adds a requirement that another module flag be present and have a
435 * specified value after linking is performed. The value must be a metadata
436 * pair, where the first element of the pair is the ID of the module flag
437 * to be restricted, and the second element of the pair is the value the
438 * module flag should be restricted to. This behavior can be used to
439 * restrict the allowable results (via triggering of an error) of linking
440 * IDs with the **Override** behavior.
441 *
442 * @see Module::ModFlagBehavior::Require
443 */
445 /**
446 * Uses the specified value, regardless of the behavior or value of the
447 * other module. If both modules specify **Override**, but the values
448 * differ, an error will be emitted.
449 *
450 * @see Module::ModFlagBehavior::Override
451 */
453 /**
454 * Appends the two values, which are required to be metadata nodes.
455 *
456 * @see Module::ModFlagBehavior::Append
457 */
459 /**
460 * Appends the two values, which are required to be metadata
461 * nodes. However, duplicate entries in the second list are dropped
462 * during the append operation.
463 *
464 * @see Module::ModFlagBehavior::AppendUnique
465 */
468
469/**
470 * Attribute index are either LLVMAttributeReturnIndex,
471 * LLVMAttributeFunctionIndex or a parameter number from 1 to N.
472 */
473enum {
475 // ISO C restricts enumerator values to range of 'int'
476 // (4294967295 is too large)
477 // LLVMAttributeFunctionIndex = ~0U,
479};
480
481typedef unsigned LLVMAttributeIndex;
482
483/**
484 * Tail call kind for LLVMSetTailCallKind and LLVMGetTailCallKind.
485 *
486 * Note that 'musttail' implies 'tail'.
487 *
488 * @see CallInst::TailCallKind
489 */
496
497enum {
510};
511
512/**
513 * Flags to indicate what fast-math-style optimizations are allowed
514 * on operations.
515 *
516 * See https://llvm.org/docs/LangRef.html#fast-math-flags
517 */
518typedef unsigned LLVMFastMathFlags;
519
520enum {
522 LLVMGEPFlagNUSW = (1 << 1),
523 LLVMGEPFlagNUW = (1 << 2),
524};
525
526/**
527 * Flags that constrain the allowed wrap semantics of a getelementptr
528 * instruction.
529 *
530 * See https://llvm.org/docs/LangRef.html#getelementptr-instruction
531 */
532typedef unsigned LLVMGEPNoWrapFlags;
533
540
541/**
542 * @}
543 */
544
545/** Deallocate and destroy all ManagedStatic variables.
546 @see llvm::llvm_shutdown
547 @see ManagedStatic */
548LLVM_C_ABI void LLVMShutdown(void);
549
550/*===-- Version query -----------------------------------------------------===*/
551
552/**
553 * Return the major, minor, and patch version of LLVM
554 *
555 * The version components are returned via the function's three output
556 * parameters or skipped if a NULL pointer was supplied.
557 */
558LLVM_C_ABI void LLVMGetVersion(unsigned *Major, unsigned *Minor,
559 unsigned *Patch);
560
561/*===-- Error handling ----------------------------------------------------===*/
562
563LLVM_C_ABI char *LLVMCreateMessage(const char *Message);
564LLVM_C_ABI void LLVMDisposeMessage(char *Message);
565
566/**
567 * @defgroup LLVMCCoreContext Contexts
568 *
569 * Contexts are execution states for the core LLVM IR system.
570 *
571 * Most types are tied to a context instance. Multiple contexts can
572 * exist simultaneously. A single context is not thread safe. However,
573 * different contexts can execute on different threads simultaneously.
574 *
575 * @{
576 */
577
579typedef void (*LLVMYieldCallback)(LLVMContextRef, void *);
580
581/**
582 * Create a new context.
583 *
584 * Every call to this function should be paired with a call to
585 * LLVMContextDispose() or the context will leak memory.
586 */
588
589/**
590 * Obtain the global context instance.
591 */
593
594/**
595 * Set the diagnostic handler for this context.
596 */
598 LLVMDiagnosticHandler Handler,
599 void *DiagnosticContext);
600
601/**
602 * Get the diagnostic handler of this context.
603 */
606
607/**
608 * Get the diagnostic context of this context.
609 */
611
612/**
613 * Set the yield callback function for this context.
614 *
615 * @see LLVMContext::setYieldCallback()
616 */
618 LLVMYieldCallback Callback,
619 void *OpaqueHandle);
620
621/**
622 * Retrieve whether the given context is set to discard all value names.
623 *
624 * @see LLVMContext::shouldDiscardValueNames()
625 */
627
628/**
629 * Set whether the given context discards all value names.
630 *
631 * If true, only the names of GlobalValue objects will be available in the IR.
632 * This can be used to save memory and runtime, especially in release mode.
633 *
634 * @see LLVMContext::setDiscardValueNames()
635 */
637 LLVMBool Discard);
638
639/**
640 * Destroy a context instance.
641 *
642 * This should be called for every call to LLVMContextCreate() or memory
643 * will be leaked.
644 */
646
647/**
648 * Return a string representation of the DiagnosticInfo. Use
649 * LLVMDisposeMessage to free the string.
650 *
651 * @see DiagnosticInfo::print()
652 */
654
655/**
656 * Return an enum LLVMDiagnosticSeverity.
657 *
658 * @see DiagnosticInfo::getSeverity()
659 */
662
663LLVM_C_ABI unsigned LLVMGetMDKindIDInContext(LLVMContextRef C, const char *Name,
664 unsigned SLen);
665LLVM_C_ABI unsigned LLVMGetMDKindID(const char *Name, unsigned SLen);
666
667/**
668 * Maps a synchronization scope name to a ID unique within this context.
669 */
670LLVM_C_ABI unsigned LLVMGetSyncScopeID(LLVMContextRef C, const char *Name,
671 size_t SLen);
672
673/**
674 * Return an unique id given the name of a enum attribute,
675 * or 0 if no attribute by that name exists.
676 *
677 * See http://llvm.org/docs/LangRef.html#parameter-attributes
678 * and http://llvm.org/docs/LangRef.html#function-attributes
679 * for the list of available attributes.
680 *
681 * NB: Attribute names and/or id are subject to change without
682 * going through the C API deprecation cycle.
683 */
684LLVM_C_ABI unsigned LLVMGetEnumAttributeKindForName(const char *Name,
685 size_t SLen);
687
688/**
689 * Create an enum attribute.
690 */
692 unsigned KindID,
693 uint64_t Val);
694
695/**
696 * Get the unique id corresponding to the enum attribute
697 * passed as argument.
698 */
700
701/**
702 * Get the enum attribute's value. 0 is returned if none exists.
703 */
705
706/**
707 * Create a type attribute
708 */
710 unsigned KindID,
711 LLVMTypeRef type_ref);
712
713/**
714 * Get the type attribute's value.
715 */
717
718/**
719 * Create a ConstantRange attribute.
720 *
721 * LowerWords and UpperWords need to be NumBits divided by 64 rounded up
722 * elements long.
723 */
725 LLVMContextRef C, unsigned KindID, unsigned NumBits,
726 const uint64_t LowerWords[], const uint64_t UpperWords[]);
727
728/**
729 * Create a string attribute.
730 */
732 const char *K,
733 unsigned KLength,
734 const char *V,
735 unsigned VLength);
736
737/**
738 * Get the string attribute's kind.
739 */
741 unsigned *Length);
742
743/**
744 * Get the string attribute's value.
745 */
747 unsigned *Length);
748
749/**
750 * Check for the different types of attributes.
751 */
755
756/**
757 * Obtain a Type from a context by its registered name.
758 */
760
761/**
762 * @}
763 */
764
765/**
766 * @defgroup LLVMCCoreModule Modules
767 *
768 * Modules represent the top-level structure in an LLVM program. An LLVM
769 * module is effectively a translation unit or a collection of
770 * translation units merged together.
771 *
772 * @{
773 */
774
775/**
776 * Create a new, empty module in the global context.
777 *
778 * This is equivalent to calling LLVMModuleCreateWithNameInContext with
779 * LLVMGetGlobalContext() as the context parameter.
780 *
781 * Every invocation should be paired with LLVMDisposeModule() or memory
782 * will be leaked.
783 */
785
786/**
787 * Create a new, empty module in a specific context.
788 *
789 * Every invocation should be paired with LLVMDisposeModule() or memory
790 * will be leaked.
791 */
794/**
795 * Return an exact copy of the specified module.
796 */
798
799/**
800 * Destroy a module instance.
801 *
802 * This must be called for every created module or memory will be
803 * leaked.
804 */
806
807/**
808 * Soon to be deprecated.
809 * See https://llvm.org/docs/RemoveDIsDebugInfo.html#c-api-changes
810 *
811 * Returns true if the module is in the new debug info mode which uses
812 * non-instruction debug records instead of debug intrinsics for variable
813 * location tracking.
814 */
816
817/**
818 * Soon to be deprecated.
819 * See https://llvm.org/docs/RemoveDIsDebugInfo.html#c-api-changes
820 *
821 * Convert module into desired debug info format.
822 */
824 LLVMBool UseNewFormat);
825
826/**
827 * Obtain the identifier of a module.
828 *
829 * @param M Module to obtain identifier of
830 * @param Len Out parameter which holds the length of the returned string.
831 * @return The identifier of M.
832 * @see Module::getModuleIdentifier()
833 */
834LLVM_C_ABI const char *LLVMGetModuleIdentifier(LLVMModuleRef M, size_t *Len);
835
836/**
837 * Set the identifier of a module to a string Ident with length Len.
838 *
839 * @param M The module to set identifier
840 * @param Ident The string to set M's identifier to
841 * @param Len Length of Ident
842 * @see Module::setModuleIdentifier()
843 */
844LLVM_C_ABI void LLVMSetModuleIdentifier(LLVMModuleRef M, const char *Ident,
845 size_t Len);
846
847/**
848 * Obtain the module's original source file name.
849 *
850 * @param M Module to obtain the name of
851 * @param Len Out parameter which holds the length of the returned string
852 * @return The original source file name of M
853 * @see Module::getSourceFileName()
854 */
855LLVM_C_ABI const char *LLVMGetSourceFileName(LLVMModuleRef M, size_t *Len);
856
857/**
858 * Set the original source file name of a module to a string Name with length
859 * Len.
860 *
861 * @param M The module to set the source file name of
862 * @param Name The string to set M's source file name to
863 * @param Len Length of Name
864 * @see Module::setSourceFileName()
865 */
866LLVM_C_ABI void LLVMSetSourceFileName(LLVMModuleRef M, const char *Name,
867 size_t Len);
868
869/**
870 * Obtain the data layout for a module.
871 *
872 * @see Module::getDataLayoutStr()
873 *
874 * LLVMGetDataLayout is DEPRECATED, as the name is not only incorrect,
875 * but match the name of another method on the module. Prefer the use
876 * of LLVMGetDataLayoutStr, which is not ambiguous.
877 */
880
881/**
882 * Set the data layout for a module.
883 *
884 * @see Module::setDataLayout()
885 */
886LLVM_C_ABI void LLVMSetDataLayout(LLVMModuleRef M, const char *DataLayoutStr);
887
888/**
889 * Obtain the target triple for a module.
890 *
891 * @see Module::getTargetTriple()
892 */
894
895/**
896 * Set the target triple for a module.
897 *
898 * @see Module::setTargetTriple()
899 */
900LLVM_C_ABI void LLVMSetTarget(LLVMModuleRef M, const char *Triple);
901
902/**
903 * Returns the module flags as an array of flag-key-value triples. The caller
904 * is responsible for freeing this array by calling
905 * \c LLVMDisposeModuleFlagsMetadata.
906 *
907 * @see Module::getModuleFlagsMetadata()
908 */
910 size_t *Len);
911
912/**
913 * Destroys module flags metadata entries.
914 */
916
917/**
918 * Returns the flag behavior for a module flag entry at a specific index.
919 *
920 * @see Module::ModuleFlagEntry::Behavior
921 */
923 LLVMModuleFlagEntry *Entries, unsigned Index);
924
925/**
926 * Returns the key for a module flag entry at a specific index.
927 *
928 * @see Module::ModuleFlagEntry::Key
929 */
931 unsigned Index, size_t *Len);
932
933/**
934 * Returns the metadata for a module flag entry at a specific index.
935 *
936 * @see Module::ModuleFlagEntry::Val
937 */
940
941/**
942 * Add a module-level flag to the module-level flags metadata if it doesn't
943 * already exist.
944 *
945 * @see Module::getModuleFlag()
946 */
948 size_t KeyLen);
949
950/**
951 * Add a module-level flag to the module-level flags metadata if it doesn't
952 * already exist.
953 *
954 * @see Module::addModuleFlag()
955 */
957 LLVMModuleFlagBehavior Behavior,
958 const char *Key, size_t KeyLen,
959 LLVMMetadataRef Val);
960
961/**
962 * Dump a representation of a module to stderr.
963 *
964 * @see Module::dump()
965 */
967
968/**
969 * Print a representation of a module to a file. The ErrorMessage needs to be
970 * disposed with LLVMDisposeMessage. Returns 0 on success, 1 otherwise.
971 *
972 * @see Module::print()
973 */
975 char **ErrorMessage);
976
977/**
978 * Return a string representation of the module. Use
979 * LLVMDisposeMessage to free the string.
980 *
981 * @see Module::print()
982 */
984
985/**
986 * Get inline assembly for a module.
987 *
988 * @see Module::getModuleInlineAsm()
989 */
990LLVM_C_ABI const char *LLVMGetModuleInlineAsm(LLVMModuleRef M, size_t *Len);
991
992/**
993 * Set inline assembly for a module.
994 *
995 * @see Module::setModuleInlineAsm()
996 */
997LLVM_C_ABI void LLVMSetModuleInlineAsm2(LLVMModuleRef M, const char *Asm,
998 size_t Len);
999
1000/**
1001 * Append inline assembly to a module.
1002 *
1003 * @see Module::appendModuleInlineAsm()
1004 */
1005LLVM_C_ABI void LLVMAppendModuleInlineAsm(LLVMModuleRef M, const char *Asm,
1006 size_t Len);
1007
1008/**
1009 * Create the specified uniqued inline asm string.
1010 *
1011 * @see InlineAsm::get()
1012 */
1014 LLVMTypeRef Ty, const char *AsmString, size_t AsmStringSize,
1015 const char *Constraints, size_t ConstraintsSize, LLVMBool HasSideEffects,
1016 LLVMBool IsAlignStack, LLVMInlineAsmDialect Dialect, LLVMBool CanThrow);
1017
1018/**
1019 * Get the template string used for an inline assembly snippet
1020 *
1021 */
1022LLVM_C_ABI const char *LLVMGetInlineAsmAsmString(LLVMValueRef InlineAsmVal,
1023 size_t *Len);
1024
1025/**
1026 * Get the raw constraint string for an inline assembly snippet
1027 *
1028 */
1029LLVM_C_ABI const char *
1030LLVMGetInlineAsmConstraintString(LLVMValueRef InlineAsmVal, size_t *Len);
1031
1032/**
1033 * Get the dialect used by the inline asm snippet
1034 *
1035 */
1038
1039/**
1040 * Get the function type of the inline assembly snippet. The same type that
1041 * was passed into LLVMGetInlineAsm originally
1042 *
1043 * @see LLVMGetInlineAsm
1044 *
1045 */
1047
1048/**
1049 * Get if the inline asm snippet has side effects
1050 *
1051 */
1053
1054/**
1055 * Get if the inline asm snippet needs an aligned stack
1056 *
1057 */
1060
1061/**
1062 * Get if the inline asm snippet may unwind the stack
1063 *
1064 */
1066
1067/**
1068 * Obtain the context to which this module is associated.
1069 *
1070 * @see Module::getContext()
1071 */
1073
1074/** Deprecated: Use LLVMGetTypeByName2 instead. */
1076
1077/**
1078 * Obtain an iterator to the first NamedMDNode in a Module.
1079 *
1080 * @see llvm::Module::named_metadata_begin()
1081 */
1083
1084/**
1085 * Obtain an iterator to the last NamedMDNode in a Module.
1086 *
1087 * @see llvm::Module::named_metadata_end()
1088 */
1090
1091/**
1092 * Advance a NamedMDNode iterator to the next NamedMDNode.
1093 *
1094 * Returns NULL if the iterator was already at the end and there are no more
1095 * named metadata nodes.
1096 */
1099
1100/**
1101 * Decrement a NamedMDNode iterator to the previous NamedMDNode.
1102 *
1103 * Returns NULL if the iterator was already at the beginning and there are
1104 * no previous named metadata nodes.
1105 */
1108
1109/**
1110 * Retrieve a NamedMDNode with the given name, returning NULL if no such
1111 * node exists.
1112 *
1113 * @see llvm::Module::getNamedMetadata()
1114 */
1116 const char *Name,
1117 size_t NameLen);
1118
1119/**
1120 * Retrieve a NamedMDNode with the given name, creating a new node if no such
1121 * node exists.
1122 *
1123 * @see llvm::Module::getOrInsertNamedMetadata()
1124 */
1126 const char *Name,
1127 size_t NameLen);
1128
1129/**
1130 * Retrieve the name of a NamedMDNode.
1131 *
1132 * @see llvm::NamedMDNode::getName()
1133 */
1135 size_t *NameLen);
1136
1137/**
1138 * Obtain the number of operands for named metadata in a module.
1139 *
1140 * @see llvm::Module::getNamedMetadata()
1141 */
1143 const char *Name);
1144
1145/**
1146 * Obtain the named metadata operands for a module.
1147 *
1148 * The passed LLVMValueRef pointer should refer to an array of
1149 * LLVMValueRef at least LLVMGetNamedMetadataNumOperands long. This
1150 * array will be populated with the LLVMValueRef instances. Each
1151 * instance corresponds to a llvm::MDNode.
1152 *
1153 * @see llvm::Module::getNamedMetadata()
1154 * @see llvm::MDNode::getOperand()
1155 */
1157 LLVMValueRef *Dest);
1158
1159/**
1160 * Add an operand to named metadata.
1161 *
1162 * @see llvm::Module::getNamedMetadata()
1163 * @see llvm::MDNode::addOperand()
1164 */
1166 LLVMValueRef Val);
1167
1168/**
1169 * Return the directory of the debug location for this value, which must be
1170 * an llvm::Instruction, llvm::GlobalVariable, or llvm::Function.
1171 *
1172 * @see llvm::Instruction::getDebugLoc()
1173 * @see llvm::GlobalVariable::getDebugInfo()
1174 * @see llvm::Function::getSubprogram()
1175 */
1177 unsigned *Length);
1178
1179/**
1180 * Return the filename of the debug location for this value, which must be
1181 * an llvm::Instruction, llvm::GlobalVariable, or llvm::Function.
1182 *
1183 * @see llvm::Instruction::getDebugLoc()
1184 * @see llvm::GlobalVariable::getDebugInfo()
1185 * @see llvm::Function::getSubprogram()
1186 */
1188 unsigned *Length);
1189
1190/**
1191 * Return the line number of the debug location for this value, which must be
1192 * an llvm::Instruction, llvm::GlobalVariable, or llvm::Function.
1193 *
1194 * @see llvm::Instruction::getDebugLoc()
1195 * @see llvm::GlobalVariable::getDebugInfo()
1196 * @see llvm::Function::getSubprogram()
1197 */
1199
1200/**
1201 * Return the column number of the debug location for this value, which must be
1202 * an llvm::Instruction.
1203 *
1204 * @see llvm::Instruction::getDebugLoc()
1205 */
1207
1208/**
1209 * Add a function to a module under a specified name.
1210 *
1211 * @see llvm::Function::Create()
1212 */
1214 LLVMTypeRef FunctionTy);
1215
1216/**
1217 * Obtain or insert a function into a module.
1218 *
1219 * If a function with the specified name already exists in the module, it
1220 * is returned. Otherwise, a new function is created in the module with the
1221 * specified name and type and is returned.
1222 *
1223 * The returned value corresponds to a llvm::Function instance.
1224 *
1225 * @see llvm::Module::getOrInsertFunction()
1226 */
1228 const char *Name,
1229 size_t NameLen,
1230 LLVMTypeRef FunctionTy);
1231
1232/**
1233 * Obtain a Function value from a Module by its name.
1234 *
1235 * The returned value corresponds to a llvm::Function value.
1236 *
1237 * @see llvm::Module::getFunction()
1238 */
1240
1241/**
1242 * Obtain a Function value from a Module by its name.
1243 *
1244 * The returned value corresponds to a llvm::Function value.
1245 *
1246 * @see llvm::Module::getFunction()
1247 */
1249 const char *Name,
1250 size_t Length);
1251
1252/**
1253 * Obtain an iterator to the first Function in a Module.
1254 *
1255 * @see llvm::Module::begin()
1256 */
1258
1259/**
1260 * Obtain an iterator to the last Function in a Module.
1261 *
1262 * @see llvm::Module::end()
1263 */
1265
1266/**
1267 * Advance a Function iterator to the next Function.
1268 *
1269 * Returns NULL if the iterator was already at the end and there are no more
1270 * functions.
1271 */
1273
1274/**
1275 * Decrement a Function iterator to the previous Function.
1276 *
1277 * Returns NULL if the iterator was already at the beginning and there are
1278 * no previous functions.
1279 */
1281
1282/** Deprecated: Use LLVMSetModuleInlineAsm2 instead. */
1283LLVM_C_ABI void LLVMSetModuleInlineAsm(LLVMModuleRef M, const char *Asm);
1284
1285/**
1286 * @}
1287 */
1288
1289/**
1290 * @defgroup LLVMCCoreType Types
1291 *
1292 * Types represent the type of a value.
1293 *
1294 * Types are associated with a context instance. The context internally
1295 * deduplicates types so there is only 1 instance of a specific type
1296 * alive at a time. In other words, a unique type is shared among all
1297 * consumers within a context.
1298 *
1299 * A Type in the C API corresponds to llvm::Type.
1300 *
1301 * Types have the following hierarchy:
1302 *
1303 * types:
1304 * integer type
1305 * real type
1306 * function type
1307 * sequence types:
1308 * array type
1309 * pointer type
1310 * vector type
1311 * void type
1312 * label type
1313 * opaque type
1314 *
1315 * @{
1316 */
1317
1318/**
1319 * Obtain the enumerated type of a Type instance.
1320 *
1321 * @see llvm::Type:getTypeID()
1322 */
1324
1325/**
1326 * Whether the type has a known size.
1327 *
1328 * Things that don't have a size are abstract types, labels, and void.a
1329 *
1330 * @see llvm::Type::isSized()
1331 */
1333
1334/**
1335 * Obtain the context to which this type instance is associated.
1336 *
1337 * @see llvm::Type::getContext()
1338 */
1340
1341/**
1342 * Dump a representation of a type to stderr.
1343 *
1344 * @see llvm::Type::dump()
1345 */
1347
1348/**
1349 * Return a string representation of the type. Use
1350 * LLVMDisposeMessage to free the string.
1351 *
1352 * @see llvm::Type::print()
1353 */
1355
1356/**
1357 * @defgroup LLVMCCoreTypeInt Integer Types
1358 *
1359 * Functions in this section operate on integer types.
1360 *
1361 * @{
1362 */
1363
1364/**
1365 * Obtain an integer type from a context with specified bit width.
1366 */
1374
1375/**
1376 * Obtain an integer type from the global context with a specified bit
1377 * width.
1378 */
1385LLVM_C_ABI LLVMTypeRef LLVMIntType(unsigned NumBits);
1386LLVM_C_ABI unsigned LLVMGetIntTypeWidth(LLVMTypeRef IntegerTy);
1387
1388/**
1389 * @}
1390 */
1391
1392/**
1393 * @defgroup LLVMCCoreTypeFloat Floating Point Types
1394 *
1395 * @{
1396 */
1397
1398/**
1399 * Obtain a 16-bit floating point type from a context.
1400 */
1402
1403/**
1404 * Obtain a 16-bit brain floating point type from a context.
1405 */
1407
1408/**
1409 * Obtain a 32-bit floating point type from a context.
1410 */
1412
1413/**
1414 * Obtain a 64-bit floating point type from a context.
1415 */
1417
1418/**
1419 * Obtain a 80-bit floating point type (X87) from a context.
1420 */
1422
1423/**
1424 * Obtain a 128-bit floating point type (112-bit mantissa) from a
1425 * context.
1426 */
1428
1429/**
1430 * Obtain a 128-bit floating point type (two 64-bits) from a context.
1431 */
1433
1434/**
1435 * Obtain a floating point type from the global context.
1436 *
1437 * These map to the functions in this group of the same name.
1438 */
1446
1447/**
1448 * @}
1449 */
1450
1451/**
1452 * @defgroup LLVMCCoreTypeFunction Function Types
1453 *
1454 * @{
1455 */
1456
1457/**
1458 * Obtain a function type consisting of a specified signature.
1459 *
1460 * The function is defined as a tuple of a return Type, a list of
1461 * parameter types, and whether the function is variadic.
1462 */
1464 LLVMTypeRef *ParamTypes,
1465 unsigned ParamCount, LLVMBool IsVarArg);
1466
1467/**
1468 * Returns whether a function type is variadic.
1469 */
1471
1472/**
1473 * Obtain the Type this function Type returns.
1474 */
1476
1477/**
1478 * Obtain the number of parameters this function accepts.
1479 */
1480LLVM_C_ABI unsigned LLVMCountParamTypes(LLVMTypeRef FunctionTy);
1481
1482/**
1483 * Obtain the types of a function's parameters.
1484 *
1485 * The Dest parameter should point to a pre-allocated array of
1486 * LLVMTypeRef at least LLVMCountParamTypes() large. On return, the
1487 * first LLVMCountParamTypes() entries in the array will be populated
1488 * with LLVMTypeRef instances.
1489 *
1490 * @param FunctionTy The function type to operate on.
1491 * @param Dest Memory address of an array to be filled with result.
1492 */
1493LLVM_C_ABI void LLVMGetParamTypes(LLVMTypeRef FunctionTy, LLVMTypeRef *Dest);
1494
1495/**
1496 * @}
1497 */
1498
1499/**
1500 * @defgroup LLVMCCoreTypeStruct Structure Types
1501 *
1502 * These functions relate to LLVMTypeRef instances.
1503 *
1504 * @see llvm::StructType
1505 *
1506 * @{
1507 */
1508
1509/**
1510 * Create a new structure type in a context.
1511 *
1512 * A structure is specified by a list of inner elements/types and
1513 * whether these can be packed together.
1514 *
1515 * @see llvm::StructType::create()
1516 */
1518 LLVMTypeRef *ElementTypes,
1519 unsigned ElementCount,
1520 LLVMBool Packed);
1521
1522/**
1523 * Create a new structure type in the global context.
1524 *
1525 * @see llvm::StructType::create()
1526 */
1528 unsigned ElementCount, LLVMBool Packed);
1529
1530/**
1531 * Create an empty structure in a context having a specified name.
1532 *
1533 * @see llvm::StructType::create()
1534 */
1536 const char *Name);
1537
1538/**
1539 * Obtain the name of a structure.
1540 *
1541 * @see llvm::StructType::getName()
1542 */
1544
1545/**
1546 * Set the contents of a structure type.
1547 *
1548 * @see llvm::StructType::setBody()
1549 */
1551 LLVMTypeRef *ElementTypes,
1552 unsigned ElementCount, LLVMBool Packed);
1553
1554/**
1555 * Get the number of elements defined inside the structure.
1556 *
1557 * @see llvm::StructType::getNumElements()
1558 */
1560
1561/**
1562 * Get the elements within a structure.
1563 *
1564 * The function is passed the address of a pre-allocated array of
1565 * LLVMTypeRef at least LLVMCountStructElementTypes() long. After
1566 * invocation, this array will be populated with the structure's
1567 * elements. The objects in the destination array will have a lifetime
1568 * of the structure type itself, which is the lifetime of the context it
1569 * is contained in.
1570 */
1572 LLVMTypeRef *Dest);
1573
1574/**
1575 * Get the type of the element at a given index in the structure.
1576 *
1577 * @see llvm::StructType::getTypeAtIndex()
1578 */
1580 unsigned i);
1581
1582/**
1583 * Determine whether a structure is packed.
1584 *
1585 * @see llvm::StructType::isPacked()
1586 */
1588
1589/**
1590 * Determine whether a structure is opaque.
1591 *
1592 * @see llvm::StructType::isOpaque()
1593 */
1595
1596/**
1597 * Determine whether a structure is literal.
1598 *
1599 * @see llvm::StructType::isLiteral()
1600 */
1602
1603/**
1604 * @}
1605 */
1606
1607/**
1608 * @defgroup LLVMCCoreTypeSequential Sequential Types
1609 *
1610 * Sequential types represents "arrays" of types. This is a super class
1611 * for array, vector, and pointer types.
1612 *
1613 * @{
1614 */
1615
1616/**
1617 * Obtain the element type of an array or vector type.
1618 *
1619 * @see llvm::SequentialType::getElementType()
1620 */
1622
1623/**
1624 * Returns type's subtypes
1625 *
1626 * @see llvm::Type::subtypes()
1627 */
1629
1630/**
1631 * Return the number of types in the derived type.
1632 *
1633 * @see llvm::Type::getNumContainedTypes()
1634 */
1636
1637/**
1638 * Create a fixed size array type that refers to a specific type.
1639 *
1640 * The created type will exist in the context that its element type
1641 * exists in.
1642 *
1643 * @deprecated LLVMArrayType is deprecated in favor of the API accurate
1644 * LLVMArrayType2
1645 * @see llvm::ArrayType::get()
1646 */
1648 unsigned ElementCount);
1649
1650/**
1651 * Create a fixed size array type that refers to a specific type.
1652 *
1653 * The created type will exist in the context that its element type
1654 * exists in.
1655 *
1656 * @see llvm::ArrayType::get()
1657 */
1659 uint64_t ElementCount);
1660
1661/**
1662 * Obtain the length of an array type.
1663 *
1664 * This only works on types that represent arrays.
1665 *
1666 * @deprecated LLVMGetArrayLength is deprecated in favor of the API accurate
1667 * LLVMGetArrayLength2
1668 * @see llvm::ArrayType::getNumElements()
1669 */
1670LLVM_C_ABI unsigned LLVMGetArrayLength(LLVMTypeRef ArrayTy);
1671
1672/**
1673 * Obtain the length of an array type.
1674 *
1675 * This only works on types that represent arrays.
1676 *
1677 * @see llvm::ArrayType::getNumElements()
1678 */
1680
1681/**
1682 * Create a pointer type that points to a defined type.
1683 *
1684 * The created type will exist in the context that its pointee type
1685 * exists in.
1686 *
1687 * @see llvm::PointerType::get()
1688 */
1690 unsigned AddressSpace);
1691
1692/**
1693 * Determine whether a pointer is opaque.
1694 *
1695 * True if this is an instance of an opaque PointerType.
1696 *
1697 * @see llvm::Type::isOpaquePointerTy()
1698 */
1700
1701/**
1702 * Create an opaque pointer type in a context.
1703 *
1704 * @see llvm::PointerType::get()
1705 */
1707 unsigned AddressSpace);
1708
1709/**
1710 * Obtain the address space of a pointer type.
1711 *
1712 * This only works on types that represent pointers.
1713 *
1714 * @see llvm::PointerType::getAddressSpace()
1715 */
1717
1718/**
1719 * Create a vector type that contains a defined type and has a specific
1720 * number of elements.
1721 *
1722 * The created type will exist in the context thats its element type
1723 * exists in.
1724 *
1725 * @see llvm::VectorType::get()
1726 */
1728 unsigned ElementCount);
1729
1730/**
1731 * Create a vector type that contains a defined type and has a scalable
1732 * number of elements.
1733 *
1734 * The created type will exist in the context thats its element type
1735 * exists in.
1736 *
1737 * @see llvm::ScalableVectorType::get()
1738 */
1740 unsigned ElementCount);
1741
1742/**
1743 * Obtain the (possibly scalable) number of elements in a vector type.
1744 *
1745 * This only works on types that represent vectors (fixed or scalable).
1746 *
1747 * @see llvm::VectorType::getNumElements()
1748 */
1749LLVM_C_ABI unsigned LLVMGetVectorSize(LLVMTypeRef VectorTy);
1750
1751/**
1752 * Get the pointer value for the associated ConstantPtrAuth constant.
1753 *
1754 * @see llvm::ConstantPtrAuth::getPointer
1755 */
1757
1758/**
1759 * Get the key value for the associated ConstantPtrAuth constant.
1760 *
1761 * @see llvm::ConstantPtrAuth::getKey
1762 */
1764
1765/**
1766 * Get the discriminator value for the associated ConstantPtrAuth constant.
1767 *
1768 * @see llvm::ConstantPtrAuth::getDiscriminator
1769 */
1772
1773/**
1774 * Get the address discriminator value for the associated ConstantPtrAuth
1775 * constant.
1776 *
1777 * @see llvm::ConstantPtrAuth::getAddrDiscriminator
1778 */
1781
1782/**
1783 * @}
1784 */
1785
1786/**
1787 * @defgroup LLVMCCoreTypeOther Other Types
1788 *
1789 * @{
1790 */
1791
1792/**
1793 * Create a void type in a context.
1794 */
1796
1797/**
1798 * Create a label type in a context.
1799 */
1801
1802/**
1803 * Create a X86 AMX type in a context.
1804 */
1806
1807/**
1808 * Create a token type in a context.
1809 */
1811
1812/**
1813 * Create a metadata type in a context.
1814 */
1816
1817/**
1818 * These are similar to the above functions except they operate on the
1819 * global context.
1820 */
1824
1825/**
1826 * Create a target extension type in LLVM context.
1827 */
1829 LLVMContextRef C, const char *Name, LLVMTypeRef *TypeParams,
1830 unsigned TypeParamCount, unsigned *IntParams, unsigned IntParamCount);
1831
1832/**
1833 * Obtain the name for this target extension type.
1834 *
1835 * @see llvm::TargetExtType::getName()
1836 */
1837LLVM_C_ABI const char *LLVMGetTargetExtTypeName(LLVMTypeRef TargetExtTy);
1838
1839/**
1840 * Obtain the number of type parameters for this target extension type.
1841 *
1842 * @see llvm::TargetExtType::getNumTypeParameters()
1843 */
1845
1846/**
1847 * Get the type parameter at the given index for the target extension type.
1848 *
1849 * @see llvm::TargetExtType::getTypeParameter()
1850 */
1852 unsigned Idx);
1853
1854/**
1855 * Obtain the number of int parameters for this target extension type.
1856 *
1857 * @see llvm::TargetExtType::getNumIntParameters()
1858 */
1860
1861/**
1862 * Get the int parameter at the given index for the target extension type.
1863 *
1864 * @see llvm::TargetExtType::getIntParameter()
1865 */
1867 unsigned Idx);
1868
1869/**
1870 * @}
1871 */
1872
1873/**
1874 * @}
1875 */
1876
1877/**
1878 * @defgroup LLVMCCoreValues Values
1879 *
1880 * The bulk of LLVM's object model consists of values, which comprise a very
1881 * rich type hierarchy.
1882 *
1883 * LLVMValueRef essentially represents llvm::Value. There is a rich
1884 * hierarchy of classes within this type. Depending on the instance
1885 * obtained, not all APIs are available.
1886 *
1887 * Callers can determine the type of an LLVMValueRef by calling the
1888 * LLVMIsA* family of functions (e.g. LLVMIsAArgument()). These
1889 * functions are defined by a macro, so it isn't obvious which are
1890 * available by looking at the Doxygen source code. Instead, look at the
1891 * source definition of LLVM_FOR_EACH_VALUE_SUBCLASS and note the list
1892 * of value names given. These value names also correspond to classes in
1893 * the llvm::Value hierarchy.
1894 *
1895 * @{
1896 */
1897
1898// Currently, clang-format tries to format the LLVM_FOR_EACH_VALUE_SUBCLASS
1899// macro in a progressively-indented fashion, which is not desired
1900// clang-format off
1901
1902#define LLVM_FOR_EACH_VALUE_SUBCLASS(macro) \
1903 macro(Argument) \
1904 macro(BasicBlock) \
1905 macro(InlineAsm) \
1906 macro(User) \
1907 macro(Constant) \
1908 macro(BlockAddress) \
1909 macro(ConstantAggregateZero) \
1910 macro(ConstantArray) \
1911 macro(ConstantDataSequential) \
1912 macro(ConstantDataArray) \
1913 macro(ConstantDataVector) \
1914 macro(ConstantExpr) \
1915 macro(ConstantFP) \
1916 macro(ConstantInt) \
1917 macro(ConstantPointerNull) \
1918 macro(ConstantStruct) \
1919 macro(ConstantTokenNone) \
1920 macro(ConstantVector) \
1921 macro(ConstantPtrAuth) \
1922 macro(GlobalValue) \
1923 macro(GlobalAlias) \
1924 macro(GlobalObject) \
1925 macro(Function) \
1926 macro(GlobalVariable) \
1927 macro(GlobalIFunc) \
1928 macro(UndefValue) \
1929 macro(PoisonValue) \
1930 macro(Instruction) \
1931 macro(UnaryOperator) \
1932 macro(BinaryOperator) \
1933 macro(CallInst) \
1934 macro(IntrinsicInst) \
1935 macro(DbgInfoIntrinsic) \
1936 macro(DbgVariableIntrinsic) \
1937 macro(DbgDeclareInst) \
1938 macro(DbgLabelInst) \
1939 macro(MemIntrinsic) \
1940 macro(MemCpyInst) \
1941 macro(MemMoveInst) \
1942 macro(MemSetInst) \
1943 macro(CmpInst) \
1944 macro(FCmpInst) \
1945 macro(ICmpInst) \
1946 macro(ExtractElementInst) \
1947 macro(GetElementPtrInst) \
1948 macro(InsertElementInst) \
1949 macro(InsertValueInst) \
1950 macro(LandingPadInst) \
1951 macro(PHINode) \
1952 macro(SelectInst) \
1953 macro(ShuffleVectorInst) \
1954 macro(StoreInst) \
1955 macro(BranchInst) \
1956 macro(IndirectBrInst) \
1957 macro(InvokeInst) \
1958 macro(ReturnInst) \
1959 macro(SwitchInst) \
1960 macro(UnreachableInst) \
1961 macro(ResumeInst) \
1962 macro(CleanupReturnInst) \
1963 macro(CatchReturnInst) \
1964 macro(CatchSwitchInst) \
1965 macro(CallBrInst) \
1966 macro(FuncletPadInst) \
1967 macro(CatchPadInst) \
1968 macro(CleanupPadInst) \
1969 macro(UnaryInstruction) \
1970 macro(AllocaInst) \
1971 macro(CastInst) \
1972 macro(AddrSpaceCastInst) \
1973 macro(BitCastInst) \
1974 macro(FPExtInst) \
1975 macro(FPToSIInst) \
1976 macro(FPToUIInst) \
1977 macro(FPTruncInst) \
1978 macro(IntToPtrInst) \
1979 macro(PtrToIntInst) \
1980 macro(SExtInst) \
1981 macro(SIToFPInst) \
1982 macro(TruncInst) \
1983 macro(UIToFPInst) \
1984 macro(ZExtInst) \
1985 macro(ExtractValueInst) \
1986 macro(LoadInst) \
1987 macro(VAArgInst) \
1988 macro(FreezeInst) \
1989 macro(AtomicCmpXchgInst) \
1990 macro(AtomicRMWInst) \
1991 macro(FenceInst)
1992
1993// clang-format on
1994
1995/**
1996 * @defgroup LLVMCCoreValueGeneral General APIs
1997 *
1998 * Functions in this section work on all LLVMValueRef instances,
1999 * regardless of their sub-type. They correspond to functions available
2000 * on llvm::Value.
2001 *
2002 * @{
2003 */
2004
2005/**
2006 * Obtain the type of a value.
2007 *
2008 * @see llvm::Value::getType()
2009 */
2011
2012/**
2013 * Obtain the enumerated type of a Value instance.
2014 *
2015 * @see llvm::Value::getValueID()
2016 */
2018
2019/**
2020 * Obtain the string name of a value.
2021 *
2022 * @see llvm::Value::getName()
2023 */
2024LLVM_C_ABI const char *LLVMGetValueName2(LLVMValueRef Val, size_t *Length);
2025
2026/**
2027 * Set the string name of a value.
2028 *
2029 * @see llvm::Value::setName()
2030 */
2031LLVM_C_ABI void LLVMSetValueName2(LLVMValueRef Val, const char *Name,
2032 size_t NameLen);
2033
2034/**
2035 * Dump a representation of a value to stderr.
2036 *
2037 * @see llvm::Value::dump()
2038 */
2040
2041/**
2042 * Return a string representation of the value. Use
2043 * LLVMDisposeMessage to free the string.
2044 *
2045 * @see llvm::Value::print()
2046 */
2048
2049/**
2050 * Obtain the context to which this value is associated.
2051 *
2052 * @see llvm::Value::getContext()
2053 */
2055
2056/**
2057 * Return a string representation of the DbgRecord. Use
2058 * LLVMDisposeMessage to free the string.
2059 *
2060 * @see llvm::DbgRecord::print()
2061 */
2063
2064/**
2065 * Replace all uses of a value with another one.
2066 *
2067 * @see llvm::Value::replaceAllUsesWith()
2068 */
2070 LLVMValueRef NewVal);
2071
2072/**
2073 * Determine whether the specified value instance is constant.
2074 */
2076
2077/**
2078 * Determine whether a value instance is undefined.
2079 */
2081
2082/**
2083 * Determine whether a value instance is poisonous.
2084 */
2086
2087/**
2088 * Convert value instances between types.
2089 *
2090 * Internally, an LLVMValueRef is "pinned" to a specific type. This
2091 * series of functions allows you to cast an instance to a specific
2092 * type.
2093 *
2094 * If the cast is not valid for the specified type, NULL is returned.
2095 *
2096 * @see llvm::dyn_cast_or_null<>
2097 */
2098#define LLVM_DECLARE_VALUE_CAST(name) \
2099 LLVM_C_ABI LLVMValueRef LLVMIsA##name(LLVMValueRef Val);
2101
2105
2106/** Deprecated: Use LLVMGetValueName2 instead. */
2108/** Deprecated: Use LLVMSetValueName2 instead. */
2109LLVM_C_ABI void LLVMSetValueName(LLVMValueRef Val, const char *Name);
2110
2111/**
2112 * @}
2113 */
2114
2115/**
2116 * @defgroup LLVMCCoreValueUses Usage
2117 *
2118 * This module defines functions that allow you to inspect the uses of a
2119 * LLVMValueRef.
2120 *
2121 * It is possible to obtain an LLVMUseRef for any LLVMValueRef instance.
2122 * Each LLVMUseRef (which corresponds to a llvm::Use instance) holds a
2123 * llvm::User and llvm::Value.
2124 *
2125 * @{
2126 */
2127
2128/**
2129 * Obtain the first use of a value.
2130 *
2131 * Uses are obtained in an iterator fashion. First, call this function
2132 * to obtain a reference to the first use. Then, call LLVMGetNextUse()
2133 * on that instance and all subsequently obtained instances until
2134 * LLVMGetNextUse() returns NULL.
2135 *
2136 * @see llvm::Value::use_begin()
2137 */
2139
2140/**
2141 * Obtain the next use of a value.
2142 *
2143 * This effectively advances the iterator. It returns NULL if you are on
2144 * the final use and no more are available.
2145 */
2147
2148/**
2149 * Obtain the user value for a user.
2150 *
2151 * The returned value corresponds to a llvm::User type.
2152 *
2153 * @see llvm::Use::getUser()
2154 */
2156
2157/**
2158 * Obtain the value this use corresponds to.
2159 *
2160 * @see llvm::Use::get().
2161 */
2163
2164/**
2165 * @}
2166 */
2167
2168/**
2169 * @defgroup LLVMCCoreValueUser User value
2170 *
2171 * Function in this group pertain to LLVMValueRef instances that descent
2172 * from llvm::User. This includes constants, instructions, and
2173 * operators.
2174 *
2175 * @{
2176 */
2177
2178/**
2179 * Obtain an operand at a specific index in a llvm::User value.
2180 *
2181 * @see llvm::User::getOperand()
2182 */
2184
2185/**
2186 * Obtain the use of an operand at a specific index in a llvm::User value.
2187 *
2188 * @see llvm::User::getOperandUse()
2189 */
2191
2192/**
2193 * Set an operand at a specific index in a llvm::User value.
2194 *
2195 * @see llvm::User::setOperand()
2196 */
2197LLVM_C_ABI void LLVMSetOperand(LLVMValueRef User, unsigned Index,
2198 LLVMValueRef Val);
2199
2200/**
2201 * Obtain the number of operands in a llvm::User value.
2202 *
2203 * @see llvm::User::getNumOperands()
2204 */
2206
2207/**
2208 * @}
2209 */
2210
2211/**
2212 * @defgroup LLVMCCoreValueConstant Constants
2213 *
2214 * This section contains APIs for interacting with LLVMValueRef that
2215 * correspond to llvm::Constant instances.
2216 *
2217 * These functions will work for any LLVMValueRef in the llvm::Constant
2218 * class hierarchy.
2219 *
2220 * @{
2221 */
2222
2223/**
2224 * Obtain a constant value referring to the null instance of a type.
2225 *
2226 * @see llvm::Constant::getNullValue()
2227 */
2229
2230/**
2231 * Obtain a constant value referring to the instance of a type
2232 * consisting of all ones.
2233 *
2234 * This is only valid for integer types.
2235 *
2236 * @see llvm::Constant::getAllOnesValue()
2237 */
2239
2240/**
2241 * Obtain a constant value referring to an undefined value of a type.
2242 *
2243 * @see llvm::UndefValue::get()
2244 */
2246
2247/**
2248 * Obtain a constant value referring to a poison value of a type.
2249 *
2250 * @see llvm::PoisonValue::get()
2251 */
2253
2254/**
2255 * Determine whether a value instance is null.
2256 *
2257 * @see llvm::Constant::isNullValue()
2258 */
2260
2261/**
2262 * Obtain a constant that is a constant pointer pointing to NULL for a
2263 * specified type.
2264 */
2266
2267/**
2268 * @defgroup LLVMCCoreValueConstantScalar Scalar constants
2269 *
2270 * Functions in this group model LLVMValueRef instances that correspond
2271 * to constants referring to scalar types.
2272 *
2273 * For integer types, the LLVMTypeRef parameter should correspond to a
2274 * llvm::IntegerType instance and the returned LLVMValueRef will
2275 * correspond to a llvm::ConstantInt.
2276 *
2277 * For floating point types, the LLVMTypeRef returned corresponds to a
2278 * llvm::ConstantFP.
2279 *
2280 * @{
2281 */
2282
2283/**
2284 * Obtain a constant value for an integer type.
2285 *
2286 * The returned value corresponds to a llvm::ConstantInt.
2287 *
2288 * @see llvm::ConstantInt::get()
2289 *
2290 * @param IntTy Integer type to obtain value of.
2291 * @param N The value the returned instance should refer to.
2292 * @param SignExtend Whether to sign extend the produced value.
2293 */
2294LLVM_C_ABI LLVMValueRef LLVMConstInt(LLVMTypeRef IntTy, unsigned long long N,
2295 LLVMBool SignExtend);
2296
2297/**
2298 * Obtain a constant value for an integer of arbitrary precision.
2299 *
2300 * @see llvm::ConstantInt::get()
2301 */
2303 LLVMTypeRef IntTy, unsigned NumWords, const uint64_t Words[]);
2304
2305/**
2306 * Obtain a constant value for an integer parsed from a string.
2307 *
2308 * A similar API, LLVMConstIntOfStringAndSize is also available. If the
2309 * string's length is available, it is preferred to call that function
2310 * instead.
2311 *
2312 * @see llvm::ConstantInt::get()
2313 */
2315 const char *Text, uint8_t Radix);
2316
2317/**
2318 * Obtain a constant value for an integer parsed from a string with
2319 * specified length.
2320 *
2321 * @see llvm::ConstantInt::get()
2322 */
2324 const char *Text,
2325 unsigned SLen,
2326 uint8_t Radix);
2327
2328/**
2329 * Obtain a constant value referring to a double floating point value.
2330 */
2332
2333/**
2334 * Obtain a constant for a floating point value parsed from a string.
2335 *
2336 * A similar API, LLVMConstRealOfStringAndSize is also available. It
2337 * should be used if the input string's length is known.
2338 */
2340 const char *Text);
2341
2342/**
2343 * Obtain a constant for a floating point value parsed from a string.
2344 */
2346 const char *Text,
2347 unsigned SLen);
2348
2349/**
2350 * Obtain the zero extended value for an integer constant value.
2351 *
2352 * @see llvm::ConstantInt::getZExtValue()
2353 */
2354LLVM_C_ABI unsigned long long
2356
2357/**
2358 * Obtain the sign extended value for an integer constant value.
2359 *
2360 * @see llvm::ConstantInt::getSExtValue()
2361 */
2362LLVM_C_ABI long long LLVMConstIntGetSExtValue(LLVMValueRef ConstantVal);
2363
2364/**
2365 * Obtain the double value for an floating point constant value.
2366 * losesInfo indicates if some precision was lost in the conversion.
2367 *
2368 * @see llvm::ConstantFP::getDoubleValue
2369 */
2371 LLVMBool *losesInfo);
2372
2373/**
2374 * @}
2375 */
2376
2377/**
2378 * @defgroup LLVMCCoreValueConstantComposite Composite Constants
2379 *
2380 * Functions in this group operate on composite constants.
2381 *
2382 * @{
2383 */
2384
2385/**
2386 * Create a ConstantDataSequential and initialize it with a string.
2387 *
2388 * @deprecated LLVMConstStringInContext is deprecated in favor of the API
2389 * accurate LLVMConstStringInContext2
2390 * @see llvm::ConstantDataArray::getString()
2391 */
2393 const char *Str,
2394 unsigned Length,
2395 LLVMBool DontNullTerminate);
2396
2397/**
2398 * Create a ConstantDataSequential and initialize it with a string.
2399 *
2400 * @see llvm::ConstantDataArray::getString()
2401 */
2403 const char *Str,
2404 size_t Length,
2405 LLVMBool DontNullTerminate);
2406
2407/**
2408 * Create a ConstantDataSequential with string content in the global context.
2409 *
2410 * This is the same as LLVMConstStringInContext except it operates on the
2411 * global context.
2412 *
2413 * @see LLVMConstStringInContext()
2414 * @see llvm::ConstantDataArray::getString()
2415 */
2416LLVM_C_ABI LLVMValueRef LLVMConstString(const char *Str, unsigned Length,
2417 LLVMBool DontNullTerminate);
2418
2419/**
2420 * Returns true if the specified constant is an array of i8.
2421 *
2422 * @see ConstantDataSequential::getAsString()
2423 */
2425
2426/**
2427 * Get the given constant data sequential as a string.
2428 *
2429 * @see ConstantDataSequential::getAsString()
2430 */
2431LLVM_C_ABI const char *LLVMGetAsString(LLVMValueRef c, size_t *Length);
2432
2433/**
2434 * Get the raw, underlying bytes of the given constant data sequential.
2435 *
2436 * This is the same as LLVMGetAsString except it works for all constant data
2437 * sequentials, not just i8 arrays.
2438 *
2439 * @see ConstantDataSequential::getRawDataValues()
2440 */
2442 size_t *SizeInBytes);
2443
2444/**
2445 * Create an anonymous ConstantStruct with the specified values.
2446 *
2447 * @see llvm::ConstantStruct::getAnon()
2448 */
2450 LLVMValueRef *ConstantVals,
2451 unsigned Count,
2452 LLVMBool Packed);
2453
2454/**
2455 * Create a ConstantStruct in the global Context.
2456 *
2457 * This is the same as LLVMConstStructInContext except it operates on the
2458 * global Context.
2459 *
2460 * @see LLVMConstStructInContext()
2461 */
2463 unsigned Count, LLVMBool Packed);
2464
2465/**
2466 * Create a ConstantArray from values.
2467 *
2468 * @deprecated LLVMConstArray is deprecated in favor of the API accurate
2469 * LLVMConstArray2
2470 * @see llvm::ConstantArray::get()
2471 */
2473 LLVMValueRef *ConstantVals,
2474 unsigned Length);
2475
2476/**
2477 * Create a ConstantArray from values.
2478 *
2479 * @see llvm::ConstantArray::get()
2480 */
2482 LLVMValueRef *ConstantVals,
2483 uint64_t Length);
2484
2485/**
2486 * Create a ConstantDataArray from raw values.
2487 *
2488 * ElementTy must be one of i8, i16, i32, i64, half, bfloat, float, or double.
2489 * Data points to a contiguous buffer of raw values in the host endianness. The
2490 * element count is inferred from the element type and the data size in bytes.
2491 *
2492 * @see llvm::ConstantDataArray::getRaw()
2493 */
2495 const char *Data,
2496 size_t SizeInBytes);
2497
2498/**
2499 * Create a non-anonymous ConstantStruct from values.
2500 *
2501 * @see llvm::ConstantStruct::get()
2502 */
2504 LLVMValueRef *ConstantVals,
2505 unsigned Count);
2506
2507/**
2508 * Get element of a constant aggregate (struct, array or vector) at the
2509 * specified index. Returns null if the index is out of range, or it's not
2510 * possible to determine the element (e.g., because the constant is a
2511 * constant expression.)
2512 *
2513 * @see llvm::Constant::getAggregateElement()
2514 */
2516
2517/**
2518 * Get an element at specified index as a constant.
2519 *
2520 * @see ConstantDataSequential::getElementAsConstant()
2521 */
2524 "Use LLVMGetAggregateElement instead");
2525
2526/**
2527 * Create a ConstantVector from values.
2528 *
2529 * @see llvm::ConstantVector::get()
2530 */
2532 unsigned Size);
2533
2534/**
2535 * Create a ConstantPtrAuth constant with the given values.
2536 *
2537 * @see llvm::ConstantPtrAuth::get()
2538 */
2540 LLVMValueRef Disc,
2541 LLVMValueRef AddrDisc);
2542
2543/**
2544 * @}
2545 */
2546
2547/**
2548 * @defgroup LLVMCCoreValueConstantExpressions Constant Expressions
2549 *
2550 * Functions in this group correspond to APIs on llvm::ConstantExpr.
2551 *
2552 * @see llvm::ConstantExpr.
2553 *
2554 * @{
2555 */
2563 "Use LLVMConstNull instead.");
2566 LLVMValueRef RHSConstant);
2568 LLVMValueRef RHSConstant);
2570 LLVMValueRef RHSConstant);
2572 LLVMValueRef RHSConstant);
2574 LLVMValueRef RHSConstant);
2576 LLVMValueRef RHSConstant);
2578 LLVMValueRef RHSConstant);
2580 LLVMValueRef *ConstantIndices,
2581 unsigned NumIndices);
2583 LLVMValueRef ConstantVal,
2584 LLVMValueRef *ConstantIndices,
2585 unsigned NumIndices);
2586/**
2587 * Creates a constant GetElementPtr expression. Similar to LLVMConstGEP2, but
2588 * allows specifying the no-wrap flags.
2589 *
2590 * @see llvm::ConstantExpr::getGetElementPtr()
2591 */
2593 LLVMTypeRef Ty, LLVMValueRef ConstantVal, LLVMValueRef *ConstantIndices,
2594 unsigned NumIndices, LLVMGEPNoWrapFlags NoWrapFlags);
2596 LLVMTypeRef ToType);
2598 LLVMTypeRef ToType);
2600 LLVMTypeRef ToType);
2602 LLVMTypeRef ToType);
2604 LLVMTypeRef ToType);
2606 LLVMTypeRef ToType);
2608 LLVMTypeRef ToType);
2610 LLVMValueRef IndexConstant);
2612 LLVMValueRef VectorConstant, LLVMValueRef ElementValueConstant,
2613 LLVMValueRef IndexConstant);
2615 LLVMValueRef VectorBConstant,
2616 LLVMValueRef MaskConstant);
2618
2619/**
2620 * Gets the function associated with a given BlockAddress constant value.
2621 */
2623
2624/**
2625 * Gets the basic block associated with a given BlockAddress constant value.
2626 */
2629
2630/** Deprecated: Use LLVMGetInlineAsm instead. */
2632 const char *AsmString,
2633 const char *Constraints,
2634 LLVMBool HasSideEffects,
2635 LLVMBool IsAlignStack);
2636
2637/**
2638 * @}
2639 */
2640
2641/**
2642 * @defgroup LLVMCCoreValueConstantGlobals Global Values
2643 *
2644 * This group contains functions that operate on global values. Functions in
2645 * this group relate to functions in the llvm::GlobalValue class tree.
2646 *
2647 * @see llvm::GlobalValue
2648 *
2649 * @{
2650 */
2651
2656LLVM_C_ABI const char *LLVMGetSection(LLVMValueRef Global);
2657LLVM_C_ABI void LLVMSetSection(LLVMValueRef Global, const char *Section);
2662 LLVMDLLStorageClass Class);
2665 LLVMUnnamedAddr UnnamedAddr);
2666
2667/**
2668 * Returns the "value type" of a global value. This differs from the formal
2669 * type of a global value which is always a pointer type.
2670 *
2671 * @see llvm::GlobalValue::getValueType()
2672 * @see llvm::Function::getFunctionType()
2673 */
2675
2676/** Deprecated: Use LLVMGetUnnamedAddress instead. */
2678/** Deprecated: Use LLVMSetUnnamedAddress instead. */
2680 LLVMBool HasUnnamedAddr);
2681
2682/**
2683 * @defgroup LLVMCCoreValueWithAlignment Values with alignment
2684 *
2685 * Functions in this group only apply to values with alignment, i.e.
2686 * global variables, load and store instructions.
2687 */
2688
2689/**
2690 * Obtain the preferred alignment of the value.
2691 * @see llvm::AllocaInst::getAlignment()
2692 * @see llvm::LoadInst::getAlignment()
2693 * @see llvm::StoreInst::getAlignment()
2694 * @see llvm::AtomicRMWInst::setAlignment()
2695 * @see llvm::AtomicCmpXchgInst::setAlignment()
2696 * @see llvm::GlobalValue::getAlignment()
2697 */
2699
2700/**
2701 * Set the preferred alignment of the value.
2702 * @see llvm::AllocaInst::setAlignment()
2703 * @see llvm::LoadInst::setAlignment()
2704 * @see llvm::StoreInst::setAlignment()
2705 * @see llvm::AtomicRMWInst::setAlignment()
2706 * @see llvm::AtomicCmpXchgInst::setAlignment()
2707 * @see llvm::GlobalValue::setAlignment()
2708 */
2709LLVM_C_ABI void LLVMSetAlignment(LLVMValueRef V, unsigned Bytes);
2710
2711/**
2712 * Sets a metadata attachment, erasing the existing metadata attachment if
2713 * it already exists for the given kind.
2714 *
2715 * @see llvm::GlobalObject::setMetadata()
2716 */
2717LLVM_C_ABI void LLVMGlobalSetMetadata(LLVMValueRef Global, unsigned Kind,
2718 LLVMMetadataRef MD);
2719
2720/**
2721 * Adds a metadata attachment.
2722 *
2723 * @see llvm::GlobalObject::addMetadata()
2724 */
2725LLVM_C_ABI void LLVMGlobalAddMetadata(LLVMValueRef Global, unsigned Kind,
2726 LLVMMetadataRef MD);
2727
2728/**
2729 * Erases a metadata attachment of the given kind if it exists.
2730 *
2731 * @see llvm::GlobalObject::eraseMetadata()
2732 */
2733LLVM_C_ABI void LLVMGlobalEraseMetadata(LLVMValueRef Global, unsigned Kind);
2734
2735/**
2736 * Removes all metadata attachments from this value.
2737 *
2738 * @see llvm::GlobalObject::clearMetadata()
2739 */
2741
2742/**
2743 * Add debuginfo metadata to this global.
2744 *
2745 * @see llvm::GlobalVariable::addDebugInfo()
2746 */
2748 LLVMMetadataRef GVE);
2749
2750/**
2751 * Retrieves an array of metadata entries representing the metadata attached to
2752 * this value. The caller is responsible for freeing this array by calling
2753 * \c LLVMDisposeValueMetadataEntries.
2754 *
2755 * @see llvm::GlobalObject::getAllMetadata()
2756 */
2758LLVMGlobalCopyAllMetadata(LLVMValueRef Value, size_t *NumEntries);
2759
2760/**
2761 * Destroys value metadata entries.
2762 */
2763LLVM_C_ABI void
2765
2766/**
2767 * Returns the kind of a value metadata entry at a specific index.
2768 */
2769LLVM_C_ABI unsigned
2771 unsigned Index);
2772
2773/**
2774 * Returns the underlying metadata node of a value metadata entry at a
2775 * specific index.
2776 */
2778 LLVMValueMetadataEntry *Entries, unsigned Index);
2779
2780/**
2781 * @}
2782 */
2783
2784/**
2785 * @defgroup LLVMCoreValueConstantGlobalVariable Global Variables
2786 *
2787 * This group contains functions that operate on global variable values.
2788 *
2789 * @see llvm::GlobalVariable
2790 *
2791 * @{
2792 */
2794 const char *Name);
2796 LLVMTypeRef Ty,
2797 const char *Name,
2798 unsigned AddressSpace);
2801 const char *Name,
2802 size_t Length);
2810 LLVMValueRef ConstantVal);
2813 LLVMBool IsThreadLocal);
2816 LLVMBool IsConstant);
2822 LLVMBool IsExtInit);
2823
2824/**
2825 * @}
2826 */
2827
2828/**
2829 * @defgroup LLVMCoreValueConstantGlobalAlias Global Aliases
2830 *
2831 * This group contains function that operate on global alias values.
2832 *
2833 * @see llvm::GlobalAlias
2834 *
2835 * @{
2836 */
2837
2838/**
2839 * Add a GlobalAlias with the given value type, address space and aliasee.
2840 *
2841 * @see llvm::GlobalAlias::create()
2842 */
2844 unsigned AddrSpace, LLVMValueRef Aliasee,
2845 const char *Name);
2846
2847/**
2848 * Obtain a GlobalAlias value from a Module by its name.
2849 *
2850 * The returned value corresponds to a llvm::GlobalAlias value.
2851 *
2852 * @see llvm::Module::getNamedAlias()
2853 */
2855 const char *Name,
2856 size_t NameLen);
2857
2858/**
2859 * Obtain an iterator to the first GlobalAlias in a Module.
2860 *
2861 * @see llvm::Module::alias_begin()
2862 */
2864
2865/**
2866 * Obtain an iterator to the last GlobalAlias in a Module.
2867 *
2868 * @see llvm::Module::alias_end()
2869 */
2871
2872/**
2873 * Advance a GlobalAlias iterator to the next GlobalAlias.
2874 *
2875 * Returns NULL if the iterator was already at the end and there are no more
2876 * global aliases.
2877 */
2879
2880/**
2881 * Decrement a GlobalAlias iterator to the previous GlobalAlias.
2882 *
2883 * Returns NULL if the iterator was already at the beginning and there are
2884 * no previous global aliases.
2885 */
2887
2888/**
2889 * Retrieve the target value of an alias.
2890 */
2892
2893/**
2894 * Set the target value of an alias.
2895 */
2897
2898/**
2899 * @}
2900 */
2901
2902/**
2903 * @defgroup LLVMCCoreValueFunction Function values
2904 *
2905 * Functions in this group operate on LLVMValueRef instances that
2906 * correspond to llvm::Function instances.
2907 *
2908 * @see llvm::Function
2909 *
2910 * @{
2911 */
2912
2913/**
2914 * Remove a function from its containing module and deletes it.
2915 *
2916 * @see llvm::Function::eraseFromParent()
2917 */
2919
2920/**
2921 * Check whether the given function has a personality function.
2922 *
2923 * @see llvm::Function::hasPersonalityFn()
2924 */
2926
2927/**
2928 * Obtain the personality function attached to the function.
2929 *
2930 * @see llvm::Function::getPersonalityFn()
2931 */
2933
2934/**
2935 * Set the personality function attached to the function.
2936 *
2937 * @see llvm::Function::setPersonalityFn()
2938 */
2940 LLVMValueRef PersonalityFn);
2941
2942/**
2943 * Obtain the intrinsic ID number which matches the given function name.
2944 *
2945 * @see llvm::Intrinsic::lookupIntrinsicID()
2946 */
2947LLVM_C_ABI unsigned LLVMLookupIntrinsicID(const char *Name, size_t NameLen);
2948
2949/**
2950 * Obtain the ID number from a function instance.
2951 *
2952 * @see llvm::Function::getIntrinsicID()
2953 */
2955
2956/**
2957 * Get or insert the declaration of an intrinsic. For overloaded intrinsics,
2958 * parameter types must be provided to uniquely identify an overload.
2959 *
2960 * @see llvm::Intrinsic::getOrInsertDeclaration()
2961 */
2963 unsigned ID,
2964 LLVMTypeRef *ParamTypes,
2965 size_t ParamCount);
2966
2967/**
2968 * Retrieves the type of an intrinsic. For overloaded intrinsics, parameter
2969 * types must be provided to uniquely identify an overload.
2970 *
2971 * @see llvm::Intrinsic::getType()
2972 */
2974 LLVMTypeRef *ParamTypes,
2975 size_t ParamCount);
2976
2977/**
2978 * Retrieves the name of an intrinsic.
2979 *
2980 * @see llvm::Intrinsic::getName()
2981 */
2982LLVM_C_ABI const char *LLVMIntrinsicGetName(unsigned ID, size_t *NameLength);
2983
2984/** Deprecated: Use LLVMIntrinsicCopyOverloadedName2 instead. */
2986 LLVMTypeRef *ParamTypes,
2987 size_t ParamCount,
2988 size_t *NameLength);
2989
2990/**
2991 * Copies the name of an overloaded intrinsic identified by a given list of
2992 * parameter types.
2993 *
2994 * Unlike LLVMIntrinsicGetName, the caller is responsible for freeing the
2995 * returned string.
2996 *
2997 * This version also supports unnamed types.
2998 *
2999 * @see llvm::Intrinsic::getName()
3000 */
3002 unsigned ID,
3003 LLVMTypeRef *ParamTypes,
3004 size_t ParamCount,
3005 size_t *NameLength);
3006
3007/**
3008 * Obtain if the intrinsic identified by the given ID is overloaded.
3009 *
3010 * @see llvm::Intrinsic::isOverloaded()
3011 */
3013
3014/**
3015 * Obtain the calling function of a function.
3016 *
3017 * The returned value corresponds to the LLVMCallConv enumeration.
3018 *
3019 * @see llvm::Function::getCallingConv()
3020 */
3022
3023/**
3024 * Set the calling convention of a function.
3025 *
3026 * @see llvm::Function::setCallingConv()
3027 *
3028 * @param Fn Function to operate on
3029 * @param CC LLVMCallConv to set calling convention to
3030 */
3031LLVM_C_ABI void LLVMSetFunctionCallConv(LLVMValueRef Fn, unsigned CC);
3032
3033/**
3034 * Obtain the name of the garbage collector to use during code
3035 * generation.
3036 *
3037 * @see llvm::Function::getGC()
3038 */
3039LLVM_C_ABI const char *LLVMGetGC(LLVMValueRef Fn);
3040
3041/**
3042 * Define the garbage collector to use during code generation.
3043 *
3044 * @see llvm::Function::setGC()
3045 */
3046LLVM_C_ABI void LLVMSetGC(LLVMValueRef Fn, const char *Name);
3047
3048/**
3049 * Gets the prefix data associated with a function. Only valid on functions, and
3050 * only if LLVMHasPrefixData returns true.
3051 * See https://llvm.org/docs/LangRef.html#prefix-data
3052 */
3054
3055/**
3056 * Check if a given function has prefix data. Only valid on functions.
3057 * See https://llvm.org/docs/LangRef.html#prefix-data
3058 */
3060
3061/**
3062 * Sets the prefix data for the function. Only valid on functions.
3063 * See https://llvm.org/docs/LangRef.html#prefix-data
3064 */
3066
3067/**
3068 * Gets the prologue data associated with a function. Only valid on functions,
3069 * and only if LLVMHasPrologueData returns true.
3070 * See https://llvm.org/docs/LangRef.html#prologue-data
3071 */
3073
3074/**
3075 * Check if a given function has prologue data. Only valid on functions.
3076 * See https://llvm.org/docs/LangRef.html#prologue-data
3077 */
3079
3080/**
3081 * Sets the prologue data for the function. Only valid on functions.
3082 * See https://llvm.org/docs/LangRef.html#prologue-data
3083 */
3085
3086/**
3087 * Add an attribute to a function.
3088 *
3089 * @see llvm::Function::addAttribute()
3090 */
3094 LLVMAttributeIndex Idx);
3096 LLVMAttributeRef *Attrs);
3099 unsigned KindID);
3101 LLVMValueRef F, LLVMAttributeIndex Idx, const char *K, unsigned KLen);
3104 unsigned KindID);
3107 const char *K, unsigned KLen);
3108
3109/**
3110 * Add a target-dependent attribute to a function
3111 * @see llvm::AttrBuilder::addAttribute()
3112 */
3114 const char *A,
3115 const char *V);
3116
3117/**
3118 * @defgroup LLVMCCoreValueFunctionParameters Function Parameters
3119 *
3120 * Functions in this group relate to arguments/parameters on functions.
3121 *
3122 * Functions in this group expect LLVMValueRef instances that correspond
3123 * to llvm::Function instances.
3124 *
3125 * @{
3126 */
3127
3128/**
3129 * Obtain the number of parameters in a function.
3130 *
3131 * @see llvm::Function::arg_size()
3132 */
3134
3135/**
3136 * Obtain the parameters in a function.
3137 *
3138 * The takes a pointer to a pre-allocated array of LLVMValueRef that is
3139 * at least LLVMCountParams() long. This array will be filled with
3140 * LLVMValueRef instances which correspond to the parameters the
3141 * function receives. Each LLVMValueRef corresponds to a llvm::Argument
3142 * instance.
3143 *
3144 * @see llvm::Function::arg_begin()
3145 */
3147
3148/**
3149 * Obtain the parameter at the specified index.
3150 *
3151 * Parameters are indexed from 0.
3152 *
3153 * @see llvm::Function::arg_begin()
3154 */
3156
3157/**
3158 * Obtain the function to which this argument belongs.
3159 *
3160 * Unlike other functions in this group, this one takes an LLVMValueRef
3161 * that corresponds to a llvm::Attribute.
3162 *
3163 * The returned LLVMValueRef is the llvm::Function to which this
3164 * argument belongs.
3165 */
3167
3168/**
3169 * Obtain the first parameter to a function.
3170 *
3171 * @see llvm::Function::arg_begin()
3172 */
3174
3175/**
3176 * Obtain the last parameter to a function.
3177 *
3178 * @see llvm::Function::arg_end()
3179 */
3181
3182/**
3183 * Obtain the next parameter to a function.
3184 *
3185 * This takes an LLVMValueRef obtained from LLVMGetFirstParam() (which is
3186 * actually a wrapped iterator) and obtains the next parameter from the
3187 * underlying iterator.
3188 */
3190
3191/**
3192 * Obtain the previous parameter to a function.
3193 *
3194 * This is the opposite of LLVMGetNextParam().
3195 */
3197
3198/**
3199 * Set the alignment for a function parameter.
3200 *
3201 * @see llvm::Argument::addAttr()
3202 * @see llvm::AttrBuilder::addAlignmentAttr()
3203 */
3204LLVM_C_ABI void LLVMSetParamAlignment(LLVMValueRef Arg, unsigned Align);
3205
3206/**
3207 * @}
3208 */
3209
3210/**
3211 * @defgroup LLVMCCoreValueGlobalIFunc IFuncs
3212 *
3213 * Functions in this group relate to indirect functions.
3214 *
3215 * Functions in this group expect LLVMValueRef instances that correspond
3216 * to llvm::GlobalIFunc instances.
3217 *
3218 * @{
3219 */
3220
3221/**
3222 * Add a global indirect function to a module under a specified name.
3223 *
3224 * @see llvm::GlobalIFunc::create()
3225 */
3227 size_t NameLen, LLVMTypeRef Ty,
3228 unsigned AddrSpace,
3229 LLVMValueRef Resolver);
3230
3231/**
3232 * Obtain a GlobalIFunc value from a Module by its name.
3233 *
3234 * The returned value corresponds to a llvm::GlobalIFunc value.
3235 *
3236 * @see llvm::Module::getNamedIFunc()
3237 */
3239 const char *Name,
3240 size_t NameLen);
3241
3242/**
3243 * Obtain an iterator to the first GlobalIFunc in a Module.
3244 *
3245 * @see llvm::Module::ifunc_begin()
3246 */
3248
3249/**
3250 * Obtain an iterator to the last GlobalIFunc in a Module.
3251 *
3252 * @see llvm::Module::ifunc_end()
3253 */
3255
3256/**
3257 * Advance a GlobalIFunc iterator to the next GlobalIFunc.
3258 *
3259 * Returns NULL if the iterator was already at the end and there are no more
3260 * global aliases.
3261 */
3263
3264/**
3265 * Decrement a GlobalIFunc iterator to the previous GlobalIFunc.
3266 *
3267 * Returns NULL if the iterator was already at the beginning and there are
3268 * no previous global aliases.
3269 */
3271
3272/**
3273 * Retrieves the resolver function associated with this indirect function, or
3274 * NULL if it doesn't not exist.
3275 *
3276 * @see llvm::GlobalIFunc::getResolver()
3277 */
3279
3280/**
3281 * Sets the resolver function associated with this indirect function.
3282 *
3283 * @see llvm::GlobalIFunc::setResolver()
3284 */
3286 LLVMValueRef Resolver);
3287
3288/**
3289 * Remove a global indirect function from its parent module and delete it.
3290 *
3291 * @see llvm::GlobalIFunc::eraseFromParent()
3292 */
3294
3295/**
3296 * Remove a global indirect function from its parent module.
3297 *
3298 * This unlinks the global indirect function from its containing module but
3299 * keeps it alive.
3300 *
3301 * @see llvm::GlobalIFunc::removeFromParent()
3302 */
3304
3305/**
3306 * @}
3307 */
3308
3309/**
3310 * @}
3311 */
3312
3313/**
3314 * @}
3315 */
3316
3317/**
3318 * @}
3319 */
3320
3321/**
3322 * @defgroup LLVMCCoreValueMetadata Metadata
3323 *
3324 * @{
3325 */
3326
3327/**
3328 * Create an MDString value from a given string value.
3329 *
3330 * The MDString value does not take ownership of the given string, it remains
3331 * the responsibility of the caller to free it.
3332 *
3333 * @see llvm::MDString::get()
3334 */
3336 const char *Str, size_t SLen);
3337
3338/**
3339 * Create an MDNode value with the given array of operands.
3340 *
3341 * @see llvm::MDNode::get()
3342 */
3344 LLVMMetadataRef *MDs,
3345 size_t Count);
3346
3347/**
3348 * Obtain a Metadata as a Value.
3349 */
3351 LLVMMetadataRef MD);
3352
3353/**
3354 * Obtain a Value as a Metadata.
3355 */
3357
3358/**
3359 * Obtain the underlying string from a MDString value.
3360 *
3361 * @param V Instance to obtain string from.
3362 * @param Length Memory address which will hold length of returned string.
3363 * @return String data in MDString.
3364 */
3365LLVM_C_ABI const char *LLVMGetMDString(LLVMValueRef V, unsigned *Length);
3366
3367/**
3368 * Obtain the number of operands from an MDNode value.
3369 *
3370 * @param V MDNode to get number of operands from.
3371 * @return Number of operands of the MDNode.
3372 */
3374
3375/**
3376 * Obtain the given MDNode's operands.
3377 *
3378 * The passed LLVMValueRef pointer should point to enough memory to hold all of
3379 * the operands of the given MDNode (see LLVMGetMDNodeNumOperands) as
3380 * LLVMValueRefs. This memory will be populated with the LLVMValueRefs of the
3381 * MDNode's operands.
3382 *
3383 * @param V MDNode to get the operands from.
3384 * @param Dest Destination array for operands.
3385 */
3387
3388/**
3389 * Replace an operand at a specific index in a llvm::MDNode value.
3390 *
3391 * @see llvm::MDNode::replaceOperandWith()
3392 */
3394 LLVMMetadataRef Replacement);
3395
3396/** Deprecated: Use LLVMMDStringInContext2 instead. */
3398 unsigned SLen);
3399/** Deprecated: Use LLVMMDStringInContext2 instead. */
3400LLVM_C_ABI LLVMValueRef LLVMMDString(const char *Str, unsigned SLen);
3401/** Deprecated: Use LLVMMDNodeInContext2 instead. */
3403 LLVMValueRef *Vals, unsigned Count);
3404/** Deprecated: Use LLVMMDNodeInContext2 instead. */
3405LLVM_C_ABI LLVMValueRef LLVMMDNode(LLVMValueRef *Vals, unsigned Count);
3406
3407/**
3408 * @}
3409 */
3410
3411/**
3412 * @defgroup LLVMCCoreOperandBundle Operand Bundles
3413 *
3414 * Functions in this group operate on LLVMOperandBundleRef instances that
3415 * correspond to llvm::OperandBundleDef instances.
3416 *
3417 * @see llvm::OperandBundleDef
3418 *
3419 * @{
3420 */
3421
3422/**
3423 * Create a new operand bundle.
3424 *
3425 * Every invocation should be paired with LLVMDisposeOperandBundle() or memory
3426 * will be leaked.
3427 *
3428 * @param Tag Tag name of the operand bundle
3429 * @param TagLen Length of Tag
3430 * @param Args Memory address of an array of bundle operands
3431 * @param NumArgs Length of Args
3432 */
3434 size_t TagLen,
3435 LLVMValueRef *Args,
3436 unsigned NumArgs);
3437
3438/**
3439 * Destroy an operand bundle.
3440 *
3441 * This must be called for every created operand bundle or memory will be
3442 * leaked.
3443 */
3445
3446/**
3447 * Obtain the tag of an operand bundle as a string.
3448 *
3449 * @param Bundle Operand bundle to obtain tag of.
3450 * @param Len Out parameter which holds the length of the returned string.
3451 * @return The tag name of Bundle.
3452 * @see OperandBundleDef::getTag()
3453 */
3455 size_t *Len);
3456
3457/**
3458 * Obtain the number of operands for an operand bundle.
3459 *
3460 * @param Bundle Operand bundle to obtain operand count of.
3461 * @return The number of operands.
3462 * @see OperandBundleDef::input_size()
3463 */
3465
3466/**
3467 * Obtain the operand for an operand bundle at the given index.
3468 *
3469 * @param Bundle Operand bundle to obtain operand of.
3470 * @param Index An operand index, must be less than
3471 * LLVMGetNumOperandBundleArgs().
3472 * @return The operand.
3473 */
3476
3477/**
3478 * @}
3479 */
3480
3481/**
3482 * @defgroup LLVMCCoreValueBasicBlock Basic Block
3483 *
3484 * A basic block represents a single entry single exit section of code.
3485 * Basic blocks contain a list of instructions which form the body of
3486 * the block.
3487 *
3488 * Basic blocks belong to functions. They have the type of label.
3489 *
3490 * Basic blocks are themselves values. However, the C API models them as
3491 * LLVMBasicBlockRef.
3492 *
3493 * @see llvm::BasicBlock
3494 *
3495 * @{
3496 */
3497
3498/**
3499 * Convert a basic block instance to a value type.
3500 */
3502
3503/**
3504 * Determine whether an LLVMValueRef is itself a basic block.
3505 */
3507
3508/**
3509 * Convert an LLVMValueRef to an LLVMBasicBlockRef instance.
3510 */
3512
3513/**
3514 * Obtain the string name of a basic block.
3515 */
3517
3518/**
3519 * Obtain the function to which a basic block belongs.
3520 *
3521 * @see llvm::BasicBlock::getParent()
3522 */
3524
3525/**
3526 * Obtain the terminator instruction for a basic block.
3527 *
3528 * If the basic block does not have a terminator (it is not well-formed
3529 * if it doesn't), then NULL is returned.
3530 *
3531 * The returned LLVMValueRef corresponds to an llvm::Instruction.
3532 *
3533 * @see llvm::BasicBlock::getTerminator()
3534 */
3536
3537/**
3538 * Obtain the number of basic blocks in a function.
3539 *
3540 * @param Fn Function value to operate on.
3541 */
3543
3544/**
3545 * Obtain all of the basic blocks in a function.
3546 *
3547 * This operates on a function value. The BasicBlocks parameter is a
3548 * pointer to a pre-allocated array of LLVMBasicBlockRef of at least
3549 * LLVMCountBasicBlocks() in length. This array is populated with
3550 * LLVMBasicBlockRef instances.
3551 */
3553 LLVMBasicBlockRef *BasicBlocks);
3554
3555/**
3556 * Obtain the first basic block in a function.
3557 *
3558 * The returned basic block can be used as an iterator. You will likely
3559 * eventually call into LLVMGetNextBasicBlock() with it.
3560 *
3561 * @see llvm::Function::begin()
3562 */
3564
3565/**
3566 * Obtain the last basic block in a function.
3567 *
3568 * @see llvm::Function::end()
3569 */
3571
3572/**
3573 * Advance a basic block iterator.
3574 */
3576
3577/**
3578 * Go backwards in a basic block iterator.
3579 */
3581
3582/**
3583 * Obtain the basic block that corresponds to the entry point of a
3584 * function.
3585 *
3586 * @see llvm::Function::getEntryBlock()
3587 */
3589
3590/**
3591 * Insert the given basic block after the insertion point of the given builder.
3592 *
3593 * The insertion point must be valid.
3594 *
3595 * @see llvm::Function::BasicBlockListType::insertAfter()
3596 */
3597LLVM_C_ABI void
3600
3601/**
3602 * Append the given basic block to the basic block list of the given function.
3603 *
3604 * @see llvm::Function::BasicBlockListType::push_back()
3605 */
3608
3609/**
3610 * Create a new basic block without inserting it into a function.
3611 *
3612 * @see llvm::BasicBlock::Create()
3613 */
3615 const char *Name);
3616
3617/**
3618 * Append a basic block to the end of a function.
3619 *
3620 * @see llvm::BasicBlock::Create()
3621 */
3623 LLVMValueRef Fn,
3624 const char *Name);
3625
3626/**
3627 * Append a basic block to the end of a function using the global
3628 * context.
3629 *
3630 * @see llvm::BasicBlock::Create()
3631 */
3633 const char *Name);
3634
3635/**
3636 * Insert a basic block in a function before another basic block.
3637 *
3638 * The function to add to is determined by the function of the
3639 * passed basic block.
3640 *
3641 * @see llvm::BasicBlock::Create()
3642 */
3645 const char *Name);
3646
3647/**
3648 * Insert a basic block in a function using the global context.
3649 *
3650 * @see llvm::BasicBlock::Create()
3651 */
3653LLVMInsertBasicBlock(LLVMBasicBlockRef InsertBeforeBB, const char *Name);
3654
3655/**
3656 * Remove a basic block from a function and delete it.
3657 *
3658 * This deletes the basic block from its containing function and deletes
3659 * the basic block itself.
3660 *
3661 * @see llvm::BasicBlock::eraseFromParent()
3662 */
3664
3665/**
3666 * Remove a basic block from a function.
3667 *
3668 * This deletes the basic block from its containing function but keep
3669 * the basic block alive.
3670 *
3671 * @see llvm::BasicBlock::removeFromParent()
3672 */
3674
3675/**
3676 * Move a basic block to before another one.
3677 *
3678 * @see llvm::BasicBlock::moveBefore()
3679 */
3681 LLVMBasicBlockRef MovePos);
3682
3683/**
3684 * Move a basic block to after another one.
3685 *
3686 * @see llvm::BasicBlock::moveAfter()
3687 */
3689 LLVMBasicBlockRef MovePos);
3690
3691/**
3692 * Obtain the first instruction in a basic block.
3693 *
3694 * The returned LLVMValueRef corresponds to a llvm::Instruction
3695 * instance.
3696 */
3698
3699/**
3700 * Obtain the last instruction in a basic block.
3701 *
3702 * The returned LLVMValueRef corresponds to an LLVM:Instruction.
3703 */
3705
3706/**
3707 * @}
3708 */
3709
3710/**
3711 * @defgroup LLVMCCoreValueInstruction Instructions
3712 *
3713 * Functions in this group relate to the inspection and manipulation of
3714 * individual instructions.
3715 *
3716 * In the C++ API, an instruction is modeled by llvm::Instruction. This
3717 * class has a large number of descendents. llvm::Instruction is a
3718 * llvm::Value and in the C API, instructions are modeled by
3719 * LLVMValueRef.
3720 *
3721 * This group also contains sub-groups which operate on specific
3722 * llvm::Instruction types, e.g. llvm::CallInst.
3723 *
3724 * @{
3725 */
3726
3727/**
3728 * Determine whether an instruction has any metadata attached.
3729 */
3731
3732/**
3733 * Return metadata associated with an instruction value.
3734 */
3736
3737/**
3738 * Set metadata associated with an instruction value.
3739 */
3740LLVM_C_ABI void LLVMSetMetadata(LLVMValueRef Val, unsigned KindID,
3742
3743/**
3744 * Returns the metadata associated with an instruction value, but filters out
3745 * all the debug locations.
3746 *
3747 * @see llvm::Instruction::getAllMetadataOtherThanDebugLoc()
3748 */
3751 size_t *NumEntries);
3752
3753/**
3754 * Obtain the basic block to which an instruction belongs.
3755 *
3756 * @see llvm::Instruction::getParent()
3757 */
3759
3760/**
3761 * Obtain the instruction that occurs after the one specified.
3762 *
3763 * The next instruction will be from the same basic block.
3764 *
3765 * If this is the last instruction in a basic block, NULL will be
3766 * returned.
3767 */
3769
3770/**
3771 * Obtain the instruction that occurred before this one.
3772 *
3773 * If the instruction is the first instruction in a basic block, NULL
3774 * will be returned.
3775 */
3777
3778/**
3779 * Remove an instruction.
3780 *
3781 * The instruction specified is removed from its containing building
3782 * block but is kept alive.
3783 *
3784 * @see llvm::Instruction::removeFromParent()
3785 */
3787
3788/**
3789 * Remove and delete an instruction.
3790 *
3791 * The instruction specified is removed from its containing building
3792 * block and then deleted.
3793 *
3794 * @see llvm::Instruction::eraseFromParent()
3795 */
3797
3798/**
3799 * Delete an instruction.
3800 *
3801 * The instruction specified is deleted. It must have previously been
3802 * removed from its containing building block.
3803 *
3804 * @see llvm::Value::deleteValue()
3805 */
3807
3808/**
3809 * Obtain the code opcode for an individual instruction.
3810 *
3811 * @see llvm::Instruction::getOpCode()
3812 */
3814
3815/**
3816 * Obtain the predicate of an instruction.
3817 *
3818 * This is only valid for instructions that correspond to llvm::ICmpInst.
3819 *
3820 * @see llvm::ICmpInst::getPredicate()
3821 */
3823
3824/**
3825 * Get whether or not an icmp instruction has the samesign flag.
3826 *
3827 * This is only valid for instructions that correspond to llvm::ICmpInst.
3828 *
3829 * @see llvm::ICmpInst::hasSameSign()
3830 */
3832
3833/**
3834 * Set the samesign flag on an icmp instruction.
3835 *
3836 * This is only valid for instructions that correspond to llvm::ICmpInst.
3837 *
3838 * @see llvm::ICmpInst::setSameSign()
3839 */
3841
3842/**
3843 * Obtain the float predicate of an instruction.
3844 *
3845 * This is only valid for instructions that correspond to llvm::FCmpInst.
3846 *
3847 * @see llvm::FCmpInst::getPredicate()
3848 */
3850
3851/**
3852 * Create a copy of 'this' instruction that is identical in all ways
3853 * except the following:
3854 * * The instruction has no parent
3855 * * The instruction has no name
3856 *
3857 * @see llvm::Instruction::clone()
3858 */
3860
3861/**
3862 * Determine whether an instruction is a terminator. This routine is named to
3863 * be compatible with historical functions that did this by querying the
3864 * underlying C++ type.
3865 *
3866 * @see llvm::Instruction::isTerminator()
3867 */
3869
3870/**
3871 * Obtain the first debug record attached to an instruction.
3872 *
3873 * Use LLVMGetNextDbgRecord() and LLVMGetPreviousDbgRecord() to traverse the
3874 * sequence of DbgRecords.
3875 *
3876 * Return the first DbgRecord attached to Inst or NULL if there are none.
3877 *
3878 * @see llvm::Instruction::getDbgRecordRange()
3879 */
3881
3882/**
3883 * Obtain the last debug record attached to an instruction.
3884 *
3885 * Return the last DbgRecord attached to Inst or NULL if there are none.
3886 *
3887 * @see llvm::Instruction::getDbgRecordRange()
3888 */
3890
3891/**
3892 * Obtain the next DbgRecord in the sequence or NULL if there are no more.
3893 *
3894 * @see llvm::Instruction::getDbgRecordRange()
3895 */
3897
3898/**
3899 * Obtain the previous DbgRecord in the sequence or NULL if there are no more.
3900 *
3901 * @see llvm::Instruction::getDbgRecordRange()
3902 */
3905
3906/**
3907 * Get the debug location attached to the debug record.
3908 *
3909 * @see llvm::DbgRecord::getDebugLoc()
3910 */
3912
3914
3915/**
3916 * Get the value of the DbgVariableRecord.
3917 *
3918 * @see llvm::DbgVariableRecord::getValue()
3919 */
3921 unsigned OpIdx);
3922
3923/**
3924 * Get the debug info variable of the DbgVariableRecord.
3925 *
3926 * @see llvm::DbgVariableRecord::getVariable()
3927 */
3929
3930/**
3931 * Get the debug info expression of the DbgVariableRecord.
3932 *
3933 * @see llvm::DbgVariableRecord::getExpression()
3934 */
3936
3937/**
3938 * @defgroup LLVMCCoreValueInstructionCall Call Sites and Invocations
3939 *
3940 * Functions in this group apply to instructions that refer to call
3941 * sites and invocations. These correspond to C++ types in the
3942 * llvm::CallInst class tree.
3943 *
3944 * @{
3945 */
3946
3947/**
3948 * Obtain the argument count for a call instruction.
3949 *
3950 * This expects an LLVMValueRef that corresponds to a llvm::CallInst,
3951 * llvm::InvokeInst, or llvm:FuncletPadInst.
3952 *
3953 * @see llvm::CallInst::getNumArgOperands()
3954 * @see llvm::InvokeInst::getNumArgOperands()
3955 * @see llvm::FuncletPadInst::getNumArgOperands()
3956 */
3958
3959/**
3960 * Set the calling convention for a call instruction.
3961 *
3962 * This expects an LLVMValueRef that corresponds to a llvm::CallInst or
3963 * llvm::InvokeInst.
3964 *
3965 * @see llvm::CallInst::setCallingConv()
3966 * @see llvm::InvokeInst::setCallingConv()
3967 */
3968LLVM_C_ABI void LLVMSetInstructionCallConv(LLVMValueRef Instr, unsigned CC);
3969
3970/**
3971 * Obtain the calling convention for a call instruction.
3972 *
3973 * This is the opposite of LLVMSetInstructionCallConv(). Reads its
3974 * usage.
3975 *
3976 * @see LLVMSetInstructionCallConv()
3977 */
3979
3982 unsigned Align);
3983
3987 LLVMAttributeIndex Idx);
3990 LLVMAttributeRef *Attrs);
3993 unsigned KindID);
3995 LLVMValueRef C, LLVMAttributeIndex Idx, const char *K, unsigned KLen);
3998 unsigned KindID);
4001 const char *K, unsigned KLen);
4002
4003/**
4004 * Obtain the function type called by this instruction.
4005 *
4006 * @see llvm::CallBase::getFunctionType()
4007 */
4009
4010/**
4011 * Obtain the pointer to the function invoked by this instruction.
4012 *
4013 * This expects an LLVMValueRef that corresponds to a llvm::CallInst or
4014 * llvm::InvokeInst.
4015 *
4016 * @see llvm::CallInst::getCalledOperand()
4017 * @see llvm::InvokeInst::getCalledOperand()
4018 */
4020
4021/**
4022 * Obtain the number of operand bundles attached to this instruction.
4023 *
4024 * This only works on llvm::CallInst and llvm::InvokeInst instructions.
4025 *
4026 * @see llvm::CallBase::getNumOperandBundles()
4027 */
4029
4030/**
4031 * Obtain the operand bundle attached to this instruction at the given index.
4032 * Use LLVMDisposeOperandBundle to free the operand bundle.
4033 *
4034 * This only works on llvm::CallInst and llvm::InvokeInst instructions.
4035 */
4037 unsigned Index);
4038
4039/**
4040 * Obtain whether a call instruction is a tail call.
4041 *
4042 * This only works on llvm::CallInst instructions.
4043 *
4044 * @see llvm::CallInst::isTailCall()
4045 */
4047
4048/**
4049 * Set whether a call instruction is a tail call.
4050 *
4051 * This only works on llvm::CallInst instructions.
4052 *
4053 * @see llvm::CallInst::setTailCall()
4054 */
4055LLVM_C_ABI void LLVMSetTailCall(LLVMValueRef CallInst, LLVMBool IsTailCall);
4056
4057/**
4058 * Obtain a tail call kind of the call instruction.
4059 *
4060 * @see llvm::CallInst::setTailCallKind()
4061 */
4063
4064/**
4065 * Set the call kind of the call instruction.
4066 *
4067 * @see llvm::CallInst::getTailCallKind()
4068 */
4070 LLVMTailCallKind kind);
4071
4072/**
4073 * Return the normal destination basic block.
4074 *
4075 * This only works on llvm::InvokeInst instructions.
4076 *
4077 * @see llvm::InvokeInst::getNormalDest()
4078 */
4080
4081/**
4082 * Return the unwind destination basic block.
4083 *
4084 * Works on llvm::InvokeInst, llvm::CleanupReturnInst, and
4085 * llvm::CatchSwitchInst instructions.
4086 *
4087 * @see llvm::InvokeInst::getUnwindDest()
4088 * @see llvm::CleanupReturnInst::getUnwindDest()
4089 * @see llvm::CatchSwitchInst::getUnwindDest()
4090 */
4092
4093/**
4094 * Set the normal destination basic block.
4095 *
4096 * This only works on llvm::InvokeInst instructions.
4097 *
4098 * @see llvm::InvokeInst::setNormalDest()
4099 */
4101
4102/**
4103 * Set the unwind destination basic block.
4104 *
4105 * Works on llvm::InvokeInst, llvm::CleanupReturnInst, and
4106 * llvm::CatchSwitchInst instructions.
4107 *
4108 * @see llvm::InvokeInst::setUnwindDest()
4109 * @see llvm::CleanupReturnInst::setUnwindDest()
4110 * @see llvm::CatchSwitchInst::setUnwindDest()
4111 */
4113
4114/**
4115 * Get the default destination of a CallBr instruction.
4116 *
4117 * @see llvm::CallBrInst::getDefaultDest()
4118 */
4120
4121/**
4122 * Get the number of indirect destinations of a CallBr instruction.
4123 *
4124 * @see llvm::CallBrInst::getNumIndirectDests()
4125
4126 */
4128
4129/**
4130 * Get the indirect destination of a CallBr instruction at the given index.
4131 *
4132 * @see llvm::CallBrInst::getIndirectDest()
4133 */
4135 unsigned Idx);
4136
4137/**
4138 * @}
4139 */
4140
4141/**
4142 * @defgroup LLVMCCoreValueInstructionTerminator Terminators
4143 *
4144 * Functions in this group only apply to instructions for which
4145 * LLVMIsATerminatorInst returns true.
4146 *
4147 * @{
4148 */
4149
4150/**
4151 * Return the number of successors that this terminator has.
4152 *
4153 * @see llvm::Instruction::getNumSuccessors
4154 */
4156
4157/**
4158 * Return the specified successor.
4159 *
4160 * @see llvm::Instruction::getSuccessor
4161 */
4163
4164/**
4165 * Update the specified successor to point at the provided block.
4166 *
4167 * @see llvm::Instruction::setSuccessor
4168 */
4169LLVM_C_ABI void LLVMSetSuccessor(LLVMValueRef Term, unsigned i,
4171
4172/**
4173 * Return if a branch is conditional.
4174 *
4175 * This only works on llvm::BranchInst instructions.
4176 *
4177 * @see llvm::BranchInst::isConditional
4178 */
4180
4181/**
4182 * Return the condition of a branch instruction.
4183 *
4184 * This only works on llvm::BranchInst instructions.
4185 *
4186 * @see llvm::BranchInst::getCondition
4187 */
4189
4190/**
4191 * Set the condition of a branch instruction.
4192 *
4193 * This only works on llvm::BranchInst instructions.
4194 *
4195 * @see llvm::BranchInst::setCondition
4196 */
4198
4199/**
4200 * Obtain the default destination basic block of a switch instruction.
4201 *
4202 * This only works on llvm::SwitchInst instructions.
4203 *
4204 * @see llvm::SwitchInst::getDefaultDest()
4205 */
4207
4208/**
4209 * @}
4210 */
4211
4212/**
4213 * @defgroup LLVMCCoreValueInstructionAlloca Allocas
4214 *
4215 * Functions in this group only apply to instructions that map to
4216 * llvm::AllocaInst instances.
4217 *
4218 * @{
4219 */
4220
4221/**
4222 * Obtain the type that is being allocated by the alloca instruction.
4223 */
4225
4226/**
4227 * @}
4228 */
4229
4230/**
4231 * @defgroup LLVMCCoreValueInstructionGetElementPointer GEPs
4232 *
4233 * Functions in this group only apply to instructions that map to
4234 * llvm::GetElementPtrInst instances.
4235 *
4236 * @{
4237 */
4238
4239/**
4240 * Check whether the given GEP operator is inbounds.
4241 */
4243
4244/**
4245 * Set the given GEP instruction to be inbounds or not.
4246 */
4248
4249/**
4250 * Get the source element type of the given GEP operator.
4251 */
4253
4254/**
4255 * Get the no-wrap related flags for the given GEP instruction.
4256 *
4257 * @see llvm::GetElementPtrInst::getNoWrapFlags
4258 */
4260
4261/**
4262 * Set the no-wrap related flags for the given GEP instruction.
4263 *
4264 * @see llvm::GetElementPtrInst::setNoWrapFlags
4265 */
4267 LLVMGEPNoWrapFlags NoWrapFlags);
4268
4269/**
4270 * @}
4271 */
4272
4273/**
4274 * @defgroup LLVMCCoreValueInstructionPHINode PHI Nodes
4275 *
4276 * Functions in this group only apply to instructions that map to
4277 * llvm::PHINode instances.
4278 *
4279 * @{
4280 */
4281
4282/**
4283 * Add an incoming value to the end of a PHI list.
4284 */
4286 LLVMValueRef *IncomingValues,
4287 LLVMBasicBlockRef *IncomingBlocks,
4288 unsigned Count);
4289
4290/**
4291 * Obtain the number of incoming basic blocks to a PHI node.
4292 */
4293LLVM_C_ABI unsigned LLVMCountIncoming(LLVMValueRef PhiNode);
4294
4295/**
4296 * Obtain an incoming value to a PHI node as an LLVMValueRef.
4297 */
4299 unsigned Index);
4300
4301/**
4302 * Obtain an incoming value to a PHI node as an LLVMBasicBlockRef.
4303 */
4305 unsigned Index);
4306
4307/**
4308 * @}
4309 */
4310
4311/**
4312 * @defgroup LLVMCCoreValueInstructionExtractValue ExtractValue
4313 * @defgroup LLVMCCoreValueInstructionInsertValue InsertValue
4314 *
4315 * Functions in this group only apply to instructions that map to
4316 * llvm::ExtractValue and llvm::InsertValue instances.
4317 *
4318 * @{
4319 */
4320
4321/**
4322 * Obtain the number of indices.
4323 * NB: This also works on GEP operators.
4324 */
4326
4327/**
4328 * Obtain the indices as an array.
4329 */
4330LLVM_C_ABI const unsigned *LLVMGetIndices(LLVMValueRef Inst);
4331
4332/**
4333 * @}
4334 */
4335
4336/**
4337 * @}
4338 */
4339
4340/**
4341 * @}
4342 */
4343
4344/**
4345 * @defgroup LLVMCCoreInstructionBuilder Instruction Builders
4346 *
4347 * An instruction builder represents a point within a basic block and is
4348 * the exclusive means of building instructions using the C interface.
4349 *
4350 * @{
4351 */
4352
4355/**
4356 * Set the builder position before Instr but after any attached debug records,
4357 * or if Instr is null set the position to the end of Block.
4358 */
4360 LLVMBasicBlockRef Block,
4361 LLVMValueRef Instr);
4362/**
4363 * Set the builder position before Instr and any attached debug records,
4364 * or if Instr is null set the position to the end of Block.
4365 */
4367 LLVMBasicBlockRef Block,
4368 LLVMValueRef Inst);
4369/**
4370 * Set the builder position before Instr but after any attached debug records.
4371 */
4373 LLVMValueRef Instr);
4374/**
4375 * Set the builder position before Instr and any attached debug records.
4376 */
4377LLVM_C_ABI void
4379 LLVMValueRef Instr);
4381 LLVMBasicBlockRef Block);
4385 LLVMValueRef Instr);
4387 LLVMValueRef Instr,
4388 const char *Name);
4390
4391/* Metadata */
4392
4393/**
4394 * Get location information used by debugging information.
4395 *
4396 * @see llvm::IRBuilder::getCurrentDebugLocation()
4397 */
4399
4400/**
4401 * Set location information used by debugging information.
4402 *
4403 * To clear the location metadata of the given instruction, pass NULL to \p Loc.
4404 *
4405 * @see llvm::IRBuilder::SetCurrentDebugLocation()
4406 */
4408 LLVMMetadataRef Loc);
4409
4410/**
4411 * Attempts to set the debug location for the given instruction using the
4412 * current debug location for the given builder. If the builder has no current
4413 * debug location, this function is a no-op.
4414 *
4415 * @deprecated LLVMSetInstDebugLocation is deprecated in favor of the more general
4416 * LLVMAddMetadataToInst.
4417 *
4418 * @see llvm::IRBuilder::SetInstDebugLocation()
4419 */
4421 LLVMValueRef Inst);
4422
4423/**
4424 * Adds the metadata registered with the given builder to the given instruction.
4425 *
4426 * @see llvm::IRBuilder::AddMetadataToInst()
4427 */
4429 LLVMValueRef Inst);
4430
4431/**
4432 * Get the dafult floating-point math metadata for a given builder.
4433 *
4434 * @see llvm::IRBuilder::getDefaultFPMathTag()
4435 */
4438
4439/**
4440 * Set the default floating-point math metadata for the given builder.
4441 *
4442 * To clear the metadata, pass NULL to \p FPMathTag.
4443 *
4444 * @see llvm::IRBuilder::setDefaultFPMathTag()
4445 */
4447 LLVMMetadataRef FPMathTag);
4448
4449/**
4450 * Obtain the context to which this builder is associated.
4451 *
4452 * @see llvm::IRBuilder::getContext()
4453 */
4455
4456/**
4457 * Deprecated: Passing the NULL location will crash.
4458 * Use LLVMGetCurrentDebugLocation2 instead.
4459 */
4461 LLVMValueRef L);
4462/**
4463 * Deprecated: Returning the NULL location will crash.
4464 * Use LLVMGetCurrentDebugLocation2 instead.
4465 */
4467
4468/* Terminators */
4472 LLVMValueRef *RetVals,
4473 unsigned N);
4476 LLVMBasicBlockRef Then,
4477 LLVMBasicBlockRef Else);
4479 LLVMBasicBlockRef Else,
4480 unsigned NumCases);
4482 unsigned NumDests);
4485 LLVMBasicBlockRef DefaultDest, LLVMBasicBlockRef *IndirectDests,
4486 unsigned NumIndirectDests, LLVMValueRef *Args, unsigned NumArgs,
4487 LLVMOperandBundleRef *Bundles, unsigned NumBundles, const char *Name);
4489 LLVMValueRef Fn, LLVMValueRef *Args,
4490 unsigned NumArgs,
4491 LLVMBasicBlockRef Then,
4492 LLVMBasicBlockRef Catch,
4493 const char *Name);
4496 unsigned NumArgs, LLVMBasicBlockRef Then, LLVMBasicBlockRef Catch,
4497 LLVMOperandBundleRef *Bundles, unsigned NumBundles, const char *Name);
4499
4500/* Exception Handling */
4503 LLVMValueRef PersFn,
4504 unsigned NumClauses,
4505 const char *Name);
4507 LLVMValueRef CatchPad,
4510 LLVMValueRef CatchPad,
4513 LLVMValueRef ParentPad,
4514 LLVMValueRef *Args, unsigned NumArgs,
4515 const char *Name);
4517 LLVMValueRef ParentPad,
4518 LLVMValueRef *Args,
4519 unsigned NumArgs, const char *Name);
4521 LLVMValueRef ParentPad,
4522 LLVMBasicBlockRef UnwindBB,
4523 unsigned NumHandlers,
4524 const char *Name);
4525
4526/* Add a case to the switch instruction */
4528 LLVMBasicBlockRef Dest);
4529
4530/* Add a destination to the indirectbr instruction */
4532 LLVMBasicBlockRef Dest);
4533
4534/* Get the number of clauses on the landingpad instruction */
4535LLVM_C_ABI unsigned LLVMGetNumClauses(LLVMValueRef LandingPad);
4536
4537/* Get the value of the clause at index Idx on the landingpad instruction */
4538LLVM_C_ABI LLVMValueRef LLVMGetClause(LLVMValueRef LandingPad, unsigned Idx);
4539
4540/* Add a catch or filter clause to the landingpad instruction */
4541LLVM_C_ABI void LLVMAddClause(LLVMValueRef LandingPad, LLVMValueRef ClauseVal);
4542
4543/* Get the 'cleanup' flag in the landingpad instruction */
4545
4546/* Set the 'cleanup' flag in the landingpad instruction */
4547LLVM_C_ABI void LLVMSetCleanup(LLVMValueRef LandingPad, LLVMBool Val);
4548
4549/* Add a destination to the catchswitch instruction */
4550LLVM_C_ABI void LLVMAddHandler(LLVMValueRef CatchSwitch,
4551 LLVMBasicBlockRef Dest);
4552
4553/* Get the number of handlers on the catchswitch instruction */
4554LLVM_C_ABI unsigned LLVMGetNumHandlers(LLVMValueRef CatchSwitch);
4555
4556/**
4557 * Obtain the basic blocks acting as handlers for a catchswitch instruction.
4558 *
4559 * The Handlers parameter should point to a pre-allocated array of
4560 * LLVMBasicBlockRefs at least LLVMGetNumHandlers() large. On return, the
4561 * first LLVMGetNumHandlers() entries in the array will be populated
4562 * with LLVMBasicBlockRef instances.
4563 *
4564 * @param CatchSwitch The catchswitch instruction to operate on.
4565 * @param Handlers Memory address of an array to be filled with basic blocks.
4566 */
4567LLVM_C_ABI void LLVMGetHandlers(LLVMValueRef CatchSwitch,
4568 LLVMBasicBlockRef *Handlers);
4569
4570/* Funclets */
4571
4572/* Get the number of funcletpad arguments. */
4574
4575/* Set a funcletpad argument at the given index. */
4576LLVM_C_ABI void LLVMSetArgOperand(LLVMValueRef Funclet, unsigned i,
4577 LLVMValueRef value);
4578
4579/**
4580 * Get the parent catchswitch instruction of a catchpad instruction.
4581 *
4582 * This only works on llvm::CatchPadInst instructions.
4583 *
4584 * @see llvm::CatchPadInst::getCatchSwitch()
4585 */
4587
4588/**
4589 * Set the parent catchswitch instruction of a catchpad instruction.
4590 *
4591 * This only works on llvm::CatchPadInst instructions.
4592 *
4593 * @see llvm::CatchPadInst::setCatchSwitch()
4594 */
4596 LLVMValueRef CatchSwitch);
4597
4598/* Arithmetic */
4600 LLVMValueRef RHS, const char *Name);
4602 LLVMValueRef RHS, const char *Name);
4604 LLVMValueRef RHS, const char *Name);
4606 LLVMValueRef RHS, const char *Name);
4608 LLVMValueRef RHS, const char *Name);
4610 LLVMValueRef RHS, const char *Name);
4612 LLVMValueRef RHS, const char *Name);
4614 LLVMValueRef RHS, const char *Name);
4616 LLVMValueRef RHS, const char *Name);
4618 LLVMValueRef RHS, const char *Name);
4620 LLVMValueRef RHS, const char *Name);
4622 LLVMValueRef RHS, const char *Name);
4624 LLVMValueRef RHS, const char *Name);
4626 LLVMValueRef RHS, const char *Name);
4628 LLVMValueRef RHS, const char *Name);
4630 LLVMValueRef RHS, const char *Name);
4632 LLVMValueRef RHS, const char *Name);
4634 LLVMValueRef RHS, const char *Name);
4636 LLVMValueRef RHS, const char *Name);
4638 LLVMValueRef RHS, const char *Name);
4640 LLVMValueRef RHS, const char *Name);
4642 LLVMValueRef RHS, const char *Name);
4644 LLVMValueRef RHS, const char *Name);
4646 LLVMValueRef RHS, const char *Name);
4648 LLVMValueRef RHS, const char *Name);
4650 LLVMValueRef RHS, const char *Name);
4653 const char *Name);
4655 const char *Name);
4657 const char *Name);
4660 const char *Name),
4661 "Use LLVMBuildNeg + LLVMSetNUW instead.");
4663 const char *Name);
4665 const char *Name);
4666
4668LLVM_C_ABI void LLVMSetNUW(LLVMValueRef ArithInst, LLVMBool HasNUW);
4670LLVM_C_ABI void LLVMSetNSW(LLVMValueRef ArithInst, LLVMBool HasNSW);
4672LLVM_C_ABI void LLVMSetExact(LLVMValueRef DivOrShrInst, LLVMBool IsExact);
4673
4674/**
4675 * Gets if the instruction has the non-negative flag set.
4676 * Only valid for zext instructions.
4677 */
4679/**
4680 * Sets the non-negative flag for the instruction.
4681 * Only valid for zext instructions.
4682 */
4683LLVM_C_ABI void LLVMSetNNeg(LLVMValueRef NonNegInst, LLVMBool IsNonNeg);
4684
4685/**
4686 * Get the flags for which fast-math-style optimizations are allowed for this
4687 * value.
4688 *
4689 * Only valid on floating point instructions.
4690 * @see LLVMCanValueUseFastMathFlags
4691 */
4693
4694/**
4695 * Sets the flags for which fast-math-style optimizations are allowed for this
4696 * value.
4697 *
4698 * Only valid on floating point instructions.
4699 * @see LLVMCanValueUseFastMathFlags
4700 */
4702 LLVMFastMathFlags FMF);
4703
4704/**
4705 * Check if a given value can potentially have fast math flags.
4706 *
4707 * Will return true for floating point arithmetic instructions, and for select,
4708 * phi, and call instructions whose type is a floating point type, or a vector
4709 * or array thereof. See https://llvm.org/docs/LangRef.html#fast-math-flags
4710 */
4712
4713/**
4714 * Gets whether the instruction has the disjoint flag set.
4715 * Only valid for or instructions.
4716 */
4718/**
4719 * Sets the disjoint flag for the instruction.
4720 * Only valid for or instructions.
4721 */
4722LLVM_C_ABI void LLVMSetIsDisjoint(LLVMValueRef Inst, LLVMBool IsDisjoint);
4723
4724/* Memory */
4726 const char *Name);
4728 LLVMValueRef Val,
4729 const char *Name);
4730
4731/**
4732 * Creates and inserts a memset to the specified pointer and the
4733 * specified value.
4734 *
4735 * @see llvm::IRRBuilder::CreateMemSet()
4736 */
4738 LLVMValueRef Val, LLVMValueRef Len,
4739 unsigned Align);
4740/**
4741 * Creates and inserts a memcpy between the specified pointers.
4742 *
4743 * @see llvm::IRRBuilder::CreateMemCpy()
4744 */
4746 unsigned DstAlign, LLVMValueRef Src,
4747 unsigned SrcAlign, LLVMValueRef Size);
4748/**
4749 * Creates and inserts a memmove between the specified pointers.
4750 *
4751 * @see llvm::IRRBuilder::CreateMemMove()
4752 */
4754 unsigned DstAlign, LLVMValueRef Src,
4755 unsigned SrcAlign, LLVMValueRef Size);
4756
4758 const char *Name);
4760 LLVMValueRef Val,
4761 const char *Name);
4764 LLVMValueRef PointerVal,
4765 const char *Name);
4767 LLVMValueRef Ptr);
4769 LLVMValueRef Pointer,
4770 LLVMValueRef *Indices,
4771 unsigned NumIndices, const char *Name);
4773 LLVMValueRef Pointer,
4774 LLVMValueRef *Indices,
4775 unsigned NumIndices,
4776 const char *Name);
4777/**
4778 * Creates a GetElementPtr instruction. Similar to LLVMBuildGEP2, but allows
4779 * specifying the no-wrap flags.
4780 *
4781 * @see llvm::IRBuilder::CreateGEP()
4782 */
4785 LLVMValueRef *Indices, unsigned NumIndices, const char *Name,
4786 LLVMGEPNoWrapFlags NoWrapFlags);
4788 LLVMValueRef Pointer, unsigned Idx,
4789 const char *Name);
4791 const char *Name);
4792/**
4793 * Deprecated: Use LLVMBuildGlobalString instead, which has identical behavior.
4794 */
4796 const char *Str,
4797 const char *Name);
4799LLVM_C_ABI void LLVMSetVolatile(LLVMValueRef MemoryAccessInst,
4800 LLVMBool IsVolatile);
4802LLVM_C_ABI void LLVMSetWeak(LLVMValueRef CmpXchgInst, LLVMBool IsWeak);
4804LLVM_C_ABI void LLVMSetOrdering(LLVMValueRef MemoryAccessInst,
4805 LLVMAtomicOrdering Ordering);
4808 LLVMAtomicRMWBinOp BinOp);
4809
4810/* Casts */
4812 LLVMTypeRef DestTy, const char *Name);
4814 LLVMTypeRef DestTy, const char *Name);
4816 LLVMTypeRef DestTy, const char *Name);
4818 LLVMTypeRef DestTy, const char *Name);
4820 LLVMTypeRef DestTy, const char *Name);
4822 LLVMTypeRef DestTy, const char *Name);
4824 LLVMTypeRef DestTy, const char *Name);
4826 LLVMTypeRef DestTy, const char *Name);
4828 LLVMTypeRef DestTy, const char *Name);
4830 LLVMTypeRef DestTy, const char *Name);
4832 LLVMTypeRef DestTy, const char *Name);
4834 LLVMTypeRef DestTy, const char *Name);
4836 LLVMTypeRef DestTy,
4837 const char *Name);
4839 LLVMTypeRef DestTy,
4840 const char *Name);
4842 LLVMTypeRef DestTy,
4843 const char *Name);
4845 LLVMValueRef Val,
4846 LLVMTypeRef DestTy,
4847 const char *Name);
4849 LLVMValueRef Val, LLVMTypeRef DestTy,
4850 const char *Name);
4852 LLVMTypeRef DestTy,
4853 const char *Name);
4855 LLVMTypeRef DestTy, LLVMBool IsSigned,
4856 const char *Name);
4858 LLVMTypeRef DestTy, const char *Name);
4859
4860/** Deprecated: This cast is always signed. Use LLVMBuildIntCast2 instead. */
4862 LLVMValueRef Val, /*Signed cast!*/
4863 LLVMTypeRef DestTy, const char *Name);
4864
4866 LLVMTypeRef DestTy,
4867 LLVMBool DestIsSigned);
4868
4869/* Comparisons */
4872 const char *Name);
4875 const char *Name);
4876
4877/* Miscellaneous instructions */
4879 const char *Name);
4881 LLVMValueRef Fn, LLVMValueRef *Args,
4882 unsigned NumArgs, const char *Name);
4885 unsigned NumArgs, LLVMOperandBundleRef *Bundles, unsigned NumBundles,
4886 const char *Name);
4888 LLVMValueRef Then, LLVMValueRef Else,
4889 const char *Name);
4891 LLVMTypeRef Ty, const char *Name);
4893 LLVMValueRef VecVal,
4894 LLVMValueRef Index,
4895 const char *Name);
4897 LLVMValueRef VecVal,
4898 LLVMValueRef EltVal,
4899 LLVMValueRef Index,
4900 const char *Name);
4902 LLVMValueRef V2,
4903 LLVMValueRef Mask,
4904 const char *Name);
4906 LLVMValueRef AggVal,
4907 unsigned Index, const char *Name);
4909 LLVMValueRef AggVal,
4910 LLVMValueRef EltVal,
4911 unsigned Index, const char *Name);
4913 const char *Name);
4914
4916 const char *Name);
4918 const char *Name);
4921 const char *Name);
4923 LLVMAtomicOrdering ordering,
4924 LLVMBool singleThread, const char *Name);
4926 LLVMAtomicOrdering ordering,
4927 unsigned SSID,
4928 const char *Name);
4931 LLVMValueRef PTR, LLVMValueRef Val,
4932 LLVMAtomicOrdering ordering,
4933 LLVMBool singleThread);
4936 LLVMAtomicOrdering ordering, unsigned SSID);
4939 LLVMAtomicOrdering SuccessOrdering, LLVMAtomicOrdering FailureOrdering,
4943 LLVMAtomicOrdering SuccessOrdering, LLVMAtomicOrdering FailureOrdering,
4944 unsigned SSID);
4945
4946/**
4947 * Get the number of elements in the mask of a ShuffleVector instruction.
4948 */
4949LLVM_C_ABI unsigned LLVMGetNumMaskElements(LLVMValueRef ShuffleVectorInst);
4950
4951/**
4952 * \returns a constant that specifies that the result of a \c ShuffleVectorInst
4953 * is undefined.
4954 */
4956
4957/**
4958 * Get the mask value at position Elt in the mask of a ShuffleVector
4959 * instruction.
4960 *
4961 * \Returns the result of \c LLVMGetUndefMaskElem() if the mask value is
4962 * poison at that position.
4963 */
4964LLVM_C_ABI int LLVMGetMaskValue(LLVMValueRef ShuffleVectorInst, unsigned Elt);
4965
4969
4970/**
4971 * Returns whether an instruction is an atomic instruction, e.g., atomicrmw,
4972 * cmpxchg, fence, or loads and stores with atomic ordering.
4973 */
4975
4976/**
4977 * Returns the synchronization scope ID of an atomic instruction.
4978 */
4980
4981/**
4982 * Sets the synchronization scope ID of an atomic instruction.
4983 */
4985 unsigned SSID);
4986
4990 LLVMAtomicOrdering Ordering);
4994 LLVMAtomicOrdering Ordering);
4995
4996/**
4997 * @}
4998 */
4999
5000/**
5001 * @defgroup LLVMCCoreModuleProvider Module Providers
5002 *
5003 * @{
5004 */
5005
5006/**
5007 * Changes the type of M so it can be passed to FunctionPassManagers and the
5008 * JIT. They take ModuleProviders for historical reasons.
5009 */
5012
5013/**
5014 * Destroys the module M.
5015 */
5017
5018/**
5019 * @}
5020 */
5021
5022/**
5023 * @defgroup LLVMCCoreMemoryBuffers Memory Buffers
5024 *
5025 * @{
5026 */
5027
5029 const char *Path, LLVMMemoryBufferRef *OutMemBuf, char **OutMessage);
5031 LLVMMemoryBufferRef *OutMemBuf, char **OutMessage);
5033 const char *InputData, size_t InputDataLength, const char *BufferName,
5034 LLVMBool RequiresNullTerminator);
5036 const char *InputData, size_t InputDataLength, const char *BufferName);
5040
5041/**
5042 * @}
5043 */
5044
5045/**
5046 * @defgroup LLVMCCorePassManagers Pass Managers
5047 * @ingroup LLVMCCore
5048 *
5049 * @{
5050 */
5051
5052/** Constructs a new whole-module pass pipeline. This type of pipeline is
5053 suitable for link-time optimization and whole-module transformations.
5054 @see llvm::PassManager::PassManager */
5056
5057/** Constructs a new function-by-function pass pipeline over the module
5058 provider. It does not take ownership of the module provider. This type of
5059 pipeline is suitable for code generation and JIT compilation tasks.
5060 @see llvm::FunctionPassManager::FunctionPassManager */
5063
5064/** Deprecated: Use LLVMCreateFunctionPassManagerForModule instead. */
5067
5068/** Initializes, executes on the provided module, and finalizes all of the
5069 passes scheduled in the pass manager. Returns 1 if any of the passes
5070 modified the module, 0 otherwise.
5071 @see llvm::PassManager::run(Module&) */
5073
5074/** Initializes all of the function passes scheduled in the function pass
5075 manager. Returns 1 if any of the passes modified the module, 0 otherwise.
5076 @see llvm::FunctionPassManager::doInitialization */
5078
5079/** Executes all of the function passes scheduled in the function pass manager
5080 on the provided function. Returns 1 if any of the passes modified the
5081 function, false otherwise.
5082 @see llvm::FunctionPassManager::run(Function&) */
5084 LLVMValueRef F);
5085
5086/** Finalizes all of the function passes scheduled in the function pass
5087 manager. Returns 1 if any of the passes modified the module, 0 otherwise.
5088 @see llvm::FunctionPassManager::doFinalization */
5090
5091/** Frees the memory of a pass pipeline. For function pipelines, does not free
5092 the module provider.
5093 @see llvm::PassManagerBase::~PassManagerBase. */
5095
5096/**
5097 * @}
5098 */
5099
5100/**
5101 * @defgroup LLVMCCoreThreading Threading
5102 *
5103 * Handle the structures needed to make LLVM safe for multithreading.
5104 *
5105 * @{
5106 */
5107
5108/** Deprecated: Multi-threading can only be enabled/disabled with the compile
5109 time define LLVM_ENABLE_THREADS. This function always returns
5110 LLVMIsMultithreaded(). */
5112
5113/** Deprecated: Multi-threading can only be enabled/disabled with the compile
5114 time define LLVM_ENABLE_THREADS. */
5116
5117/** Check whether LLVM is executing in thread-safe mode or not.
5118 @see llvm::llvm_is_multithreaded */
5120
5121/**
5122 * @}
5123 */
5124
5125/**
5126 * @}
5127 */
5128
5129/**
5130 * @}
5131 */
5132
5134
5135#endif /* LLVM_C_CORE_H */
static GCRegistry::Add< ShadowStackGC > C("shadow-stack", "Very portable GC for uncooperative code generators")
static GCRegistry::Add< ErlangGC > A("erlang", "erlang-compatible garbage collector")
static GCRegistry::Add< OcamlGC > B("ocaml", "ocaml 3.10-compatible GC")
DXIL Finalize Linkage
#define LLVM_ATTRIBUTE_C_DEPRECATED(decl, message)
Definition Deprecated.h:34
#define LLVM_C_EXTERN_C_BEGIN
Definition ExternC.h:35
#define LLVM_C_EXTERN_C_END
Definition ExternC.h:36
#define op(i)
Hexagon Common GEP
LLVMValueRef LLVMGetElementAsConstant(LLVMValueRef C, unsigned idx)
Definition Core.cpp:1631
LLVMValueRef LLVMBuildNUWNeg(LLVMBuilderRef B, LLVMValueRef V, const char *Name)
Definition Core.cpp:3822
LLVMValueRef LLVMConstNUWNeg(LLVMValueRef ConstantVal)
Definition Core.cpp:1775
static cl::opt< bool > SingleThread("licm-force-thread-model-single", cl::Hidden, cl::init(false), cl::desc("Force thread model single in LICM pass"))
#define F(x, y, z)
Definition MD5.cpp:54
MachineInstr unsigned OpIdx
if(auto Err=PB.parsePassPipeline(MPM, Passes)) return wrap(std MPM run * Mod
const SmallVectorImpl< MachineOperand > & Cond
static cl::opt< RegAllocEvictionAdvisorAnalysisLegacy::AdvisorMode > Mode("regalloc-enable-advisor", cl::Hidden, cl::init(RegAllocEvictionAdvisorAnalysisLegacy::AdvisorMode::Default), cl::desc("Enable regalloc advisor mode"), cl::values(clEnumValN(RegAllocEvictionAdvisorAnalysisLegacy::AdvisorMode::Default, "default", "Default"), clEnumValN(RegAllocEvictionAdvisorAnalysisLegacy::AdvisorMode::Release, "release", "precompiled"), clEnumValN(RegAllocEvictionAdvisorAnalysisLegacy::AdvisorMode::Development, "development", "for training")))
unify loop Fixup each natural loop to have a single exit block
#define LLVM_C_ABI
LLVM_C_ABI is the export/visibility macro used to mark symbols declared in llvm-c as exported when bu...
Definition Visibility.h:40
Value * RHS
Value * LHS
LLVM_C_ABI LLVMTypeRef LLVMGetTypeByName2(LLVMContextRef C, const char *Name)
Obtain a Type from a context by its registered name.
Definition Core.cpp:852
LLVM_C_ABI LLVMBool LLVMIsEnumAttribute(LLVMAttributeRef A)
Check for the different types of attributes.
Definition Core.cpp:229
LLVM_C_ABI LLVMTypeRef LLVMGetTypeAttributeValue(LLVMAttributeRef A)
Get the type attribute's value.
Definition Core.cpp:189
LLVM_C_ABI unsigned LLVMGetMDKindID(const char *Name, unsigned SLen)
Definition Core.cpp:148
LLVM_C_ABI void LLVMContextSetDiagnosticHandler(LLVMContextRef C, LLVMDiagnosticHandler Handler, void *DiagnosticContext)
Set the diagnostic handler for this context.
Definition Core.cpp:106
LLVM_C_ABI const char * LLVMGetStringAttributeValue(LLVMAttributeRef A, unsigned *Length)
Get the string attribute's value.
Definition Core.cpp:222
LLVM_C_ABI uint64_t LLVMGetEnumAttributeValue(LLVMAttributeRef A)
Get the enum attribute's value.
Definition Core.cpp:175
LLVM_C_ABI LLVMBool LLVMIsStringAttribute(LLVMAttributeRef A)
Definition Core.cpp:234
LLVM_C_ABI LLVMAttributeRef LLVMCreateConstantRangeAttribute(LLVMContextRef C, unsigned KindID, unsigned NumBits, const uint64_t LowerWords[], const uint64_t UpperWords[])
Create a ConstantRange attribute.
Definition Core.cpp:194
LLVM_C_ABI 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:156
LLVM_C_ABI LLVMDiagnosticHandler LLVMContextGetDiagnosticHandler(LLVMContextRef C)
Get the diagnostic handler of this context.
Definition Core.cpp:115
LLVM_C_ABI void LLVMContextSetYieldCallback(LLVMContextRef C, LLVMYieldCallback Callback, void *OpaqueHandle)
Set the yield callback function for this context.
Definition Core.cpp:124
LLVM_C_ABI char * LLVMGetDiagInfoDescription(LLVMDiagnosticInfoRef DI)
Return a string representation of the DiagnosticInfo.
Definition Core.cpp:242
LLVM_C_ABI LLVMAttributeRef LLVMCreateStringAttribute(LLVMContextRef C, const char *K, unsigned KLength, const char *V, unsigned VLength)
Create a string attribute.
Definition Core.cpp:208
LLVM_C_ABI unsigned LLVMGetSyncScopeID(LLVMContextRef C, const char *Name, size_t SLen)
Maps a synchronization scope name to a ID unique within this context.
Definition Core.cpp:152
LLVM_C_ABI void LLVMContextSetDiscardValueNames(LLVMContextRef C, LLVMBool Discard)
Set whether the given context discards all value names.
Definition Core.cpp:135
LLVM_C_ABI unsigned LLVMGetMDKindIDInContext(LLVMContextRef C, const char *Name, unsigned SLen)
Definition Core.cpp:143
LLVM_C_ABI unsigned LLVMGetEnumAttributeKind(LLVMAttributeRef A)
Get the unique id corresponding to the enum attribute passed as argument.
Definition Core.cpp:171
LLVM_C_ABI void * LLVMContextGetDiagnosticContext(LLVMContextRef C)
Get the diagnostic context of this context.
Definition Core.cpp:120
LLVM_C_ABI LLVMAttributeRef LLVMCreateTypeAttribute(LLVMContextRef C, unsigned KindID, LLVMTypeRef type_ref)
Create a type attribute.
Definition Core.cpp:182
LLVM_C_ABI unsigned LLVMGetLastEnumAttributeKind(void)
Definition Core.cpp:160
LLVM_C_ABI LLVMBool LLVMContextShouldDiscardValueNames(LLVMContextRef C)
Retrieve whether the given context is set to discard all value names.
Definition Core.cpp:131
LLVM_C_ABI LLVMBool LLVMIsTypeAttribute(LLVMAttributeRef A)
Definition Core.cpp:238
LLVM_C_ABI LLVMContextRef LLVMGetGlobalContext(void)
Obtain the global context instance.
Definition Core.cpp:104
LLVM_C_ABI void LLVMContextDispose(LLVMContextRef C)
Destroy a context instance.
Definition Core.cpp:139
void(* LLVMYieldCallback)(LLVMContextRef, void *)
Definition Core.h:579
LLVM_C_ABI LLVMAttributeRef LLVMCreateEnumAttribute(LLVMContextRef C, unsigned KindID, uint64_t Val)
Create an enum attribute.
Definition Core.cpp:164
LLVM_C_ABI const char * LLVMGetStringAttributeKind(LLVMAttributeRef A, unsigned *Length)
Get the string attribute's kind.
Definition Core.cpp:215
LLVM_C_ABI LLVMContextRef LLVMContextCreate(void)
Create a new context.
Definition Core.cpp:100
void(* LLVMDiagnosticHandler)(LLVMDiagnosticInfoRef, void *)
Definition Core.h:578
LLVM_C_ABI LLVMDiagnosticSeverity LLVMGetDiagInfoSeverity(LLVMDiagnosticInfoRef DI)
Return an enum LLVMDiagnosticSeverity.
Definition Core.cpp:253
LLVM_C_ABI LLVMValueRef LLVMBuildAggregateRet(LLVMBuilderRef, LLVMValueRef *RetVals, unsigned N)
Definition Core.cpp:3452
LLVM_C_ABI LLVMValueRef LLVMBuildMul(LLVMBuilderRef, LLVMValueRef LHS, LLVMValueRef RHS, const char *Name)
Definition Core.cpp:3716
LLVM_C_ABI LLVMValueRef LLVMBuildRetVoid(LLVMBuilderRef)
Definition Core.cpp:3444
LLVM_C_ABI LLVMValueRef LLVMBuildSub(LLVMBuilderRef, LLVMValueRef LHS, LLVMValueRef RHS, const char *Name)
Definition Core.cpp:3696
LLVM_C_ABI LLVMValueRef LLVMBuildNUWMul(LLVMBuilderRef, LLVMValueRef LHS, LLVMValueRef RHS, const char *Name)
Definition Core.cpp:3726
LLVM_C_ABI LLVMBool LLVMGetWeak(LLVMValueRef CmpXchgInst)
Definition Core.cpp:4147
LLVM_C_ABI LLVMValueRef LLVMBuildCast(LLVMBuilderRef B, LLVMOpcode Op, LLVMValueRef Val, LLVMTypeRef DestTy, const char *Name)
Definition Core.cpp:4275
LLVM_C_ABI LLVMValueRef LLVMBuildIsNull(LLVMBuilderRef, LLVMValueRef Val, const char *Name)
Definition Core.cpp:4404
LLVM_C_ABI LLVMValueRef LLVMBuildGEPWithNoWrapFlags(LLVMBuilderRef B, LLVMTypeRef Ty, LLVMValueRef Pointer, LLVMValueRef *Indices, unsigned NumIndices, const char *Name, LLVMGEPNoWrapFlags NoWrapFlags)
Creates a GetElementPtr instruction.
Definition Core.cpp:4105
LLVM_C_ABI LLVMValueRef LLVMBuildAdd(LLVMBuilderRef, LLVMValueRef LHS, LLVMValueRef RHS, const char *Name)
Definition Core.cpp:3676
LLVM_C_ABI LLVMBuilderRef LLVMCreateBuilder(void)
Definition Core.cpp:3332
LLVM_C_ABI void LLVMSetWeak(LLVMValueRef CmpXchgInst, LLVMBool IsWeak)
Definition Core.cpp:4151
LLVM_C_ABI LLVMValueRef LLVMBuildOr(LLVMBuilderRef, LLVMValueRef LHS, LLVMValueRef RHS, const char *Name)
Definition Core.cpp:3796
LLVM_C_ABI LLVMValueRef LLVMBuildBitCast(LLVMBuilderRef, LLVMValueRef Val, LLVMTypeRef DestTy, const char *Name)
Definition Core.cpp:4247
LLVM_C_ABI LLVMValueRef LLVMBuildExactUDiv(LLVMBuilderRef, LLVMValueRef LHS, LLVMValueRef RHS, const char *Name)
Definition Core.cpp:3741
LLVM_C_ABI LLVMValueRef LLVMBuildGEP2(LLVMBuilderRef B, LLVMTypeRef Ty, LLVMValueRef Pointer, LLVMValueRef *Indices, unsigned NumIndices, const char *Name)
Definition Core.cpp:4090
LLVM_C_ABI LLVMValueRef LLVMBuildNSWSub(LLVMBuilderRef, LLVMValueRef LHS, LLVMValueRef RHS, const char *Name)
Definition Core.cpp:3701
LLVM_C_ABI void LLVMPositionBuilderBeforeInstrAndDbgRecords(LLVMBuilderRef Builder, LLVMValueRef Instr)
Set the builder position before Instr and any attached debug records.
Definition Core.cpp:3361
LLVM_C_ABI LLVMValueRef LLVMBuildIsNotNull(LLVMBuilderRef, LLVMValueRef Val, const char *Name)
Definition Core.cpp:4409
LLVM_C_ABI void LLVMDisposeBuilder(LLVMBuilderRef Builder)
Definition Core.cpp:3389
LLVM_C_ABI void LLVMClearInsertionPosition(LLVMBuilderRef Builder)
Definition Core.cpp:3376
LLVM_C_ABI LLVMValueRef LLVMBuildLandingPad(LLVMBuilderRef B, LLVMTypeRef Ty, LLVMValueRef PersFn, unsigned NumClauses, const char *Name)
Definition Core.cpp:3518
LLVM_C_ABI void LLVMSetIsDisjoint(LLVMValueRef Inst, LLVMBool IsDisjoint)
Sets the disjoint flag for the instruction.
Definition Core.cpp:3899
LLVM_C_ABI LLVMBool LLVMIsAtomicSingleThread(LLVMValueRef AtomicInst)
Definition Core.cpp:4485
LLVM_C_ABI LLVMValueRef LLVMBuildResume(LLVMBuilderRef B, LLVMValueRef Exn)
Definition Core.cpp:3548
LLVM_C_ABI void LLVMSetAtomicRMWBinOp(LLVMValueRef AtomicRMWInst, LLVMAtomicRMWBinOp BinOp)
Definition Core.cpp:4186
LLVM_C_ABI LLVMValueRef LLVMBuildFDiv(LLVMBuilderRef, LLVMValueRef LHS, LLVMValueRef RHS, const char *Name)
Definition Core.cpp:3756
LLVM_C_ABI LLVMValueRef LLVMBuildInvokeWithOperandBundles(LLVMBuilderRef, LLVMTypeRef Ty, LLVMValueRef Fn, LLVMValueRef *Args, unsigned NumArgs, LLVMBasicBlockRef Then, LLVMBasicBlockRef Catch, LLVMOperandBundleRef *Bundles, unsigned NumBundles, const char *Name)
Definition Core.cpp:3504
LLVM_C_ABI LLVMValueRef LLVMBuildXor(LLVMBuilderRef, LLVMValueRef LHS, LLVMValueRef RHS, const char *Name)
Definition Core.cpp:3801
LLVM_C_ABI LLVMBool LLVMGetExact(LLVMValueRef DivOrShrInst)
Definition Core.cpp:3858
LLVM_C_ABI LLVMValueRef LLVMBuildAddrSpaceCast(LLVMBuilderRef, LLVMValueRef Val, LLVMTypeRef DestTy, const char *Name)
Definition Core.cpp:4252
LLVM_C_ABI unsigned LLVMGetNumMaskElements(LLVMValueRef ShuffleVectorInst)
Get the number of elements in the mask of a ShuffleVector instruction.
Definition Core.cpp:4467
LLVM_C_ABI void LLVMInsertIntoBuilder(LLVMBuilderRef Builder, LLVMValueRef Instr)
Definition Core.cpp:3380
LLVM_C_ABI LLVMValueRef LLVMBuildCleanupRet(LLVMBuilderRef B, LLVMValueRef CatchPad, LLVMBasicBlockRef BB)
Definition Core.cpp:3569
LLVM_C_ABI LLVMValueRef LLVMBuildFPToSI(LLVMBuilderRef, LLVMValueRef Val, LLVMTypeRef DestTy, const char *Name)
Definition Core.cpp:4212
LLVM_C_ABI void LLVMGetHandlers(LLVMValueRef CatchSwitch, LLVMBasicBlockRef *Handlers)
Obtain the basic blocks acting as handlers for a catchswitch instruction.
Definition Core.cpp:3616
LLVM_C_ABI LLVMValueRef LLVMBuildTrunc(LLVMBuilderRef, LLVMValueRef Val, LLVMTypeRef DestTy, const char *Name)
Definition Core.cpp:4192
LLVM_C_ABI LLVMValueRef LLVMGetArgOperand(LLVMValueRef Funclet, unsigned i)
Definition Core.cpp:3633
LLVM_C_ABI LLVMValueRef LLVMBuildAnd(LLVMBuilderRef, LLVMValueRef LHS, LLVMValueRef RHS, const char *Name)
Definition Core.cpp:3791
LLVM_C_ABI unsigned LLVMGetNumHandlers(LLVMValueRef CatchSwitch)
Definition Core.cpp:3612
LLVM_C_ABI LLVMValueRef LLVMBuildCallBr(LLVMBuilderRef B, LLVMTypeRef Ty, LLVMValueRef Fn, LLVMBasicBlockRef DefaultDest, LLVMBasicBlockRef *IndirectDests, unsigned NumIndirectDests, LLVMValueRef *Args, unsigned NumArgs, LLVMOperandBundleRef *Bundles, unsigned NumBundles, const char *Name)
Definition Core.cpp:3476
LLVM_C_ABI LLVMBasicBlockRef LLVMGetInsertBlock(LLVMBuilderRef Builder)
Definition Core.cpp:3372
LLVM_C_ABI LLVMValueRef LLVMBuildSDiv(LLVMBuilderRef, LLVMValueRef LHS, LLVMValueRef RHS, const char *Name)
Definition Core.cpp:3746
LLVM_C_ABI LLVMValueRef LLVMBuildSExtOrBitCast(LLVMBuilderRef, LLVMValueRef Val, LLVMTypeRef DestTy, const char *Name)
Definition Core.cpp:4263
LLVM_C_ABI LLVMValueRef LLVMBuildCall2(LLVMBuilderRef, LLVMTypeRef, LLVMValueRef Fn, LLVMValueRef *Args, unsigned NumArgs, const char *Name)
Definition Core.cpp:4332
LLVM_C_ABI void LLVMSetNSW(LLVMValueRef ArithInst, LLVMBool HasNSW)
Definition Core.cpp:3853
LLVM_C_ABI LLVMMetadataRef LLVMGetCurrentDebugLocation2(LLVMBuilderRef Builder)
Get location information used by debugging information.
Definition Core.cpp:3395
LLVM_C_ABI LLVMValueRef LLVMBuildUDiv(LLVMBuilderRef, LLVMValueRef LHS, LLVMValueRef RHS, const char *Name)
Definition Core.cpp:3736
LLVM_C_ABI LLVMValueRef LLVMBuildSelect(LLVMBuilderRef, LLVMValueRef If, LLVMValueRef Then, LLVMValueRef Else, const char *Name)
Definition Core.cpp:4355
LLVM_C_ABI void LLVMPositionBuilderBefore(LLVMBuilderRef Builder, LLVMValueRef Instr)
Set the builder position before Instr but after any attached debug records.
Definition Core.cpp:3356
LLVM_C_ABI LLVMBool LLVMCanValueUseFastMathFlags(LLVMValueRef Inst)
Check if a given value can potentially have fast math flags.
Definition Core.cpp:3889
LLVM_C_ABI void LLVMSetArgOperand(LLVMValueRef Funclet, unsigned i, LLVMValueRef value)
Definition Core.cpp:3637
LLVM_C_ABI LLVMValueRef LLVMBuildCondBr(LLVMBuilderRef, LLVMValueRef If, LLVMBasicBlockRef Then, LLVMBasicBlockRef Else)
Definition Core.cpp:3461
LLVM_C_ABI LLVMBool LLVMGetNUW(LLVMValueRef ArithInst)
Definition Core.cpp:3838
LLVM_C_ABI LLVMOpcode LLVMGetCastOpcode(LLVMValueRef Src, LLVMBool SrcIsSigned, LLVMTypeRef DestTy, LLVMBool DestIsSigned)
Definition Core.cpp:4304
LLVM_C_ABI void LLVMInsertIntoBuilderWithName(LLVMBuilderRef Builder, LLVMValueRef Instr, const char *Name)
Definition Core.cpp:3384
LLVM_C_ABI LLVMValueRef LLVMBuildSRem(LLVMBuilderRef, LLVMValueRef LHS, LLVMValueRef RHS, const char *Name)
Definition Core.cpp:3766
LLVM_C_ABI LLVMValueRef LLVMBuildCleanupPad(LLVMBuilderRef B, LLVMValueRef ParentPad, LLVMValueRef *Args, unsigned NumArgs, const char *Name)
Definition Core.cpp:3537
LLVM_C_ABI LLVMValueRef LLVMBuildIntCast(LLVMBuilderRef, LLVMValueRef Val, LLVMTypeRef DestTy, const char *Name)
Deprecated: This cast is always signed.
Definition Core.cpp:4293
LLVM_C_ABI LLVMValueRef LLVMGetCurrentDebugLocation(LLVMBuilderRef Builder)
Deprecated: Returning the NULL location will crash.
Definition Core.cpp:3412
LLVM_C_ABI LLVMValueRef LLVMBuildExtractElement(LLVMBuilderRef, LLVMValueRef VecVal, LLVMValueRef Index, const char *Name)
Definition Core.cpp:4367
LLVM_C_ABI LLVMValueRef LLVMBuildShl(LLVMBuilderRef, LLVMValueRef LHS, LLVMValueRef RHS, const char *Name)
Definition Core.cpp:3776
LLVM_C_ABI LLVMBuilderRef LLVMCreateBuilderInContext(LLVMContextRef C)
Definition Core.cpp:3328
LLVM_C_ABI LLVMValueRef LLVMBuildCatchRet(LLVMBuilderRef B, LLVMValueRef CatchPad, LLVMBasicBlockRef BB)
Definition Core.cpp:3563
LLVM_C_ABI 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:3940
LLVM_C_ABI LLVMAtomicOrdering LLVMGetOrdering(LLVMValueRef MemoryAccessInst)
Definition Core.cpp:4155
LLVM_C_ABI LLVMValueRef LLVMBuildStructGEP2(LLVMBuilderRef B, LLVMTypeRef Ty, LLVMValueRef Pointer, unsigned Idx, const char *Name)
Definition Core.cpp:4115
LLVM_C_ABI int LLVMGetMaskValue(LLVMValueRef ShuffleVectorInst, unsigned Elt)
Get the mask value at position Elt in the mask of a ShuffleVector instruction.
Definition Core.cpp:4473
LLVM_C_ABI void LLVMAddCase(LLVMValueRef Switch, LLVMValueRef OnVal, LLVMBasicBlockRef Dest)
Definition Core.cpp:3579
LLVM_C_ABI LLVMValueRef LLVMBuildBr(LLVMBuilderRef, LLVMBasicBlockRef Dest)
Definition Core.cpp:3457
LLVM_C_ABI LLVMValueRef LLVMBuildInsertElement(LLVMBuilderRef, LLVMValueRef VecVal, LLVMValueRef EltVal, LLVMValueRef Index, const char *Name)
Definition Core.cpp:4373
LLVM_C_ABI void LLVMPositionBuilderBeforeDbgRecords(LLVMBuilderRef Builder, LLVMBasicBlockRef Block, LLVMValueRef Inst)
Set the builder position before Instr and any attached debug records, or if Instr is null set the pos...
Definition Core.cpp:3349
LLVM_C_ABI void LLVMSetFastMathFlags(LLVMValueRef FPMathInst, LLVMFastMathFlags FMF)
Sets the flags for which fast-math-style optimizations are allowed for this value.
Definition Core.cpp:3884
LLVM_C_ABI LLVMValueRef LLVMBuildIntCast2(LLVMBuilderRef, LLVMValueRef Val, LLVMTypeRef DestTy, LLVMBool IsSigned, const char *Name)
Definition Core.cpp:4286
LLVM_C_ABI LLVMValueRef LLVMBuildNUWSub(LLVMBuilderRef, LLVMValueRef LHS, LLVMValueRef RHS, const char *Name)
Definition Core.cpp:3706
LLVM_C_ABI LLVMValueRef LLVMBuildFAdd(LLVMBuilderRef, LLVMValueRef LHS, LLVMValueRef RHS, const char *Name)
Definition Core.cpp:3691
LLVM_C_ABI LLVMValueRef LLVMBuildCatchPad(LLVMBuilderRef B, LLVMValueRef ParentPad, LLVMValueRef *Args, unsigned NumArgs, const char *Name)
Definition Core.cpp:3530
LLVM_C_ABI LLVMValueRef LLVMBuildCallWithOperandBundles(LLVMBuilderRef, LLVMTypeRef, LLVMValueRef Fn, LLVMValueRef *Args, unsigned NumArgs, LLVMOperandBundleRef *Bundles, unsigned NumBundles, const char *Name)
Definition Core.cpp:4341
LLVM_C_ABI LLVMBool LLVMIsCleanup(LLVMValueRef LandingPad)
Definition Core.cpp:3600
LLVM_C_ABI LLVMValueRef LLVMBuildZExtOrBitCast(LLVMBuilderRef, LLVMValueRef Val, LLVMTypeRef DestTy, const char *Name)
Definition Core.cpp:4257
LLVM_C_ABI LLVMBool LLVMGetVolatile(LLVMValueRef Inst)
Definition Core.cpp:4132
LLVM_C_ABI LLVMValueRef LLVMBuildFPCast(LLVMBuilderRef, LLVMValueRef Val, LLVMTypeRef DestTy, const char *Name)
Definition Core.cpp:4299
LLVM_C_ABI LLVMValueRef LLVMBuildPtrToInt(LLVMBuilderRef, LLVMValueRef Val, LLVMTypeRef DestTy, const char *Name)
Definition Core.cpp:4237
LLVM_C_ABI LLVMValueRef LLVMBuildPtrDiff2(LLVMBuilderRef, LLVMTypeRef ElemTy, LLVMValueRef LHS, LLVMValueRef RHS, const char *Name)
Definition Core.cpp:4414
LLVM_C_ABI LLVMValueRef LLVMBuildTruncOrBitCast(LLVMBuilderRef, LLVMValueRef Val, LLVMTypeRef DestTy, const char *Name)
Definition Core.cpp:4269
LLVM_C_ABI LLVMValueRef LLVMBuildArrayAlloca(LLVMBuilderRef, LLVMTypeRef Ty, LLVMValueRef Val, const char *Name)
Definition Core.cpp:3954
LLVM_C_ABI LLVMValueRef LLVMGetClause(LLVMValueRef LandingPad, unsigned Idx)
Definition Core.cpp:3592
LLVM_C_ABI unsigned LLVMGetAtomicSyncScopeID(LLVMValueRef AtomicInst)
Returns the synchronization scope ID of an atomic instruction.
Definition Core.cpp:4504
LLVM_C_ABI LLVMValueRef LLVMBuildVAArg(LLVMBuilderRef, LLVMValueRef List, LLVMTypeRef Ty, const char *Name)
Definition Core.cpp:4362
LLVM_C_ABI LLVMValueRef LLVMBuildAtomicCmpXchgSyncScope(LLVMBuilderRef B, LLVMValueRef Ptr, LLVMValueRef Cmp, LLVMValueRef New, LLVMAtomicOrdering SuccessOrdering, LLVMAtomicOrdering FailureOrdering, unsigned SSID)
Definition Core.cpp:4456
LLVM_C_ABI LLVMValueRef LLVMBuildBinOp(LLVMBuilderRef B, LLVMOpcode Op, LLVMValueRef LHS, LLVMValueRef RHS, const char *Name)
Definition Core.cpp:3806
LLVM_C_ABI LLVMBool LLVMIsAtomic(LLVMValueRef Inst)
Returns whether an instruction is an atomic instruction, e.g., atomicrmw, cmpxchg,...
Definition Core.cpp:4481
LLVM_C_ABI void LLVMSetVolatile(LLVMValueRef MemoryAccessInst, LLVMBool IsVolatile)
Definition Core.cpp:4136
LLVM_C_ABI void LLVMSetAtomicSingleThread(LLVMValueRef AtomicInst, LLVMBool SingleThread)
Definition Core.cpp:4494
LLVM_C_ABI LLVMValueRef LLVMBuildFRem(LLVMBuilderRef, LLVMValueRef LHS, LLVMValueRef RHS, const char *Name)
Definition Core.cpp:3771
LLVM_C_ABI LLVMValueRef LLVMBuildURem(LLVMBuilderRef, LLVMValueRef LHS, LLVMValueRef RHS, const char *Name)
Definition Core.cpp:3761
LLVM_C_ABI LLVMValueRef LLVMBuildIntToPtr(LLVMBuilderRef, LLVMValueRef Val, LLVMTypeRef DestTy, const char *Name)
Definition Core.cpp:4242
LLVM_C_ABI LLVMBool LLVMGetNSW(LLVMValueRef ArithInst)
Definition Core.cpp:3848
LLVM_C_ABI LLVMValueRef LLVMBuildNSWMul(LLVMBuilderRef, LLVMValueRef LHS, LLVMValueRef RHS, const char *Name)
Definition Core.cpp:3721
LLVM_C_ABI LLVMValueRef LLVMBuildFree(LLVMBuilderRef, LLVMValueRef PointerVal)
Definition Core.cpp:3959
LLVM_C_ABI LLVMValueRef LLVMBuildNeg(LLVMBuilderRef, LLVMValueRef V, const char *Name)
Definition Core.cpp:3813
LLVM_C_ABI LLVMValueRef LLVMBuildFSub(LLVMBuilderRef, LLVMValueRef LHS, LLVMValueRef RHS, const char *Name)
Definition Core.cpp:3711
LLVM_C_ABI LLVMValueRef LLVMBuildCatchSwitch(LLVMBuilderRef B, LLVMValueRef ParentPad, LLVMBasicBlockRef UnwindBB, unsigned NumHandlers, const char *Name)
Definition Core.cpp:3552
LLVM_C_ABI LLVMValueRef LLVMBuildLoad2(LLVMBuilderRef, LLVMTypeRef Ty, LLVMValueRef PointerVal, const char *Name)
Definition Core.cpp:3963
LLVM_C_ABI LLVMValueRef LLVMBuildInBoundsGEP2(LLVMBuilderRef B, LLVMTypeRef Ty, LLVMValueRef Pointer, LLVMValueRef *Indices, unsigned NumIndices, const char *Name)
Definition Core.cpp:4097
LLVM_C_ABI LLVMValueRef LLVMBuildArrayMalloc(LLVMBuilderRef, LLVMTypeRef Ty, LLVMValueRef Val, const char *Name)
Definition Core.cpp:3915
LLVM_C_ABI LLVMValueRef LLVMBuildAtomicCmpXchg(LLVMBuilderRef B, LLVMValueRef Ptr, LLVMValueRef Cmp, LLVMValueRef New, LLVMAtomicOrdering SuccessOrdering, LLVMAtomicOrdering FailureOrdering, LLVMBool SingleThread)
Definition Core.cpp:4443
LLVM_C_ABI LLVMValueRef LLVMBuildIndirectBr(LLVMBuilderRef B, LLVMValueRef Addr, unsigned NumDests)
Definition Core.cpp:3471
LLVM_C_ABI LLVMValueRef LLVMBuildUnreachable(LLVMBuilderRef)
Definition Core.cpp:3575
LLVM_C_ABI LLVMValueRef LLVMBuildSIToFP(LLVMBuilderRef, LLVMValueRef Val, LLVMTypeRef DestTy, const char *Name)
Definition Core.cpp:4222
LLVM_C_ABI LLVMValueRef LLVMBuildSExt(LLVMBuilderRef, LLVMValueRef Val, LLVMTypeRef DestTy, const char *Name)
Definition Core.cpp:4202
LLVM_C_ABI LLVMValueRef LLVMBuildFPToUI(LLVMBuilderRef, LLVMValueRef Val, LLVMTypeRef DestTy, const char *Name)
Definition Core.cpp:4207
LLVM_C_ABI 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:3418
LLVM_C_ABI void LLVMSetCurrentDebugLocation2(LLVMBuilderRef Builder, LLVMMetadataRef Loc)
Set location information used by debugging information.
Definition Core.cpp:3399
LLVM_C_ABI LLVMValueRef LLVMBuildAlloca(LLVMBuilderRef, LLVMTypeRef Ty, const char *Name)
Definition Core.cpp:3949
LLVM_C_ABI void LLVMSetCurrentDebugLocation(LLVMBuilderRef Builder, LLVMValueRef L)
Deprecated: Passing the NULL location will crash.
Definition Core.cpp:3406
LLVM_C_ABI LLVMValueRef LLVMBuildPhi(LLVMBuilderRef, LLVMTypeRef Ty, const char *Name)
Definition Core.cpp:4328
LLVM_C_ABI void LLVMAddDestination(LLVMValueRef IndirectBr, LLVMBasicBlockRef Dest)
Definition Core.cpp:3584
LLVM_C_ABI LLVMBool LLVMGetNNeg(LLVMValueRef NonNegInst)
Gets if the instruction has the non-negative flag set.
Definition Core.cpp:3868
LLVM_C_ABI LLVMValueRef LLVMBuildAtomicRMWSyncScope(LLVMBuilderRef B, LLVMAtomicRMWBinOp op, LLVMValueRef PTR, LLVMValueRef Val, LLVMAtomicOrdering ordering, unsigned SSID)
Definition Core.cpp:4432
LLVM_C_ABI LLVMValueRef LLVMBuildRet(LLVMBuilderRef, LLVMValueRef V)
Definition Core.cpp:3448
LLVM_C_ABI LLVMMetadataRef LLVMBuilderGetDefaultFPMathTag(LLVMBuilderRef Builder)
Get the dafult floating-point math metadata for a given builder.
Definition Core.cpp:3438
LLVM_C_ABI LLVMValueRef LLVMBuildExtractValue(LLVMBuilderRef, LLVMValueRef AggVal, unsigned Index, const char *Name)
Definition Core.cpp:4387
LLVM_C_ABI LLVMValueRef LLVMBuildGlobalStringPtr(LLVMBuilderRef B, const char *Str, const char *Name)
Deprecated: Use LLVMBuildGlobalString instead, which has identical behavior.
Definition Core.cpp:4127
LLVM_C_ABI LLVMValueRef LLVMBuildNSWAdd(LLVMBuilderRef, LLVMValueRef LHS, LLVMValueRef RHS, const char *Name)
Definition Core.cpp:3681
LLVM_C_ABI void LLVMPositionBuilderAtEnd(LLVMBuilderRef Builder, LLVMBasicBlockRef Block)
Definition Core.cpp:3367
LLVM_C_ABI LLVMValueRef LLVMBuildFMul(LLVMBuilderRef, LLVMValueRef LHS, LLVMValueRef RHS, const char *Name)
Definition Core.cpp:3731
LLVM_C_ABI LLVMValueRef LLVMBuildLShr(LLVMBuilderRef, LLVMValueRef LHS, LLVMValueRef RHS, const char *Name)
Definition Core.cpp:3781
LLVM_C_ABI LLVMAtomicRMWBinOp LLVMGetAtomicRMWBinOp(LLVMValueRef AtomicRMWInst)
Definition Core.cpp:4182
LLVM_C_ABI LLVMValueRef LLVMBuildFNeg(LLVMBuilderRef, LLVMValueRef V, const char *Name)
Definition Core.cpp:3830
LLVM_C_ABI 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:3924
LLVM_C_ABI void LLVMSetAtomicSyncScopeID(LLVMValueRef AtomicInst, unsigned SSID)
Sets the synchronization scope ID of an atomic instruction.
Definition Core.cpp:4510
LLVM_C_ABI LLVMContextRef LLVMGetBuilderContext(LLVMBuilderRef Builder)
Obtain the context to which this builder is associated.
Definition Core.cpp:3434
LLVM_C_ABI LLVMValueRef LLVMBuildMalloc(LLVMBuilderRef, LLVMTypeRef Ty, const char *Name)
Definition Core.cpp:3906
LLVM_C_ABI LLVMValueRef LLVMBuildFreeze(LLVMBuilderRef, LLVMValueRef Val, const char *Name)
Definition Core.cpp:4399
LLVM_C_ABI LLVMValueRef LLVMBuildGlobalString(LLVMBuilderRef B, const char *Str, const char *Name)
Definition Core.cpp:4122
LLVM_C_ABI void LLVMSetNUW(LLVMValueRef ArithInst, LLVMBool HasNUW)
Definition Core.cpp:3843
LLVM_C_ABI LLVMAtomicOrdering LLVMGetCmpXchgSuccessOrdering(LLVMValueRef CmpXchgInst)
Definition Core.cpp:4516
LLVM_C_ABI LLVMValueRef LLVMBuildFCmp(LLVMBuilderRef, LLVMRealPredicate Op, LLVMValueRef LHS, LLVMValueRef RHS, const char *Name)
Definition Core.cpp:4319
LLVM_C_ABI LLVMValueRef LLVMBuildPointerCast(LLVMBuilderRef, LLVMValueRef Val, LLVMTypeRef DestTy, const char *Name)
Definition Core.cpp:4281
LLVM_C_ABI LLVMValueRef LLVMBuildExactSDiv(LLVMBuilderRef, LLVMValueRef LHS, LLVMValueRef RHS, const char *Name)
Definition Core.cpp:3751
LLVM_C_ABI LLVMValueRef LLVMBuildShuffleVector(LLVMBuilderRef, LLVMValueRef V1, LLVMValueRef V2, LLVMValueRef Mask, const char *Name)
Definition Core.cpp:4380
LLVM_C_ABI LLVMValueRef LLVMBuildFPExt(LLVMBuilderRef, LLVMValueRef Val, LLVMTypeRef DestTy, const char *Name)
Definition Core.cpp:4232
LLVM_C_ABI void LLVMSetCleanup(LLVMValueRef LandingPad, LLVMBool Val)
Definition Core.cpp:3604
LLVM_C_ABI LLVMValueRef LLVMBuildICmp(LLVMBuilderRef, LLVMIntPredicate Op, LLVMValueRef LHS, LLVMValueRef RHS, const char *Name)
Definition Core.cpp:4312
LLVM_C_ABI void LLVMSetCmpXchgFailureOrdering(LLVMValueRef CmpXchgInst, LLVMAtomicOrdering Ordering)
Definition Core.cpp:4534
LLVM_C_ABI void LLVMAddClause(LLVMValueRef LandingPad, LLVMValueRef ClauseVal)
Definition Core.cpp:3596
LLVM_C_ABI LLVMValueRef LLVMBuildFence(LLVMBuilderRef B, LLVMAtomicOrdering ordering, LLVMBool singleThread, const char *Name)
Definition Core.cpp:4074
LLVM_C_ABI void LLVMSetParentCatchSwitch(LLVMValueRef CatchPad, LLVMValueRef CatchSwitch)
Set the parent catchswitch instruction of a catchpad instruction.
Definition Core.cpp:3626
LLVM_C_ABI LLVMValueRef LLVMBuildFenceSyncScope(LLVMBuilderRef B, LLVMAtomicOrdering ordering, unsigned SSID, const char *Name)
Definition Core.cpp:4083
LLVM_C_ABI LLVMValueRef LLVMBuildUIToFP(LLVMBuilderRef, LLVMValueRef Val, LLVMTypeRef DestTy, const char *Name)
Definition Core.cpp:4217
LLVM_C_ABI void LLVMPositionBuilder(LLVMBuilderRef Builder, LLVMBasicBlockRef Block, LLVMValueRef Instr)
Set the builder position before Instr but after any attached debug records, or if Instr is null set t...
Definition Core.cpp:3343
LLVM_C_ABI unsigned LLVMGetNumClauses(LLVMValueRef LandingPad)
Definition Core.cpp:3588
LLVM_C_ABI int LLVMGetUndefMaskElem(void)
Definition Core.cpp:4479
LLVM_C_ABI void LLVMSetCmpXchgSuccessOrdering(LLVMValueRef CmpXchgInst, LLVMAtomicOrdering Ordering)
Definition Core.cpp:4521
LLVM_C_ABI LLVMValueRef LLVMGetParentCatchSwitch(LLVMValueRef CatchPad)
Get the parent catchswitch instruction of a catchpad instruction.
Definition Core.cpp:3622
LLVM_C_ABI LLVMFastMathFlags LLVMGetFastMathFlags(LLVMValueRef FPMathInst)
Get the flags for which fast-math-style optimizations are allowed for this value.
Definition Core.cpp:3878
LLVM_C_ABI LLVMBool LLVMGetIsDisjoint(LLVMValueRef Inst)
Gets whether the instruction has the disjoint flag set.
Definition Core.cpp:3894
LLVM_C_ABI LLVMValueRef LLVMBuildSwitch(LLVMBuilderRef, LLVMValueRef V, LLVMBasicBlockRef Else, unsigned NumCases)
Definition Core.cpp:3466
LLVM_C_ABI void LLVMSetNNeg(LLVMValueRef NonNegInst, LLVMBool IsNonNeg)
Sets the non-negative flag for the instruction.
Definition Core.cpp:3873
LLVM_C_ABI 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:3931
LLVM_C_ABI void LLVMAddHandler(LLVMValueRef CatchSwitch, LLVMBasicBlockRef Dest)
Definition Core.cpp:3608
LLVM_C_ABI void LLVMSetExact(LLVMValueRef DivOrShrInst, LLVMBool IsExact)
Definition Core.cpp:3863
LLVM_C_ABI LLVMValueRef LLVMBuildNSWNeg(LLVMBuilderRef B, LLVMValueRef V, const char *Name)
Definition Core.cpp:3817
LLVM_C_ABI LLVMValueRef LLVMBuildAShr(LLVMBuilderRef, LLVMValueRef LHS, LLVMValueRef RHS, const char *Name)
Definition Core.cpp:3786
LLVM_C_ABI LLVMValueRef LLVMBuildInvoke2(LLVMBuilderRef, LLVMTypeRef Ty, LLVMValueRef Fn, LLVMValueRef *Args, unsigned NumArgs, LLVMBasicBlockRef Then, LLVMBasicBlockRef Catch, const char *Name)
Definition Core.cpp:3495
LLVM_C_ABI void LLVMSetOrdering(LLVMValueRef MemoryAccessInst, LLVMAtomicOrdering Ordering)
Definition Core.cpp:4169
LLVM_C_ABI LLVMValueRef LLVMBuildFPTrunc(LLVMBuilderRef, LLVMValueRef Val, LLVMTypeRef DestTy, const char *Name)
Definition Core.cpp:4227
LLVM_C_ABI LLVMValueRef LLVMBuildStore(LLVMBuilderRef, LLVMValueRef Val, LLVMValueRef Ptr)
Definition Core.cpp:3968
LLVM_C_ABI void LLVMAddMetadataToInst(LLVMBuilderRef Builder, LLVMValueRef Inst)
Adds the metadata registered with the given builder to the given instruction.
Definition Core.cpp:3422
LLVM_C_ABI LLVMAtomicOrdering LLVMGetCmpXchgFailureOrdering(LLVMValueRef CmpXchgInst)
Definition Core.cpp:4529
LLVM_C_ABI LLVMValueRef LLVMBuildNUWAdd(LLVMBuilderRef, LLVMValueRef LHS, LLVMValueRef RHS, const char *Name)
Definition Core.cpp:3686
LLVM_C_ABI LLVMValueRef LLVMBuildInsertValue(LLVMBuilderRef, LLVMValueRef AggVal, LLVMValueRef EltVal, unsigned Index, const char *Name)
Definition Core.cpp:4392
LLVM_C_ABI void LLVMBuilderSetDefaultFPMathTag(LLVMBuilderRef Builder, LLVMMetadataRef FPMathTag)
Set the default floating-point math metadata for the given builder.
Definition Core.cpp:3426
LLVM_C_ABI LLVMValueRef LLVMBuildZExt(LLVMBuilderRef, LLVMValueRef Val, LLVMTypeRef DestTy, const char *Name)
Definition Core.cpp:4197
LLVM_C_ABI LLVMValueRef LLVMBuildNot(LLVMBuilderRef, LLVMValueRef V, const char *Name)
Definition Core.cpp:3834
LLVM_C_ABI LLVMValueRef LLVMBuildAtomicRMW(LLVMBuilderRef B, LLVMAtomicRMWBinOp op, LLVMValueRef PTR, LLVMValueRef Val, LLVMAtomicOrdering ordering, LLVMBool singleThread)
Definition Core.cpp:4421
LLVM_C_ABI LLVMMemoryBufferRef LLVMCreateMemoryBufferWithMemoryRange(const char *InputData, size_t InputDataLength, const char *BufferName, LLVMBool RequiresNullTerminator)
Definition Core.cpp:4581
LLVM_C_ABI size_t LLVMGetBufferSize(LLVMMemoryBufferRef MemBuf)
Definition Core.cpp:4606
LLVM_C_ABI LLVMMemoryBufferRef LLVMCreateMemoryBufferWithMemoryRangeCopy(const char *InputData, size_t InputDataLength, const char *BufferName)
Definition Core.cpp:4592
LLVM_C_ABI const char * LLVMGetBufferStart(LLVMMemoryBufferRef MemBuf)
Definition Core.cpp:4602
LLVM_C_ABI LLVMBool LLVMCreateMemoryBufferWithContentsOfFile(const char *Path, LLVMMemoryBufferRef *OutMemBuf, char **OutMessage)
Definition Core.cpp:4556
LLVM_C_ABI LLVMBool LLVMCreateMemoryBufferWithSTDIN(LLVMMemoryBufferRef *OutMemBuf, char **OutMessage)
Definition Core.cpp:4570
LLVM_C_ABI void LLVMDisposeMemoryBuffer(LLVMMemoryBufferRef MemBuf)
Definition Core.cpp:4610
LLVM_C_ABI LLVMModuleProviderRef LLVMCreateModuleProviderForExistingModule(LLVMModuleRef M)
Changes the type of M so it can be passed to FunctionPassManagers and the JIT.
Definition Core.cpp:4545
LLVM_C_ABI void LLVMDisposeModuleProvider(LLVMModuleProviderRef M)
Destroys the module M.
Definition Core.cpp:4549
LLVM_C_ABI char * LLVMPrintModuleToString(LLVMModuleRef M)
Return a string representation of the module.
Definition Core.cpp:471
LLVM_C_ABI 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:1400
LLVM_C_ABI LLVMValueRef LLVMGetNamedFunctionWithLength(LLVMModuleRef M, const char *Name, size_t Length)
Obtain a Function value from a Module by its name.
Definition Core.cpp:2418
LLVM_C_ABI unsigned LLVMGetDebugLocColumn(LLVMValueRef Val)
Return the column number of the debug location for this value, which must be an llvm::Instruction.
Definition Core.cpp:1528
LLVM_C_ABI 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:1395
LLVM_C_ABI LLVMModuleRef LLVMModuleCreateWithNameInContext(const char *ModuleID, LLVMContextRef C)
Create a new, empty module in a specific context.
Definition Core.cpp:280
LLVM_C_ABI const char * LLVMGetTarget(LLVMModuleRef M)
Obtain the target triple for a module.
Definition Core.cpp:323
LLVM_C_ABI LLVMBool LLVMGetInlineAsmCanUnwind(LLVMValueRef InlineAsmVal)
Get if the inline asm snippet may unwind the stack.
Definition Core.cpp:569
LLVM_C_ABI const char * LLVMGetModuleInlineAsm(LLVMModuleRef M, size_t *Len)
Get inline assembly for a module.
Definition Core.cpp:494
LLVM_C_ABI LLVMBool LLVMGetInlineAsmNeedsAlignedStack(LLVMValueRef InlineAsmVal)
Get if the inline asm snippet needs an aligned stack.
Definition Core.cpp:564
LLVM_C_ABI LLVMBool LLVMGetInlineAsmHasSideEffects(LLVMValueRef InlineAsmVal)
Get if the inline asm snippet has side effects.
Definition Core.cpp:559
LLVM_C_ABI unsigned LLVMGetNamedMetadataNumOperands(LLVMModuleRef M, const char *Name)
Obtain the number of operands for named metadata in a module.
Definition Core.cpp:1431
LLVM_C_ABI void LLVMDumpModule(LLVMModuleRef M)
Dump a representation of a module to stderr.
Definition Core.cpp:444
LLVM_C_ABI void LLVMSetTarget(LLVMModuleRef M, const char *Triple)
Set the target triple for a module.
Definition Core.cpp:327
LLVM_C_ABI LLVMTypeRef LLVMGetInlineAsmFunctionType(LLVMValueRef InlineAsmVal)
Get the function type of the inline assembly snippet.
Definition Core.cpp:554
LLVM_C_ABI LLVMBool LLVMIsNewDbgInfoFormat(LLVMModuleRef M)
Soon to be deprecated.
Definition Core.cpp:434
LLVM_C_ABI LLVMContextRef LLVMGetModuleContext(LLVMModuleRef M)
Obtain the context to which this module is associated.
Definition Core.cpp:575
LLVM_C_ABI LLVMInlineAsmDialect LLVMGetInlineAsmDialect(LLVMValueRef InlineAsmVal)
Get the dialect used by the inline asm snippet.
Definition Core.cpp:538
LLVM_C_ABI LLVMModuleRef LLVMCloneModule(LLVMModuleRef M)
Return an exact copy of the specified module.
LLVM_C_ABI void LLVMSetModuleInlineAsm(LLVMModuleRef M, const char *Asm)
Deprecated: Use LLVMSetModuleInlineAsm2 instead.
Definition Core.cpp:486
LLVM_C_ABI LLVMValueRef LLVMGetNextFunction(LLVMValueRef Fn)
Advance a Function iterator to the next Function.
Definition Core.cpp:2439
LLVM_C_ABI const char * LLVMGetModuleIdentifier(LLVMModuleRef M, size_t *Len)
Obtain the identifier of a module.
Definition Core.cpp:289
LLVM_C_ABI const char * LLVMGetSourceFileName(LLVMModuleRef M, size_t *Len)
Obtain the module's original source file name.
Definition Core.cpp:299
LLVM_C_ABI LLVMModuleRef LLVMModuleCreateWithName(const char *ModuleID)
Create a new, empty module in the global context.
Definition Core.cpp:276
LLVM_C_ABI const char * LLVMGetDataLayoutStr(LLVMModuleRef M)
Obtain the data layout for a module.
Definition Core.cpp:310
LLVM_C_ABI LLVMModuleFlagBehavior LLVMModuleFlagEntriesGetFlagBehavior(LLVMModuleFlagEntry *Entries, unsigned Index)
Returns the flag behavior for a module flag entry at a specific index.
Definition Core.cpp:400
LLVM_C_ABI void LLVMSetIsNewDbgInfoFormat(LLVMModuleRef M, LLVMBool UseNewFormat)
Soon to be deprecated.
Definition Core.cpp:436
LLVM_C_ABI LLVMTypeRef LLVMGetTypeByName(LLVMModuleRef M, const char *Name)
Deprecated: Use LLVMGetTypeByName2 instead.
Definition Core.cpp:848
LLVM_C_ABI 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:295
LLVM_C_ABI const char * LLVMGetInlineAsmAsmString(LLVMValueRef InlineAsmVal, size_t *Len)
Get the template string used for an inline assembly snippet.
Definition Core.cpp:520
LLVM_C_ABI LLVMValueRef LLVMGetInlineAsm(LLVMTypeRef Ty, const char *AsmString, size_t AsmStringSize, const char *Constraints, size_t ConstraintsSize, LLVMBool HasSideEffects, LLVMBool IsAlignStack, LLVMInlineAsmDialect Dialect, LLVMBool CanThrow)
Create the specified uniqued inline asm string.
Definition Core.cpp:500
LLVM_C_ABI LLVMValueRef LLVMGetOrInsertFunction(LLVMModuleRef M, const char *Name, size_t NameLen, LLVMTypeRef FunctionTy)
Obtain or insert a function into a module.
Definition Core.cpp:2406
LLVM_C_ABI const char * LLVMGetInlineAsmConstraintString(LLVMValueRef InlineAsmVal, size_t *Len)
Get the raw constraint string for an inline assembly snippet.
Definition Core.cpp:529
LLVM_C_ABI LLVMNamedMDNodeRef LLVMGetNextNamedMetadata(LLVMNamedMDNodeRef NamedMDNode)
Advance a NamedMDNode iterator to the next NamedMDNode.
Definition Core.cpp:1379
LLVM_C_ABI void LLVMGetNamedMetadataOperands(LLVMModuleRef M, const char *Name, LLVMValueRef *Dest)
Obtain the named metadata operands for a module.
Definition Core.cpp:1438
LLVM_C_ABI LLVMMetadataRef LLVMGetModuleFlag(LLVMModuleRef M, const char *Key, size_t KeyLen)
Add a module-level flag to the module-level flags metadata if it doesn't already exist.
Definition Core.cpp:422
LLVM_C_ABI LLVMValueRef LLVMAddFunction(LLVMModuleRef M, const char *Name, LLVMTypeRef FunctionTy)
Add a function to a module under a specified name.
Definition Core.cpp:2400
LLVM_C_ABI LLVMValueRef LLVMGetPreviousFunction(LLVMValueRef Fn)
Decrement a Function iterator to the previous Function.
Definition Core.cpp:2447
LLVM_C_ABI const char * LLVMGetDebugLocDirectory(LLVMValueRef Val, unsigned *Length)
Return the directory of the debug location for this value, which must be an llvm::Instruction,...
Definition Core.cpp:1458
LLVM_C_ABI void LLVMAddNamedMetadataOperand(LLVMModuleRef M, const char *Name, LLVMValueRef Val)
Add an operand to named metadata.
Definition Core.cpp:1448
LLVM_C_ABI unsigned LLVMGetDebugLocLine(LLVMValueRef Val)
Return the line number of the debug location for this value, which must be an llvm::Instruction,...
Definition Core.cpp:1506
LLVM_C_ABI LLVMMetadataRef LLVMModuleFlagEntriesGetMetadata(LLVMModuleFlagEntry *Entries, unsigned Index)
Returns the metadata for a module flag entry at a specific index.
Definition Core.cpp:415
LLVM_C_ABI 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't already exist.
Definition Core.cpp:427
LLVM_C_ABI LLVMValueRef LLVMGetLastFunction(LLVMModuleRef M)
Obtain an iterator to the last Function in a Module.
Definition Core.cpp:2431
LLVM_C_ABI LLVMNamedMDNodeRef LLVMGetPreviousNamedMetadata(LLVMNamedMDNodeRef NamedMDNode)
Decrement a NamedMDNode iterator to the previous NamedMDNode.
Definition Core.cpp:1387
LLVM_C_ABI const char * LLVMGetNamedMetadataName(LLVMNamedMDNodeRef NamedMD, size_t *NameLen)
Retrieve the name of a NamedMDNode.
Definition Core.cpp:1405
LLVM_C_ABI LLVMValueRef LLVMGetNamedFunction(LLVMModuleRef M, const char *Name)
Obtain a Function value from a Module by its name.
Definition Core.cpp:2414
LLVM_C_ABI const char * LLVMGetDebugLocFilename(LLVMValueRef Val, unsigned *Length)
Return the filename of the debug location for this value, which must be an llvm::Instruction,...
Definition Core.cpp:1482
LLVM_C_ABI void LLVMAppendModuleInlineAsm(LLVMModuleRef M, const char *Asm, size_t Len)
Append inline assembly to a module.
Definition Core.cpp:490
LLVM_C_ABI void LLVMSetDataLayout(LLVMModuleRef M, const char *DataLayoutStr)
Set the data layout for a module.
Definition Core.cpp:318
LLVM_C_ABI void LLVMDisposeModuleFlagsMetadata(LLVMModuleFlagEntry *Entries)
Destroys module flags metadata entries.
Definition Core.cpp:395
LLVM_C_ABI void LLVMDisposeModule(LLVMModuleRef M)
Destroy a module instance.
Definition Core.cpp:285
LLVM_C_ABI LLVMNamedMDNodeRef LLVMGetLastNamedMetadata(LLVMModuleRef M)
Obtain an iterator to the last NamedMDNode in a Module.
Definition Core.cpp:1371
LLVM_C_ABI void LLVMSetModuleInlineAsm2(LLVMModuleRef M, const char *Asm, size_t Len)
Set inline assembly for a module.
Definition Core.cpp:482
LLVM_C_ABI LLVMValueRef LLVMGetFirstFunction(LLVMModuleRef M)
Obtain an iterator to the first Function in a Module.
Definition Core.cpp:2423
LLVM_C_ABI LLVMNamedMDNodeRef LLVMGetFirstNamedMetadata(LLVMModuleRef M)
Obtain an iterator to the first NamedMDNode in a Module.
Definition Core.cpp:1363
LLVM_C_ABI 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:407
LLVM_C_ABI 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:305
LLVM_C_ABI LLVMBool LLVMPrintModuleToFile(LLVMModuleRef M, const char *Filename, char **ErrorMessage)
Print a representation of a module to a file.
Definition Core.cpp:449
LLVM_C_ABI const char * LLVMGetDataLayout(LLVMModuleRef M)
Definition Core.cpp:314
LLVM_C_ABI LLVMModuleFlagEntry * LLVMCopyModuleFlagsMetadata(LLVMModuleRef M, size_t *Len)
Returns the module flags as an array of flag-key-value triples.
Definition Core.cpp:378
LLVM_C_ABI LLVMOperandBundleRef LLVMCreateOperandBundle(const char *Tag, size_t TagLen, LLVMValueRef *Args, unsigned NumArgs)
Create a new operand bundle.
Definition Core.cpp:2762
LLVM_C_ABI unsigned LLVMGetNumOperandBundleArgs(LLVMOperandBundleRef Bundle)
Obtain the number of operands for an operand bundle.
Definition Core.cpp:2779
LLVM_C_ABI const char * LLVMGetOperandBundleTag(LLVMOperandBundleRef Bundle, size_t *Len)
Obtain the tag of an operand bundle as a string.
Definition Core.cpp:2773
LLVM_C_ABI void LLVMDisposeOperandBundle(LLVMOperandBundleRef Bundle)
Destroy an operand bundle.
Definition Core.cpp:2769
LLVM_C_ABI LLVMValueRef LLVMGetOperandBundleArgAtIndex(LLVMOperandBundleRef Bundle, unsigned Index)
Obtain the operand for an operand bundle at the given index.
Definition Core.cpp:2783
LLVM_C_ABI LLVMPassManagerRef LLVMCreateFunctionPassManager(LLVMModuleProviderRef MP)
Deprecated: Use LLVMCreateFunctionPassManagerForModule instead.
Definition Core.cpp:4624
LLVM_C_ABI LLVMPassManagerRef LLVMCreateFunctionPassManagerForModule(LLVMModuleRef M)
Constructs a new function-by-function pass pipeline over the module provider.
Definition Core.cpp:4620
LLVM_C_ABI LLVMBool LLVMFinalizeFunctionPassManager(LLVMPassManagerRef FPM)
Finalizes all of the function passes scheduled in the function pass manager.
Definition Core.cpp:4641
LLVM_C_ABI void LLVMDisposePassManager(LLVMPassManagerRef PM)
Frees the memory of a pass pipeline.
Definition Core.cpp:4645
LLVM_C_ABI 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:4637
LLVM_C_ABI LLVMBool LLVMInitializeFunctionPassManager(LLVMPassManagerRef FPM)
Initializes all of the function passes scheduled in the function pass manager.
Definition Core.cpp:4633
LLVM_C_ABI 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:4629
LLVM_C_ABI LLVMPassManagerRef LLVMCreatePassManager(void)
Constructs a new whole-module pass pipeline.
Definition Core.cpp:4616
LLVM_C_ABI void LLVMStopMultithreaded(void)
Deprecated: Multi-threading can only be enabled/disabled with the compile time define LLVM_ENABLE_THR...
Definition Core.cpp:4655
LLVM_C_ABI LLVMBool LLVMStartMultithreaded(void)
Deprecated: Multi-threading can only be enabled/disabled with the compile time define LLVM_ENABLE_THR...
Definition Core.cpp:4651
LLVM_C_ABI LLVMBool LLVMIsMultithreaded(void)
Check whether LLVM is executing in thread-safe mode or not.
Definition Core.cpp:4658
LLVM_C_ABI LLVMTypeRef LLVMBFloatType(void)
Definition Core.cpp:739
LLVM_C_ABI LLVMTypeRef LLVMPPCFP128Type(void)
Definition Core.cpp:754
LLVM_C_ABI LLVMTypeRef LLVMHalfTypeInContext(LLVMContextRef C)
Obtain a 16-bit floating point type from a context.
Definition Core.cpp:711
LLVM_C_ABI LLVMTypeRef LLVMHalfType(void)
Obtain a floating point type from the global context.
Definition Core.cpp:736
LLVM_C_ABI LLVMTypeRef LLVMBFloatTypeInContext(LLVMContextRef C)
Obtain a 16-bit brain floating point type from a context.
Definition Core.cpp:714
LLVM_C_ABI LLVMTypeRef LLVMPPCFP128TypeInContext(LLVMContextRef C)
Obtain a 128-bit floating point type (two 64-bits) from a context.
Definition Core.cpp:729
LLVM_C_ABI LLVMTypeRef LLVMDoubleTypeInContext(LLVMContextRef C)
Obtain a 64-bit floating point type from a context.
Definition Core.cpp:720
LLVM_C_ABI LLVMTypeRef LLVMDoubleType(void)
Definition Core.cpp:745
LLVM_C_ABI LLVMTypeRef LLVMFP128Type(void)
Definition Core.cpp:751
LLVM_C_ABI LLVMTypeRef LLVMX86FP80Type(void)
Definition Core.cpp:748
LLVM_C_ABI LLVMTypeRef LLVMFloatTypeInContext(LLVMContextRef C)
Obtain a 32-bit floating point type from a context.
Definition Core.cpp:717
LLVM_C_ABI LLVMTypeRef LLVMFloatType(void)
Definition Core.cpp:742
LLVM_C_ABI LLVMTypeRef LLVMFP128TypeInContext(LLVMContextRef C)
Obtain a 128-bit floating point type (112-bit mantissa) from a context.
Definition Core.cpp:726
LLVM_C_ABI LLVMTypeRef LLVMX86FP80TypeInContext(LLVMContextRef C)
Obtain a 80-bit floating point type (X87) from a context.
Definition Core.cpp:723
LLVM_C_ABI LLVMTypeRef LLVMGetReturnType(LLVMTypeRef FunctionTy)
Obtain the Type this function Type returns.
Definition Core.cpp:774
LLVM_C_ABI LLVMTypeRef LLVMFunctionType(LLVMTypeRef ReturnType, LLVMTypeRef *ParamTypes, unsigned ParamCount, LLVMBool IsVarArg)
Obtain a function type consisting of a specified signature.
Definition Core.cpp:763
LLVM_C_ABI LLVMBool LLVMIsFunctionVarArg(LLVMTypeRef FunctionTy)
Returns whether a function type is variadic.
Definition Core.cpp:770
LLVM_C_ABI unsigned LLVMCountParamTypes(LLVMTypeRef FunctionTy)
Obtain the number of parameters this function accepts.
Definition Core.cpp:778
LLVM_C_ABI void LLVMGetParamTypes(LLVMTypeRef FunctionTy, LLVMTypeRef *Dest)
Obtain the types of a function's parameters.
Definition Core.cpp:782
LLVM_C_ABI LLVMTypeRef LLVMInt1TypeInContext(LLVMContextRef C)
Obtain an integer type from a context with specified bit width.
Definition Core.cpp:661
LLVM_C_ABI LLVMTypeRef LLVMInt8TypeInContext(LLVMContextRef C)
Definition Core.cpp:664
LLVM_C_ABI LLVMTypeRef LLVMInt32TypeInContext(LLVMContextRef C)
Definition Core.cpp:670
LLVM_C_ABI LLVMTypeRef LLVMInt16Type(void)
Definition Core.cpp:689
LLVM_C_ABI LLVMTypeRef LLVMInt1Type(void)
Obtain an integer type from the global context with a specified bit width.
Definition Core.cpp:683
LLVM_C_ABI LLVMTypeRef LLVMInt8Type(void)
Definition Core.cpp:686
LLVM_C_ABI LLVMTypeRef LLVMIntType(unsigned NumBits)
Definition Core.cpp:701
LLVM_C_ABI LLVMTypeRef LLVMInt32Type(void)
Definition Core.cpp:692
LLVM_C_ABI LLVMTypeRef LLVMIntTypeInContext(LLVMContextRef C, unsigned NumBits)
Definition Core.cpp:679
LLVM_C_ABI LLVMTypeRef LLVMInt64Type(void)
Definition Core.cpp:695
LLVM_C_ABI LLVMTypeRef LLVMInt64TypeInContext(LLVMContextRef C)
Definition Core.cpp:673
LLVM_C_ABI LLVMTypeRef LLVMInt16TypeInContext(LLVMContextRef C)
Definition Core.cpp:667
LLVM_C_ABI unsigned LLVMGetIntTypeWidth(LLVMTypeRef IntegerTy)
Definition Core.cpp:705
LLVM_C_ABI LLVMTypeRef LLVMInt128TypeInContext(LLVMContextRef C)
Definition Core.cpp:676
LLVM_C_ABI LLVMTypeRef LLVMInt128Type(void)
Definition Core.cpp:698
LLVM_C_ABI LLVMTypeRef LLVMX86AMXType(void)
Definition Core.cpp:757
LLVM_C_ABI LLVMTypeRef LLVMVoidType(void)
These are similar to the above functions except they operate on the global context.
Definition Core.cpp:954
LLVM_C_ABI unsigned LLVMGetTargetExtTypeNumTypeParams(LLVMTypeRef TargetExtTy)
Obtain the number of type parameters for this target extension type.
Definition Core.cpp:977
LLVM_C_ABI LLVMTypeRef LLVMX86AMXTypeInContext(LLVMContextRef C)
Create a X86 AMX type in a context.
Definition Core.cpp:732
LLVM_C_ABI const char * LLVMGetTargetExtTypeName(LLVMTypeRef TargetExtTy)
Obtain the name for this target extension type.
Definition Core.cpp:972
LLVM_C_ABI LLVMTypeRef LLVMLabelType(void)
Definition Core.cpp:957
LLVM_C_ABI LLVMTypeRef LLVMVoidTypeInContext(LLVMContextRef C)
Create a void type in a context.
Definition Core.cpp:941
LLVM_C_ABI LLVMTypeRef LLVMTokenTypeInContext(LLVMContextRef C)
Create a token type in a context.
Definition Core.cpp:947
LLVM_C_ABI unsigned LLVMGetTargetExtTypeNumIntParams(LLVMTypeRef TargetExtTy)
Obtain the number of int parameters for this target extension type.
Definition Core.cpp:988
LLVM_C_ABI LLVMTypeRef LLVMLabelTypeInContext(LLVMContextRef C)
Create a label type in a context.
Definition Core.cpp:944
LLVM_C_ABI LLVMTypeRef LLVMMetadataTypeInContext(LLVMContextRef C)
Create a metadata type in a context.
Definition Core.cpp:950
LLVM_C_ABI LLVMTypeRef LLVMGetTargetExtTypeTypeParam(LLVMTypeRef TargetExtTy, unsigned Idx)
Get the type parameter at the given index for the target extension type.
Definition Core.cpp:982
LLVM_C_ABI LLVMTypeRef LLVMTargetExtTypeInContext(LLVMContextRef C, const char *Name, LLVMTypeRef *TypeParams, unsigned TypeParamCount, unsigned *IntParams, unsigned IntParamCount)
Create a target extension type in LLVM context.
Definition Core.cpp:961
LLVM_C_ABI unsigned LLVMGetTargetExtTypeIntParam(LLVMTypeRef TargetExtTy, unsigned Idx)
Get the int parameter at the given index for the target extension type.
Definition Core.cpp:993
LLVM_C_ABI LLVMValueRef LLVMGetConstantPtrAuthAddrDiscriminator(LLVMValueRef PtrAuth)
Get the address discriminator value for the associated ConstantPtrAuth constant.
Definition Core.cpp:931
LLVM_C_ABI LLVMBool LLVMPointerTypeIsOpaque(LLVMTypeRef Ty)
Determine whether a pointer is opaque.
Definition Core.cpp:879
LLVM_C_ABI LLVMTypeRef LLVMPointerTypeInContext(LLVMContextRef C, unsigned AddressSpace)
Create an opaque pointer type in a context.
Definition Core.cpp:937
LLVM_C_ABI 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:883
LLVM_C_ABI LLVMTypeRef LLVMGetElementType(LLVMTypeRef Ty)
Obtain the element type of an array or vector type.
Definition Core.cpp:892
LLVM_C_ABI LLVMTypeRef LLVMScalableVectorType(LLVMTypeRef ElementType, unsigned ElementCount)
Create a vector type that contains a defined type and has a scalable number of elements.
Definition Core.cpp:887
LLVM_C_ABI LLVMValueRef LLVMGetConstantPtrAuthDiscriminator(LLVMValueRef PtrAuth)
Get the discriminator value for the associated ConstantPtrAuth constant.
Definition Core.cpp:927
LLVM_C_ABI uint64_t LLVMGetArrayLength2(LLVMTypeRef ArrayTy)
Obtain the length of an array type.
Definition Core.cpp:907
LLVM_C_ABI LLVMValueRef LLVMGetConstantPtrAuthKey(LLVMValueRef PtrAuth)
Get the key value for the associated ConstantPtrAuth constant.
Definition Core.cpp:923
LLVM_C_ABI unsigned LLVMGetArrayLength(LLVMTypeRef ArrayTy)
Obtain the length of an array type.
Definition Core.cpp:903
LLVM_C_ABI LLVMValueRef LLVMGetConstantPtrAuthPointer(LLVMValueRef PtrAuth)
Get the pointer value for the associated ConstantPtrAuth constant.
Definition Core.cpp:919
LLVM_C_ABI unsigned LLVMGetPointerAddressSpace(LLVMTypeRef PointerTy)
Obtain the address space of a pointer type.
Definition Core.cpp:911
LLVM_C_ABI LLVMTypeRef LLVMArrayType2(LLVMTypeRef ElementType, uint64_t ElementCount)
Create a fixed size array type that refers to a specific type.
Definition Core.cpp:870
LLVM_C_ABI unsigned LLVMGetVectorSize(LLVMTypeRef VectorTy)
Obtain the (possibly scalable) number of elements in a vector type.
Definition Core.cpp:915
LLVM_C_ABI LLVMTypeRef LLVMArrayType(LLVMTypeRef ElementType, unsigned ElementCount)
Create a fixed size array type that refers to a specific type.
Definition Core.cpp:866
LLVM_C_ABI void LLVMGetSubtypes(LLVMTypeRef Tp, LLVMTypeRef *Arr)
Returns type's subtypes.
Definition Core.cpp:858
LLVM_C_ABI LLVMTypeRef LLVMPointerType(LLVMTypeRef ElementType, unsigned AddressSpace)
Create a pointer type that points to a defined type.
Definition Core.cpp:874
LLVM_C_ABI unsigned LLVMGetNumContainedTypes(LLVMTypeRef Tp)
Return the number of types in the derived type.
Definition Core.cpp:899
LLVM_C_ABI LLVMTypeRef LLVMStructTypeInContext(LLVMContextRef C, LLVMTypeRef *ElementTypes, unsigned ElementCount, LLVMBool Packed)
Create a new structure type in a context.
Definition Core.cpp:790
LLVM_C_ABI void LLVMGetStructElementTypes(LLVMTypeRef StructTy, LLVMTypeRef *Dest)
Get the elements within a structure.
Definition Core.cpp:825
LLVM_C_ABI LLVMTypeRef LLVMStructGetTypeAtIndex(LLVMTypeRef StructTy, unsigned i)
Get the type of the element at a given index in the structure.
Definition Core.cpp:831
LLVM_C_ABI LLVMBool LLVMIsPackedStruct(LLVMTypeRef StructTy)
Determine whether a structure is packed.
Definition Core.cpp:836
LLVM_C_ABI LLVMTypeRef LLVMStructCreateNamed(LLVMContextRef C, const char *Name)
Create an empty structure in a context having a specified name.
Definition Core.cpp:802
LLVM_C_ABI void LLVMStructSetBody(LLVMTypeRef StructTy, LLVMTypeRef *ElementTypes, unsigned ElementCount, LLVMBool Packed)
Set the contents of a structure type.
Definition Core.cpp:815
LLVM_C_ABI LLVMBool LLVMIsOpaqueStruct(LLVMTypeRef StructTy)
Determine whether a structure is opaque.
Definition Core.cpp:840
LLVM_C_ABI LLVMTypeRef LLVMStructType(LLVMTypeRef *ElementTypes, unsigned ElementCount, LLVMBool Packed)
Create a new structure type in the global context.
Definition Core.cpp:796
LLVM_C_ABI unsigned LLVMCountStructElementTypes(LLVMTypeRef StructTy)
Get the number of elements defined inside the structure.
Definition Core.cpp:821
LLVM_C_ABI const char * LLVMGetStructName(LLVMTypeRef Ty)
Obtain the name of a structure.
Definition Core.cpp:807
LLVM_C_ABI LLVMBool LLVMIsLiteralStruct(LLVMTypeRef StructTy)
Determine whether a structure is literal.
Definition Core.cpp:844
LLVM_C_ABI void LLVMDumpType(LLVMTypeRef Val)
Dump a representation of a type to stderr.
Definition Core.cpp:641
LLVM_C_ABI LLVMBool LLVMTypeIsSized(LLVMTypeRef Ty)
Whether the type has a known size.
Definition Core.cpp:632
LLVM_C_ABI LLVMContextRef LLVMGetTypeContext(LLVMTypeRef Ty)
Obtain the context to which this type instance is associated.
Definition Core.cpp:637
LLVM_C_ABI char * LLVMPrintTypeToString(LLVMTypeRef Val)
Return a string representation of the type.
Definition Core.cpp:645
LLVM_C_ABI LLVMTypeKind LLVMGetTypeKind(LLVMTypeRef Ty)
Obtain the enumerated type of a Type instance.
Definition Core.cpp:584
LLVMTailCallKind
Tail call kind for LLVMSetTailCallKind and LLVMGetTailCallKind.
Definition Core.h:490
LLVMLinkage
Definition Core.h:174
LLVMOpcode
External users depend on the following values being stable.
Definition Core.h:61
LLVMRealPredicate
Definition Core.h:307
LLVMTypeKind
Definition Core.h:150
LLVMDLLStorageClass
Definition Core.h:209
LLVMValueKind
Definition Core.h:259
unsigned LLVMAttributeIndex
Definition Core.h:481
LLVMCallConv
Definition Core.h:215
LLVMDbgRecordKind
Definition Core.h:534
LLVMIntPredicate
Definition Core.h:294
unsigned LLVMFastMathFlags
Flags to indicate what fast-math-style optimizations are allowed on operations.
Definition Core.h:518
LLVMUnnamedAddr
Definition Core.h:203
LLVMModuleFlagBehavior
Definition Core.h:418
LLVMDiagnosticSeverity
Definition Core.h:406
LLVMVisibility
Definition Core.h:197
LLVMAtomicRMWBinOp
Definition Core.h:361
LLVMThreadLocalMode
Definition Core.h:326
unsigned LLVMGEPNoWrapFlags
Flags that constrain the allowed wrap semantics of a getelementptr instruction.
Definition Core.h:532
LLVMAtomicOrdering
Definition Core.h:334
LLVMInlineAsmDialect
Definition Core.h:413
@ LLVMTailCallKindNoTail
Definition Core.h:494
@ LLVMTailCallKindNone
Definition Core.h:491
@ LLVMTailCallKindTail
Definition Core.h:492
@ LLVMTailCallKindMustTail
Definition Core.h:493
@ LLVMDLLImportLinkage
Obsolete.
Definition Core.h:188
@ LLVMInternalLinkage
Rename collisions when linking (static functions)
Definition Core.h:185
@ LLVMLinkOnceAnyLinkage
Keep one copy of function when linking (inline)
Definition Core.h:177
@ LLVMExternalLinkage
Externally visible function.
Definition Core.h:175
@ LLVMExternalWeakLinkage
ExternalWeak linkage description.
Definition Core.h:190
@ LLVMLinkOnceODRLinkage
Same, but only replaced by something equivalent.
Definition Core.h:178
@ LLVMPrivateLinkage
Like Internal, but omit from symbol table.
Definition Core.h:187
@ LLVMDLLExportLinkage
Obsolete.
Definition Core.h:189
@ LLVMLinkerPrivateLinkage
Like Private, but linker removes.
Definition Core.h:193
@ LLVMWeakODRLinkage
Same, but only replaced by something equivalent.
Definition Core.h:182
@ LLVMGhostLinkage
Obsolete.
Definition Core.h:191
@ LLVMWeakAnyLinkage
Keep one copy of function when linking (weak)
Definition Core.h:181
@ LLVMAppendingLinkage
Special purpose, only applies to global arrays.
Definition Core.h:184
@ LLVMCommonLinkage
Tentative definitions.
Definition Core.h:192
@ LLVMLinkOnceODRAutoHideLinkage
Obsolete.
Definition Core.h:180
@ LLVMLinkerPrivateWeakLinkage
Like LinkerPrivate, but is weak.
Definition Core.h:194
@ LLVMAvailableExternallyLinkage
Definition Core.h:176
@ LLVMAttributeReturnIndex
Definition Core.h:474
@ LLVMAttributeFunctionIndex
Definition Core.h:478
@ LLVMFastMathAllowReassoc
Definition Core.h:498
@ LLVMFastMathNoSignedZeros
Definition Core.h:501
@ LLVMFastMathApproxFunc
Definition Core.h:504
@ LLVMFastMathNoInfs
Definition Core.h:500
@ LLVMFastMathNoNaNs
Definition Core.h:499
@ LLVMFastMathAll
Definition Core.h:506
@ LLVMFastMathNone
Definition Core.h:505
@ LLVMFastMathAllowContract
Definition Core.h:503
@ LLVMFastMathAllowReciprocal
Definition Core.h:502
@ LLVMSelect
Definition Core.h:124
@ LLVMSRem
Definition Core.h:86
@ LLVMOr
Definition Core.h:94
@ LLVMCallBr
Definition Core.h:70
@ LLVMUIToFP
Definition Core.h:109
@ LLVMIntToPtr
Definition Core.h:115
@ LLVMAtomicRMW
Definition Core.h:138
@ LLVMFMul
Definition Core.h:81
@ LLVMLoad
Definition Core.h:99
@ LLVMIndirectBr
Definition Core.h:66
@ LLVMUnreachable
Definition Core.h:69
@ LLVMCatchSwitch
Definition Core.h:147
@ LLVMCall
Definition Core.h:123
@ LLVMGetElementPtr
Definition Core.h:101
@ LLVMAdd
Definition Core.h:76
@ LLVMSub
Definition Core.h:78
@ LLVMExtractValue
Definition Core.h:131
@ LLVMUserOp1
Definition Core.h:125
@ LLVMICmp
Definition Core.h:120
@ LLVMFDiv
Definition Core.h:84
@ LLVMLShr
Definition Core.h:91
@ LLVMFPTrunc
Definition Core.h:111
@ LLVMResume
Definition Core.h:141
@ LLVMAddrSpaceCast
Definition Core.h:117
@ LLVMFNeg
Definition Core.h:73
@ LLVMRet
Definition Core.h:63
@ LLVMFPToSI
Definition Core.h:108
@ LLVMCatchRet
Definition Core.h:144
@ LLVMFreeze
Definition Core.h:133
@ LLVMFRem
Definition Core.h:87
@ LLVMSIToFP
Definition Core.h:110
@ LLVMPHI
Definition Core.h:122
@ LLVMPtrToAddr
Definition Core.h:114
@ LLVMUDiv
Definition Core.h:82
@ LLVMInvoke
Definition Core.h:67
@ LLVMCleanupPad
Definition Core.h:146
@ LLVMSDiv
Definition Core.h:83
@ LLVMFence
Definition Core.h:136
@ LLVMAnd
Definition Core.h:93
@ LLVMBr
Definition Core.h:64
@ LLVMFPToUI
Definition Core.h:107
@ LLVMLandingPad
Definition Core.h:142
@ LLVMURem
Definition Core.h:85
@ LLVMCleanupRet
Definition Core.h:143
@ LLVMTrunc
Definition Core.h:104
@ LLVMVAArg
Definition Core.h:127
@ LLVMShuffleVector
Definition Core.h:130
@ LLVMSExt
Definition Core.h:106
@ LLVMBitCast
Definition Core.h:116
@ LLVMUserOp2
Definition Core.h:126
@ LLVMMul
Definition Core.h:80
@ LLVMCatchPad
Definition Core.h:145
@ LLVMAShr
Definition Core.h:92
@ LLVMPtrToInt
Definition Core.h:113
@ LLVMInsertElement
Definition Core.h:129
@ LLVMFAdd
Definition Core.h:77
@ LLVMFSub
Definition Core.h:79
@ LLVMStore
Definition Core.h:100
@ LLVMZExt
Definition Core.h:105
@ LLVMShl
Definition Core.h:90
@ LLVMInsertValue
Definition Core.h:132
@ LLVMExtractElement
Definition Core.h:128
@ LLVMXor
Definition Core.h:95
@ LLVMFCmp
Definition Core.h:121
@ LLVMFPExt
Definition Core.h:112
@ LLVMAlloca
Definition Core.h:98
@ LLVMAtomicCmpXchg
Definition Core.h:137
@ LLVMSwitch
Definition Core.h:65
@ LLVMGEPFlagInBounds
Definition Core.h:521
@ LLVMGEPFlagNUSW
Definition Core.h:522
@ LLVMGEPFlagNUW
Definition Core.h:523
@ LLVMRealUNE
True if unordered or not equal.
Definition Core.h:322
@ LLVMRealUGT
True if unordered or greater than.
Definition Core.h:318
@ LLVMRealULE
True if unordered, less than, or equal.
Definition Core.h:321
@ LLVMRealOLE
True if ordered and less than or equal.
Definition Core.h:313
@ LLVMRealOGE
True if ordered and greater than or equal.
Definition Core.h:311
@ LLVMRealULT
True if unordered or less than.
Definition Core.h:320
@ LLVMRealPredicateFalse
Always false (always folded)
Definition Core.h:308
@ LLVMRealPredicateTrue
Always true (always folded)
Definition Core.h:323
@ LLVMRealUNO
True if unordered: isnan(X) | isnan(Y)
Definition Core.h:316
@ LLVMRealOEQ
True if ordered and equal.
Definition Core.h:309
@ LLVMRealOLT
True if ordered and less than.
Definition Core.h:312
@ LLVMRealUEQ
True if unordered or equal.
Definition Core.h:317
@ LLVMRealORD
True if ordered (no nans)
Definition Core.h:315
@ LLVMRealOGT
True if ordered and greater than.
Definition Core.h:310
@ LLVMRealUGE
True if unordered, greater than, or equal.
Definition Core.h:319
@ LLVMRealONE
True if ordered and operands are unequal.
Definition Core.h:314
@ LLVMHalfTypeKind
16 bit floating point type
Definition Core.h:152
@ LLVMFP128TypeKind
128 bit floating point type (112-bit mantissa)
Definition Core.h:156
@ LLVMIntegerTypeKind
Arbitrary bit width integers.
Definition Core.h:159
@ LLVMPointerTypeKind
Pointers.
Definition Core.h:163
@ LLVMX86_FP80TypeKind
80 bit floating point type (X87)
Definition Core.h:155
@ LLVMX86_AMXTypeKind
X86 AMX.
Definition Core.h:170
@ LLVMMetadataTypeKind
Metadata.
Definition Core.h:165
@ LLVMScalableVectorTypeKind
Scalable SIMD vector type.
Definition Core.h:168
@ LLVMArrayTypeKind
Arrays.
Definition Core.h:162
@ LLVMBFloatTypeKind
16 bit brain floating point type
Definition Core.h:169
@ LLVMStructTypeKind
Structures.
Definition Core.h:161
@ LLVMLabelTypeKind
Labels.
Definition Core.h:158
@ LLVMDoubleTypeKind
64 bit floating point type
Definition Core.h:154
@ LLVMVoidTypeKind
type with no size
Definition Core.h:151
@ LLVMTokenTypeKind
Tokens.
Definition Core.h:167
@ LLVMFloatTypeKind
32 bit floating point type
Definition Core.h:153
@ LLVMFunctionTypeKind
Functions.
Definition Core.h:160
@ LLVMVectorTypeKind
Fixed width SIMD vector type.
Definition Core.h:164
@ LLVMPPC_FP128TypeKind
128 bit floating point type (two 64-bits)
Definition Core.h:157
@ LLVMTargetExtTypeKind
Target extension type.
Definition Core.h:171
@ LLVMDefaultStorageClass
Definition Core.h:210
@ LLVMDLLExportStorageClass
Function to be accessible from DLL.
Definition Core.h:212
@ LLVMDLLImportStorageClass
Function to be imported from DLL.
Definition Core.h:211
@ LLVMMemoryDefValueKind
Definition Core.h:263
@ LLVMConstantDataVectorValueKind
Definition Core.h:279
@ LLVMConstantIntValueKind
Definition Core.h:280
@ LLVMConstantDataArrayValueKind
Definition Core.h:278
@ LLVMUndefValueValueKind
Definition Core.h:276
@ LLVMFunctionValueKind
Definition Core.h:266
@ LLVMConstantVectorValueKind
Definition Core.h:274
@ LLVMMemoryPhiValueKind
Definition Core.h:264
@ LLVMConstantTokenNoneValueKind
Definition Core.h:283
@ LLVMArgumentValueKind
Definition Core.h:260
@ LLVMInlineAsmValueKind
Definition Core.h:286
@ LLVMConstantAggregateZeroValueKind
Definition Core.h:277
@ LLVMGlobalAliasValueKind
Definition Core.h:267
@ LLVMMetadataAsValueValueKind
Definition Core.h:285
@ LLVMConstantTargetNoneValueKind
Definition Core.h:290
@ LLVMConstantStructValueKind
Definition Core.h:273
@ LLVMInstructionValueKind
Definition Core.h:288
@ LLVMConstantArrayValueKind
Definition Core.h:272
@ LLVMMemoryUseValueKind
Definition Core.h:262
@ LLVMConstantPtrAuthValueKind
Definition Core.h:291
@ LLVMConstantPointerNullValueKind
Definition Core.h:282
@ LLVMBasicBlockValueKind
Definition Core.h:261
@ LLVMBlockAddressValueKind
Definition Core.h:270
@ LLVMConstantExprValueKind
Definition Core.h:271
@ LLVMPoisonValueValueKind
Definition Core.h:289
@ LLVMGlobalVariableValueKind
Definition Core.h:269
@ LLVMGlobalIFuncValueKind
Definition Core.h:268
@ LLVMConstantFPValueKind
Definition Core.h:281
@ LLVMCXXFASTTLSCallConv
Definition Core.h:225
@ LLVMX86INTRCallConv
Definition Core.h:243
@ LLVMAMDGPUCSCallConv
Definition Core.h:250
@ LLVMAMDGPUHSCallConv
Definition Core.h:253
@ LLVMSwiftCallConv
Definition Core.h:224
@ LLVMPTXDeviceCallConv
Definition Core.h:234
@ LLVMX86VectorCallCallConv
Definition Core.h:240
@ LLVMPreserveAllCallConv
Definition Core.h:223
@ LLVMAMDGPUGSCallConv
Definition Core.h:248
@ LLVMMSP430INTRCallConv
Definition Core.h:231
@ LLVMCCallConv
Definition Core.h:216
@ LLVMARMAPCSCallConv
Definition Core.h:228
@ LLVMAVRSIGNALCallConv
Definition Core.h:245
@ LLVMX86RegCallCallConv
Definition Core.h:252
@ LLVMAMDGPUVSCallConv
Definition Core.h:247
@ LLVMSPIRKERNELCallConv
Definition Core.h:236
@ LLVMGHCCallConv
Definition Core.h:219
@ LLVMX86ThisCallCallConv
Definition Core.h:232
@ LLVMPTXKernelCallConv
Definition Core.h:233
@ LLVMAnyRegCallConv
Definition Core.h:221
@ LLVMAVRINTRCallConv
Definition Core.h:244
@ LLVMAMDGPUPSCallConv
Definition Core.h:249
@ LLVMSPIRFUNCCallConv
Definition Core.h:235
@ LLVMPreserveMostCallConv
Definition Core.h:222
@ LLVMMSP430BUILTINCallConv
Definition Core.h:254
@ LLVMAMDGPUKERNELCallConv
Definition Core.h:251
@ LLVMX8664SysVCallConv
Definition Core.h:238
@ LLVMARMAAPCSCallConv
Definition Core.h:229
@ LLVMColdCallConv
Definition Core.h:218
@ LLVMAMDGPULSCallConv
Definition Core.h:255
@ LLVMX86FastcallCallConv
Definition Core.h:227
@ LLVMAMDGPUESCallConv
Definition Core.h:256
@ LLVMX86StdcallCallConv
Definition Core.h:226
@ LLVMFastCallConv
Definition Core.h:217
@ LLVMAVRBUILTINCallConv
Definition Core.h:246
@ LLVMHHVMCallConv
Definition Core.h:241
@ LLVMIntelOCLBICallConv
Definition Core.h:237
@ LLVMWin64CallConv
Definition Core.h:239
@ LLVMHiPECallConv
Definition Core.h:220
@ LLVMHHVMCCallConv
Definition Core.h:242
@ LLVMARMAAPCSVFPCallConv
Definition Core.h:230
@ LLVMDbgRecordValue
Definition Core.h:537
@ LLVMDbgRecordDeclare
Definition Core.h:536
@ LLVMDbgRecordLabel
Definition Core.h:535
@ LLVMDbgRecordAssign
Definition Core.h:538
@ LLVMIntSGT
signed greater than
Definition Core.h:301
@ LLVMIntULE
unsigned less or equal
Definition Core.h:300
@ LLVMIntEQ
equal
Definition Core.h:295
@ LLVMIntUGE
unsigned greater or equal
Definition Core.h:298
@ LLVMIntSGE
signed greater or equal
Definition Core.h:302
@ LLVMIntULT
unsigned less than
Definition Core.h:299
@ LLVMIntUGT
unsigned greater than
Definition Core.h:297
@ LLVMIntSLE
signed less or equal
Definition Core.h:304
@ LLVMIntSLT
signed less than
Definition Core.h:303
@ LLVMIntNE
not equal
Definition Core.h:296
@ LLVMGlobalUnnamedAddr
Address of the GV is globally insignificant.
Definition Core.h:206
@ LLVMLocalUnnamedAddr
Address of the GV is locally insignificant.
Definition Core.h:205
@ LLVMNoUnnamedAddr
Address of the GV is significant.
Definition Core.h:204
@ LLVMModuleFlagBehaviorRequire
Adds a requirement that another module flag be present and have a specified value after linking is pe...
Definition Core.h:444
@ LLVMModuleFlagBehaviorWarning
Emits a warning if two values disagree.
Definition Core.h:432
@ LLVMModuleFlagBehaviorOverride
Uses the specified value, regardless of the behavior or value of the other module.
Definition Core.h:452
@ LLVMModuleFlagBehaviorAppendUnique
Appends the two values, which are required to be metadata nodes.
Definition Core.h:466
@ LLVMModuleFlagBehaviorAppend
Appends the two values, which are required to be metadata nodes.
Definition Core.h:458
@ LLVMModuleFlagBehaviorError
Emits an error if two values disagree, otherwise the resulting value is that of the operands.
Definition Core.h:425
@ LLVMDSWarning
Definition Core.h:408
@ LLVMDSNote
Definition Core.h:410
@ LLVMDSError
Definition Core.h:407
@ LLVMDSRemark
Definition Core.h:409
@ LLVMProtectedVisibility
The GV is protected.
Definition Core.h:200
@ LLVMDefaultVisibility
The GV is visible.
Definition Core.h:198
@ LLVMHiddenVisibility
The GV is hidden.
Definition Core.h:199
@ LLVMAtomicRMWBinOpXor
Xor a value and return the old one.
Definition Core.h:368
@ LLVMAtomicRMWBinOpXchg
Set the new value and return the one old.
Definition Core.h:362
@ LLVMAtomicRMWBinOpSub
Subtract a value and return the old one.
Definition Core.h:364
@ LLVMAtomicRMWBinOpUMax
Sets the value if it's greater than the original using an unsigned comparison and return the old one.
Definition Core.h:375
@ LLVMAtomicRMWBinOpUSubSat
Subtracts the value, clamping to zero.
Definition Core.h:397
@ LLVMAtomicRMWBinOpAnd
And a value and return the old one.
Definition Core.h:365
@ LLVMAtomicRMWBinOpUDecWrap
Decrements the value, wrapping back to the input value when decremented below zero.
Definition Core.h:393
@ LLVMAtomicRMWBinOpFMax
Sets the value if it's greater than the original using an floating point comparison and return the ol...
Definition Core.h:385
@ LLVMAtomicRMWBinOpMin
Sets the value if it's Smaller than the original using a signed comparison and return the old one.
Definition Core.h:372
@ LLVMAtomicRMWBinOpOr
OR a value and return the old one.
Definition Core.h:367
@ LLVMAtomicRMWBinOpFMin
Sets the value if it's smaller than the original using an floating point comparison and return the ol...
Definition Core.h:388
@ LLVMAtomicRMWBinOpMax
Sets the value if it's greater than the original using a signed comparison and return the old one.
Definition Core.h:369
@ LLVMAtomicRMWBinOpFMaximum
Sets the value if it's greater than the original using an floating point comparison and return the ol...
Definition Core.h:398
@ LLVMAtomicRMWBinOpFMinimum
Sets the value if it's smaller than the original using an floating point comparison and return the ol...
Definition Core.h:401
@ LLVMAtomicRMWBinOpUIncWrap
Increments the value, wrapping back to zero when incremented above input value.
Definition Core.h:391
@ LLVMAtomicRMWBinOpFAdd
Add a floating point value and return the old one.
Definition Core.h:381
@ LLVMAtomicRMWBinOpFSub
Subtract a floating point value and return the old one.
Definition Core.h:383
@ LLVMAtomicRMWBinOpAdd
Add a value and return the old one.
Definition Core.h:363
@ LLVMAtomicRMWBinOpUMin
Sets the value if it's greater than the original using an unsigned comparison and return the old one.
Definition Core.h:378
@ LLVMAtomicRMWBinOpNand
Not-And a value and return the old one.
Definition Core.h:366
@ LLVMAtomicRMWBinOpUSubCond
Subtracts the value only if no unsigned overflow.
Definition Core.h:395
@ LLVMGeneralDynamicTLSModel
Definition Core.h:328
@ LLVMLocalDynamicTLSModel
Definition Core.h:329
@ LLVMNotThreadLocal
Definition Core.h:327
@ LLVMInitialExecTLSModel
Definition Core.h:330
@ LLVMLocalExecTLSModel
Definition Core.h:331
@ LLVMAtomicOrderingAcquireRelease
provides both an Acquire and a Release barrier (for fences and operations which both read and write m...
Definition Core.h:347
@ LLVMAtomicOrderingRelease
Release is similar to Acquire, but with a barrier of the sort necessary to release a lock.
Definition Core.h:344
@ LLVMAtomicOrderingAcquire
Acquire provides a barrier of the sort necessary to acquire a lock to access other memory with normal...
Definition Core.h:341
@ LLVMAtomicOrderingMonotonic
guarantees that if you take all the operations affecting a specific address, a consistent ordering ex...
Definition Core.h:338
@ LLVMAtomicOrderingSequentiallyConsistent
provides Acquire semantics for loads and Release semantics for stores.
Definition Core.h:351
@ LLVMAtomicOrderingNotAtomic
A load or store which is not atomic.
Definition Core.h:335
@ LLVMAtomicOrderingUnordered
Lowest level of atomicity, guarantees somewhat sane results, lock free.
Definition Core.h:336
@ LLVMInlineAsmDialectATT
Definition Core.h:414
@ LLVMInlineAsmDialectIntel
Definition Core.h:415
LLVM_C_ABI LLVMValueRef LLVMGetLastInstruction(LLVMBasicBlockRef BB)
Obtain the last instruction in a basic block.
Definition Core.cpp:2930
LLVM_C_ABI void LLVMMoveBasicBlockAfter(LLVMBasicBlockRef BB, LLVMBasicBlockRef MovePos)
Move a basic block to after another one.
Definition Core.cpp:2912
LLVM_C_ABI LLVMBasicBlockRef LLVMGetFirstBasicBlock(LLVMValueRef Fn)
Obtain the first basic block in a function.
Definition Core.cpp:2828
LLVM_C_ABI LLVMBasicBlockRef LLVMCreateBasicBlockInContext(LLVMContextRef C, const char *Name)
Create a new basic block without inserting it into a function.
Definition Core.cpp:2860
LLVM_C_ABI LLVMBasicBlockRef LLVMGetPreviousBasicBlock(LLVMBasicBlockRef BB)
Go backwards in a basic block iterator.
Definition Core.cpp:2852
LLVM_C_ABI LLVMBasicBlockRef LLVMGetLastBasicBlock(LLVMValueRef Fn)
Obtain the last basic block in a function.
Definition Core.cpp:2836
LLVM_C_ABI LLVMBasicBlockRef LLVMInsertBasicBlock(LLVMBasicBlockRef InsertBeforeBB, const char *Name)
Insert a basic block in a function using the global context.
Definition Core.cpp:2895
LLVM_C_ABI LLVMValueRef LLVMGetBasicBlockTerminator(LLVMBasicBlockRef BB)
Obtain the terminator instruction for a basic block.
Definition Core.cpp:2810
LLVM_C_ABI const char * LLVMGetBasicBlockName(LLVMBasicBlockRef BB)
Obtain the string name of a basic block.
Definition Core.cpp:2802
LLVM_C_ABI void LLVMAppendExistingBasicBlock(LLVMValueRef Fn, LLVMBasicBlockRef BB)
Append the given basic block to the basic block list of the given function.
Definition Core.cpp:2873
LLVM_C_ABI void LLVMDeleteBasicBlock(LLVMBasicBlockRef BB)
Remove a basic block from a function and delete it.
Definition Core.cpp:2900
LLVM_C_ABI LLVMBasicBlockRef LLVMInsertBasicBlockInContext(LLVMContextRef C, LLVMBasicBlockRef BB, const char *Name)
Insert a basic block in a function before another basic block.
Definition Core.cpp:2888
LLVM_C_ABI void LLVMGetBasicBlocks(LLVMValueRef Fn, LLVMBasicBlockRef *BasicBlocks)
Obtain all of the basic blocks in a function.
Definition Core.cpp:2818
LLVM_C_ABI void LLVMMoveBasicBlockBefore(LLVMBasicBlockRef BB, LLVMBasicBlockRef MovePos)
Move a basic block to before another one.
Definition Core.cpp:2908
LLVM_C_ABI LLVMValueRef LLVMGetBasicBlockParent(LLVMBasicBlockRef BB)
Obtain the function to which a basic block belongs.
Definition Core.cpp:2806
LLVM_C_ABI LLVMBasicBlockRef LLVMGetEntryBasicBlock(LLVMValueRef Fn)
Obtain the basic block that corresponds to the entry point of a function.
Definition Core.cpp:2824
LLVM_C_ABI LLVMValueRef LLVMGetFirstInstruction(LLVMBasicBlockRef BB)
Obtain the first instruction in a basic block.
Definition Core.cpp:2922
LLVM_C_ABI void LLVMInsertExistingBasicBlockAfterInsertBlock(LLVMBuilderRef Builder, LLVMBasicBlockRef BB)
Insert the given basic block after the insertion point of the given builder.
Definition Core.cpp:2865
LLVM_C_ABI LLVMValueRef LLVMBasicBlockAsValue(LLVMBasicBlockRef BB)
Convert a basic block instance to a value type.
Definition Core.cpp:2790
LLVM_C_ABI LLVMBasicBlockRef LLVMValueAsBasicBlock(LLVMValueRef Val)
Convert an LLVMValueRef to an LLVMBasicBlockRef instance.
Definition Core.cpp:2798
LLVM_C_ABI void LLVMRemoveBasicBlockFromParent(LLVMBasicBlockRef BB)
Remove a basic block from a function.
Definition Core.cpp:2904
LLVM_C_ABI LLVMBasicBlockRef LLVMGetNextBasicBlock(LLVMBasicBlockRef BB)
Advance a basic block iterator.
Definition Core.cpp:2844
LLVM_C_ABI unsigned LLVMCountBasicBlocks(LLVMValueRef Fn)
Obtain the number of basic blocks in a function.
Definition Core.cpp:2814
LLVM_C_ABI LLVMBasicBlockRef LLVMAppendBasicBlock(LLVMValueRef Fn, const char *Name)
Append a basic block to the end of a function using the global context.
Definition Core.cpp:2884
LLVM_C_ABI LLVMBasicBlockRef LLVMAppendBasicBlockInContext(LLVMContextRef C, LLVMValueRef Fn, const char *Name)
Append a basic block to the end of a function.
Definition Core.cpp:2878
LLVM_C_ABI LLVMBool LLVMValueIsBasicBlock(LLVMValueRef Val)
Determine whether an LLVMValueRef is itself a basic block.
Definition Core.cpp:2794
LLVM_C_ABI LLVMValueRef LLVMConstantPtrAuth(LLVMValueRef Ptr, LLVMValueRef Key, LLVMValueRef Disc, LLVMValueRef AddrDisc)
Create a ConstantPtrAuth constant with the given values.
Definition Core.cpp:1698
LLVM_C_ABI LLVMValueRef LLVMGetAggregateElement(LLVMValueRef C, unsigned Idx)
Get element of a constant aggregate (struct, array or vector) at the specified index.
Definition Core.cpp:1627
LLVM_C_ABI LLVMValueRef LLVMConstVector(LLVMValueRef *ScalarConstantVals, unsigned Size)
Create a ConstantVector from values.
Definition Core.cpp:1693
LLVM_C_ABI LLVMValueRef LLVMConstStringInContext2(LLVMContextRef C, const char *Str, size_t Length, LLVMBool DontNullTerminate)
Create a ConstantDataSequential and initialize it with a string.
Definition Core.cpp:1612
LLVM_C_ABI LLVMValueRef LLVMConstDataArray(LLVMTypeRef ElementTy, const char *Data, size_t SizeInBytes)
Create a ConstantDataArray from raw values.
Definition Core.cpp:1663
LLVM_C_ABI LLVMValueRef LLVMConstArray(LLVMTypeRef ElementTy, LLVMValueRef *ConstantVals, unsigned Length)
Create a ConstantArray from values.
Definition Core.cpp:1651
LLVM_C_ABI LLVMBool LLVMIsConstantString(LLVMValueRef c)
Returns true if the specified constant is an array of i8.
Definition Core.cpp:1635
LLVM_C_ABI LLVMValueRef LLVMConstStringInContext(LLVMContextRef C, const char *Str, unsigned Length, LLVMBool DontNullTerminate)
Create a ConstantDataSequential and initialize it with a string.
Definition Core.cpp:1603
LLVM_C_ABI LLVMValueRef LLVMConstArray2(LLVMTypeRef ElementTy, LLVMValueRef *ConstantVals, uint64_t Length)
Create a ConstantArray from values.
Definition Core.cpp:1657
LLVM_C_ABI const char * LLVMGetAsString(LLVMValueRef c, size_t *Length)
Get the given constant data sequential as a string.
Definition Core.cpp:1639
LLVM_C_ABI LLVMValueRef LLVMConstNamedStruct(LLVMTypeRef StructTy, LLVMValueRef *ConstantVals, unsigned Count)
Create a non-anonymous ConstantStruct from values.
Definition Core.cpp:1684
LLVM_C_ABI LLVMValueRef LLVMConstStruct(LLVMValueRef *ConstantVals, unsigned Count, LLVMBool Packed)
Create a ConstantStruct in the global Context.
Definition Core.cpp:1678
LLVM_C_ABI const char * LLVMGetRawDataValues(LLVMValueRef c, size_t *SizeInBytes)
Get the raw, underlying bytes of the given constant data sequential.
Definition Core.cpp:1645
LLVM_C_ABI LLVMValueRef LLVMConstStructInContext(LLVMContextRef C, LLVMValueRef *ConstantVals, unsigned Count, LLVMBool Packed)
Create an anonymous ConstantStruct with the specified values.
Definition Core.cpp:1670
LLVM_C_ABI LLVMValueRef LLVMConstString(const char *Str, unsigned Length, LLVMBool DontNullTerminate)
Create a ConstantDataSequential with string content in the global context.
Definition Core.cpp:1621
LLVM_C_ABI LLVMValueRef LLVMConstAddrSpaceCast(LLVMValueRef ConstantVal, LLVMTypeRef ToType)
Definition Core.cpp:1872
LLVM_C_ABI LLVMValueRef LLVMSizeOf(LLVMTypeRef Ty)
Definition Core.cpp:1763
LLVM_C_ABI LLVMValueRef LLVMConstAdd(LLVMValueRef LHSConstant, LLVMValueRef RHSConstant)
Definition Core.cpp:1784
LLVM_C_ABI LLVMValueRef LLVMConstSub(LLVMValueRef LHSConstant, LLVMValueRef RHSConstant)
Definition Core.cpp:1801
LLVM_C_ABI LLVMValueRef LLVMConstTruncOrBitCast(LLVMValueRef ConstantVal, LLVMTypeRef ToType)
Definition Core.cpp:1878
LLVM_C_ABI LLVMValueRef LLVMAlignOf(LLVMTypeRef Ty)
Definition Core.cpp:1759
LLVM_C_ABI LLVMValueRef LLVMConstBitCast(LLVMValueRef ConstantVal, LLVMTypeRef ToType)
Definition Core.cpp:1867
LLVM_C_ABI LLVMValueRef LLVMConstNUWSub(LLVMValueRef LHSConstant, LLVMValueRef RHSConstant)
Definition Core.cpp:1812
LLVM_C_ABI LLVMValueRef LLVMConstGEPWithNoWrapFlags(LLVMTypeRef Ty, LLVMValueRef ConstantVal, LLVMValueRef *ConstantIndices, unsigned NumIndices, LLVMGEPNoWrapFlags NoWrapFlags)
Creates a constant GetElementPtr expression.
Definition Core.cpp:1840
LLVM_C_ABI LLVMOpcode LLVMGetConstOpcode(LLVMValueRef ConstantVal)
Definition Core.cpp:1755
LLVM_C_ABI LLVMValueRef LLVMConstExtractElement(LLVMValueRef VectorConstant, LLVMValueRef IndexConstant)
Definition Core.cpp:1890
LLVM_C_ABI LLVMValueRef LLVMConstNSWAdd(LLVMValueRef LHSConstant, LLVMValueRef RHSConstant)
Definition Core.cpp:1789
LLVM_C_ABI LLVMValueRef LLVMConstNeg(LLVMValueRef ConstantVal)
Definition Core.cpp:1767
LLVM_C_ABI LLVMValueRef LLVMConstPointerCast(LLVMValueRef ConstantVal, LLVMTypeRef ToType)
Definition Core.cpp:1884
LLVM_C_ABI LLVMValueRef LLVMConstInsertElement(LLVMValueRef VectorConstant, LLVMValueRef ElementValueConstant, LLVMValueRef IndexConstant)
Definition Core.cpp:1896
LLVM_C_ABI LLVMValueRef LLVMConstXor(LLVMValueRef LHSConstant, LLVMValueRef RHSConstant)
Definition Core.cpp:1818
LLVM_C_ABI LLVMValueRef LLVMConstNSWSub(LLVMValueRef LHSConstant, LLVMValueRef RHSConstant)
Definition Core.cpp:1806
LLVM_C_ABI LLVMValueRef LLVMConstShuffleVector(LLVMValueRef VectorAConstant, LLVMValueRef VectorBConstant, LLVMValueRef MaskConstant)
Definition Core.cpp:1904
LLVM_C_ABI LLVMValueRef LLVMConstTrunc(LLVMValueRef ConstantVal, LLVMTypeRef ToType)
Definition Core.cpp:1852
LLVM_C_ABI LLVMValueRef LLVMConstGEP2(LLVMTypeRef Ty, LLVMValueRef ConstantVal, LLVMValueRef *ConstantIndices, unsigned NumIndices)
Definition Core.cpp:1823
LLVM_C_ABI LLVMValueRef LLVMBlockAddress(LLVMValueRef F, LLVMBasicBlockRef BB)
Definition Core.cpp:1922
LLVM_C_ABI LLVMValueRef LLVMConstNot(LLVMValueRef ConstantVal)
Definition Core.cpp:1780
LLVM_C_ABI LLVMValueRef LLVMConstNUWAdd(LLVMValueRef LHSConstant, LLVMValueRef RHSConstant)
Definition Core.cpp:1795
LLVM_C_ABI LLVMValueRef LLVMConstPtrToInt(LLVMValueRef ConstantVal, LLVMTypeRef ToType)
Definition Core.cpp:1857
LLVM_C_ABI LLVMValueRef LLVMConstIntToPtr(LLVMValueRef ConstantVal, LLVMTypeRef ToType)
Definition Core.cpp:1862
LLVM_C_ABI LLVMValueRef LLVMConstInBoundsGEP2(LLVMTypeRef Ty, LLVMValueRef ConstantVal, LLVMValueRef *ConstantIndices, unsigned NumIndices)
Definition Core.cpp:1831
LLVM_C_ABI LLVMValueRef LLVMConstInlineAsm(LLVMTypeRef Ty, const char *AsmString, const char *Constraints, LLVMBool HasSideEffects, LLVMBool IsAlignStack)
Deprecated: Use LLVMGetInlineAsm instead.
Definition Core.cpp:1914
LLVM_C_ABI LLVMValueRef LLVMConstNSWNeg(LLVMValueRef ConstantVal)
Definition Core.cpp:1771
LLVM_C_ABI LLVMValueRef LLVMGetBlockAddressFunction(LLVMValueRef BlockAddr)
Gets the function associated with a given BlockAddress constant value.
Definition Core.cpp:1926
LLVM_C_ABI LLVMBasicBlockRef LLVMGetBlockAddressBasicBlock(LLVMValueRef BlockAddr)
Gets the basic block associated with a given BlockAddress constant value.
Definition Core.cpp:1930
LLVM_C_ABI LLVMUnnamedAddr LLVMGetUnnamedAddress(LLVMValueRef Global)
Definition Core.cpp:2068
LLVM_C_ABI LLVMTypeRef LLVMGlobalGetValueType(LLVMValueRef Global)
Returns the "value type" of a global value.
Definition Core.cpp:2103
LLVM_C_ABI unsigned LLVMGetAlignment(LLVMValueRef V)
Obtain the preferred alignment of the value.
Definition Core.cpp:2109
LLVM_C_ABI void LLVMSetSection(LLVMValueRef Global, const char *Section)
Definition Core.cpp:2044
LLVM_C_ABI void LLVMSetUnnamedAddress(LLVMValueRef Global, LLVMUnnamedAddr UnnamedAddr)
Definition Core.cpp:2080
LLVM_C_ABI 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:2184
LLVM_C_ABI void LLVMSetLinkage(LLVMValueRef Global, LLVMLinkage Linkage)
Definition Core.cpp:1973
LLVM_C_ABI void LLVMSetUnnamedAddr(LLVMValueRef Global, LLVMBool HasUnnamedAddr)
Deprecated: Use LLVMSetUnnamedAddress instead.
Definition Core.cpp:2097
LLVM_C_ABI LLVMModuleRef LLVMGetGlobalParent(LLVMValueRef Global)
Definition Core.cpp:1936
LLVM_C_ABI unsigned LLVMValueMetadataEntriesGetKind(LLVMValueMetadataEntry *Entries, unsigned Index)
Returns the kind of a value metadata entry at a specific index.
Definition Core.cpp:2165
LLVM_C_ABI void LLVMSetDLLStorageClass(LLVMValueRef Global, LLVMDLLStorageClass Class)
Definition Core.cpp:2063
LLVM_C_ABI LLVMVisibility LLVMGetVisibility(LLVMValueRef Global)
Definition Core.cpp:2048
LLVM_C_ABI LLVMValueMetadataEntry * LLVMGlobalCopyAllMetadata(LLVMValueRef Value, size_t *NumEntries)
Retrieves an array of metadata entries representing the metadata attached to this value.
Definition Core.cpp:2153
LLVM_C_ABI void LLVMSetAlignment(LLVMValueRef V, unsigned Bytes)
Set the preferred alignment of the value.
Definition Core.cpp:2131
LLVM_C_ABI const char * LLVMGetSection(LLVMValueRef Global)
Definition Core.cpp:2038
LLVM_C_ABI void LLVMSetVisibility(LLVMValueRef Global, LLVMVisibility Viz)
Definition Core.cpp:2053
LLVM_C_ABI LLVMLinkage LLVMGetLinkage(LLVMValueRef Global)
Definition Core.cpp:1944
LLVM_C_ABI void LLVMGlobalEraseMetadata(LLVMValueRef Global, unsigned Kind)
Erases a metadata attachment of the given kind if it exists.
Definition Core.cpp:2194
LLVM_C_ABI LLVMDLLStorageClass LLVMGetDLLStorageClass(LLVMValueRef Global)
Definition Core.cpp:2058
LLVM_C_ABI LLVMBool LLVMIsDeclaration(LLVMValueRef Global)
Definition Core.cpp:1940
LLVM_C_ABI void LLVMGlobalClearMetadata(LLVMValueRef Global)
Removes all metadata attachments from this value.
Definition Core.cpp:2198
LLVM_C_ABI void LLVMGlobalAddMetadata(LLVMValueRef Global, unsigned Kind, LLVMMetadataRef MD)
Adds a metadata attachment.
Definition Core.cpp:2189
LLVM_C_ABI LLVMBool LLVMHasUnnamedAddr(LLVMValueRef Global)
Deprecated: Use LLVMGetUnnamedAddress instead.
Definition Core.cpp:2093
LLVM_C_ABI LLVMMetadataRef LLVMValueMetadataEntriesGetMetadata(LLVMValueMetadataEntry *Entries, unsigned Index)
Returns the underlying metadata node of a value metadata entry at a specific index.
Definition Core.cpp:2173
LLVM_C_ABI void LLVMDisposeValueMetadataEntries(LLVMValueMetadataEntry *Entries)
Destroys value metadata entries.
Definition Core.cpp:2180
LLVM_C_ABI void LLVMGlobalAddDebugInfo(LLVMValueRef Global, LLVMMetadataRef GVE)
Add debuginfo metadata to this global.
Definition Core.cpp:2202
LLVM_C_ABI LLVMValueRef LLVMConstRealOfStringAndSize(LLVMTypeRef RealTy, const char *Text, unsigned SLen)
Obtain a constant for a floating point value parsed from a string.
LLVM_C_ABI 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.
LLVM_C_ABI LLVMValueRef LLVMConstIntOfString(LLVMTypeRef IntTy, const char *Text, uint8_t Radix)
Obtain a constant value for an integer parsed from a string.
LLVM_C_ABI LLVMValueRef LLVMConstInt(LLVMTypeRef IntTy, unsigned long long N, LLVMBool SignExtend)
Obtain a constant value for an integer type.
Definition Core.cpp:1538
LLVM_C_ABI LLVMValueRef LLVMConstIntOfArbitraryPrecision(LLVMTypeRef IntTy, unsigned NumWords, const uint64_t Words[])
Obtain a constant value for an integer of arbitrary precision.
Definition Core.cpp:1543
LLVM_C_ABI long long LLVMConstIntGetSExtValue(LLVMValueRef ConstantVal)
Obtain the sign extended value for an integer constant value.
Definition Core.cpp:1580
LLVM_C_ABI LLVMValueRef LLVMConstRealOfString(LLVMTypeRef RealTy, const char *Text)
Obtain a constant for a floating point value parsed from a string.
Definition Core.cpp:1567
LLVM_C_ABI double LLVMConstRealGetDouble(LLVMValueRef ConstantVal, LLVMBool *losesInfo)
Obtain the double value for an floating point constant value.
Definition Core.cpp:1584
LLVM_C_ABI LLVMValueRef LLVMConstReal(LLVMTypeRef RealTy, double N)
Obtain a constant value referring to a double floating point value.
Definition Core.cpp:1563
LLVM_C_ABI unsigned long long LLVMConstIntGetZExtValue(LLVMValueRef ConstantVal)
Obtain the zero extended value for an integer constant value.
Definition Core.cpp:1576
LLVM_C_ABI LLVMValueRef LLVMGetPoison(LLVMTypeRef Ty)
Obtain a constant value referring to a poison value of a type.
Definition Core.cpp:1253
LLVM_C_ABI LLVMValueRef LLVMConstPointerNull(LLVMTypeRef Ty)
Obtain a constant that is a constant pointer pointing to NULL for a specified type.
Definition Core.cpp:1275
LLVM_C_ABI LLVMValueRef LLVMGetUndef(LLVMTypeRef Ty)
Obtain a constant value referring to an undefined value of a type.
Definition Core.cpp:1249
LLVM_C_ABI LLVMBool LLVMIsNull(LLVMValueRef Val)
Determine whether a value instance is null.
Definition Core.cpp:1261
LLVM_C_ABI LLVMValueRef LLVMConstNull(LLVMTypeRef Ty)
Obtain a constant value referring to the null instance of a type.
Definition Core.cpp:1241
LLVM_C_ABI LLVMValueRef LLVMConstAllOnes(LLVMTypeRef Ty)
Obtain a constant value referring to the instance of a type consisting of all ones.
Definition Core.cpp:1245
LLVM_C_ABI LLVMValueRef LLVMGetPreviousParam(LLVMValueRef Arg)
Obtain the previous parameter to a function.
Definition Core.cpp:2683
LLVM_C_ABI void LLVMSetParamAlignment(LLVMValueRef Arg, unsigned Align)
Set the alignment for a function parameter.
Definition Core.cpp:2690
LLVM_C_ABI unsigned LLVMCountParams(LLVMValueRef Fn)
Obtain the number of parameters in a function.
Definition Core.cpp:2638
LLVM_C_ABI void LLVMGetParams(LLVMValueRef Fn, LLVMValueRef *Params)
Obtain the parameters in a function.
Definition Core.cpp:2644
LLVM_C_ABI LLVMValueRef LLVMGetFirstParam(LLVMValueRef Fn)
Obtain the first parameter to a function.
Definition Core.cpp:2659
LLVM_C_ABI LLVMValueRef LLVMGetLastParam(LLVMValueRef Fn)
Obtain the last parameter to a function.
Definition Core.cpp:2667
LLVM_C_ABI LLVMValueRef LLVMGetParam(LLVMValueRef Fn, unsigned Index)
Obtain the parameter at the specified index.
Definition Core.cpp:2650
LLVM_C_ABI LLVMValueRef LLVMGetNextParam(LLVMValueRef Arg)
Obtain the next parameter to a function.
Definition Core.cpp:2675
LLVM_C_ABI LLVMValueRef LLVMGetParamParent(LLVMValueRef Inst)
Obtain the function to which this argument belongs.
Definition Core.cpp:2655
LLVM_C_ABI void LLVMAddAttributeAtIndex(LLVMValueRef F, LLVMAttributeIndex Idx, LLVMAttributeRef A)
Add an attribute to a function.
Definition Core.cpp:2588
LLVM_C_ABI LLVMValueRef LLVMGetPrefixData(LLVMValueRef Fn)
Gets the prefix data associated with a function.
Definition Core.cpp:2556
LLVM_C_ABI LLVMValueRef LLVMGetPrologueData(LLVMValueRef Fn)
Gets the prologue data associated with a function.
Definition Core.cpp:2572
LLVM_C_ABI LLVMTypeRef LLVMIntrinsicGetType(LLVMContextRef Ctx, unsigned ID, LLVMTypeRef *ParamTypes, size_t ParamCount)
Retrieves the type of an intrinsic.
Definition Core.cpp:2499
LLVM_C_ABI unsigned LLVMGetIntrinsicID(LLVMValueRef Fn)
Obtain the ID number from a function instance.
Definition Core.cpp:2472
LLVM_C_ABI LLVMValueRef LLVMGetPersonalityFn(LLVMValueRef Fn)
Obtain the personality function attached to the function.
Definition Core.cpp:2463
LLVM_C_ABI unsigned LLVMGetAttributeCountAtIndex(LLVMValueRef F, LLVMAttributeIndex Idx)
Definition Core.cpp:2593
LLVM_C_ABI LLVMBool LLVMHasPersonalityFn(LLVMValueRef Fn)
Check whether the given function has a personality function.
Definition Core.cpp:2459
LLVM_C_ABI void LLVMRemoveStringAttributeAtIndex(LLVMValueRef F, LLVMAttributeIndex Idx, const char *K, unsigned KLen)
Definition Core.cpp:2624
LLVM_C_ABI void LLVMSetPrefixData(LLVMValueRef Fn, LLVMValueRef prefixData)
Sets the prefix data for the function.
Definition Core.cpp:2566
LLVM_C_ABI char * LLVMIntrinsicCopyOverloadedName(unsigned ID, LLVMTypeRef *ParamTypes, size_t ParamCount, size_t *NameLength)
Deprecated: Use LLVMIntrinsicCopyOverloadedName2 instead.
Definition Core.cpp:2506
LLVM_C_ABI const char * LLVMGetGC(LLVMValueRef Fn)
Obtain the name of the garbage collector to use during code generation.
Definition Core.cpp:2543
LLVM_C_ABI void LLVMSetGC(LLVMValueRef Fn, const char *Name)
Define the garbage collector to use during code generation.
Definition Core.cpp:2548
LLVM_C_ABI void LLVMSetPrologueData(LLVMValueRef Fn, LLVMValueRef prologueData)
Sets the prologue data for the function.
Definition Core.cpp:2582
LLVM_C_ABI void LLVMSetPersonalityFn(LLVMValueRef Fn, LLVMValueRef PersonalityFn)
Set the personality function attached to the function.
Definition Core.cpp:2467
LLVM_C_ABI void LLVMGetAttributesAtIndex(LLVMValueRef F, LLVMAttributeIndex Idx, LLVMAttributeRef *Attrs)
Definition Core.cpp:2598
LLVM_C_ABI unsigned LLVMGetFunctionCallConv(LLVMValueRef Fn)
Obtain the calling function of a function.
Definition Core.cpp:2534
LLVM_C_ABI LLVMBool LLVMIntrinsicIsOverloaded(unsigned ID)
Obtain if the intrinsic identified by the given ID is overloaded.
Definition Core.cpp:2529
LLVM_C_ABI char * LLVMIntrinsicCopyOverloadedName2(LLVMModuleRef Mod, 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:2515
LLVM_C_ABI void LLVMDeleteFunction(LLVMValueRef Fn)
Remove a function from its containing module and deletes it.
Definition Core.cpp:2455
LLVM_C_ABI void LLVMRemoveEnumAttributeAtIndex(LLVMValueRef F, LLVMAttributeIndex Idx, unsigned KindID)
Definition Core.cpp:2619
LLVM_C_ABI LLVMAttributeRef LLVMGetEnumAttributeAtIndex(LLVMValueRef F, LLVMAttributeIndex Idx, unsigned KindID)
Definition Core.cpp:2605
LLVM_C_ABI unsigned LLVMLookupIntrinsicID(const char *Name, size_t NameLen)
Obtain the intrinsic ID number which matches the given function name.
Definition Core.cpp:2525
LLVM_C_ABI const char * LLVMIntrinsicGetName(unsigned ID, size_t *NameLength)
Retrieves the name of an intrinsic.
Definition Core.cpp:2492
LLVM_C_ABI LLVMValueRef LLVMGetIntrinsicDeclaration(LLVMModuleRef Mod, unsigned ID, LLVMTypeRef *ParamTypes, size_t ParamCount)
Get or insert the declaration of an intrinsic.
Definition Core.cpp:2483
LLVM_C_ABI LLVMBool LLVMHasPrologueData(LLVMValueRef Fn)
Check if a given function has prologue data.
Definition Core.cpp:2577
LLVM_C_ABI LLVMBool LLVMHasPrefixData(LLVMValueRef Fn)
Check if a given function has prefix data.
Definition Core.cpp:2561
LLVM_C_ABI void LLVMSetFunctionCallConv(LLVMValueRef Fn, unsigned CC)
Set the calling convention of a function.
Definition Core.cpp:2538
LLVM_C_ABI void LLVMAddTargetDependentFunctionAttr(LLVMValueRef Fn, const char *A, const char *V)
Add a target-dependent attribute to a function.
Definition Core.cpp:2629
LLVM_C_ABI LLVMAttributeRef LLVMGetStringAttributeAtIndex(LLVMValueRef F, LLVMAttributeIndex Idx, const char *K, unsigned KLen)
Definition Core.cpp:2612
LLVM_C_ABI LLVMValueRef LLVMIsAMDString(LLVMValueRef Val)
Definition Core.cpp:1165
LLVM_C_ABI LLVMBool LLVMIsPoison(LLVMValueRef Val)
Determine whether a value instance is poisonous.
Definition Core.cpp:1271
LLVM_C_ABI LLVMValueKind LLVMGetValueKind(LLVMValueRef Val)
Obtain the enumerated type of a Value instance.
Definition Core.cpp:1006
LLVM_C_ABI void LLVMDumpValue(LLVMValueRef Val)
Dump a representation of a value to stderr.
Definition Core.cpp:1036
LLVM_C_ABI const char * LLVMGetValueName(LLVMValueRef Val)
Deprecated: Use LLVMGetValueName2 instead.
Definition Core.cpp:1028
LLVM_C_ABI LLVMContextRef LLVMGetValueContext(LLVMValueRef Val)
Obtain the context to which this value is associated.
Definition Core.cpp:1054
LLVM_C_ABI void LLVMReplaceAllUsesWith(LLVMValueRef OldVal, LLVMValueRef NewVal)
Replace all uses of a value with another one.
Definition Core.cpp:1072
LLVM_C_ABI const char * LLVMGetValueName2(LLVMValueRef Val, size_t *Length)
Obtain the string name of a value.
Definition Core.cpp:1018
LLVM_C_ABI void LLVMSetValueName(LLVMValueRef Val, const char *Name)
Deprecated: Use LLVMSetValueName2 instead.
Definition Core.cpp:1032
LLVM_C_ABI LLVMValueRef LLVMIsAMDNode(LLVMValueRef Val)
Definition Core.cpp:1150
LLVM_C_ABI char * LLVMPrintDbgRecordToString(LLVMDbgRecordRef Record)
Return a string representation of the DbgRecord.
Definition Core.cpp:1058
LLVM_C_ABI LLVMBool LLVMIsUndef(LLVMValueRef Val)
Determine whether a value instance is undefined.
Definition Core.cpp:1267
LLVM_C_ABI LLVMTypeRef LLVMTypeOf(LLVMValueRef Val)
Obtain the type of a value.
Definition Core.cpp:1002
LLVM_C_ABI char * LLVMPrintValueToString(LLVMValueRef Val)
Return a string representation of the value.
Definition Core.cpp:1040
LLVM_C_ABI LLVMValueRef LLVMIsAValueAsMetadata(LLVMValueRef Val)
Definition Core.cpp:1158
#define LLVM_DECLARE_VALUE_CAST(name)
Convert value instances between types.
Definition Core.h:2098
LLVM_C_ABI LLVMBool LLVMIsConstant(LLVMValueRef Val)
Determine whether the specified value instance is constant.
Definition Core.cpp:1257
LLVM_C_ABI void LLVMSetValueName2(LLVMValueRef Val, const char *Name, size_t NameLen)
Set the string name of a value.
Definition Core.cpp:1024
LLVM_C_ABI LLVMValueRef LLVMGetFirstGlobalIFunc(LLVMModuleRef M)
Obtain an iterator to the first GlobalIFunc in a Module.
Definition Core.cpp:2712
LLVM_C_ABI LLVMValueRef LLVMGetNamedGlobalIFunc(LLVMModuleRef M, const char *Name, size_t NameLen)
Obtain a GlobalIFunc value from a Module by its name.
Definition Core.cpp:2707
LLVM_C_ABI void LLVMRemoveGlobalIFunc(LLVMValueRef IFunc)
Remove a global indirect function from its parent module.
Definition Core.cpp:2756
LLVM_C_ABI 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:2697
LLVM_C_ABI LLVMValueRef LLVMGetNextGlobalIFunc(LLVMValueRef IFunc)
Advance a GlobalIFunc iterator to the next GlobalIFunc.
Definition Core.cpp:2728
LLVM_C_ABI LLVMValueRef LLVMGetPreviousGlobalIFunc(LLVMValueRef IFunc)
Decrement a GlobalIFunc iterator to the previous GlobalIFunc.
Definition Core.cpp:2736
LLVM_C_ABI LLVMValueRef LLVMGetGlobalIFuncResolver(LLVMValueRef IFunc)
Retrieves the resolver function associated with this indirect function, or NULL if it doesn't not exi...
Definition Core.cpp:2744
LLVM_C_ABI void LLVMSetGlobalIFuncResolver(LLVMValueRef IFunc, LLVMValueRef Resolver)
Sets the resolver function associated with this indirect function.
Definition Core.cpp:2748
LLVM_C_ABI LLVMValueRef LLVMGetLastGlobalIFunc(LLVMModuleRef M)
Obtain an iterator to the last GlobalIFunc in a Module.
Definition Core.cpp:2720
LLVM_C_ABI void LLVMEraseGlobalIFunc(LLVMValueRef IFunc)
Remove a global indirect function from its parent module and delete it.
Definition Core.cpp:2752
LLVM_C_ABI LLVMTypeRef LLVMGetAllocatedType(LLVMValueRef Alloca)
Obtain the type that is being allocated by the alloca instruction.
Definition Core.cpp:3252
LLVM_C_ABI void LLVMSetTailCall(LLVMValueRef CallInst, LLVMBool IsTailCall)
Set whether a call instruction is a tail call.
Definition Core.cpp:3164
LLVM_C_ABI void LLVMAddCallSiteAttribute(LLVMValueRef C, LLVMAttributeIndex Idx, LLVMAttributeRef A)
Definition Core.cpp:3096
LLVM_C_ABI unsigned LLVMGetNumOperandBundles(LLVMValueRef C)
Obtain the number of operand bundles attached to this instruction.
Definition Core.cpp:3148
LLVM_C_ABI void LLVMRemoveCallSiteEnumAttribute(LLVMValueRef C, LLVMAttributeIndex Idx, unsigned KindID)
Definition Core.cpp:3130
LLVM_C_ABI void LLVMRemoveCallSiteStringAttribute(LLVMValueRef C, LLVMAttributeIndex Idx, const char *K, unsigned KLen)
Definition Core.cpp:3135
LLVM_C_ABI LLVMAttributeRef LLVMGetCallSiteEnumAttribute(LLVMValueRef C, LLVMAttributeIndex Idx, unsigned KindID)
Definition Core.cpp:3116
LLVM_C_ABI unsigned LLVMGetInstructionCallConv(LLVMValueRef Instr)
Obtain the calling convention for a call instruction.
Definition Core.cpp:3079
LLVM_C_ABI LLVMBasicBlockRef LLVMGetCallBrDefaultDest(LLVMValueRef CallBr)
Get the default destination of a CallBr instruction.
Definition Core.cpp:3204
LLVM_C_ABI LLVMValueRef LLVMGetCalledValue(LLVMValueRef Instr)
Obtain the pointer to the function invoked by this instruction.
Definition Core.cpp:3140
LLVM_C_ABI void LLVMSetNormalDest(LLVMValueRef InvokeInst, LLVMBasicBlockRef B)
Set the normal destination basic block.
Definition Core.cpp:3191
LLVM_C_ABI LLVMBool LLVMIsTailCall(LLVMValueRef CallInst)
Obtain whether a call instruction is a tail call.
Definition Core.cpp:3160
LLVM_C_ABI LLVMAttributeRef LLVMGetCallSiteStringAttribute(LLVMValueRef C, LLVMAttributeIndex Idx, const char *K, unsigned KLen)
Definition Core.cpp:3123
LLVM_C_ABI unsigned LLVMGetCallBrNumIndirectDests(LLVMValueRef CallBr)
Get the number of indirect destinations of a CallBr instruction.
Definition Core.cpp:3208
LLVM_C_ABI void LLVMGetCallSiteAttributes(LLVMValueRef C, LLVMAttributeIndex Idx, LLVMAttributeRef *Attrs)
Definition Core.cpp:3108
LLVM_C_ABI LLVMBasicBlockRef LLVMGetNormalDest(LLVMValueRef InvokeInst)
Return the normal destination basic block.
Definition Core.cpp:3178
LLVM_C_ABI unsigned LLVMGetNumArgOperands(LLVMValueRef Instr)
Obtain the argument count for a call instruction.
Definition Core.cpp:3070
LLVM_C_ABI void LLVMSetTailCallKind(LLVMValueRef CallInst, LLVMTailCallKind kind)
Set the call kind of the call instruction.
Definition Core.cpp:3172
LLVM_C_ABI LLVMOperandBundleRef LLVMGetOperandBundleAtIndex(LLVMValueRef C, unsigned Index)
Obtain the operand bundle attached to this instruction at the given index.
Definition Core.cpp:3152
LLVM_C_ABI LLVMBasicBlockRef LLVMGetCallBrIndirectDest(LLVMValueRef CallBr, unsigned Idx)
Get the indirect destination of a CallBr instruction at the given index.
Definition Core.cpp:3212
LLVM_C_ABI LLVMTailCallKind LLVMGetTailCallKind(LLVMValueRef CallInst)
Obtain a tail call kind of the call instruction.
Definition Core.cpp:3168
LLVM_C_ABI void LLVMSetUnwindDest(LLVMValueRef InvokeInst, LLVMBasicBlockRef B)
Set the unwind destination basic block.
Definition Core.cpp:3195
LLVM_C_ABI LLVMTypeRef LLVMGetCalledFunctionType(LLVMValueRef C)
Obtain the function type called by this instruction.
Definition Core.cpp:3144
LLVM_C_ABI LLVMBasicBlockRef LLVMGetUnwindDest(LLVMValueRef InvokeInst)
Return the unwind destination basic block.
Definition Core.cpp:3182
LLVM_C_ABI void LLVMSetInstrParamAlignment(LLVMValueRef Instr, LLVMAttributeIndex Idx, unsigned Align)
Definition Core.cpp:3088
LLVM_C_ABI unsigned LLVMGetCallSiteAttributeCount(LLVMValueRef C, LLVMAttributeIndex Idx)
Definition Core.cpp:3101
LLVM_C_ABI void LLVMSetInstructionCallConv(LLVMValueRef Instr, unsigned CC)
Set the calling convention for a call instruction.
Definition Core.cpp:3083
LLVM_C_ABI LLVMGEPNoWrapFlags LLVMGEPGetNoWrapFlags(LLVMValueRef GEP)
Get the no-wrap related flags for the given GEP instruction.
Definition Core.cpp:3270
LLVM_C_ABI LLVMBool LLVMIsInBounds(LLVMValueRef GEP)
Check whether the given GEP operator is inbounds.
Definition Core.cpp:3258
LLVM_C_ABI void LLVMSetIsInBounds(LLVMValueRef GEP, LLVMBool InBounds)
Set the given GEP instruction to be inbounds or not.
Definition Core.cpp:3262
LLVM_C_ABI LLVMTypeRef LLVMGetGEPSourceElementType(LLVMValueRef GEP)
Get the source element type of the given GEP operator.
Definition Core.cpp:3266
LLVM_C_ABI void LLVMGEPSetNoWrapFlags(LLVMValueRef GEP, LLVMGEPNoWrapFlags NoWrapFlags)
Set the no-wrap related flags for the given GEP instruction.
Definition Core.cpp:3275
LLVM_C_ABI unsigned LLVMGetNumIndices(LLVMValueRef Inst)
Obtain the number of indices.
Definition Core.cpp:3303
LLVM_C_ABI const unsigned * LLVMGetIndices(LLVMValueRef Inst)
Obtain the indices as an array.
Definition Core.cpp:3315
LLVM_C_ABI LLVMBasicBlockRef LLVMGetIncomingBlock(LLVMValueRef PhiNode, unsigned Index)
Obtain an incoming value to a PHI node as an LLVMBasicBlockRef.
Definition Core.cpp:3297
LLVM_C_ABI LLVMValueRef LLVMGetIncomingValue(LLVMValueRef PhiNode, unsigned Index)
Obtain an incoming value to a PHI node as an LLVMValueRef.
Definition Core.cpp:3293
LLVM_C_ABI void LLVMAddIncoming(LLVMValueRef PhiNode, LLVMValueRef *IncomingValues, LLVMBasicBlockRef *IncomingBlocks, unsigned Count)
Add an incoming value to the end of a PHI list.
Definition Core.cpp:3282
LLVM_C_ABI unsigned LLVMCountIncoming(LLVMValueRef PhiNode)
Obtain the number of incoming basic blocks to a PHI node.
Definition Core.cpp:3289
LLVM_C_ABI LLVMValueRef LLVMGetCondition(LLVMValueRef Branch)
Return the condition of a branch instruction.
Definition Core.cpp:3236
LLVM_C_ABI LLVMBasicBlockRef LLVMGetSuccessor(LLVMValueRef Term, unsigned i)
Return the specified successor.
Definition Core.cpp:3222
LLVM_C_ABI void LLVMSetCondition(LLVMValueRef Branch, LLVMValueRef Cond)
Set the condition of a branch instruction.
Definition Core.cpp:3240
LLVM_C_ABI void LLVMSetSuccessor(LLVMValueRef Term, unsigned i, LLVMBasicBlockRef block)
Update the specified successor to point at the provided block.
Definition Core.cpp:3226
LLVM_C_ABI LLVMBool LLVMIsConditional(LLVMValueRef Branch)
Return if a branch is conditional.
Definition Core.cpp:3232
LLVM_C_ABI LLVMBasicBlockRef LLVMGetSwitchDefaultDest(LLVMValueRef SwitchInstr)
Obtain the default destination basic block of a switch instruction.
Definition Core.cpp:3246
LLVM_C_ABI unsigned LLVMGetNumSuccessors(LLVMValueRef Term)
Return the number of successors that this terminator has.
Definition Core.cpp:3218
LLVM_C_ABI LLVMRealPredicate LLVMGetFCmpPredicate(LLVMValueRef Inst)
Obtain the float predicate of an instruction.
Definition Core.cpp:2980
LLVM_C_ABI int LLVMHasMetadata(LLVMValueRef Val)
Determine whether an instruction has any metadata attached.
Definition Core.cpp:1076
LLVM_C_ABI void LLVMInstructionRemoveFromParent(LLVMValueRef Inst)
Remove an instruction.
Definition Core.cpp:2954
LLVM_C_ABI LLVMValueRef LLVMGetPreviousInstruction(LLVMValueRef Inst)
Obtain the instruction that occurred before this one.
Definition Core.cpp:2946
LLVM_C_ABI LLVMDbgRecordRef LLVMGetPreviousDbgRecord(LLVMDbgRecordRef DbgRecord)
Obtain the previous DbgRecord in the sequence or NULL if there are no more.
Definition Core.cpp:3031
LLVM_C_ABI LLVMDbgRecordRef LLVMGetFirstDbgRecord(LLVMValueRef Inst)
Obtain the first debug record attached to an instruction.
Definition Core.cpp:3003
LLVM_C_ABI LLVMOpcode LLVMGetInstructionOpcode(LLVMValueRef Inst)
Obtain the code opcode for an individual instruction.
Definition Core.cpp:2986
LLVM_C_ABI LLVMDbgRecordRef LLVMGetNextDbgRecord(LLVMDbgRecordRef DbgRecord)
Obtain the next DbgRecord in the sequence or NULL if there are no more.
Definition Core.cpp:3023
LLVM_C_ABI LLVMDbgRecordRef LLVMGetLastDbgRecord(LLVMValueRef Inst)
Obtain the last debug record attached to an instruction.
Definition Core.cpp:3013
LLVM_C_ABI LLVMValueRef LLVMIsATerminatorInst(LLVMValueRef Inst)
Determine whether an instruction is a terminator.
Definition Core.cpp:2998
LLVMMetadataRef LLVMDbgVariableRecordGetExpression(LLVMDbgRecordRef Rec)
Get the debug info expression of the DbgVariableRecord.
Definition Core.cpp:3066
LLVM_C_ABI 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:1133
LLVM_C_ABI void LLVMDeleteInstruction(LLVMValueRef Inst)
Delete an instruction.
Definition Core.cpp:2962
LLVMMetadataRef LLVMDbgRecordGetDebugLoc(LLVMDbgRecordRef Rec)
Get the debug location attached to the debug record.
Definition Core.cpp:3039
LLVM_C_ABI LLVMBasicBlockRef LLVMGetInstructionParent(LLVMValueRef Inst)
Obtain the basic block to which an instruction belongs.
Definition Core.cpp:2918
LLVMValueRef LLVMDbgVariableRecordGetValue(LLVMDbgRecordRef Rec, unsigned OpIdx)
Get the value of the DbgVariableRecord.
Definition Core.cpp:3057
LLVM_C_ABI LLVMBool LLVMGetICmpSameSign(LLVMValueRef Inst)
Get whether or not an icmp instruction has the samesign flag.
Definition Core.cpp:2972
LLVM_C_ABI LLVMValueRef LLVMInstructionClone(LLVMValueRef Inst)
Create a copy of 'this' instruction that is identical in all ways except the following:
Definition Core.cpp:2992
LLVM_C_ABI void LLVMInstructionEraseFromParent(LLVMValueRef Inst)
Remove and delete an instruction.
Definition Core.cpp:2958
LLVM_C_ABI void LLVMSetMetadata(LLVMValueRef Val, unsigned KindID, LLVMValueRef Node)
Set metadata associated with an instruction value.
Definition Core.cpp:1102
LLVM_C_ABI LLVMValueRef LLVMGetMetadata(LLVMValueRef Val, unsigned KindID)
Return metadata associated with an instruction value.
Definition Core.cpp:1080
LLVM_C_ABI LLVMIntPredicate LLVMGetICmpPredicate(LLVMValueRef Inst)
Obtain the predicate of an instruction.
Definition Core.cpp:2966
LLVM_C_ABI LLVMValueRef LLVMGetNextInstruction(LLVMValueRef Inst)
Obtain the instruction that occurs after the one specified.
Definition Core.cpp:2938
LLVMMetadataRef LLVMDbgVariableRecordGetVariable(LLVMDbgRecordRef Rec)
Get the debug info variable of the DbgVariableRecord.
Definition Core.cpp:3062
LLVMDbgRecordKind LLVMDbgRecordGetKind(LLVMDbgRecordRef Rec)
Definition Core.cpp:3043
LLVM_C_ABI void LLVMSetICmpSameSign(LLVMValueRef Inst, LLVMBool SameSign)
Set the samesign flag on an icmp instruction.
Definition Core.cpp:2976
LLVM_C_ABI LLVMMetadataRef LLVMMDNodeInContext2(LLVMContextRef C, LLVMMetadataRef *MDs, size_t Count)
Create an MDNode value with the given array of operands.
Definition Core.cpp:1286
LLVM_C_ABI const char * LLVMGetMDString(LLVMValueRef V, unsigned *Length)
Obtain the underlying string from a MDString value.
Definition Core.cpp:1346
LLVM_C_ABI LLVMValueRef LLVMMDString(const char *Str, unsigned SLen)
Deprecated: Use LLVMMDStringInContext2 instead.
Definition Core.cpp:1298
LLVM_C_ABI LLVMValueRef LLVMMetadataAsValue(LLVMContextRef C, LLVMMetadataRef MD)
Obtain a Metadata as a Value.
Definition Core.cpp:1333
LLVM_C_ABI unsigned LLVMGetMDNodeNumOperands(LLVMValueRef V)
Obtain the number of operands from an MDNode value.
Definition Core.cpp:1356
LLVM_C_ABI LLVMValueRef LLVMMDStringInContext(LLVMContextRef C, const char *Str, unsigned SLen)
Deprecated: Use LLVMMDStringInContext2 instead.
Definition Core.cpp:1291
LLVM_C_ABI LLVMValueRef LLVMMDNode(LLVMValueRef *Vals, unsigned Count)
Deprecated: Use LLVMMDNodeInContext2 instead.
Definition Core.cpp:1329
LLVM_C_ABI LLVMMetadataRef LLVMMDStringInContext2(LLVMContextRef C, const char *Str, size_t SLen)
Create an MDString value from a given string value.
Definition Core.cpp:1281
LLVM_C_ABI LLVMValueRef LLVMMDNodeInContext(LLVMContextRef C, LLVMValueRef *Vals, unsigned Count)
Deprecated: Use LLVMMDNodeInContext2 instead.
Definition Core.cpp:1302
LLVM_C_ABI void LLVMReplaceMDNodeOperandWith(LLVMValueRef V, unsigned Index, LLVMMetadataRef Replacement)
Replace an operand at a specific index in a llvm::MDNode value.
Definition Core.cpp:1424
LLVM_C_ABI LLVMMetadataRef LLVMValueAsMetadata(LLVMValueRef Val)
Obtain a Value as a Metadata.
Definition Core.cpp:1337
LLVM_C_ABI void LLVMGetMDNodeOperands(LLVMValueRef V, LLVMValueRef *Dest)
Obtain the given MDNode's operands.
Definition Core.cpp:1411
LLVM_C_ABI LLVMUseRef LLVMGetOperandUse(LLVMValueRef Val, unsigned Index)
Obtain the use of an operand at a specific index in a llvm::User value.
Definition Core.cpp:1222
LLVM_C_ABI int LLVMGetNumOperands(LLVMValueRef Val)
Obtain the number of operands in a llvm::User value.
Definition Core.cpp:1231
LLVM_C_ABI void LLVMSetOperand(LLVMValueRef User, unsigned Index, LLVMValueRef Val)
Set an operand at a specific index in a llvm::User value.
Definition Core.cpp:1227
LLVM_C_ABI LLVMValueRef LLVMGetOperand(LLVMValueRef Val, unsigned Index)
Obtain an operand at a specific index in a llvm::User value.
Definition Core.cpp:1208
LLVM_C_ABI LLVMValueRef LLVMGetUser(LLVMUseRef U)
Obtain the user value for a user.
Definition Core.cpp:1188
LLVM_C_ABI LLVMValueRef LLVMGetUsedValue(LLVMUseRef U)
Obtain the value this use corresponds to.
Definition Core.cpp:1192
LLVM_C_ABI LLVMUseRef LLVMGetNextUse(LLVMUseRef U)
Obtain the next use of a value.
Definition Core.cpp:1181
LLVM_C_ABI LLVMUseRef LLVMGetFirstUse(LLVMValueRef Val)
Obtain the first use of a value.
Definition Core.cpp:1173
#define LLVM_FOR_EACH_VALUE_SUBCLASS(macro)
Definition Core.h:1902
LLVM_C_ABI void LLVMDisposeMessage(char *Message)
Definition Core.cpp:88
LLVM_C_ABI char * LLVMCreateMessage(const char *Message)
Definition Core.cpp:84
LLVM_C_ABI void LLVMGetVersion(unsigned *Major, unsigned *Minor, unsigned *Patch)
Return the major, minor, and patch version of LLVM.
Definition Core.cpp:73
LLVM_C_ABI void LLVMShutdown(void)
Deallocate and destroy all ManagedStatic variables.
Definition Core.cpp:67
struct LLVMOpaqueValue * LLVMValueRef
Represents an individual value in LLVM IR.
Definition Types.h:75
struct LLVMOpaqueAttributeRef * LLVMAttributeRef
Used to represent an attributes.
Definition Types.h:145
int LLVMBool
Definition Types.h:28
struct LLVMOpaqueModuleFlagEntry LLVMModuleFlagEntry
Definition Types.h:160
struct LLVMOpaqueNamedMDNode * LLVMNamedMDNodeRef
Represents an LLVM Named Metadata Node.
Definition Types.h:96
struct LLVMOpaquePassManager * LLVMPassManagerRef
Definition Types.h:127
struct LLVMOpaqueDbgRecord * LLVMDbgRecordRef
Definition Types.h:175
struct LLVMOpaqueDiagnosticInfo * LLVMDiagnosticInfoRef
Definition Types.h:150
struct LLVMOpaqueValueMetadataEntry LLVMValueMetadataEntry
Represents an entry in a Global Object's metadata attachments.
Definition Types.h:103
struct LLVMOpaqueMemoryBuffer * LLVMMemoryBufferRef
LLVM uses a polymorphic type hierarchy which C cannot represent, therefore parameters must be passed ...
Definition Types.h:48
struct LLVMOpaqueContext * LLVMContextRef
The top-level container for all LLVM global data.
Definition Types.h:53
struct LLVMOpaqueBuilder * LLVMBuilderRef
Represents an LLVM basic block builder.
Definition Types.h:110
struct LLVMOpaqueUse * LLVMUseRef
Used to get the users and usees of a Value.
Definition Types.h:133
struct LLVMOpaqueBasicBlock * LLVMBasicBlockRef
Represents a basic block of instructions in LLVM IR.
Definition Types.h:82
struct LLVMOpaqueType * LLVMTypeRef
Each value in the LLVM IR has a type, an LLVMTypeRef.
Definition Types.h:68
struct LLVMOpaqueMetadata * LLVMMetadataRef
Represents an LLVM Metadata.
Definition Types.h:89
struct LLVMOpaqueModule * LLVMModuleRef
The top-level container for all other LLVM Intermediate Representation (IR) objects.
Definition Types.h:61
struct LLVMOpaqueModuleProvider * LLVMModuleProviderRef
Interface used to provide a module to JIT or interpreter.
Definition Types.h:124
struct LLVMOpaqueOperandBundle * LLVMOperandBundleRef
Definition Types.h:138
LLVM_C_ABI LLVMValueRef LLVMAddAlias2(LLVMModuleRef M, LLVMTypeRef ValueTy, unsigned AddrSpace, LLVMValueRef Aliasee, const char *Name)
Add a GlobalAlias with the given value type, address space and aliasee.
Definition Core.cpp:2345
LLVM_C_ABI LLVMValueRef LLVMGetLastGlobalAlias(LLVMModuleRef M)
Obtain an iterator to the last GlobalAlias in a Module.
Definition Core.cpp:2366
LLVM_C_ABI LLVMValueRef LLVMGetPreviousGlobalAlias(LLVMValueRef GA)
Decrement a GlobalAlias iterator to the previous GlobalAlias.
Definition Core.cpp:2382
LLVM_C_ABI void LLVMAliasSetAliasee(LLVMValueRef Alias, LLVMValueRef Aliasee)
Set the target value of an alias.
Definition Core.cpp:2394
LLVM_C_ABI LLVMValueRef LLVMGetFirstGlobalAlias(LLVMModuleRef M)
Obtain an iterator to the first GlobalAlias in a Module.
Definition Core.cpp:2358
LLVM_C_ABI LLVMValueRef LLVMAliasGetAliasee(LLVMValueRef Alias)
Retrieve the target value of an alias.
Definition Core.cpp:2390
LLVM_C_ABI LLVMValueRef LLVMGetNamedGlobalAlias(LLVMModuleRef M, const char *Name, size_t NameLen)
Obtain a GlobalAlias value from a Module by its name.
Definition Core.cpp:2353
LLVM_C_ABI LLVMValueRef LLVMGetNextGlobalAlias(LLVMValueRef GA)
Advance a GlobalAlias iterator to the next GlobalAlias.
Definition Core.cpp:2374
LLVM_C_ABI LLVMBool LLVMIsThreadLocal(LLVMValueRef GlobalVar)
Definition Core.cpp:2280
LLVM_C_ABI LLVMThreadLocalMode LLVMGetThreadLocalMode(LLVMValueRef GlobalVar)
Definition Core.cpp:2296
LLVM_C_ABI LLVMBool LLVMIsGlobalConstant(LLVMValueRef GlobalVar)
Definition Core.cpp:2288
LLVM_C_ABI LLVMValueRef LLVMGetPreviousGlobal(LLVMValueRef GlobalVar)
Definition Core.cpp:2256
LLVM_C_ABI void LLVMSetThreadLocal(LLVMValueRef GlobalVar, LLVMBool IsThreadLocal)
Definition Core.cpp:2284
LLVM_C_ABI LLVMBool LLVMIsExternallyInitialized(LLVMValueRef GlobalVar)
Definition Core.cpp:2335
LLVM_C_ABI LLVMValueRef LLVMGetLastGlobal(LLVMModuleRef M)
Definition Core.cpp:2240
LLVM_C_ABI LLVMValueRef LLVMGetNamedGlobalWithLength(LLVMModuleRef M, const char *Name, size_t Length)
Definition Core.cpp:2227
LLVM_C_ABI LLVMValueRef LLVMGetFirstGlobal(LLVMModuleRef M)
Definition Core.cpp:2232
LLVM_C_ABI void LLVMSetThreadLocalMode(LLVMValueRef GlobalVar, LLVMThreadLocalMode Mode)
Definition Core.cpp:2313
LLVM_C_ABI LLVMValueRef LLVMGetNextGlobal(LLVMValueRef GlobalVar)
Definition Core.cpp:2248
LLVM_C_ABI void LLVMSetExternallyInitialized(LLVMValueRef GlobalVar, LLVMBool IsExtInit)
Definition Core.cpp:2339
LLVM_C_ABI LLVMValueRef LLVMGetNamedGlobal(LLVMModuleRef M, const char *Name)
Definition Core.cpp:2223
LLVM_C_ABI LLVMValueRef LLVMAddGlobalInAddressSpace(LLVMModuleRef M, LLVMTypeRef Ty, const char *Name, unsigned AddressSpace)
Definition Core.cpp:2214
LLVM_C_ABI void LLVMDeleteGlobal(LLVMValueRef GlobalVar)
Definition Core.cpp:2264
LLVM_C_ABI void LLVMSetGlobalConstant(LLVMValueRef GlobalVar, LLVMBool IsConstant)
Definition Core.cpp:2292
LLVM_C_ABI LLVMValueRef LLVMAddGlobal(LLVMModuleRef M, LLVMTypeRef Ty, const char *Name)
Definition Core.cpp:2209
LLVM_C_ABI LLVMValueRef LLVMGetInitializer(LLVMValueRef GlobalVar)
Definition Core.cpp:2268
LLVM_C_ABI void LLVMSetInitializer(LLVMValueRef GlobalVar, LLVMValueRef ConstantVal)
Definition Core.cpp:2275
#define N