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 */
594 "Use of the global context is deprecated, create "
595 "one using LLVMContextCreate instead");
596
597/**
598 * Set the diagnostic handler for this context.
599 */
601 LLVMDiagnosticHandler Handler,
602 void *DiagnosticContext);
603
604/**
605 * Get the diagnostic handler of this context.
606 */
609
610/**
611 * Get the diagnostic context of this context.
612 */
614
615/**
616 * Set the yield callback function for this context.
617 *
618 * @see LLVMContext::setYieldCallback()
619 */
621 LLVMYieldCallback Callback,
622 void *OpaqueHandle);
623
624/**
625 * Retrieve whether the given context is set to discard all value names.
626 *
627 * @see LLVMContext::shouldDiscardValueNames()
628 */
630
631/**
632 * Set whether the given context discards all value names.
633 *
634 * If true, only the names of GlobalValue objects will be available in the IR.
635 * This can be used to save memory and runtime, especially in release mode.
636 *
637 * @see LLVMContext::setDiscardValueNames()
638 */
640 LLVMBool Discard);
641
642/**
643 * Destroy a context instance.
644 *
645 * This should be called for every call to LLVMContextCreate() or memory
646 * will be leaked.
647 */
649
650/**
651 * Return a string representation of the DiagnosticInfo. Use
652 * LLVMDisposeMessage to free the string.
653 *
654 * @see DiagnosticInfo::print()
655 */
657
658/**
659 * Return an enum LLVMDiagnosticSeverity.
660 *
661 * @see DiagnosticInfo::getSeverity()
662 */
665
666LLVM_C_ABI unsigned LLVMGetMDKindIDInContext(LLVMContextRef C, const char *Name,
667 unsigned SLen);
669 unsigned LLVMGetMDKindID(const char *Name, unsigned SLen),
670 "Use of the global context is deprecated, use LLVMGetMDKindIDInContext "
671 "instead");
672
673/**
674 * Maps a synchronization scope name to a ID unique within this context.
675 */
676LLVM_C_ABI unsigned LLVMGetSyncScopeID(LLVMContextRef C, const char *Name,
677 size_t SLen);
678
679/**
680 * Return an unique id given the name of a enum attribute,
681 * or 0 if no attribute by that name exists.
682 *
683 * See http://llvm.org/docs/LangRef.html#parameter-attributes
684 * and http://llvm.org/docs/LangRef.html#function-attributes
685 * for the list of available attributes.
686 *
687 * NB: Attribute names and/or id are subject to change without
688 * going through the C API deprecation cycle.
689 */
690LLVM_C_ABI unsigned LLVMGetEnumAttributeKindForName(const char *Name,
691 size_t SLen);
693
694/**
695 * Create an enum attribute.
696 */
698 unsigned KindID,
699 uint64_t Val);
700
701/**
702 * Get the unique id corresponding to the enum attribute
703 * passed as argument.
704 */
706
707/**
708 * Get the enum attribute's value. 0 is returned if none exists.
709 */
711
712/**
713 * Create a type attribute
714 */
716 unsigned KindID,
717 LLVMTypeRef type_ref);
718
719/**
720 * Get the type attribute's value.
721 */
723
724/**
725 * Create a ConstantRange attribute.
726 *
727 * LowerWords and UpperWords need to be NumBits divided by 64 rounded up
728 * elements long.
729 */
731 LLVMContextRef C, unsigned KindID, unsigned NumBits,
732 const uint64_t LowerWords[], const uint64_t UpperWords[]);
733
734/**
735 * Create a string attribute.
736 */
738 const char *K,
739 unsigned KLength,
740 const char *V,
741 unsigned VLength);
742
743/**
744 * Get the string attribute's kind.
745 */
747 unsigned *Length);
748
749/**
750 * Get the string attribute's value.
751 */
753 unsigned *Length);
754
755/**
756 * Check for the different types of attributes.
757 */
761
762/**
763 * Obtain a Type from a context by its registered name.
764 */
766
767/**
768 * @}
769 */
770
771/**
772 * @defgroup LLVMCCoreModule Modules
773 *
774 * Modules represent the top-level structure in an LLVM program. An LLVM
775 * module is effectively a translation unit or a collection of
776 * translation units merged together.
777 *
778 * @{
779 */
780
781/**
782 * Create a new, empty module in the global context.
783 *
784 * This is equivalent to calling LLVMModuleCreateWithNameInContext with
785 * LLVMGetGlobalContext() as the context parameter.
786 *
787 * Every invocation should be paired with LLVMDisposeModule() or memory
788 * will be leaked.
789 */
791 LLVMModuleRef LLVMModuleCreateWithName(const char *ModuleID),
792 "Use of the global context is deprecated, use "
793 "LLVMModuleCreateWithNameInContext instead");
794
795/**
796 * Create a new, empty module in a specific context.
797 *
798 * Every invocation should be paired with LLVMDisposeModule() or memory
799 * will be leaked.
800 */
803/**
804 * Return an exact copy of the specified module.
805 */
807
808/**
809 * Destroy a module instance.
810 *
811 * This must be called for every created module or memory will be
812 * leaked.
813 */
815
816/**
817 * Soon to be deprecated.
818 * See https://llvm.org/docs/RemoveDIsDebugInfo.html#c-api-changes
819 *
820 * Returns true if the module is in the new debug info mode which uses
821 * non-instruction debug records instead of debug intrinsics for variable
822 * location tracking.
823 */
825
826/**
827 * Soon to be deprecated.
828 * See https://llvm.org/docs/RemoveDIsDebugInfo.html#c-api-changes
829 *
830 * Convert module into desired debug info format.
831 */
833 LLVMBool UseNewFormat);
834
835/**
836 * Obtain the identifier of a module.
837 *
838 * @param M Module to obtain identifier of
839 * @param Len Out parameter which holds the length of the returned string.
840 * @return The identifier of M.
841 * @see Module::getModuleIdentifier()
842 */
843LLVM_C_ABI const char *LLVMGetModuleIdentifier(LLVMModuleRef M, size_t *Len);
844
845/**
846 * Set the identifier of a module to a string Ident with length Len.
847 *
848 * @param M The module to set identifier
849 * @param Ident The string to set M's identifier to
850 * @param Len Length of Ident
851 * @see Module::setModuleIdentifier()
852 */
853LLVM_C_ABI void LLVMSetModuleIdentifier(LLVMModuleRef M, const char *Ident,
854 size_t Len);
855
856/**
857 * Obtain the module's original source file name.
858 *
859 * @param M Module to obtain the name of
860 * @param Len Out parameter which holds the length of the returned string
861 * @return The original source file name of M
862 * @see Module::getSourceFileName()
863 */
864LLVM_C_ABI const char *LLVMGetSourceFileName(LLVMModuleRef M, size_t *Len);
865
866/**
867 * Set the original source file name of a module to a string Name with length
868 * Len.
869 *
870 * @param M The module to set the source file name of
871 * @param Name The string to set M's source file name to
872 * @param Len Length of Name
873 * @see Module::setSourceFileName()
874 */
875LLVM_C_ABI void LLVMSetSourceFileName(LLVMModuleRef M, const char *Name,
876 size_t Len);
877
878/**
879 * Obtain the data layout for a module.
880 *
881 * @see Module::getDataLayoutStr()
882 *
883 * LLVMGetDataLayout is DEPRECATED, as the name is not only incorrect,
884 * but match the name of another method on the module. Prefer the use
885 * of LLVMGetDataLayoutStr, which is not ambiguous.
886 */
889
890/**
891 * Set the data layout for a module.
892 *
893 * @see Module::setDataLayout()
894 */
895LLVM_C_ABI void LLVMSetDataLayout(LLVMModuleRef M, const char *DataLayoutStr);
896
897/**
898 * Obtain the target triple for a module.
899 *
900 * @see Module::getTargetTriple()
901 */
903
904/**
905 * Set the target triple for a module.
906 *
907 * @see Module::setTargetTriple()
908 */
909LLVM_C_ABI void LLVMSetTarget(LLVMModuleRef M, const char *Triple);
910
911/**
912 * Returns the module flags as an array of flag-key-value triples. The caller
913 * is responsible for freeing this array by calling
914 * \c LLVMDisposeModuleFlagsMetadata.
915 *
916 * @see Module::getModuleFlagsMetadata()
917 */
919 size_t *Len);
920
921/**
922 * Destroys module flags metadata entries.
923 */
925
926/**
927 * Returns the flag behavior for a module flag entry at a specific index.
928 *
929 * @see Module::ModuleFlagEntry::Behavior
930 */
932 LLVMModuleFlagEntry *Entries, unsigned Index);
933
934/**
935 * Returns the key for a module flag entry at a specific index.
936 *
937 * @see Module::ModuleFlagEntry::Key
938 */
940 unsigned Index, size_t *Len);
941
942/**
943 * Returns the metadata for a module flag entry at a specific index.
944 *
945 * @see Module::ModuleFlagEntry::Val
946 */
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::getModuleFlag()
955 */
957 size_t KeyLen);
958
959/**
960 * Add a module-level flag to the module-level flags metadata if it doesn't
961 * already exist.
962 *
963 * @see Module::addModuleFlag()
964 */
966 LLVMModuleFlagBehavior Behavior,
967 const char *Key, size_t KeyLen,
968 LLVMMetadataRef Val);
969
970/**
971 * Dump a representation of a module to stderr.
972 *
973 * @see Module::dump()
974 */
976
977/**
978 * Print a representation of a module to a file. The ErrorMessage needs to be
979 * disposed with LLVMDisposeMessage. Returns 0 on success, 1 otherwise.
980 *
981 * @see Module::print()
982 */
984 char **ErrorMessage);
985
986/**
987 * Return a string representation of the module. Use
988 * LLVMDisposeMessage to free the string.
989 *
990 * @see Module::print()
991 */
993
994/**
995 * Get inline assembly for a module.
996 *
997 * @see Module::getModuleInlineAsm()
998 */
999LLVM_C_ABI const char *LLVMGetModuleInlineAsm(LLVMModuleRef M, size_t *Len);
1000
1001/**
1002 * Set inline assembly for a module.
1003 *
1004 * @see Module::setModuleInlineAsm()
1005 */
1006LLVM_C_ABI void LLVMSetModuleInlineAsm2(LLVMModuleRef M, const char *Asm,
1007 size_t Len);
1008
1009/**
1010 * Append inline assembly to a module.
1011 *
1012 * @see Module::appendModuleInlineAsm()
1013 */
1014LLVM_C_ABI void LLVMAppendModuleInlineAsm(LLVMModuleRef M, const char *Asm,
1015 size_t Len);
1016
1017/**
1018 * Create the specified uniqued inline asm string.
1019 *
1020 * @see InlineAsm::get()
1021 */
1023 LLVMTypeRef Ty, const char *AsmString, size_t AsmStringSize,
1024 const char *Constraints, size_t ConstraintsSize, LLVMBool HasSideEffects,
1025 LLVMBool IsAlignStack, LLVMInlineAsmDialect Dialect, LLVMBool CanThrow);
1026
1027/**
1028 * Get the template string used for an inline assembly snippet
1029 *
1030 */
1031LLVM_C_ABI const char *LLVMGetInlineAsmAsmString(LLVMValueRef InlineAsmVal,
1032 size_t *Len);
1033
1034/**
1035 * Get the raw constraint string for an inline assembly snippet
1036 *
1037 */
1038LLVM_C_ABI const char *
1039LLVMGetInlineAsmConstraintString(LLVMValueRef InlineAsmVal, size_t *Len);
1040
1041/**
1042 * Get the dialect used by the inline asm snippet
1043 *
1044 */
1047
1048/**
1049 * Get the function type of the inline assembly snippet. The same type that
1050 * was passed into LLVMGetInlineAsm originally
1051 *
1052 * @see LLVMGetInlineAsm
1053 *
1054 */
1056
1057/**
1058 * Get if the inline asm snippet has side effects
1059 *
1060 */
1062
1063/**
1064 * Get if the inline asm snippet needs an aligned stack
1065 *
1066 */
1069
1070/**
1071 * Get if the inline asm snippet may unwind the stack
1072 *
1073 */
1075
1076/**
1077 * Obtain the context to which this module is associated.
1078 *
1079 * @see Module::getContext()
1080 */
1082
1083/** Deprecated: Use LLVMGetTypeByName2 instead. */
1085
1086/**
1087 * Obtain an iterator to the first NamedMDNode in a Module.
1088 *
1089 * @see llvm::Module::named_metadata_begin()
1090 */
1092
1093/**
1094 * Obtain an iterator to the last NamedMDNode in a Module.
1095 *
1096 * @see llvm::Module::named_metadata_end()
1097 */
1099
1100/**
1101 * Advance a NamedMDNode iterator to the next NamedMDNode.
1102 *
1103 * Returns NULL if the iterator was already at the end and there are no more
1104 * named metadata nodes.
1105 */
1108
1109/**
1110 * Decrement a NamedMDNode iterator to the previous NamedMDNode.
1111 *
1112 * Returns NULL if the iterator was already at the beginning and there are
1113 * no previous named metadata nodes.
1114 */
1117
1118/**
1119 * Retrieve a NamedMDNode with the given name, returning NULL if no such
1120 * node exists.
1121 *
1122 * @see llvm::Module::getNamedMetadata()
1123 */
1125 const char *Name,
1126 size_t NameLen);
1127
1128/**
1129 * Retrieve a NamedMDNode with the given name, creating a new node if no such
1130 * node exists.
1131 *
1132 * @see llvm::Module::getOrInsertNamedMetadata()
1133 */
1135 const char *Name,
1136 size_t NameLen);
1137
1138/**
1139 * Retrieve the name of a NamedMDNode.
1140 *
1141 * @see llvm::NamedMDNode::getName()
1142 */
1144 size_t *NameLen);
1145
1146/**
1147 * Obtain the number of operands for named metadata in a module.
1148 *
1149 * @see llvm::Module::getNamedMetadata()
1150 */
1152 const char *Name);
1153
1154/**
1155 * Obtain the named metadata operands for a module.
1156 *
1157 * The passed LLVMValueRef pointer should refer to an array of
1158 * LLVMValueRef at least LLVMGetNamedMetadataNumOperands long. This
1159 * array will be populated with the LLVMValueRef instances. Each
1160 * instance corresponds to a llvm::MDNode.
1161 *
1162 * @see llvm::Module::getNamedMetadata()
1163 * @see llvm::MDNode::getOperand()
1164 */
1166 LLVMValueRef *Dest);
1167
1168/**
1169 * Add an operand to named metadata.
1170 *
1171 * @see llvm::Module::getNamedMetadata()
1172 * @see llvm::MDNode::addOperand()
1173 */
1175 LLVMValueRef Val);
1176
1177/**
1178 * Return the directory of the debug location for this value, which must be
1179 * an llvm::Instruction, llvm::GlobalVariable, or llvm::Function.
1180 *
1181 * @see llvm::Instruction::getDebugLoc()
1182 * @see llvm::GlobalVariable::getDebugInfo()
1183 * @see llvm::Function::getSubprogram()
1184 */
1186 unsigned *Length);
1187
1188/**
1189 * Return the filename of the debug location for this value, which must be
1190 * an llvm::Instruction, llvm::GlobalVariable, or llvm::Function.
1191 *
1192 * @see llvm::Instruction::getDebugLoc()
1193 * @see llvm::GlobalVariable::getDebugInfo()
1194 * @see llvm::Function::getSubprogram()
1195 */
1197 unsigned *Length);
1198
1199/**
1200 * Return the line number of the debug location for this value, which must be
1201 * an llvm::Instruction, llvm::GlobalVariable, or llvm::Function.
1202 *
1203 * @see llvm::Instruction::getDebugLoc()
1204 * @see llvm::GlobalVariable::getDebugInfo()
1205 * @see llvm::Function::getSubprogram()
1206 */
1208
1209/**
1210 * Return the column number of the debug location for this value, which must be
1211 * an llvm::Instruction.
1212 *
1213 * @see llvm::Instruction::getDebugLoc()
1214 */
1216
1217/**
1218 * Add a function to a module under a specified name.
1219 *
1220 * @see llvm::Function::Create()
1221 */
1223 LLVMTypeRef FunctionTy);
1224
1225/**
1226 * Obtain or insert a function into a module.
1227 *
1228 * If a function with the specified name already exists in the module, it
1229 * is returned. Otherwise, a new function is created in the module with the
1230 * specified name and type and is returned.
1231 *
1232 * The returned value corresponds to a llvm::Function instance.
1233 *
1234 * @see llvm::Module::getOrInsertFunction()
1235 */
1237 const char *Name,
1238 size_t NameLen,
1239 LLVMTypeRef FunctionTy);
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
1250/**
1251 * Obtain a Function value from a Module by its name.
1252 *
1253 * The returned value corresponds to a llvm::Function value.
1254 *
1255 * @see llvm::Module::getFunction()
1256 */
1258 const char *Name,
1259 size_t Length);
1260
1261/**
1262 * Obtain an iterator to the first Function in a Module.
1263 *
1264 * @see llvm::Module::begin()
1265 */
1267
1268/**
1269 * Obtain an iterator to the last Function in a Module.
1270 *
1271 * @see llvm::Module::end()
1272 */
1274
1275/**
1276 * Advance a Function iterator to the next Function.
1277 *
1278 * Returns NULL if the iterator was already at the end and there are no more
1279 * functions.
1280 */
1282
1283/**
1284 * Decrement a Function iterator to the previous Function.
1285 *
1286 * Returns NULL if the iterator was already at the beginning and there are
1287 * no previous functions.
1288 */
1290
1291/** Deprecated: Use LLVMSetModuleInlineAsm2 instead. */
1292LLVM_C_ABI void LLVMSetModuleInlineAsm(LLVMModuleRef M, const char *Asm);
1293
1294/**
1295 * @}
1296 */
1297
1298/**
1299 * @defgroup LLVMCCoreType Types
1300 *
1301 * Types represent the type of a value.
1302 *
1303 * Types are associated with a context instance. The context internally
1304 * deduplicates types so there is only 1 instance of a specific type
1305 * alive at a time. In other words, a unique type is shared among all
1306 * consumers within a context.
1307 *
1308 * A Type in the C API corresponds to llvm::Type.
1309 *
1310 * Types have the following hierarchy:
1311 *
1312 * types:
1313 * integer type
1314 * real type
1315 * function type
1316 * sequence types:
1317 * array type
1318 * pointer type
1319 * vector type
1320 * void type
1321 * label type
1322 * opaque type
1323 *
1324 * @{
1325 */
1326
1327/**
1328 * Obtain the enumerated type of a Type instance.
1329 *
1330 * @see llvm::Type:getTypeID()
1331 */
1333
1334/**
1335 * Whether the type has a known size.
1336 *
1337 * Things that don't have a size are abstract types, labels, and void.a
1338 *
1339 * @see llvm::Type::isSized()
1340 */
1342
1343/**
1344 * Obtain the context to which this type instance is associated.
1345 *
1346 * @see llvm::Type::getContext()
1347 */
1349
1350/**
1351 * Dump a representation of a type to stderr.
1352 *
1353 * @see llvm::Type::dump()
1354 */
1356
1357/**
1358 * Return a string representation of the type. Use
1359 * LLVMDisposeMessage to free the string.
1360 *
1361 * @see llvm::Type::print()
1362 */
1364
1365/**
1366 * @defgroup LLVMCCoreTypeInt Integer Types
1367 *
1368 * Functions in this section operate on integer types.
1369 *
1370 * @{
1371 */
1372
1373/**
1374 * Obtain an integer type from a context with specified bit width.
1375 */
1383
1384/**
1385 * Obtain an integer type from the global context with a specified bit
1386 * width.
1387 */
1390 "Use of the global context is deprecated, use "
1391 "LLVMInt1TypeInContext instead");
1394 "Use of the global context is deprecated, use "
1395 "LLVMInt8TypeInContext instead");
1398 "Use of the global context is deprecated, use "
1399 "LLVMInt16TypeInContext instead");
1402 "Use of the global context is deprecated, use "
1403 "LLVMInt32TypeInContext instead");
1406 "Use of the global context is deprecated, use "
1407 "LLVMInt64TypeInContext instead");
1410 "Use of the global context is deprecated, use "
1411 "LLVMInt128TypeInContext instead");
1414 "Use of the global context is deprecated, use "
1415 "LLVMIntTypeInContext instead");
1416
1417LLVM_C_ABI unsigned LLVMGetIntTypeWidth(LLVMTypeRef IntegerTy);
1418
1419/**
1420 * @}
1421 */
1422
1423/**
1424 * @defgroup LLVMCCoreTypeFloat Floating Point Types
1425 *
1426 * @{
1427 */
1428
1429/**
1430 * Obtain a 16-bit floating point type from a context.
1431 */
1433
1434/**
1435 * Obtain a 16-bit brain floating point type from a context.
1436 */
1438
1439/**
1440 * Obtain a 32-bit floating point type from a context.
1441 */
1443
1444/**
1445 * Obtain a 64-bit floating point type from a context.
1446 */
1448
1449/**
1450 * Obtain a 80-bit floating point type (X87) from a context.
1451 */
1453
1454/**
1455 * Obtain a 128-bit floating point type (112-bit mantissa) from a
1456 * context.
1457 */
1459
1460/**
1461 * Obtain a 128-bit floating point type (two 64-bits) from a context.
1462 */
1464
1465/**
1466 * Obtain a floating point type from the global context.
1467 *
1468 * These map to the functions in this group of the same name.
1469 */
1472 "Use of the global context is deprecated, use "
1473 "LLVMHalfTypeInContext instead");
1476 "Use of the global context is deprecated, use "
1477 "LLVMBFloatTypeInContext instead");
1480 "Use of the global context is deprecated, use "
1481 "LLVMFloatTypeInContext instead");
1484 "Use of the global context is deprecated, use "
1485 "LLVMDoubleTypeInContext instead");
1488 "Use of the global context is deprecated, use "
1489 "LLVMX86FP80TypeInContext instead");
1492 "Use of the global context is deprecated, use "
1493 "LLVMFP128TypeInContext instead");
1496 "Use of the global context is deprecated, use "
1497 "LLVMPPCFP128TypeInContext instead");
1498
1499/**
1500 * @}
1501 */
1502
1503/**
1504 * @defgroup LLVMCCoreTypeFunction Function Types
1505 *
1506 * @{
1507 */
1508
1509/**
1510 * Obtain a function type consisting of a specified signature.
1511 *
1512 * The function is defined as a tuple of a return Type, a list of
1513 * parameter types, and whether the function is variadic.
1514 */
1516 LLVMTypeRef *ParamTypes,
1517 unsigned ParamCount, LLVMBool IsVarArg);
1518
1519/**
1520 * Returns whether a function type is variadic.
1521 */
1523
1524/**
1525 * Obtain the Type this function Type returns.
1526 */
1528
1529/**
1530 * Obtain the number of parameters this function accepts.
1531 */
1532LLVM_C_ABI unsigned LLVMCountParamTypes(LLVMTypeRef FunctionTy);
1533
1534/**
1535 * Obtain the types of a function's parameters.
1536 *
1537 * The Dest parameter should point to a pre-allocated array of
1538 * LLVMTypeRef at least LLVMCountParamTypes() large. On return, the
1539 * first LLVMCountParamTypes() entries in the array will be populated
1540 * with LLVMTypeRef instances.
1541 *
1542 * @param FunctionTy The function type to operate on.
1543 * @param Dest Memory address of an array to be filled with result.
1544 */
1545LLVM_C_ABI void LLVMGetParamTypes(LLVMTypeRef FunctionTy, LLVMTypeRef *Dest);
1546
1547/**
1548 * @}
1549 */
1550
1551/**
1552 * @defgroup LLVMCCoreTypeStruct Structure Types
1553 *
1554 * These functions relate to LLVMTypeRef instances.
1555 *
1556 * @see llvm::StructType
1557 *
1558 * @{
1559 */
1560
1561/**
1562 * Create a new structure type in a context.
1563 *
1564 * A structure is specified by a list of inner elements/types and
1565 * whether these can be packed together.
1566 *
1567 * @see llvm::StructType::create()
1568 */
1570 LLVMTypeRef *ElementTypes,
1571 unsigned ElementCount,
1572 LLVMBool Packed);
1573
1574/**
1575 * Create a new structure type in the global context.
1576 *
1577 * @see llvm::StructType::create()
1578 */
1580 LLVMTypeRef LLVMStructType(LLVMTypeRef *ElementTypes, unsigned ElementCount,
1581 LLVMBool Packed),
1582 "Use of the global context is deprecated, use LLVMStructTypeInContext "
1583 "instead");
1584
1585/**
1586 * Create an empty structure in a context having a specified name.
1587 *
1588 * @see llvm::StructType::create()
1589 */
1591 const char *Name);
1592
1593/**
1594 * Obtain the name of a structure.
1595 *
1596 * @see llvm::StructType::getName()
1597 */
1599
1600/**
1601 * Set the contents of a structure type.
1602 *
1603 * @see llvm::StructType::setBody()
1604 */
1606 LLVMTypeRef *ElementTypes,
1607 unsigned ElementCount, LLVMBool Packed);
1608
1609/**
1610 * Get the number of elements defined inside the structure.
1611 *
1612 * @see llvm::StructType::getNumElements()
1613 */
1615
1616/**
1617 * Get the elements within a structure.
1618 *
1619 * The function is passed the address of a pre-allocated array of
1620 * LLVMTypeRef at least LLVMCountStructElementTypes() long. After
1621 * invocation, this array will be populated with the structure's
1622 * elements. The objects in the destination array will have a lifetime
1623 * of the structure type itself, which is the lifetime of the context it
1624 * is contained in.
1625 */
1627 LLVMTypeRef *Dest);
1628
1629/**
1630 * Get the type of the element at a given index in the structure.
1631 *
1632 * @see llvm::StructType::getTypeAtIndex()
1633 */
1635 unsigned i);
1636
1637/**
1638 * Determine whether a structure is packed.
1639 *
1640 * @see llvm::StructType::isPacked()
1641 */
1643
1644/**
1645 * Determine whether a structure is opaque.
1646 *
1647 * @see llvm::StructType::isOpaque()
1648 */
1650
1651/**
1652 * Determine whether a structure is literal.
1653 *
1654 * @see llvm::StructType::isLiteral()
1655 */
1657
1658/**
1659 * @}
1660 */
1661
1662/**
1663 * @defgroup LLVMCCoreTypeSequential Sequential Types
1664 *
1665 * Sequential types represents "arrays" of types. This is a super class
1666 * for array, vector, and pointer types.
1667 *
1668 * @{
1669 */
1670
1671/**
1672 * Obtain the element type of an array or vector type.
1673 *
1674 * @see llvm::SequentialType::getElementType()
1675 */
1677
1678/**
1679 * Returns type's subtypes
1680 *
1681 * @see llvm::Type::subtypes()
1682 */
1684
1685/**
1686 * Return the number of types in the derived type.
1687 *
1688 * @see llvm::Type::getNumContainedTypes()
1689 */
1691
1692/**
1693 * Create a fixed size array type that refers to a specific type.
1694 *
1695 * The created type will exist in the context that its element type
1696 * exists in.
1697 *
1698 * @deprecated LLVMArrayType is deprecated in favor of the API accurate
1699 * LLVMArrayType2
1700 * @see llvm::ArrayType::get()
1701 */
1703 unsigned ElementCount);
1704
1705/**
1706 * Create a fixed size array type that refers to a specific type.
1707 *
1708 * The created type will exist in the context that its element type
1709 * exists in.
1710 *
1711 * @see llvm::ArrayType::get()
1712 */
1714 uint64_t ElementCount);
1715
1716/**
1717 * Obtain the length of an array type.
1718 *
1719 * This only works on types that represent arrays.
1720 *
1721 * @deprecated LLVMGetArrayLength is deprecated in favor of the API accurate
1722 * LLVMGetArrayLength2
1723 * @see llvm::ArrayType::getNumElements()
1724 */
1725LLVM_C_ABI unsigned LLVMGetArrayLength(LLVMTypeRef ArrayTy);
1726
1727/**
1728 * Obtain the length of an array type.
1729 *
1730 * This only works on types that represent arrays.
1731 *
1732 * @see llvm::ArrayType::getNumElements()
1733 */
1735
1736/**
1737 * Create a pointer type that points to a defined type.
1738 *
1739 * The created type will exist in the context that its pointee type
1740 * exists in.
1741 *
1742 * @see llvm::PointerType::get()
1743 */
1745 unsigned AddressSpace);
1746
1747/**
1748 * Determine whether a pointer is opaque.
1749 *
1750 * True if this is an instance of an opaque PointerType.
1751 *
1752 * @see llvm::Type::isOpaquePointerTy()
1753 */
1755
1756/**
1757 * Create an opaque pointer type in a context.
1758 *
1759 * @see llvm::PointerType::get()
1760 */
1762 unsigned AddressSpace);
1763
1764/**
1765 * Obtain the address space of a pointer type.
1766 *
1767 * This only works on types that represent pointers.
1768 *
1769 * @see llvm::PointerType::getAddressSpace()
1770 */
1772
1773/**
1774 * Create a vector type that contains a defined type and has a specific
1775 * number of elements.
1776 *
1777 * The created type will exist in the context thats its element type
1778 * exists in.
1779 *
1780 * @see llvm::VectorType::get()
1781 */
1783 unsigned ElementCount);
1784
1785/**
1786 * Create a vector type that contains a defined type and has a scalable
1787 * number of elements.
1788 *
1789 * The created type will exist in the context thats its element type
1790 * exists in.
1791 *
1792 * @see llvm::ScalableVectorType::get()
1793 */
1795 unsigned ElementCount);
1796
1797/**
1798 * Obtain the (possibly scalable) number of elements in a vector type.
1799 *
1800 * This only works on types that represent vectors (fixed or scalable).
1801 *
1802 * @see llvm::VectorType::getNumElements()
1803 */
1804LLVM_C_ABI unsigned LLVMGetVectorSize(LLVMTypeRef VectorTy);
1805
1806/**
1807 * Get the pointer value for the associated ConstantPtrAuth constant.
1808 *
1809 * @see llvm::ConstantPtrAuth::getPointer
1810 */
1812
1813/**
1814 * Get the key value for the associated ConstantPtrAuth constant.
1815 *
1816 * @see llvm::ConstantPtrAuth::getKey
1817 */
1819
1820/**
1821 * Get the discriminator value for the associated ConstantPtrAuth constant.
1822 *
1823 * @see llvm::ConstantPtrAuth::getDiscriminator
1824 */
1827
1828/**
1829 * Get the address discriminator value for the associated ConstantPtrAuth
1830 * constant.
1831 *
1832 * @see llvm::ConstantPtrAuth::getAddrDiscriminator
1833 */
1836
1837/**
1838 * @}
1839 */
1840
1841/**
1842 * @defgroup LLVMCCoreTypeOther Other Types
1843 *
1844 * @{
1845 */
1846
1847/**
1848 * Create a void type in a context.
1849 */
1851
1852/**
1853 * Create a label type in a context.
1854 */
1856
1857/**
1858 * Create a X86 AMX type in a context.
1859 */
1861
1862/**
1863 * Create a token type in a context.
1864 */
1866
1867/**
1868 * Create a metadata type in a context.
1869 */
1871
1872/**
1873 * These are similar to the above functions except they operate on the
1874 * global context.
1875 */
1878 "Use of the global context is deprecated, use "
1879 "LLVMVoidTypeInContext instead");
1882 "Use of the global context is deprecated, use "
1883 "LLVMLabelTypeInContext instead");
1886 "Use of the global context is deprecated, use "
1887 "LLVMX86AMXTypeInContext instead");
1888
1889/**
1890 * Create a target extension type in LLVM context.
1891 */
1893 LLVMContextRef C, const char *Name, LLVMTypeRef *TypeParams,
1894 unsigned TypeParamCount, unsigned *IntParams, unsigned IntParamCount);
1895
1896/**
1897 * Obtain the name for this target extension type.
1898 *
1899 * @see llvm::TargetExtType::getName()
1900 */
1901LLVM_C_ABI const char *LLVMGetTargetExtTypeName(LLVMTypeRef TargetExtTy);
1902
1903/**
1904 * Obtain the number of type parameters for this target extension type.
1905 *
1906 * @see llvm::TargetExtType::getNumTypeParameters()
1907 */
1909
1910/**
1911 * Get the type parameter at the given index for the target extension type.
1912 *
1913 * @see llvm::TargetExtType::getTypeParameter()
1914 */
1916 unsigned Idx);
1917
1918/**
1919 * Obtain the number of int parameters for this target extension type.
1920 *
1921 * @see llvm::TargetExtType::getNumIntParameters()
1922 */
1924
1925/**
1926 * Get the int parameter at the given index for the target extension type.
1927 *
1928 * @see llvm::TargetExtType::getIntParameter()
1929 */
1931 unsigned Idx);
1932
1933/**
1934 * @}
1935 */
1936
1937/**
1938 * @}
1939 */
1940
1941/**
1942 * @defgroup LLVMCCoreValues Values
1943 *
1944 * The bulk of LLVM's object model consists of values, which comprise a very
1945 * rich type hierarchy.
1946 *
1947 * LLVMValueRef essentially represents llvm::Value. There is a rich
1948 * hierarchy of classes within this type. Depending on the instance
1949 * obtained, not all APIs are available.
1950 *
1951 * Callers can determine the type of an LLVMValueRef by calling the
1952 * LLVMIsA* family of functions (e.g. LLVMIsAArgument()). These
1953 * functions are defined by a macro, so it isn't obvious which are
1954 * available by looking at the Doxygen source code. Instead, look at the
1955 * source definition of LLVM_FOR_EACH_VALUE_SUBCLASS and note the list
1956 * of value names given. These value names also correspond to classes in
1957 * the llvm::Value hierarchy.
1958 *
1959 * @{
1960 */
1961
1962// Currently, clang-format tries to format the LLVM_FOR_EACH_VALUE_SUBCLASS
1963// macro in a progressively-indented fashion, which is not desired
1964// clang-format off
1965
1966#define LLVM_FOR_EACH_VALUE_SUBCLASS(macro) \
1967 macro(Argument) \
1968 macro(BasicBlock) \
1969 macro(InlineAsm) \
1970 macro(User) \
1971 macro(Constant) \
1972 macro(BlockAddress) \
1973 macro(ConstantAggregateZero) \
1974 macro(ConstantArray) \
1975 macro(ConstantDataSequential) \
1976 macro(ConstantDataArray) \
1977 macro(ConstantDataVector) \
1978 macro(ConstantExpr) \
1979 macro(ConstantFP) \
1980 macro(ConstantInt) \
1981 macro(ConstantPointerNull) \
1982 macro(ConstantStruct) \
1983 macro(ConstantTokenNone) \
1984 macro(ConstantVector) \
1985 macro(ConstantPtrAuth) \
1986 macro(GlobalValue) \
1987 macro(GlobalAlias) \
1988 macro(GlobalObject) \
1989 macro(Function) \
1990 macro(GlobalVariable) \
1991 macro(GlobalIFunc) \
1992 macro(UndefValue) \
1993 macro(PoisonValue) \
1994 macro(Instruction) \
1995 macro(UnaryOperator) \
1996 macro(BinaryOperator) \
1997 macro(CallInst) \
1998 macro(IntrinsicInst) \
1999 macro(DbgInfoIntrinsic) \
2000 macro(DbgVariableIntrinsic) \
2001 macro(DbgDeclareInst) \
2002 macro(DbgLabelInst) \
2003 macro(MemIntrinsic) \
2004 macro(MemCpyInst) \
2005 macro(MemMoveInst) \
2006 macro(MemSetInst) \
2007 macro(CmpInst) \
2008 macro(FCmpInst) \
2009 macro(ICmpInst) \
2010 macro(ExtractElementInst) \
2011 macro(GetElementPtrInst) \
2012 macro(InsertElementInst) \
2013 macro(InsertValueInst) \
2014 macro(LandingPadInst) \
2015 macro(PHINode) \
2016 macro(SelectInst) \
2017 macro(ShuffleVectorInst) \
2018 macro(StoreInst) \
2019 macro(BranchInst) \
2020 macro(IndirectBrInst) \
2021 macro(InvokeInst) \
2022 macro(ReturnInst) \
2023 macro(SwitchInst) \
2024 macro(UnreachableInst) \
2025 macro(ResumeInst) \
2026 macro(CleanupReturnInst) \
2027 macro(CatchReturnInst) \
2028 macro(CatchSwitchInst) \
2029 macro(CallBrInst) \
2030 macro(FuncletPadInst) \
2031 macro(CatchPadInst) \
2032 macro(CleanupPadInst) \
2033 macro(UnaryInstruction) \
2034 macro(AllocaInst) \
2035 macro(CastInst) \
2036 macro(AddrSpaceCastInst) \
2037 macro(BitCastInst) \
2038 macro(FPExtInst) \
2039 macro(FPToSIInst) \
2040 macro(FPToUIInst) \
2041 macro(FPTruncInst) \
2042 macro(IntToPtrInst) \
2043 macro(PtrToIntInst) \
2044 macro(SExtInst) \
2045 macro(SIToFPInst) \
2046 macro(TruncInst) \
2047 macro(UIToFPInst) \
2048 macro(ZExtInst) \
2049 macro(ExtractValueInst) \
2050 macro(LoadInst) \
2051 macro(VAArgInst) \
2052 macro(FreezeInst) \
2053 macro(AtomicCmpXchgInst) \
2054 macro(AtomicRMWInst) \
2055 macro(FenceInst)
2056
2057// clang-format on
2058
2059/**
2060 * @defgroup LLVMCCoreValueGeneral General APIs
2061 *
2062 * Functions in this section work on all LLVMValueRef instances,
2063 * regardless of their sub-type. They correspond to functions available
2064 * on llvm::Value.
2065 *
2066 * @{
2067 */
2068
2069/**
2070 * Obtain the type of a value.
2071 *
2072 * @see llvm::Value::getType()
2073 */
2075
2076/**
2077 * Obtain the enumerated type of a Value instance.
2078 *
2079 * @see llvm::Value::getValueID()
2080 */
2082
2083/**
2084 * Obtain the string name of a value.
2085 *
2086 * @see llvm::Value::getName()
2087 */
2088LLVM_C_ABI const char *LLVMGetValueName2(LLVMValueRef Val, size_t *Length);
2089
2090/**
2091 * Set the string name of a value.
2092 *
2093 * @see llvm::Value::setName()
2094 */
2095LLVM_C_ABI void LLVMSetValueName2(LLVMValueRef Val, const char *Name,
2096 size_t NameLen);
2097
2098/**
2099 * Dump a representation of a value to stderr.
2100 *
2101 * @see llvm::Value::dump()
2102 */
2104
2105/**
2106 * Return a string representation of the value. Use
2107 * LLVMDisposeMessage to free the string.
2108 *
2109 * @see llvm::Value::print()
2110 */
2112
2113/**
2114 * Obtain the context to which this value is associated.
2115 *
2116 * @see llvm::Value::getContext()
2117 */
2119
2120/**
2121 * Return a string representation of the DbgRecord. Use
2122 * LLVMDisposeMessage to free the string.
2123 *
2124 * @see llvm::DbgRecord::print()
2125 */
2127
2128/**
2129 * Replace all uses of a value with another one.
2130 *
2131 * @see llvm::Value::replaceAllUsesWith()
2132 */
2134 LLVMValueRef NewVal);
2135
2136/**
2137 * Determine whether the specified value instance is constant.
2138 */
2140
2141/**
2142 * Determine whether a value instance is undefined.
2143 */
2145
2146/**
2147 * Determine whether a value instance is poisonous.
2148 */
2150
2151/**
2152 * Convert value instances between types.
2153 *
2154 * Internally, an LLVMValueRef is "pinned" to a specific type. This
2155 * series of functions allows you to cast an instance to a specific
2156 * type.
2157 *
2158 * If the cast is not valid for the specified type, NULL is returned.
2159 *
2160 * @see llvm::dyn_cast_or_null<>
2161 */
2162#define LLVM_DECLARE_VALUE_CAST(name) \
2163 LLVM_C_ABI LLVMValueRef LLVMIsA##name(LLVMValueRef Val);
2165
2169
2170/** Deprecated: Use LLVMGetValueName2 instead. */
2172/** Deprecated: Use LLVMSetValueName2 instead. */
2173LLVM_C_ABI void LLVMSetValueName(LLVMValueRef Val, const char *Name);
2174
2175/**
2176 * @}
2177 */
2178
2179/**
2180 * @defgroup LLVMCCoreValueUses Usage
2181 *
2182 * This module defines functions that allow you to inspect the uses of a
2183 * LLVMValueRef.
2184 *
2185 * It is possible to obtain an LLVMUseRef for any LLVMValueRef instance.
2186 * Each LLVMUseRef (which corresponds to a llvm::Use instance) holds a
2187 * llvm::User and llvm::Value.
2188 *
2189 * @{
2190 */
2191
2192/**
2193 * Obtain the first use of a value.
2194 *
2195 * Uses are obtained in an iterator fashion. First, call this function
2196 * to obtain a reference to the first use. Then, call LLVMGetNextUse()
2197 * on that instance and all subsequently obtained instances until
2198 * LLVMGetNextUse() returns NULL.
2199 *
2200 * @see llvm::Value::use_begin()
2201 */
2203
2204/**
2205 * Obtain the next use of a value.
2206 *
2207 * This effectively advances the iterator. It returns NULL if you are on
2208 * the final use and no more are available.
2209 */
2211
2212/**
2213 * Obtain the user value for a user.
2214 *
2215 * The returned value corresponds to a llvm::User type.
2216 *
2217 * @see llvm::Use::getUser()
2218 */
2220
2221/**
2222 * Obtain the value this use corresponds to.
2223 *
2224 * @see llvm::Use::get().
2225 */
2227
2228/**
2229 * @}
2230 */
2231
2232/**
2233 * @defgroup LLVMCCoreValueUser User value
2234 *
2235 * Function in this group pertain to LLVMValueRef instances that descent
2236 * from llvm::User. This includes constants, instructions, and
2237 * operators.
2238 *
2239 * @{
2240 */
2241
2242/**
2243 * Obtain an operand at a specific index in a llvm::User value.
2244 *
2245 * @see llvm::User::getOperand()
2246 */
2248
2249/**
2250 * Obtain the use of an operand at a specific index in a llvm::User value.
2251 *
2252 * @see llvm::User::getOperandUse()
2253 */
2255
2256/**
2257 * Set an operand at a specific index in a llvm::User value.
2258 *
2259 * @see llvm::User::setOperand()
2260 */
2261LLVM_C_ABI void LLVMSetOperand(LLVMValueRef User, unsigned Index,
2262 LLVMValueRef Val);
2263
2264/**
2265 * Obtain the number of operands in a llvm::User value.
2266 *
2267 * @see llvm::User::getNumOperands()
2268 */
2270
2271/**
2272 * @}
2273 */
2274
2275/**
2276 * @defgroup LLVMCCoreValueConstant Constants
2277 *
2278 * This section contains APIs for interacting with LLVMValueRef that
2279 * correspond to llvm::Constant instances.
2280 *
2281 * These functions will work for any LLVMValueRef in the llvm::Constant
2282 * class hierarchy.
2283 *
2284 * @{
2285 */
2286
2287/**
2288 * Obtain a constant value referring to the null instance of a type.
2289 *
2290 * @see llvm::Constant::getNullValue()
2291 */
2293
2294/**
2295 * Obtain a constant value referring to the instance of a type
2296 * consisting of all ones.
2297 *
2298 * This is only valid for integer types.
2299 *
2300 * @see llvm::Constant::getAllOnesValue()
2301 */
2303
2304/**
2305 * Obtain a constant value referring to an undefined value of a type.
2306 *
2307 * @see llvm::UndefValue::get()
2308 */
2310
2311/**
2312 * Obtain a constant value referring to a poison value of a type.
2313 *
2314 * @see llvm::PoisonValue::get()
2315 */
2317
2318/**
2319 * Determine whether a value instance is null.
2320 *
2321 * @see llvm::Constant::isNullValue()
2322 */
2324
2325/**
2326 * Obtain a constant that is a constant pointer pointing to NULL for a
2327 * specified type.
2328 */
2330
2331/**
2332 * @defgroup LLVMCCoreValueConstantScalar Scalar constants
2333 *
2334 * Functions in this group model LLVMValueRef instances that correspond
2335 * to constants referring to scalar types.
2336 *
2337 * For integer types, the LLVMTypeRef parameter should correspond to a
2338 * llvm::IntegerType instance and the returned LLVMValueRef will
2339 * correspond to a llvm::ConstantInt.
2340 *
2341 * For floating point types, the LLVMTypeRef returned corresponds to a
2342 * llvm::ConstantFP.
2343 *
2344 * @{
2345 */
2346
2347/**
2348 * Obtain a constant value for an integer type.
2349 *
2350 * The returned value corresponds to a llvm::ConstantInt.
2351 *
2352 * @see llvm::ConstantInt::get()
2353 *
2354 * @param IntTy Integer type to obtain value of.
2355 * @param N The value the returned instance should refer to.
2356 * @param SignExtend Whether to sign extend the produced value.
2357 */
2358LLVM_C_ABI LLVMValueRef LLVMConstInt(LLVMTypeRef IntTy, unsigned long long N,
2359 LLVMBool SignExtend);
2360
2361/**
2362 * Obtain a constant value for an integer of arbitrary precision.
2363 *
2364 * @see llvm::ConstantInt::get()
2365 */
2367 LLVMTypeRef IntTy, unsigned NumWords, const uint64_t Words[]);
2368
2369/**
2370 * Obtain a constant value for an integer parsed from a string.
2371 *
2372 * A similar API, LLVMConstIntOfStringAndSize is also available. If the
2373 * string's length is available, it is preferred to call that function
2374 * instead.
2375 *
2376 * @see llvm::ConstantInt::get()
2377 */
2379 const char *Text, uint8_t Radix);
2380
2381/**
2382 * Obtain a constant value for an integer parsed from a string with
2383 * specified length.
2384 *
2385 * @see llvm::ConstantInt::get()
2386 */
2388 const char *Text,
2389 unsigned SLen,
2390 uint8_t Radix);
2391
2392/**
2393 * Obtain a constant value referring to a double floating point value.
2394 */
2396
2397/**
2398 * Obtain a constant for a floating point value parsed from a string.
2399 *
2400 * A similar API, LLVMConstRealOfStringAndSize is also available. It
2401 * should be used if the input string's length is known.
2402 */
2404 const char *Text);
2405
2406/**
2407 * Obtain a constant for a floating point value parsed from a string.
2408 */
2410 const char *Text,
2411 unsigned SLen);
2412
2413/**
2414 * Obtain a constant for a floating point value from array of 64 bit values.
2415 * The length of the array N must be ceildiv(bits, 64), where bits is the
2416 * scalar size in bits of the floating-point type.
2417 */
2418
2420
2421/**
2422 * Obtain the zero extended value for an integer constant value.
2423 *
2424 * @see llvm::ConstantInt::getZExtValue()
2425 */
2426LLVM_C_ABI unsigned long long
2428
2429/**
2430 * Obtain the sign extended value for an integer constant value.
2431 *
2432 * @see llvm::ConstantInt::getSExtValue()
2433 */
2434LLVM_C_ABI long long LLVMConstIntGetSExtValue(LLVMValueRef ConstantVal);
2435
2436/**
2437 * Obtain the double value for an floating point constant value.
2438 * losesInfo indicates if some precision was lost in the conversion.
2439 *
2440 * @see llvm::ConstantFP::getDoubleValue
2441 */
2443 LLVMBool *losesInfo);
2444
2445/**
2446 * @}
2447 */
2448
2449/**
2450 * @defgroup LLVMCCoreValueConstantComposite Composite Constants
2451 *
2452 * Functions in this group operate on composite constants.
2453 *
2454 * @{
2455 */
2456
2457/**
2458 * Create a ConstantDataSequential and initialize it with a string.
2459 *
2460 * @deprecated LLVMConstStringInContext is deprecated in favor of the API
2461 * accurate LLVMConstStringInContext2
2462 * @see llvm::ConstantDataArray::getString()
2463 */
2465 const char *Str,
2466 unsigned Length,
2467 LLVMBool DontNullTerminate);
2468
2469/**
2470 * Create a ConstantDataSequential and initialize it with a string.
2471 *
2472 * @see llvm::ConstantDataArray::getString()
2473 */
2475 const char *Str,
2476 size_t Length,
2477 LLVMBool DontNullTerminate);
2478
2479/**
2480 * Create a ConstantDataSequential with string content in the global context.
2481 *
2482 * This is the same as LLVMConstStringInContext except it operates on the
2483 * global context.
2484 *
2485 * @see LLVMConstStringInContext()
2486 * @see llvm::ConstantDataArray::getString()
2487 */
2489 LLVMValueRef LLVMConstString(const char *Str, unsigned Length,
2490 LLVMBool DontNullTerminate),
2491 "Use of the global context is deprecated, use LLVMConstStringInContext2 "
2492 "instead");
2493
2494/**
2495 * Returns true if the specified constant is an array of i8.
2496 *
2497 * @see ConstantDataSequential::getAsString()
2498 */
2500
2501/**
2502 * Get the given constant data sequential as a string.
2503 *
2504 * @see ConstantDataSequential::getAsString()
2505 */
2506LLVM_C_ABI const char *LLVMGetAsString(LLVMValueRef c, size_t *Length);
2507
2508/**
2509 * Get the raw, underlying bytes of the given constant data sequential.
2510 *
2511 * This is the same as LLVMGetAsString except it works for all constant data
2512 * sequentials, not just i8 arrays.
2513 *
2514 * @see ConstantDataSequential::getRawDataValues()
2515 */
2517 size_t *SizeInBytes);
2518
2519/**
2520 * Create an anonymous ConstantStruct with the specified values.
2521 *
2522 * @see llvm::ConstantStruct::getAnon()
2523 */
2525 LLVMValueRef *ConstantVals,
2526 unsigned Count,
2527 LLVMBool Packed);
2528
2529/**
2530 * Create a ConstantStruct in the global Context.
2531 *
2532 * This is the same as LLVMConstStructInContext except it operates on the
2533 * global Context.
2534 *
2535 * @see LLVMConstStructInContext()
2536 */
2538 LLVMValueRef LLVMConstStruct(LLVMValueRef *ConstantVals, unsigned Count,
2539 LLVMBool Packed),
2540 "Use of the global context is deprecated, use LLVMConstStructInContext "
2541 "instead");
2542
2543/**
2544 * Create a ConstantArray from values.
2545 *
2546 * @deprecated LLVMConstArray is deprecated in favor of the API accurate
2547 * LLVMConstArray2
2548 * @see llvm::ConstantArray::get()
2549 */
2551 LLVMValueRef *ConstantVals,
2552 unsigned Length);
2553
2554/**
2555 * Create a ConstantArray from values.
2556 *
2557 * @see llvm::ConstantArray::get()
2558 */
2560 LLVMValueRef *ConstantVals,
2561 uint64_t Length);
2562
2563/**
2564 * Create a ConstantDataArray from raw values.
2565 *
2566 * ElementTy must be one of i8, i16, i32, i64, half, bfloat, float, or double.
2567 * Data points to a contiguous buffer of raw values in the host endianness. The
2568 * element count is inferred from the element type and the data size in bytes.
2569 *
2570 * @see llvm::ConstantDataArray::getRaw()
2571 */
2573 const char *Data,
2574 size_t SizeInBytes);
2575
2576/**
2577 * Create a non-anonymous ConstantStruct from values.
2578 *
2579 * @see llvm::ConstantStruct::get()
2580 */
2582 LLVMValueRef *ConstantVals,
2583 unsigned Count);
2584
2585/**
2586 * Get element of a constant aggregate (struct, array or vector) at the
2587 * specified index. Returns null if the index is out of range, or it's not
2588 * possible to determine the element (e.g., because the constant is a
2589 * constant expression.)
2590 *
2591 * @see llvm::Constant::getAggregateElement()
2592 */
2594
2595/**
2596 * Get an element at specified index as a constant.
2597 *
2598 * @see ConstantDataSequential::getElementAsConstant()
2599 */
2602 "Use LLVMGetAggregateElement instead");
2603
2604/**
2605 * Create a ConstantVector from values.
2606 *
2607 * @see llvm::ConstantVector::get()
2608 */
2610 unsigned Size);
2611
2612/**
2613 * Create a ConstantPtrAuth constant with the given values.
2614 *
2615 * @see llvm::ConstantPtrAuth::get()
2616 */
2618 LLVMValueRef Disc,
2619 LLVMValueRef AddrDisc);
2620
2621/**
2622 * @}
2623 */
2624
2625/**
2626 * @defgroup LLVMCCoreValueConstantExpressions Constant Expressions
2627 *
2628 * Functions in this group correspond to APIs on llvm::ConstantExpr.
2629 *
2630 * @see llvm::ConstantExpr.
2631 *
2632 * @{
2633 */
2641 "Use LLVMConstNull instead.");
2644 LLVMValueRef RHSConstant);
2646 LLVMValueRef RHSConstant);
2648 LLVMValueRef RHSConstant);
2650 LLVMValueRef RHSConstant);
2652 LLVMValueRef RHSConstant);
2654 LLVMValueRef RHSConstant);
2656 LLVMValueRef RHSConstant);
2658 LLVMValueRef *ConstantIndices,
2659 unsigned NumIndices);
2661 LLVMValueRef ConstantVal,
2662 LLVMValueRef *ConstantIndices,
2663 unsigned NumIndices);
2664/**
2665 * Creates a constant GetElementPtr expression. Similar to LLVMConstGEP2, but
2666 * allows specifying the no-wrap flags.
2667 *
2668 * @see llvm::ConstantExpr::getGetElementPtr()
2669 */
2671 LLVMTypeRef Ty, LLVMValueRef ConstantVal, LLVMValueRef *ConstantIndices,
2672 unsigned NumIndices, LLVMGEPNoWrapFlags NoWrapFlags);
2674 LLVMTypeRef ToType);
2676 LLVMTypeRef ToType);
2678 LLVMTypeRef ToType);
2680 LLVMTypeRef ToType);
2682 LLVMTypeRef ToType);
2684 LLVMTypeRef ToType);
2686 LLVMTypeRef ToType);
2688 LLVMValueRef IndexConstant);
2690 LLVMValueRef VectorConstant, LLVMValueRef ElementValueConstant,
2691 LLVMValueRef IndexConstant);
2693 LLVMValueRef VectorBConstant,
2694 LLVMValueRef MaskConstant);
2696
2697/**
2698 * Gets the function associated with a given BlockAddress constant value.
2699 */
2701
2702/**
2703 * Gets the basic block associated with a given BlockAddress constant value.
2704 */
2707
2708/** Deprecated: Use LLVMGetInlineAsm instead. */
2710 const char *AsmString,
2711 const char *Constraints,
2712 LLVMBool HasSideEffects,
2713 LLVMBool IsAlignStack);
2714
2715/**
2716 * @}
2717 */
2718
2719/**
2720 * @defgroup LLVMCCoreValueConstantGlobals Global Values
2721 *
2722 * This group contains functions that operate on global values. Functions in
2723 * this group relate to functions in the llvm::GlobalValue class tree.
2724 *
2725 * @see llvm::GlobalValue
2726 *
2727 * @{
2728 */
2729
2734LLVM_C_ABI const char *LLVMGetSection(LLVMValueRef Global);
2735LLVM_C_ABI void LLVMSetSection(LLVMValueRef Global, const char *Section);
2740 LLVMDLLStorageClass Class);
2743 LLVMUnnamedAddr UnnamedAddr);
2744
2745/**
2746 * Returns the "value type" of a global value. This differs from the formal
2747 * type of a global value which is always a pointer type.
2748 *
2749 * @see llvm::GlobalValue::getValueType()
2750 * @see llvm::Function::getFunctionType()
2751 */
2753
2754/** Deprecated: Use LLVMGetUnnamedAddress instead. */
2756/** Deprecated: Use LLVMSetUnnamedAddress instead. */
2758 LLVMBool HasUnnamedAddr);
2759
2760/**
2761 * @defgroup LLVMCCoreValueWithAlignment Values with alignment
2762 *
2763 * Functions in this group only apply to values with alignment, i.e.
2764 * global variables, load and store instructions.
2765 */
2766
2767/**
2768 * Obtain the preferred alignment of the value.
2769 * @see llvm::AllocaInst::getAlignment()
2770 * @see llvm::LoadInst::getAlignment()
2771 * @see llvm::StoreInst::getAlignment()
2772 * @see llvm::AtomicRMWInst::setAlignment()
2773 * @see llvm::AtomicCmpXchgInst::setAlignment()
2774 * @see llvm::GlobalValue::getAlignment()
2775 */
2777
2778/**
2779 * Set the preferred alignment of the value.
2780 * @see llvm::AllocaInst::setAlignment()
2781 * @see llvm::LoadInst::setAlignment()
2782 * @see llvm::StoreInst::setAlignment()
2783 * @see llvm::AtomicRMWInst::setAlignment()
2784 * @see llvm::AtomicCmpXchgInst::setAlignment()
2785 * @see llvm::GlobalValue::setAlignment()
2786 */
2787LLVM_C_ABI void LLVMSetAlignment(LLVMValueRef V, unsigned Bytes);
2788
2789/**
2790 * Sets a metadata attachment, erasing the existing metadata attachment if
2791 * it already exists for the given kind.
2792 *
2793 * @see llvm::GlobalObject::setMetadata()
2794 */
2795LLVM_C_ABI void LLVMGlobalSetMetadata(LLVMValueRef Global, unsigned Kind,
2796 LLVMMetadataRef MD);
2797
2798/**
2799 * Adds a metadata attachment.
2800 *
2801 * @see llvm::GlobalObject::addMetadata()
2802 */
2803LLVM_C_ABI void LLVMGlobalAddMetadata(LLVMValueRef Global, unsigned Kind,
2804 LLVMMetadataRef MD);
2805
2806/**
2807 * Erases a metadata attachment of the given kind if it exists.
2808 *
2809 * @see llvm::GlobalObject::eraseMetadata()
2810 */
2811LLVM_C_ABI void LLVMGlobalEraseMetadata(LLVMValueRef Global, unsigned Kind);
2812
2813/**
2814 * Removes all metadata attachments from this value.
2815 *
2816 * @see llvm::GlobalObject::clearMetadata()
2817 */
2819
2820/**
2821 * Add debuginfo metadata to this global.
2822 *
2823 * @see llvm::GlobalVariable::addDebugInfo()
2824 */
2826 LLVMMetadataRef GVE);
2827
2828/**
2829 * Retrieves an array of metadata entries representing the metadata attached to
2830 * this value. The caller is responsible for freeing this array by calling
2831 * \c LLVMDisposeValueMetadataEntries.
2832 *
2833 * @see llvm::GlobalObject::getAllMetadata()
2834 */
2836LLVMGlobalCopyAllMetadata(LLVMValueRef Value, size_t *NumEntries);
2837
2838/**
2839 * Destroys value metadata entries.
2840 */
2841LLVM_C_ABI void
2843
2844/**
2845 * Returns the kind of a value metadata entry at a specific index.
2846 */
2847LLVM_C_ABI unsigned
2849 unsigned Index);
2850
2851/**
2852 * Returns the underlying metadata node of a value metadata entry at a
2853 * specific index.
2854 */
2856 LLVMValueMetadataEntry *Entries, unsigned Index);
2857
2858/**
2859 * @}
2860 */
2861
2862/**
2863 * @defgroup LLVMCoreValueConstantGlobalVariable Global Variables
2864 *
2865 * This group contains functions that operate on global variable values.
2866 *
2867 * @see llvm::GlobalVariable
2868 *
2869 * @{
2870 */
2872 const char *Name);
2874 LLVMTypeRef Ty,
2875 const char *Name,
2876 unsigned AddressSpace);
2879 const char *Name,
2880 size_t Length);
2888 LLVMValueRef ConstantVal);
2891 LLVMBool IsThreadLocal);
2894 LLVMBool IsConstant);
2900 LLVMBool IsExtInit);
2901
2902/**
2903 * @}
2904 */
2905
2906/**
2907 * @defgroup LLVMCoreValueConstantGlobalAlias Global Aliases
2908 *
2909 * This group contains function that operate on global alias values.
2910 *
2911 * @see llvm::GlobalAlias
2912 *
2913 * @{
2914 */
2915
2916/**
2917 * Add a GlobalAlias with the given value type, address space and aliasee.
2918 *
2919 * @see llvm::GlobalAlias::create()
2920 */
2922 unsigned AddrSpace, LLVMValueRef Aliasee,
2923 const char *Name);
2924
2925/**
2926 * Obtain a GlobalAlias value from a Module by its name.
2927 *
2928 * The returned value corresponds to a llvm::GlobalAlias value.
2929 *
2930 * @see llvm::Module::getNamedAlias()
2931 */
2933 const char *Name,
2934 size_t NameLen);
2935
2936/**
2937 * Obtain an iterator to the first GlobalAlias in a Module.
2938 *
2939 * @see llvm::Module::alias_begin()
2940 */
2942
2943/**
2944 * Obtain an iterator to the last GlobalAlias in a Module.
2945 *
2946 * @see llvm::Module::alias_end()
2947 */
2949
2950/**
2951 * Advance a GlobalAlias iterator to the next GlobalAlias.
2952 *
2953 * Returns NULL if the iterator was already at the end and there are no more
2954 * global aliases.
2955 */
2957
2958/**
2959 * Decrement a GlobalAlias iterator to the previous GlobalAlias.
2960 *
2961 * Returns NULL if the iterator was already at the beginning and there are
2962 * no previous global aliases.
2963 */
2965
2966/**
2967 * Retrieve the target value of an alias.
2968 */
2970
2971/**
2972 * Set the target value of an alias.
2973 */
2975
2976/**
2977 * @}
2978 */
2979
2980/**
2981 * @defgroup LLVMCCoreValueFunction Function values
2982 *
2983 * Functions in this group operate on LLVMValueRef instances that
2984 * correspond to llvm::Function instances.
2985 *
2986 * @see llvm::Function
2987 *
2988 * @{
2989 */
2990
2991/**
2992 * Remove a function from its containing module and deletes it.
2993 *
2994 * @see llvm::Function::eraseFromParent()
2995 */
2997
2998/**
2999 * Check whether the given function has a personality function.
3000 *
3001 * @see llvm::Function::hasPersonalityFn()
3002 */
3004
3005/**
3006 * Obtain the personality function attached to the function.
3007 *
3008 * @see llvm::Function::getPersonalityFn()
3009 */
3011
3012/**
3013 * Set the personality function attached to the function.
3014 *
3015 * @see llvm::Function::setPersonalityFn()
3016 */
3018 LLVMValueRef PersonalityFn);
3019
3020/**
3021 * Obtain the intrinsic ID number which matches the given function name.
3022 *
3023 * @see llvm::Intrinsic::lookupIntrinsicID()
3024 */
3025LLVM_C_ABI unsigned LLVMLookupIntrinsicID(const char *Name, size_t NameLen);
3026
3027/**
3028 * Obtain the ID number from a function instance.
3029 *
3030 * @see llvm::Function::getIntrinsicID()
3031 */
3033
3034/**
3035 * Get or insert the declaration of an intrinsic. For overloaded intrinsics,
3036 * parameter types must be provided to uniquely identify an overload.
3037 *
3038 * @see llvm::Intrinsic::getOrInsertDeclaration()
3039 */
3041 unsigned ID,
3042 LLVMTypeRef *ParamTypes,
3043 size_t ParamCount);
3044
3045/**
3046 * Retrieves the type of an intrinsic. For overloaded intrinsics, parameter
3047 * types must be provided to uniquely identify an overload.
3048 *
3049 * @see llvm::Intrinsic::getType()
3050 */
3052 LLVMTypeRef *ParamTypes,
3053 size_t ParamCount);
3054
3055/**
3056 * Retrieves the name of an intrinsic.
3057 *
3058 * @see llvm::Intrinsic::getName()
3059 */
3060LLVM_C_ABI const char *LLVMIntrinsicGetName(unsigned ID, size_t *NameLength);
3061
3062/** Deprecated: Use LLVMIntrinsicCopyOverloadedName2 instead. */
3064 LLVMTypeRef *ParamTypes,
3065 size_t ParamCount,
3066 size_t *NameLength);
3067
3068/**
3069 * Copies the name of an overloaded intrinsic identified by a given list of
3070 * parameter types.
3071 *
3072 * Unlike LLVMIntrinsicGetName, the caller is responsible for freeing the
3073 * returned string.
3074 *
3075 * This version also supports unnamed types.
3076 *
3077 * @see llvm::Intrinsic::getName()
3078 */
3080 unsigned ID,
3081 LLVMTypeRef *ParamTypes,
3082 size_t ParamCount,
3083 size_t *NameLength);
3084
3085/**
3086 * Obtain if the intrinsic identified by the given ID is overloaded.
3087 *
3088 * @see llvm::Intrinsic::isOverloaded()
3089 */
3091
3092/**
3093 * Obtain the calling function of a function.
3094 *
3095 * The returned value corresponds to the LLVMCallConv enumeration.
3096 *
3097 * @see llvm::Function::getCallingConv()
3098 */
3100
3101/**
3102 * Set the calling convention of a function.
3103 *
3104 * @see llvm::Function::setCallingConv()
3105 *
3106 * @param Fn Function to operate on
3107 * @param CC LLVMCallConv to set calling convention to
3108 */
3109LLVM_C_ABI void LLVMSetFunctionCallConv(LLVMValueRef Fn, unsigned CC);
3110
3111/**
3112 * Obtain the name of the garbage collector to use during code
3113 * generation.
3114 *
3115 * @see llvm::Function::getGC()
3116 */
3117LLVM_C_ABI const char *LLVMGetGC(LLVMValueRef Fn);
3118
3119/**
3120 * Define the garbage collector to use during code generation.
3121 *
3122 * @see llvm::Function::setGC()
3123 */
3124LLVM_C_ABI void LLVMSetGC(LLVMValueRef Fn, const char *Name);
3125
3126/**
3127 * Gets the prefix data associated with a function. Only valid on functions, and
3128 * only if LLVMHasPrefixData returns true.
3129 * See https://llvm.org/docs/LangRef.html#prefix-data
3130 */
3132
3133/**
3134 * Check if a given function has prefix data. Only valid on functions.
3135 * See https://llvm.org/docs/LangRef.html#prefix-data
3136 */
3138
3139/**
3140 * Sets the prefix data for the function. Only valid on functions.
3141 * See https://llvm.org/docs/LangRef.html#prefix-data
3142 */
3144
3145/**
3146 * Gets the prologue data associated with a function. Only valid on functions,
3147 * and only if LLVMHasPrologueData returns true.
3148 * See https://llvm.org/docs/LangRef.html#prologue-data
3149 */
3151
3152/**
3153 * Check if a given function has prologue data. Only valid on functions.
3154 * See https://llvm.org/docs/LangRef.html#prologue-data
3155 */
3157
3158/**
3159 * Sets the prologue data for the function. Only valid on functions.
3160 * See https://llvm.org/docs/LangRef.html#prologue-data
3161 */
3163
3164/**
3165 * Add an attribute to a function.
3166 *
3167 * @see llvm::Function::addAttribute()
3168 */
3172 LLVMAttributeIndex Idx);
3174 LLVMAttributeRef *Attrs);
3177 unsigned KindID);
3179 LLVMValueRef F, LLVMAttributeIndex Idx, const char *K, unsigned KLen);
3182 unsigned KindID);
3185 const char *K, unsigned KLen);
3186
3187/**
3188 * Add a target-dependent attribute to a function
3189 * @see llvm::AttrBuilder::addAttribute()
3190 */
3192 const char *A,
3193 const char *V);
3194
3195/**
3196 * @defgroup LLVMCCoreValueFunctionParameters Function Parameters
3197 *
3198 * Functions in this group relate to arguments/parameters on functions.
3199 *
3200 * Functions in this group expect LLVMValueRef instances that correspond
3201 * to llvm::Function instances.
3202 *
3203 * @{
3204 */
3205
3206/**
3207 * Obtain the number of parameters in a function.
3208 *
3209 * @see llvm::Function::arg_size()
3210 */
3212
3213/**
3214 * Obtain the parameters in a function.
3215 *
3216 * The takes a pointer to a pre-allocated array of LLVMValueRef that is
3217 * at least LLVMCountParams() long. This array will be filled with
3218 * LLVMValueRef instances which correspond to the parameters the
3219 * function receives. Each LLVMValueRef corresponds to a llvm::Argument
3220 * instance.
3221 *
3222 * @see llvm::Function::arg_begin()
3223 */
3225
3226/**
3227 * Obtain the parameter at the specified index.
3228 *
3229 * Parameters are indexed from 0.
3230 *
3231 * @see llvm::Function::arg_begin()
3232 */
3234
3235/**
3236 * Obtain the function to which this argument belongs.
3237 *
3238 * Unlike other functions in this group, this one takes an LLVMValueRef
3239 * that corresponds to a llvm::Attribute.
3240 *
3241 * The returned LLVMValueRef is the llvm::Function to which this
3242 * argument belongs.
3243 */
3245
3246/**
3247 * Obtain the first parameter to a function.
3248 *
3249 * @see llvm::Function::arg_begin()
3250 */
3252
3253/**
3254 * Obtain the last parameter to a function.
3255 *
3256 * @see llvm::Function::arg_end()
3257 */
3259
3260/**
3261 * Obtain the next parameter to a function.
3262 *
3263 * This takes an LLVMValueRef obtained from LLVMGetFirstParam() (which is
3264 * actually a wrapped iterator) and obtains the next parameter from the
3265 * underlying iterator.
3266 */
3268
3269/**
3270 * Obtain the previous parameter to a function.
3271 *
3272 * This is the opposite of LLVMGetNextParam().
3273 */
3275
3276/**
3277 * Set the alignment for a function parameter.
3278 *
3279 * @see llvm::Argument::addAttr()
3280 * @see llvm::AttrBuilder::addAlignmentAttr()
3281 */
3282LLVM_C_ABI void LLVMSetParamAlignment(LLVMValueRef Arg, unsigned Align);
3283
3284/**
3285 * @}
3286 */
3287
3288/**
3289 * @defgroup LLVMCCoreValueGlobalIFunc IFuncs
3290 *
3291 * Functions in this group relate to indirect functions.
3292 *
3293 * Functions in this group expect LLVMValueRef instances that correspond
3294 * to llvm::GlobalIFunc instances.
3295 *
3296 * @{
3297 */
3298
3299/**
3300 * Add a global indirect function to a module under a specified name.
3301 *
3302 * @see llvm::GlobalIFunc::create()
3303 */
3305 size_t NameLen, LLVMTypeRef Ty,
3306 unsigned AddrSpace,
3307 LLVMValueRef Resolver);
3308
3309/**
3310 * Obtain a GlobalIFunc value from a Module by its name.
3311 *
3312 * The returned value corresponds to a llvm::GlobalIFunc value.
3313 *
3314 * @see llvm::Module::getNamedIFunc()
3315 */
3317 const char *Name,
3318 size_t NameLen);
3319
3320/**
3321 * Obtain an iterator to the first GlobalIFunc in a Module.
3322 *
3323 * @see llvm::Module::ifunc_begin()
3324 */
3326
3327/**
3328 * Obtain an iterator to the last GlobalIFunc in a Module.
3329 *
3330 * @see llvm::Module::ifunc_end()
3331 */
3333
3334/**
3335 * Advance a GlobalIFunc iterator to the next GlobalIFunc.
3336 *
3337 * Returns NULL if the iterator was already at the end and there are no more
3338 * global aliases.
3339 */
3341
3342/**
3343 * Decrement a GlobalIFunc iterator to the previous GlobalIFunc.
3344 *
3345 * Returns NULL if the iterator was already at the beginning and there are
3346 * no previous global aliases.
3347 */
3349
3350/**
3351 * Retrieves the resolver function associated with this indirect function, or
3352 * NULL if it doesn't not exist.
3353 *
3354 * @see llvm::GlobalIFunc::getResolver()
3355 */
3357
3358/**
3359 * Sets the resolver function associated with this indirect function.
3360 *
3361 * @see llvm::GlobalIFunc::setResolver()
3362 */
3364 LLVMValueRef Resolver);
3365
3366/**
3367 * Remove a global indirect function from its parent module and delete it.
3368 *
3369 * @see llvm::GlobalIFunc::eraseFromParent()
3370 */
3372
3373/**
3374 * Remove a global indirect function from its parent module.
3375 *
3376 * This unlinks the global indirect function from its containing module but
3377 * keeps it alive.
3378 *
3379 * @see llvm::GlobalIFunc::removeFromParent()
3380 */
3382
3383/**
3384 * @}
3385 */
3386
3387/**
3388 * @}
3389 */
3390
3391/**
3392 * @}
3393 */
3394
3395/**
3396 * @}
3397 */
3398
3399/**
3400 * @defgroup LLVMCCoreValueMetadata Metadata
3401 *
3402 * @{
3403 */
3404
3405/**
3406 * Create an MDString value from a given string value.
3407 *
3408 * The MDString value does not take ownership of the given string, it remains
3409 * the responsibility of the caller to free it.
3410 *
3411 * @see llvm::MDString::get()
3412 */
3414 const char *Str, size_t SLen);
3415
3416/**
3417 * Create an MDNode value with the given array of operands.
3418 *
3419 * @see llvm::MDNode::get()
3420 */
3422 LLVMMetadataRef *MDs,
3423 size_t Count);
3424
3425/**
3426 * Obtain a Metadata as a Value.
3427 */
3429 LLVMMetadataRef MD);
3430
3431/**
3432 * Obtain a Value as a Metadata.
3433 */
3435
3436/**
3437 * Obtain the underlying string from a MDString value.
3438 *
3439 * @param V Instance to obtain string from.
3440 * @param Length Memory address which will hold length of returned string.
3441 * @return String data in MDString.
3442 */
3443LLVM_C_ABI const char *LLVMGetMDString(LLVMValueRef V, unsigned *Length);
3444
3445/**
3446 * Obtain the number of operands from an MDNode value.
3447 *
3448 * @param V MDNode to get number of operands from.
3449 * @return Number of operands of the MDNode.
3450 */
3452
3453/**
3454 * Obtain the given MDNode's operands.
3455 *
3456 * The passed LLVMValueRef pointer should point to enough memory to hold all of
3457 * the operands of the given MDNode (see LLVMGetMDNodeNumOperands) as
3458 * LLVMValueRefs. This memory will be populated with the LLVMValueRefs of the
3459 * MDNode's operands.
3460 *
3461 * @param V MDNode to get the operands from.
3462 * @param Dest Destination array for operands.
3463 */
3465
3466/**
3467 * Replace an operand at a specific index in a llvm::MDNode value.
3468 *
3469 * @see llvm::MDNode::replaceOperandWith()
3470 */
3472 LLVMMetadataRef Replacement);
3473
3474/** Deprecated: Use LLVMMDStringInContext2 instead. */
3476 unsigned SLen);
3477/** Deprecated: Use LLVMMDStringInContext2 instead. */
3479 LLVMValueRef LLVMMDString(const char *Str, unsigned SLen),
3480 "Use of the global context is deprecated, use LLVMMDStringInContext2 "
3481 "instead");
3482/** Deprecated: Use LLVMMDNodeInContext2 instead. */
3484 LLVMValueRef *Vals, unsigned Count);
3485/** Deprecated: Use LLVMMDNodeInContext2 instead. */
3487 LLVMValueRef LLVMMDNode(LLVMValueRef *Vals, unsigned Count),
3488 "Use of the global context is deprecated, use LLVMMDNodeInContext2 "
3489 "instead");
3490
3491/**
3492 * @}
3493 */
3494
3495/**
3496 * @defgroup LLVMCCoreOperandBundle Operand Bundles
3497 *
3498 * Functions in this group operate on LLVMOperandBundleRef instances that
3499 * correspond to llvm::OperandBundleDef instances.
3500 *
3501 * @see llvm::OperandBundleDef
3502 *
3503 * @{
3504 */
3505
3506/**
3507 * Create a new operand bundle.
3508 *
3509 * Every invocation should be paired with LLVMDisposeOperandBundle() or memory
3510 * will be leaked.
3511 *
3512 * @param Tag Tag name of the operand bundle
3513 * @param TagLen Length of Tag
3514 * @param Args Memory address of an array of bundle operands
3515 * @param NumArgs Length of Args
3516 */
3518 size_t TagLen,
3519 LLVMValueRef *Args,
3520 unsigned NumArgs);
3521
3522/**
3523 * Destroy an operand bundle.
3524 *
3525 * This must be called for every created operand bundle or memory will be
3526 * leaked.
3527 */
3529
3530/**
3531 * Obtain the tag of an operand bundle as a string.
3532 *
3533 * @param Bundle Operand bundle to obtain tag of.
3534 * @param Len Out parameter which holds the length of the returned string.
3535 * @return The tag name of Bundle.
3536 * @see OperandBundleDef::getTag()
3537 */
3539 size_t *Len);
3540
3541/**
3542 * Obtain the number of operands for an operand bundle.
3543 *
3544 * @param Bundle Operand bundle to obtain operand count of.
3545 * @return The number of operands.
3546 * @see OperandBundleDef::input_size()
3547 */
3549
3550/**
3551 * Obtain the operand for an operand bundle at the given index.
3552 *
3553 * @param Bundle Operand bundle to obtain operand of.
3554 * @param Index An operand index, must be less than
3555 * LLVMGetNumOperandBundleArgs().
3556 * @return The operand.
3557 */
3560
3561/**
3562 * @}
3563 */
3564
3565/**
3566 * @defgroup LLVMCCoreValueBasicBlock Basic Block
3567 *
3568 * A basic block represents a single entry single exit section of code.
3569 * Basic blocks contain a list of instructions which form the body of
3570 * the block.
3571 *
3572 * Basic blocks belong to functions. They have the type of label.
3573 *
3574 * Basic blocks are themselves values. However, the C API models them as
3575 * LLVMBasicBlockRef.
3576 *
3577 * @see llvm::BasicBlock
3578 *
3579 * @{
3580 */
3581
3582/**
3583 * Convert a basic block instance to a value type.
3584 */
3586
3587/**
3588 * Determine whether an LLVMValueRef is itself a basic block.
3589 */
3591
3592/**
3593 * Convert an LLVMValueRef to an LLVMBasicBlockRef instance.
3594 */
3596
3597/**
3598 * Obtain the string name of a basic block.
3599 */
3601
3602/**
3603 * Obtain the function to which a basic block belongs.
3604 *
3605 * @see llvm::BasicBlock::getParent()
3606 */
3608
3609/**
3610 * Obtain the terminator instruction for a basic block.
3611 *
3612 * If the basic block does not have a terminator (it is not well-formed
3613 * if it doesn't), then NULL is returned.
3614 *
3615 * The returned LLVMValueRef corresponds to an llvm::Instruction.
3616 *
3617 * @see llvm::BasicBlock::getTerminator()
3618 */
3620
3621/**
3622 * Obtain the number of basic blocks in a function.
3623 *
3624 * @param Fn Function value to operate on.
3625 */
3627
3628/**
3629 * Obtain all of the basic blocks in a function.
3630 *
3631 * This operates on a function value. The BasicBlocks parameter is a
3632 * pointer to a pre-allocated array of LLVMBasicBlockRef of at least
3633 * LLVMCountBasicBlocks() in length. This array is populated with
3634 * LLVMBasicBlockRef instances.
3635 */
3637 LLVMBasicBlockRef *BasicBlocks);
3638
3639/**
3640 * Obtain the first basic block in a function.
3641 *
3642 * The returned basic block can be used as an iterator. You will likely
3643 * eventually call into LLVMGetNextBasicBlock() with it.
3644 *
3645 * @see llvm::Function::begin()
3646 */
3648
3649/**
3650 * Obtain the last basic block in a function.
3651 *
3652 * @see llvm::Function::end()
3653 */
3655
3656/**
3657 * Advance a basic block iterator.
3658 */
3660
3661/**
3662 * Go backwards in a basic block iterator.
3663 */
3665
3666/**
3667 * Obtain the basic block that corresponds to the entry point of a
3668 * function.
3669 *
3670 * @see llvm::Function::getEntryBlock()
3671 */
3673
3674/**
3675 * Insert the given basic block after the insertion point of the given builder.
3676 *
3677 * The insertion point must be valid.
3678 *
3679 * @see llvm::Function::BasicBlockListType::insertAfter()
3680 */
3681LLVM_C_ABI void
3684
3685/**
3686 * Append the given basic block to the basic block list of the given function.
3687 *
3688 * @see llvm::Function::BasicBlockListType::push_back()
3689 */
3692
3693/**
3694 * Create a new basic block without inserting it into a function.
3695 *
3696 * @see llvm::BasicBlock::Create()
3697 */
3699 const char *Name);
3700
3701/**
3702 * Append a basic block to the end of a function.
3703 *
3704 * @see llvm::BasicBlock::Create()
3705 */
3707 LLVMValueRef Fn,
3708 const char *Name);
3709
3710/**
3711 * Append a basic block to the end of a function using the global
3712 * context.
3713 *
3714 * @see llvm::BasicBlock::Create()
3715 */
3718 "Use of the global context is deprecated, use "
3719 "LLVMAppendBasicBlockInContext instead");
3720
3721/**
3722 * Insert a basic block in a function before another basic block.
3723 *
3724 * The function to add to is determined by the function of the
3725 * passed basic block.
3726 *
3727 * @see llvm::BasicBlock::Create()
3728 */
3731 const char *Name);
3732
3733/**
3734 * Insert a basic block in a function using the global context.
3735 *
3736 * @see llvm::BasicBlock::Create()
3737 */
3740 const char *Name),
3741 "Use of the global context is deprecated, use "
3742 "LLVMInsertBasicBlockInContext instead");
3743
3744/**
3745 * Remove a basic block from a function and delete it.
3746 *
3747 * This deletes the basic block from its containing function and deletes
3748 * the basic block itself.
3749 *
3750 * @see llvm::BasicBlock::eraseFromParent()
3751 */
3753
3754/**
3755 * Remove a basic block from a function.
3756 *
3757 * This deletes the basic block from its containing function but keep
3758 * the basic block alive.
3759 *
3760 * @see llvm::BasicBlock::removeFromParent()
3761 */
3763
3764/**
3765 * Move a basic block to before another one.
3766 *
3767 * @see llvm::BasicBlock::moveBefore()
3768 */
3770 LLVMBasicBlockRef MovePos);
3771
3772/**
3773 * Move a basic block to after another one.
3774 *
3775 * @see llvm::BasicBlock::moveAfter()
3776 */
3778 LLVMBasicBlockRef MovePos);
3779
3780/**
3781 * Obtain the first instruction in a basic block.
3782 *
3783 * The returned LLVMValueRef corresponds to a llvm::Instruction
3784 * instance.
3785 */
3787
3788/**
3789 * Obtain the last instruction in a basic block.
3790 *
3791 * The returned LLVMValueRef corresponds to an LLVM:Instruction.
3792 */
3794
3795/**
3796 * @}
3797 */
3798
3799/**
3800 * @defgroup LLVMCCoreValueInstruction Instructions
3801 *
3802 * Functions in this group relate to the inspection and manipulation of
3803 * individual instructions.
3804 *
3805 * In the C++ API, an instruction is modeled by llvm::Instruction. This
3806 * class has a large number of descendents. llvm::Instruction is a
3807 * llvm::Value and in the C API, instructions are modeled by
3808 * LLVMValueRef.
3809 *
3810 * This group also contains sub-groups which operate on specific
3811 * llvm::Instruction types, e.g. llvm::CallInst.
3812 *
3813 * @{
3814 */
3815
3816/**
3817 * Determine whether an instruction has any metadata attached.
3818 */
3820
3821/**
3822 * Return metadata associated with an instruction value.
3823 */
3825
3826/**
3827 * Set metadata associated with an instruction value.
3828 */
3829LLVM_C_ABI void LLVMSetMetadata(LLVMValueRef Val, unsigned KindID,
3831
3832/**
3833 * Returns the metadata associated with an instruction value, but filters out
3834 * all the debug locations.
3835 *
3836 * @see llvm::Instruction::getAllMetadataOtherThanDebugLoc()
3837 */
3840 size_t *NumEntries);
3841
3842/**
3843 * Obtain the basic block to which an instruction belongs.
3844 *
3845 * @see llvm::Instruction::getParent()
3846 */
3848
3849/**
3850 * Obtain the instruction that occurs after the one specified.
3851 *
3852 * The next instruction will be from the same basic block.
3853 *
3854 * If this is the last instruction in a basic block, NULL will be
3855 * returned.
3856 */
3858
3859/**
3860 * Obtain the instruction that occurred before this one.
3861 *
3862 * If the instruction is the first instruction in a basic block, NULL
3863 * will be returned.
3864 */
3866
3867/**
3868 * Remove an instruction.
3869 *
3870 * The instruction specified is removed from its containing building
3871 * block but is kept alive.
3872 *
3873 * @see llvm::Instruction::removeFromParent()
3874 */
3876
3877/**
3878 * Remove and delete an instruction.
3879 *
3880 * The instruction specified is removed from its containing building
3881 * block and then deleted.
3882 *
3883 * @see llvm::Instruction::eraseFromParent()
3884 */
3886
3887/**
3888 * Delete an instruction.
3889 *
3890 * The instruction specified is deleted. It must have previously been
3891 * removed from its containing building block.
3892 *
3893 * @see llvm::Value::deleteValue()
3894 */
3896
3897/**
3898 * Obtain the code opcode for an individual instruction.
3899 *
3900 * @see llvm::Instruction::getOpCode()
3901 */
3903
3904/**
3905 * Obtain the predicate of an instruction.
3906 *
3907 * This is only valid for instructions that correspond to llvm::ICmpInst.
3908 *
3909 * @see llvm::ICmpInst::getPredicate()
3910 */
3912
3913/**
3914 * Get whether or not an icmp instruction has the samesign flag.
3915 *
3916 * This is only valid for instructions that correspond to llvm::ICmpInst.
3917 *
3918 * @see llvm::ICmpInst::hasSameSign()
3919 */
3921
3922/**
3923 * Set the samesign flag on an icmp instruction.
3924 *
3925 * This is only valid for instructions that correspond to llvm::ICmpInst.
3926 *
3927 * @see llvm::ICmpInst::setSameSign()
3928 */
3930
3931/**
3932 * Obtain the float predicate of an instruction.
3933 *
3934 * This is only valid for instructions that correspond to llvm::FCmpInst.
3935 *
3936 * @see llvm::FCmpInst::getPredicate()
3937 */
3939
3940/**
3941 * Create a copy of 'this' instruction that is identical in all ways
3942 * except the following:
3943 * * The instruction has no parent
3944 * * The instruction has no name
3945 *
3946 * @see llvm::Instruction::clone()
3947 */
3949
3950/**
3951 * Determine whether an instruction is a terminator. This routine is named to
3952 * be compatible with historical functions that did this by querying the
3953 * underlying C++ type.
3954 *
3955 * @see llvm::Instruction::isTerminator()
3956 */
3958
3959/**
3960 * Obtain the first debug record attached to an instruction.
3961 *
3962 * Use LLVMGetNextDbgRecord() and LLVMGetPreviousDbgRecord() to traverse the
3963 * sequence of DbgRecords.
3964 *
3965 * Return the first DbgRecord attached to Inst or NULL if there are none.
3966 *
3967 * @see llvm::Instruction::getDbgRecordRange()
3968 */
3970
3971/**
3972 * Obtain the last debug record attached to an instruction.
3973 *
3974 * Return the last DbgRecord attached to Inst or NULL if there are none.
3975 *
3976 * @see llvm::Instruction::getDbgRecordRange()
3977 */
3979
3980/**
3981 * Obtain the next DbgRecord in the sequence or NULL if there are no more.
3982 *
3983 * @see llvm::Instruction::getDbgRecordRange()
3984 */
3986
3987/**
3988 * Obtain the previous DbgRecord in the sequence or NULL if there are no more.
3989 *
3990 * @see llvm::Instruction::getDbgRecordRange()
3991 */
3994
3995/**
3996 * Get the debug location attached to the debug record.
3997 *
3998 * @see llvm::DbgRecord::getDebugLoc()
3999 */
4001
4003
4004/**
4005 * Get the value of the DbgVariableRecord.
4006 *
4007 * @see llvm::DbgVariableRecord::getValue()
4008 */
4010 unsigned OpIdx);
4011
4012/**
4013 * Get the debug info variable of the DbgVariableRecord.
4014 *
4015 * @see llvm::DbgVariableRecord::getVariable()
4016 */
4018
4019/**
4020 * Get the debug info expression of the DbgVariableRecord.
4021 *
4022 * @see llvm::DbgVariableRecord::getExpression()
4023 */
4025
4026/**
4027 * @defgroup LLVMCCoreValueInstructionCall Call Sites and Invocations
4028 *
4029 * Functions in this group apply to instructions that refer to call
4030 * sites and invocations. These correspond to C++ types in the
4031 * llvm::CallInst class tree.
4032 *
4033 * @{
4034 */
4035
4036/**
4037 * Obtain the argument count for a call instruction.
4038 *
4039 * This expects an LLVMValueRef that corresponds to a llvm::CallInst,
4040 * llvm::InvokeInst, or llvm:FuncletPadInst.
4041 *
4042 * @see llvm::CallInst::getNumArgOperands()
4043 * @see llvm::InvokeInst::getNumArgOperands()
4044 * @see llvm::FuncletPadInst::getNumArgOperands()
4045 */
4047
4048/**
4049 * Set the calling convention for a call instruction.
4050 *
4051 * This expects an LLVMValueRef that corresponds to a llvm::CallInst or
4052 * llvm::InvokeInst.
4053 *
4054 * @see llvm::CallInst::setCallingConv()
4055 * @see llvm::InvokeInst::setCallingConv()
4056 */
4057LLVM_C_ABI void LLVMSetInstructionCallConv(LLVMValueRef Instr, unsigned CC);
4058
4059/**
4060 * Obtain the calling convention for a call instruction.
4061 *
4062 * This is the opposite of LLVMSetInstructionCallConv(). Reads its
4063 * usage.
4064 *
4065 * @see LLVMSetInstructionCallConv()
4066 */
4068
4071 unsigned Align);
4072
4076 LLVMAttributeIndex Idx);
4079 LLVMAttributeRef *Attrs);
4082 unsigned KindID);
4084 LLVMValueRef C, LLVMAttributeIndex Idx, const char *K, unsigned KLen);
4087 unsigned KindID);
4090 const char *K, unsigned KLen);
4091
4092/**
4093 * Obtain the function type called by this instruction.
4094 *
4095 * @see llvm::CallBase::getFunctionType()
4096 */
4098
4099/**
4100 * Obtain the pointer to the function invoked by this instruction.
4101 *
4102 * This expects an LLVMValueRef that corresponds to a llvm::CallInst or
4103 * llvm::InvokeInst.
4104 *
4105 * @see llvm::CallInst::getCalledOperand()
4106 * @see llvm::InvokeInst::getCalledOperand()
4107 */
4109
4110/**
4111 * Obtain the number of operand bundles attached to this instruction.
4112 *
4113 * This only works on llvm::CallInst and llvm::InvokeInst instructions.
4114 *
4115 * @see llvm::CallBase::getNumOperandBundles()
4116 */
4118
4119/**
4120 * Obtain the operand bundle attached to this instruction at the given index.
4121 * Use LLVMDisposeOperandBundle to free the operand bundle.
4122 *
4123 * This only works on llvm::CallInst and llvm::InvokeInst instructions.
4124 */
4126 unsigned Index);
4127
4128/**
4129 * Obtain whether a call instruction is a tail call.
4130 *
4131 * This only works on llvm::CallInst instructions.
4132 *
4133 * @see llvm::CallInst::isTailCall()
4134 */
4136
4137/**
4138 * Set whether a call instruction is a tail call.
4139 *
4140 * This only works on llvm::CallInst instructions.
4141 *
4142 * @see llvm::CallInst::setTailCall()
4143 */
4144LLVM_C_ABI void LLVMSetTailCall(LLVMValueRef CallInst, LLVMBool IsTailCall);
4145
4146/**
4147 * Obtain a tail call kind of the call instruction.
4148 *
4149 * @see llvm::CallInst::setTailCallKind()
4150 */
4152
4153/**
4154 * Set the call kind of the call instruction.
4155 *
4156 * @see llvm::CallInst::getTailCallKind()
4157 */
4159 LLVMTailCallKind kind);
4160
4161/**
4162 * Return the normal destination basic block.
4163 *
4164 * This only works on llvm::InvokeInst instructions.
4165 *
4166 * @see llvm::InvokeInst::getNormalDest()
4167 */
4169
4170/**
4171 * Return the unwind destination basic block.
4172 *
4173 * Works on llvm::InvokeInst, llvm::CleanupReturnInst, and
4174 * llvm::CatchSwitchInst instructions.
4175 *
4176 * @see llvm::InvokeInst::getUnwindDest()
4177 * @see llvm::CleanupReturnInst::getUnwindDest()
4178 * @see llvm::CatchSwitchInst::getUnwindDest()
4179 */
4181
4182/**
4183 * Set the normal destination basic block.
4184 *
4185 * This only works on llvm::InvokeInst instructions.
4186 *
4187 * @see llvm::InvokeInst::setNormalDest()
4188 */
4190
4191/**
4192 * Set the unwind destination basic block.
4193 *
4194 * Works on llvm::InvokeInst, llvm::CleanupReturnInst, and
4195 * llvm::CatchSwitchInst instructions.
4196 *
4197 * @see llvm::InvokeInst::setUnwindDest()
4198 * @see llvm::CleanupReturnInst::setUnwindDest()
4199 * @see llvm::CatchSwitchInst::setUnwindDest()
4200 */
4202
4203/**
4204 * Get the default destination of a CallBr instruction.
4205 *
4206 * @see llvm::CallBrInst::getDefaultDest()
4207 */
4209
4210/**
4211 * Get the number of indirect destinations of a CallBr instruction.
4212 *
4213 * @see llvm::CallBrInst::getNumIndirectDests()
4214
4215 */
4217
4218/**
4219 * Get the indirect destination of a CallBr instruction at the given index.
4220 *
4221 * @see llvm::CallBrInst::getIndirectDest()
4222 */
4224 unsigned Idx);
4225
4226/**
4227 * @}
4228 */
4229
4230/**
4231 * @defgroup LLVMCCoreValueInstructionTerminator Terminators
4232 *
4233 * Functions in this group only apply to instructions for which
4234 * LLVMIsATerminatorInst returns true.
4235 *
4236 * @{
4237 */
4238
4239/**
4240 * Return the number of successors that this terminator has.
4241 *
4242 * @see llvm::Instruction::getNumSuccessors
4243 */
4245
4246/**
4247 * Return the specified successor.
4248 *
4249 * @see llvm::Instruction::getSuccessor
4250 */
4252
4253/**
4254 * Update the specified successor to point at the provided block.
4255 *
4256 * @see llvm::Instruction::setSuccessor
4257 */
4258LLVM_C_ABI void LLVMSetSuccessor(LLVMValueRef Term, unsigned i,
4260
4261/**
4262 * Return if a branch is conditional.
4263 *
4264 * This only works on llvm::BranchInst instructions.
4265 *
4266 * @see llvm::BranchInst::isConditional
4267 */
4269
4270/**
4271 * Return the condition of a branch instruction.
4272 *
4273 * This only works on llvm::BranchInst instructions.
4274 *
4275 * @see llvm::BranchInst::getCondition
4276 */
4278
4279/**
4280 * Set the condition of a branch instruction.
4281 *
4282 * This only works on llvm::BranchInst instructions.
4283 *
4284 * @see llvm::BranchInst::setCondition
4285 */
4287
4288/**
4289 * Obtain the default destination basic block of a switch instruction.
4290 *
4291 * This only works on llvm::SwitchInst instructions.
4292 *
4293 * @see llvm::SwitchInst::getDefaultDest()
4294 */
4296
4297/**
4298 * @}
4299 */
4300
4301/**
4302 * @defgroup LLVMCCoreValueInstructionAlloca Allocas
4303 *
4304 * Functions in this group only apply to instructions that map to
4305 * llvm::AllocaInst instances.
4306 *
4307 * @{
4308 */
4309
4310/**
4311 * Obtain the type that is being allocated by the alloca instruction.
4312 */
4314
4315/**
4316 * @}
4317 */
4318
4319/**
4320 * @defgroup LLVMCCoreValueInstructionGetElementPointer GEPs
4321 *
4322 * Functions in this group only apply to instructions that map to
4323 * llvm::GetElementPtrInst instances.
4324 *
4325 * @{
4326 */
4327
4328/**
4329 * Check whether the given GEP operator is inbounds.
4330 */
4332
4333/**
4334 * Set the given GEP instruction to be inbounds or not.
4335 */
4337
4338/**
4339 * Get the source element type of the given GEP operator.
4340 */
4342
4343/**
4344 * Get the no-wrap related flags for the given GEP instruction.
4345 *
4346 * @see llvm::GetElementPtrInst::getNoWrapFlags
4347 */
4349
4350/**
4351 * Set the no-wrap related flags for the given GEP instruction.
4352 *
4353 * @see llvm::GetElementPtrInst::setNoWrapFlags
4354 */
4356 LLVMGEPNoWrapFlags NoWrapFlags);
4357
4358/**
4359 * @}
4360 */
4361
4362/**
4363 * @defgroup LLVMCCoreValueInstructionPHINode PHI Nodes
4364 *
4365 * Functions in this group only apply to instructions that map to
4366 * llvm::PHINode instances.
4367 *
4368 * @{
4369 */
4370
4371/**
4372 * Add an incoming value to the end of a PHI list.
4373 */
4375 LLVMValueRef *IncomingValues,
4376 LLVMBasicBlockRef *IncomingBlocks,
4377 unsigned Count);
4378
4379/**
4380 * Obtain the number of incoming basic blocks to a PHI node.
4381 */
4382LLVM_C_ABI unsigned LLVMCountIncoming(LLVMValueRef PhiNode);
4383
4384/**
4385 * Obtain an incoming value to a PHI node as an LLVMValueRef.
4386 */
4388 unsigned Index);
4389
4390/**
4391 * Obtain an incoming value to a PHI node as an LLVMBasicBlockRef.
4392 */
4394 unsigned Index);
4395
4396/**
4397 * @}
4398 */
4399
4400/**
4401 * @defgroup LLVMCCoreValueInstructionExtractValue ExtractValue
4402 * @defgroup LLVMCCoreValueInstructionInsertValue InsertValue
4403 *
4404 * Functions in this group only apply to instructions that map to
4405 * llvm::ExtractValue and llvm::InsertValue instances.
4406 *
4407 * @{
4408 */
4409
4410/**
4411 * Obtain the number of indices.
4412 * NB: This also works on GEP operators.
4413 */
4415
4416/**
4417 * Obtain the indices as an array.
4418 */
4419LLVM_C_ABI const unsigned *LLVMGetIndices(LLVMValueRef Inst);
4420
4421/**
4422 * @}
4423 */
4424
4425/**
4426 * @}
4427 */
4428
4429/**
4430 * @}
4431 */
4432
4433/**
4434 * @defgroup LLVMCCoreInstructionBuilder Instruction Builders
4435 *
4436 * An instruction builder represents a point within a basic block and is
4437 * the exclusive means of building instructions using the C interface.
4438 *
4439 * @{
4440 */
4441
4445 "Use of the global context is deprecated, use "
4446 "LLVMCreateBuilderInContext instead");
4447/**
4448 * Set the builder position before Instr but after any attached debug records,
4449 * or if Instr is null set the position to the end of Block.
4450 */
4452 LLVMBasicBlockRef Block,
4453 LLVMValueRef Instr);
4454/**
4455 * Set the builder position before Instr and any attached debug records,
4456 * or if Instr is null set the position to the end of Block.
4457 */
4459 LLVMBasicBlockRef Block,
4460 LLVMValueRef Inst);
4461/**
4462 * Set the builder position before Instr but after any attached debug records.
4463 */
4465 LLVMValueRef Instr);
4466/**
4467 * Set the builder position before Instr and any attached debug records.
4468 */
4469LLVM_C_ABI void
4471 LLVMValueRef Instr);
4473 LLVMBasicBlockRef Block);
4477 LLVMValueRef Instr);
4479 LLVMValueRef Instr,
4480 const char *Name);
4482
4483/* Metadata */
4484
4485/**
4486 * Get location information used by debugging information.
4487 *
4488 * @see llvm::IRBuilder::getCurrentDebugLocation()
4489 */
4491
4492/**
4493 * Set location information used by debugging information.
4494 *
4495 * To clear the location metadata of the given instruction, pass NULL to \p Loc.
4496 *
4497 * @see llvm::IRBuilder::SetCurrentDebugLocation()
4498 */
4500 LLVMMetadataRef Loc);
4501
4502/**
4503 * Attempts to set the debug location for the given instruction using the
4504 * current debug location for the given builder. If the builder has no current
4505 * debug location, this function is a no-op.
4506 *
4507 * @deprecated LLVMSetInstDebugLocation is deprecated in favor of the more general
4508 * LLVMAddMetadataToInst.
4509 *
4510 * @see llvm::IRBuilder::SetInstDebugLocation()
4511 */
4513 LLVMValueRef Inst);
4514
4515/**
4516 * Adds the metadata registered with the given builder to the given instruction.
4517 *
4518 * @see llvm::IRBuilder::AddMetadataToInst()
4519 */
4521 LLVMValueRef Inst);
4522
4523/**
4524 * Get the dafult floating-point math metadata for a given builder.
4525 *
4526 * @see llvm::IRBuilder::getDefaultFPMathTag()
4527 */
4530
4531/**
4532 * Set the default floating-point math metadata for the given builder.
4533 *
4534 * To clear the metadata, pass NULL to \p FPMathTag.
4535 *
4536 * @see llvm::IRBuilder::setDefaultFPMathTag()
4537 */
4539 LLVMMetadataRef FPMathTag);
4540
4541/**
4542 * Obtain the context to which this builder is associated.
4543 *
4544 * @see llvm::IRBuilder::getContext()
4545 */
4547
4548/**
4549 * Deprecated: Passing the NULL location will crash.
4550 * Use LLVMGetCurrentDebugLocation2 instead.
4551 */
4553 LLVMValueRef L);
4554/**
4555 * Deprecated: Returning the NULL location will crash.
4556 * Use LLVMGetCurrentDebugLocation2 instead.
4557 */
4559
4560/* Terminators */
4564 LLVMValueRef *RetVals,
4565 unsigned N);
4568 LLVMBasicBlockRef Then,
4569 LLVMBasicBlockRef Else);
4571 LLVMBasicBlockRef Else,
4572 unsigned NumCases);
4574 unsigned NumDests);
4577 LLVMBasicBlockRef DefaultDest, LLVMBasicBlockRef *IndirectDests,
4578 unsigned NumIndirectDests, LLVMValueRef *Args, unsigned NumArgs,
4579 LLVMOperandBundleRef *Bundles, unsigned NumBundles, const char *Name);
4581 LLVMValueRef Fn, LLVMValueRef *Args,
4582 unsigned NumArgs,
4583 LLVMBasicBlockRef Then,
4584 LLVMBasicBlockRef Catch,
4585 const char *Name);
4588 unsigned NumArgs, LLVMBasicBlockRef Then, LLVMBasicBlockRef Catch,
4589 LLVMOperandBundleRef *Bundles, unsigned NumBundles, const char *Name);
4591
4592/* Exception Handling */
4595 LLVMValueRef PersFn,
4596 unsigned NumClauses,
4597 const char *Name);
4599 LLVMValueRef CatchPad,
4602 LLVMValueRef CatchPad,
4605 LLVMValueRef ParentPad,
4606 LLVMValueRef *Args, unsigned NumArgs,
4607 const char *Name);
4609 LLVMValueRef ParentPad,
4610 LLVMValueRef *Args,
4611 unsigned NumArgs, const char *Name);
4613 LLVMValueRef ParentPad,
4614 LLVMBasicBlockRef UnwindBB,
4615 unsigned NumHandlers,
4616 const char *Name);
4617
4618/* Add a case to the switch instruction */
4620 LLVMBasicBlockRef Dest);
4621
4622/* Add a destination to the indirectbr instruction */
4624 LLVMBasicBlockRef Dest);
4625
4626/* Get the number of clauses on the landingpad instruction */
4627LLVM_C_ABI unsigned LLVMGetNumClauses(LLVMValueRef LandingPad);
4628
4629/* Get the value of the clause at index Idx on the landingpad instruction */
4630LLVM_C_ABI LLVMValueRef LLVMGetClause(LLVMValueRef LandingPad, unsigned Idx);
4631
4632/* Add a catch or filter clause to the landingpad instruction */
4633LLVM_C_ABI void LLVMAddClause(LLVMValueRef LandingPad, LLVMValueRef ClauseVal);
4634
4635/* Get the 'cleanup' flag in the landingpad instruction */
4637
4638/* Set the 'cleanup' flag in the landingpad instruction */
4639LLVM_C_ABI void LLVMSetCleanup(LLVMValueRef LandingPad, LLVMBool Val);
4640
4641/* Add a destination to the catchswitch instruction */
4642LLVM_C_ABI void LLVMAddHandler(LLVMValueRef CatchSwitch,
4643 LLVMBasicBlockRef Dest);
4644
4645/* Get the number of handlers on the catchswitch instruction */
4646LLVM_C_ABI unsigned LLVMGetNumHandlers(LLVMValueRef CatchSwitch);
4647
4648/**
4649 * Obtain the basic blocks acting as handlers for a catchswitch instruction.
4650 *
4651 * The Handlers parameter should point to a pre-allocated array of
4652 * LLVMBasicBlockRefs at least LLVMGetNumHandlers() large. On return, the
4653 * first LLVMGetNumHandlers() entries in the array will be populated
4654 * with LLVMBasicBlockRef instances.
4655 *
4656 * @param CatchSwitch The catchswitch instruction to operate on.
4657 * @param Handlers Memory address of an array to be filled with basic blocks.
4658 */
4659LLVM_C_ABI void LLVMGetHandlers(LLVMValueRef CatchSwitch,
4660 LLVMBasicBlockRef *Handlers);
4661
4662/* Funclets */
4663
4664/* Get the number of funcletpad arguments. */
4666
4667/* Set a funcletpad argument at the given index. */
4668LLVM_C_ABI void LLVMSetArgOperand(LLVMValueRef Funclet, unsigned i,
4669 LLVMValueRef value);
4670
4671/**
4672 * Get the parent catchswitch instruction of a catchpad instruction.
4673 *
4674 * This only works on llvm::CatchPadInst instructions.
4675 *
4676 * @see llvm::CatchPadInst::getCatchSwitch()
4677 */
4679
4680/**
4681 * Set the parent catchswitch instruction of a catchpad instruction.
4682 *
4683 * This only works on llvm::CatchPadInst instructions.
4684 *
4685 * @see llvm::CatchPadInst::setCatchSwitch()
4686 */
4688 LLVMValueRef CatchSwitch);
4689
4690/* Arithmetic */
4692 LLVMValueRef RHS, const char *Name);
4694 LLVMValueRef RHS, const char *Name);
4696 LLVMValueRef RHS, const char *Name);
4698 LLVMValueRef RHS, const char *Name);
4700 LLVMValueRef RHS, const char *Name);
4702 LLVMValueRef RHS, const char *Name);
4704 LLVMValueRef RHS, const char *Name);
4706 LLVMValueRef RHS, const char *Name);
4708 LLVMValueRef RHS, const char *Name);
4710 LLVMValueRef RHS, const char *Name);
4712 LLVMValueRef RHS, const char *Name);
4714 LLVMValueRef RHS, const char *Name);
4716 LLVMValueRef RHS, const char *Name);
4718 LLVMValueRef RHS, const char *Name);
4720 LLVMValueRef RHS, const char *Name);
4722 LLVMValueRef RHS, const char *Name);
4724 LLVMValueRef RHS, const char *Name);
4726 LLVMValueRef RHS, const char *Name);
4728 LLVMValueRef RHS, const char *Name);
4730 LLVMValueRef RHS, const char *Name);
4732 LLVMValueRef RHS, const char *Name);
4734 LLVMValueRef RHS, const char *Name);
4736 LLVMValueRef RHS, const char *Name);
4738 LLVMValueRef RHS, const char *Name);
4740 LLVMValueRef RHS, const char *Name);
4742 LLVMValueRef RHS, const char *Name);
4745 const char *Name);
4747 const char *Name);
4749 const char *Name);
4752 const char *Name),
4753 "Use LLVMBuildNeg + LLVMSetNUW instead.");
4755 const char *Name);
4757 const char *Name);
4758
4760LLVM_C_ABI void LLVMSetNUW(LLVMValueRef ArithInst, LLVMBool HasNUW);
4762LLVM_C_ABI void LLVMSetNSW(LLVMValueRef ArithInst, LLVMBool HasNSW);
4764LLVM_C_ABI void LLVMSetExact(LLVMValueRef DivOrShrInst, LLVMBool IsExact);
4765
4766/**
4767 * Gets if the instruction has the non-negative flag set.
4768 * Only valid for zext instructions.
4769 */
4771/**
4772 * Sets the non-negative flag for the instruction.
4773 * Only valid for zext instructions.
4774 */
4775LLVM_C_ABI void LLVMSetNNeg(LLVMValueRef NonNegInst, LLVMBool IsNonNeg);
4776
4777/**
4778 * Get the flags for which fast-math-style optimizations are allowed for this
4779 * value.
4780 *
4781 * Only valid on floating point instructions.
4782 * @see LLVMCanValueUseFastMathFlags
4783 */
4785
4786/**
4787 * Sets the flags for which fast-math-style optimizations are allowed for this
4788 * value.
4789 *
4790 * Only valid on floating point instructions.
4791 * @see LLVMCanValueUseFastMathFlags
4792 */
4794 LLVMFastMathFlags FMF);
4795
4796/**
4797 * Check if a given value can potentially have fast math flags.
4798 *
4799 * Will return true for floating point arithmetic instructions, and for select,
4800 * phi, and call instructions whose type is a floating point type, or a vector
4801 * or array thereof. See https://llvm.org/docs/LangRef.html#fast-math-flags
4802 */
4804
4805/**
4806 * Gets whether the instruction has the disjoint flag set.
4807 * Only valid for or instructions.
4808 */
4810/**
4811 * Sets the disjoint flag for the instruction.
4812 * Only valid for or instructions.
4813 */
4814LLVM_C_ABI void LLVMSetIsDisjoint(LLVMValueRef Inst, LLVMBool IsDisjoint);
4815
4816/* Memory */
4818 const char *Name);
4820 LLVMValueRef Val,
4821 const char *Name);
4822
4823/**
4824 * Creates and inserts a memset to the specified pointer and the
4825 * specified value.
4826 *
4827 * @see llvm::IRRBuilder::CreateMemSet()
4828 */
4830 LLVMValueRef Val, LLVMValueRef Len,
4831 unsigned Align);
4832/**
4833 * Creates and inserts a memcpy between the specified pointers.
4834 *
4835 * @see llvm::IRRBuilder::CreateMemCpy()
4836 */
4838 unsigned DstAlign, LLVMValueRef Src,
4839 unsigned SrcAlign, LLVMValueRef Size);
4840/**
4841 * Creates and inserts a memmove between the specified pointers.
4842 *
4843 * @see llvm::IRRBuilder::CreateMemMove()
4844 */
4846 unsigned DstAlign, LLVMValueRef Src,
4847 unsigned SrcAlign, LLVMValueRef Size);
4848
4850 const char *Name);
4852 LLVMValueRef Val,
4853 const char *Name);
4856 LLVMValueRef PointerVal,
4857 const char *Name);
4859 LLVMValueRef Ptr);
4861 LLVMValueRef Pointer,
4862 LLVMValueRef *Indices,
4863 unsigned NumIndices, const char *Name);
4865 LLVMValueRef Pointer,
4866 LLVMValueRef *Indices,
4867 unsigned NumIndices,
4868 const char *Name);
4869/**
4870 * Creates a GetElementPtr instruction. Similar to LLVMBuildGEP2, but allows
4871 * specifying the no-wrap flags.
4872 *
4873 * @see llvm::IRBuilder::CreateGEP()
4874 */
4877 LLVMValueRef *Indices, unsigned NumIndices, const char *Name,
4878 LLVMGEPNoWrapFlags NoWrapFlags);
4880 LLVMValueRef Pointer, unsigned Idx,
4881 const char *Name);
4883 const char *Name);
4884/**
4885 * Deprecated: Use LLVMBuildGlobalString instead, which has identical behavior.
4886 */
4888 const char *Str,
4889 const char *Name);
4891LLVM_C_ABI void LLVMSetVolatile(LLVMValueRef MemoryAccessInst,
4892 LLVMBool IsVolatile);
4894LLVM_C_ABI void LLVMSetWeak(LLVMValueRef CmpXchgInst, LLVMBool IsWeak);
4896LLVM_C_ABI void LLVMSetOrdering(LLVMValueRef MemoryAccessInst,
4897 LLVMAtomicOrdering Ordering);
4900 LLVMAtomicRMWBinOp BinOp);
4901
4902/* Casts */
4904 LLVMTypeRef DestTy, const char *Name);
4906 LLVMTypeRef DestTy, const char *Name);
4908 LLVMTypeRef DestTy, const char *Name);
4910 LLVMTypeRef DestTy, const char *Name);
4912 LLVMTypeRef DestTy, const char *Name);
4914 LLVMTypeRef DestTy, const char *Name);
4916 LLVMTypeRef DestTy, const char *Name);
4918 LLVMTypeRef DestTy, const char *Name);
4920 LLVMTypeRef DestTy, const char *Name);
4922 LLVMTypeRef DestTy, const char *Name);
4924 LLVMTypeRef DestTy, const char *Name);
4926 LLVMTypeRef DestTy, const char *Name);
4928 LLVMTypeRef DestTy,
4929 const char *Name);
4931 LLVMTypeRef DestTy,
4932 const char *Name);
4934 LLVMTypeRef DestTy,
4935 const char *Name);
4937 LLVMValueRef Val,
4938 LLVMTypeRef DestTy,
4939 const char *Name);
4941 LLVMValueRef Val, LLVMTypeRef DestTy,
4942 const char *Name);
4944 LLVMTypeRef DestTy,
4945 const char *Name);
4947 LLVMTypeRef DestTy, LLVMBool IsSigned,
4948 const char *Name);
4950 LLVMTypeRef DestTy, const char *Name);
4951
4952/** Deprecated: This cast is always signed. Use LLVMBuildIntCast2 instead. */
4954 LLVMValueRef Val, /*Signed cast!*/
4955 LLVMTypeRef DestTy, const char *Name);
4956
4958 LLVMTypeRef DestTy,
4959 LLVMBool DestIsSigned);
4960
4961/* Comparisons */
4964 const char *Name);
4967 const char *Name);
4968
4969/* Miscellaneous instructions */
4971 const char *Name);
4973 LLVMValueRef Fn, LLVMValueRef *Args,
4974 unsigned NumArgs, const char *Name);
4977 unsigned NumArgs, LLVMOperandBundleRef *Bundles, unsigned NumBundles,
4978 const char *Name);
4980 LLVMValueRef Then, LLVMValueRef Else,
4981 const char *Name);
4983 LLVMTypeRef Ty, const char *Name);
4985 LLVMValueRef VecVal,
4986 LLVMValueRef Index,
4987 const char *Name);
4989 LLVMValueRef VecVal,
4990 LLVMValueRef EltVal,
4991 LLVMValueRef Index,
4992 const char *Name);
4994 LLVMValueRef V2,
4995 LLVMValueRef Mask,
4996 const char *Name);
4998 LLVMValueRef AggVal,
4999 unsigned Index, const char *Name);
5001 LLVMValueRef AggVal,
5002 LLVMValueRef EltVal,
5003 unsigned Index, const char *Name);
5005 const char *Name);
5006
5008 const char *Name);
5010 const char *Name);
5013 const char *Name);
5015 LLVMAtomicOrdering ordering,
5016 LLVMBool singleThread, const char *Name);
5018 LLVMAtomicOrdering ordering,
5019 unsigned SSID,
5020 const char *Name);
5023 LLVMValueRef PTR, LLVMValueRef Val,
5024 LLVMAtomicOrdering ordering,
5025 LLVMBool singleThread);
5028 LLVMAtomicOrdering ordering, unsigned SSID);
5031 LLVMAtomicOrdering SuccessOrdering, LLVMAtomicOrdering FailureOrdering,
5035 LLVMAtomicOrdering SuccessOrdering, LLVMAtomicOrdering FailureOrdering,
5036 unsigned SSID);
5037
5038/**
5039 * Get the number of elements in the mask of a ShuffleVector instruction.
5040 */
5041LLVM_C_ABI unsigned LLVMGetNumMaskElements(LLVMValueRef ShuffleVectorInst);
5042
5043/**
5044 * \returns a constant that specifies that the result of a \c ShuffleVectorInst
5045 * is undefined.
5046 */
5048
5049/**
5050 * Get the mask value at position Elt in the mask of a ShuffleVector
5051 * instruction.
5052 *
5053 * \Returns the result of \c LLVMGetUndefMaskElem() if the mask value is
5054 * poison at that position.
5055 */
5056LLVM_C_ABI int LLVMGetMaskValue(LLVMValueRef ShuffleVectorInst, unsigned Elt);
5057
5061
5062/**
5063 * Returns whether an instruction is an atomic instruction, e.g., atomicrmw,
5064 * cmpxchg, fence, or loads and stores with atomic ordering.
5065 */
5067
5068/**
5069 * Returns the synchronization scope ID of an atomic instruction.
5070 */
5072
5073/**
5074 * Sets the synchronization scope ID of an atomic instruction.
5075 */
5077 unsigned SSID);
5078
5082 LLVMAtomicOrdering Ordering);
5086 LLVMAtomicOrdering Ordering);
5087
5088/**
5089 * @}
5090 */
5091
5092/**
5093 * @defgroup LLVMCCoreModuleProvider Module Providers
5094 *
5095 * @{
5096 */
5097
5098/**
5099 * Changes the type of M so it can be passed to FunctionPassManagers and the
5100 * JIT. They take ModuleProviders for historical reasons.
5101 */
5104
5105/**
5106 * Destroys the module M.
5107 */
5109
5110/**
5111 * @}
5112 */
5113
5114/**
5115 * @defgroup LLVMCCoreMemoryBuffers Memory Buffers
5116 *
5117 * @{
5118 */
5119
5121 const char *Path, LLVMMemoryBufferRef *OutMemBuf, char **OutMessage);
5123 LLVMMemoryBufferRef *OutMemBuf, char **OutMessage);
5125 const char *InputData, size_t InputDataLength, const char *BufferName,
5126 LLVMBool RequiresNullTerminator);
5128 const char *InputData, size_t InputDataLength, const char *BufferName);
5132
5133/**
5134 * @}
5135 */
5136
5137/**
5138 * @defgroup LLVMCCorePassManagers Pass Managers
5139 * @ingroup LLVMCCore
5140 *
5141 * @{
5142 */
5143
5144/** Constructs a new whole-module pass pipeline. This type of pipeline is
5145 suitable for link-time optimization and whole-module transformations.
5146 @see llvm::PassManager::PassManager */
5148
5149/** Constructs a new function-by-function pass pipeline over the module
5150 provider. It does not take ownership of the module provider. This type of
5151 pipeline is suitable for code generation and JIT compilation tasks.
5152 @see llvm::FunctionPassManager::FunctionPassManager */
5155
5156/** Deprecated: Use LLVMCreateFunctionPassManagerForModule instead. */
5159
5160/** Initializes, executes on the provided module, and finalizes all of the
5161 passes scheduled in the pass manager. Returns 1 if any of the passes
5162 modified the module, 0 otherwise.
5163 @see llvm::PassManager::run(Module&) */
5165
5166/** Initializes all of the function passes scheduled in the function pass
5167 manager. Returns 1 if any of the passes modified the module, 0 otherwise.
5168 @see llvm::FunctionPassManager::doInitialization */
5170
5171/** Executes all of the function passes scheduled in the function pass manager
5172 on the provided function. Returns 1 if any of the passes modified the
5173 function, false otherwise.
5174 @see llvm::FunctionPassManager::run(Function&) */
5176 LLVMValueRef F);
5177
5178/** Finalizes all of the function passes scheduled in the function pass
5179 manager. Returns 1 if any of the passes modified the module, 0 otherwise.
5180 @see llvm::FunctionPassManager::doFinalization */
5182
5183/** Frees the memory of a pass pipeline. For function pipelines, does not free
5184 the module provider.
5185 @see llvm::PassManagerBase::~PassManagerBase. */
5187
5188/**
5189 * @}
5190 */
5191
5192/**
5193 * @defgroup LLVMCCoreThreading Threading
5194 *
5195 * Handle the structures needed to make LLVM safe for multithreading.
5196 *
5197 * @{
5198 */
5199
5200/** Deprecated: Multi-threading can only be enabled/disabled with the compile
5201 time define LLVM_ENABLE_THREADS. This function always returns
5202 LLVMIsMultithreaded(). */
5204
5205/** Deprecated: Multi-threading can only be enabled/disabled with the compile
5206 time define LLVM_ENABLE_THREADS. */
5208
5209/** Check whether LLVM is executing in thread-safe mode or not.
5210 @see llvm::llvm_is_multithreaded */
5212
5213/**
5214 * @}
5215 */
5216
5217/**
5218 * @}
5219 */
5220
5221/**
5222 * @}
5223 */
5224
5226
5227#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
LLVMTypeRef LLVMFP128Type(void)
Definition Core.cpp:755
LLVMValueRef LLVMGetElementAsConstant(LLVMValueRef C, unsigned idx)
Definition Core.cpp:1643
LLVMTypeRef LLVMInt64Type(void)
Definition Core.cpp:699
LLVMValueRef LLVMConstStruct(LLVMValueRef *ConstantVals, unsigned Count, LLVMBool Packed)
Definition Core.cpp:1690
LLVMBasicBlockRef LLVMAppendBasicBlock(LLVMValueRef FnRef, const char *Name)
Definition Core.cpp:2898
LLVMTypeRef LLVMVoidType(void)
Definition Core.cpp:958
LLVMValueRef LLVMMDString(const char *Str, unsigned SLen)
Definition Core.cpp:1302
LLVMTypeRef LLVMBFloatType(void)
Definition Core.cpp:743
LLVMTypeRef LLVMInt32Type(void)
Definition Core.cpp:696
LLVMTypeRef LLVMHalfType(void)
Definition Core.cpp:740
LLVMTypeRef LLVMIntType(unsigned NumBits)
Definition Core.cpp:705
LLVMTypeRef LLVMX86AMXType(void)
Definition Core.cpp:761
LLVMTypeRef LLVMStructType(LLVMTypeRef *ElementTypes, unsigned ElementCount, LLVMBool Packed)
Definition Core.cpp:800
LLVMModuleRef LLVMModuleCreateWithName(const char *ModuleID)
Definition Core.cpp:280
LLVMTypeRef LLVMX86FP80Type(void)
Definition Core.cpp:752
LLVMBasicBlockRef LLVMInsertBasicBlock(LLVMBasicBlockRef BBRef, const char *Name)
Definition Core.cpp:2909
LLVMValueRef LLVMBuildNUWNeg(LLVMBuilderRef B, LLVMValueRef V, const char *Name)
Definition Core.cpp:3836
LLVMTypeRef LLVMPPCFP128Type(void)
Definition Core.cpp:758
LLVMTypeRef LLVMFloatType(void)
Definition Core.cpp:746
LLVMTypeRef LLVMLabelType(void)
Definition Core.cpp:961
LLVMValueRef LLVMConstString(const char *Str, unsigned Length, LLVMBool DontNullTerminate)
Definition Core.cpp:1633
unsigned LLVMGetMDKindID(const char *Name, unsigned SLen)
Definition Core.cpp:152
LLVMTypeRef LLVMInt8Type(void)
Definition Core.cpp:690
LLVMTypeRef LLVMDoubleType(void)
Definition Core.cpp:749
LLVMTypeRef LLVMInt1Type(void)
Definition Core.cpp:687
LLVMBuilderRef LLVMCreateBuilder(void)
Definition Core.cpp:3346
LLVMTypeRef LLVMInt128Type(void)
Definition Core.cpp:702
LLVMValueRef LLVMConstNUWNeg(LLVMValueRef ConstantVal)
Definition Core.cpp:1789
LLVMTypeRef LLVMInt16Type(void)
Definition Core.cpp:693
LLVMValueRef LLVMMDNode(LLVMValueRef *Vals, unsigned Count)
Definition Core.cpp:1333
LLVMContextRef LLVMGetGlobalContext()
Definition Core.cpp:108
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:856
LLVM_C_ABI LLVMBool LLVMIsEnumAttribute(LLVMAttributeRef A)
Check for the different types of attributes.
Definition Core.cpp:233
LLVM_C_ABI LLVMTypeRef LLVMGetTypeAttributeValue(LLVMAttributeRef A)
Get the type attribute's value.
Definition Core.cpp:193
LLVM_C_ABI void LLVMContextSetDiagnosticHandler(LLVMContextRef C, LLVMDiagnosticHandler Handler, void *DiagnosticContext)
Set the diagnostic handler for this context.
Definition Core.cpp:110
LLVM_C_ABI const char * LLVMGetStringAttributeValue(LLVMAttributeRef A, unsigned *Length)
Get the string attribute's value.
Definition Core.cpp:226
LLVM_C_ABI uint64_t LLVMGetEnumAttributeValue(LLVMAttributeRef A)
Get the enum attribute's value.
Definition Core.cpp:179
LLVM_C_ABI LLVMBool LLVMIsStringAttribute(LLVMAttributeRef A)
Definition Core.cpp:238
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:198
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:160
LLVM_C_ABI LLVMDiagnosticHandler LLVMContextGetDiagnosticHandler(LLVMContextRef C)
Get the diagnostic handler of this context.
Definition Core.cpp:119
LLVM_C_ABI void LLVMContextSetYieldCallback(LLVMContextRef C, LLVMYieldCallback Callback, void *OpaqueHandle)
Set the yield callback function for this context.
Definition Core.cpp:128
LLVM_C_ABI char * LLVMGetDiagInfoDescription(LLVMDiagnosticInfoRef DI)
Return a string representation of the DiagnosticInfo.
Definition Core.cpp:246
LLVM_C_ABI LLVMAttributeRef LLVMCreateStringAttribute(LLVMContextRef C, const char *K, unsigned KLength, const char *V, unsigned VLength)
Create a string attribute.
Definition Core.cpp:212
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:156
LLVM_C_ABI void LLVMContextSetDiscardValueNames(LLVMContextRef C, LLVMBool Discard)
Set whether the given context discards all value names.
Definition Core.cpp:139
LLVM_C_ABI unsigned LLVMGetMDKindIDInContext(LLVMContextRef C, const char *Name, unsigned SLen)
Definition Core.cpp:147
LLVM_C_ABI unsigned LLVMGetEnumAttributeKind(LLVMAttributeRef A)
Get the unique id corresponding to the enum attribute passed as argument.
Definition Core.cpp:175
LLVM_C_ABI void * LLVMContextGetDiagnosticContext(LLVMContextRef C)
Get the diagnostic context of this context.
Definition Core.cpp:124
LLVM_C_ABI LLVMAttributeRef LLVMCreateTypeAttribute(LLVMContextRef C, unsigned KindID, LLVMTypeRef type_ref)
Create a type attribute.
Definition Core.cpp:186
LLVM_C_ABI unsigned LLVMGetLastEnumAttributeKind(void)
Definition Core.cpp:164
LLVM_C_ABI LLVMBool LLVMContextShouldDiscardValueNames(LLVMContextRef C)
Retrieve whether the given context is set to discard all value names.
Definition Core.cpp:135
LLVM_C_ABI LLVMBool LLVMIsTypeAttribute(LLVMAttributeRef A)
Definition Core.cpp:242
LLVM_C_ABI void LLVMContextDispose(LLVMContextRef C)
Destroy a context instance.
Definition Core.cpp:143
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:168
LLVM_C_ABI const char * LLVMGetStringAttributeKind(LLVMAttributeRef A, unsigned *Length)
Get the string attribute's kind.
Definition Core.cpp:219
LLVM_C_ABI LLVMContextRef LLVMContextCreate(void)
Create a new context.
Definition Core.cpp:104
void(* LLVMDiagnosticHandler)(LLVMDiagnosticInfoRef, void *)
Definition Core.h:578
LLVM_C_ABI LLVMDiagnosticSeverity LLVMGetDiagInfoSeverity(LLVMDiagnosticInfoRef DI)
Return an enum LLVMDiagnosticSeverity.
Definition Core.cpp:257
LLVM_C_ABI LLVMValueRef LLVMBuildAggregateRet(LLVMBuilderRef, LLVMValueRef *RetVals, unsigned N)
Definition Core.cpp:3466
LLVM_C_ABI LLVMValueRef LLVMBuildMul(LLVMBuilderRef, LLVMValueRef LHS, LLVMValueRef RHS, const char *Name)
Definition Core.cpp:3730
LLVM_C_ABI LLVMValueRef LLVMBuildRetVoid(LLVMBuilderRef)
Definition Core.cpp:3458
LLVM_C_ABI LLVMValueRef LLVMBuildSub(LLVMBuilderRef, LLVMValueRef LHS, LLVMValueRef RHS, const char *Name)
Definition Core.cpp:3710
LLVM_C_ABI LLVMValueRef LLVMBuildNUWMul(LLVMBuilderRef, LLVMValueRef LHS, LLVMValueRef RHS, const char *Name)
Definition Core.cpp:3740
LLVM_C_ABI LLVMBool LLVMGetWeak(LLVMValueRef CmpXchgInst)
Definition Core.cpp:4161
LLVM_C_ABI LLVMValueRef LLVMBuildCast(LLVMBuilderRef B, LLVMOpcode Op, LLVMValueRef Val, LLVMTypeRef DestTy, const char *Name)
Definition Core.cpp:4289
LLVM_C_ABI LLVMValueRef LLVMBuildIsNull(LLVMBuilderRef, LLVMValueRef Val, const char *Name)
Definition Core.cpp:4418
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:4119
LLVM_C_ABI LLVMValueRef LLVMBuildAdd(LLVMBuilderRef, LLVMValueRef LHS, LLVMValueRef RHS, const char *Name)
Definition Core.cpp:3690
LLVM_C_ABI void LLVMSetWeak(LLVMValueRef CmpXchgInst, LLVMBool IsWeak)
Definition Core.cpp:4165
LLVM_C_ABI LLVMValueRef LLVMBuildOr(LLVMBuilderRef, LLVMValueRef LHS, LLVMValueRef RHS, const char *Name)
Definition Core.cpp:3810
LLVM_C_ABI LLVMValueRef LLVMBuildBitCast(LLVMBuilderRef, LLVMValueRef Val, LLVMTypeRef DestTy, const char *Name)
Definition Core.cpp:4261
LLVM_C_ABI LLVMValueRef LLVMBuildExactUDiv(LLVMBuilderRef, LLVMValueRef LHS, LLVMValueRef RHS, const char *Name)
Definition Core.cpp:3755
LLVM_C_ABI LLVMValueRef LLVMBuildGEP2(LLVMBuilderRef B, LLVMTypeRef Ty, LLVMValueRef Pointer, LLVMValueRef *Indices, unsigned NumIndices, const char *Name)
Definition Core.cpp:4104
LLVM_C_ABI LLVMValueRef LLVMBuildNSWSub(LLVMBuilderRef, LLVMValueRef LHS, LLVMValueRef RHS, const char *Name)
Definition Core.cpp:3715
LLVM_C_ABI void LLVMPositionBuilderBeforeInstrAndDbgRecords(LLVMBuilderRef Builder, LLVMValueRef Instr)
Set the builder position before Instr and any attached debug records.
Definition Core.cpp:3375
LLVM_C_ABI LLVMValueRef LLVMBuildIsNotNull(LLVMBuilderRef, LLVMValueRef Val, const char *Name)
Definition Core.cpp:4423
LLVM_C_ABI void LLVMDisposeBuilder(LLVMBuilderRef Builder)
Definition Core.cpp:3403
LLVM_C_ABI void LLVMClearInsertionPosition(LLVMBuilderRef Builder)
Definition Core.cpp:3390
LLVM_C_ABI LLVMValueRef LLVMBuildLandingPad(LLVMBuilderRef B, LLVMTypeRef Ty, LLVMValueRef PersFn, unsigned NumClauses, const char *Name)
Definition Core.cpp:3532
LLVM_C_ABI void LLVMSetIsDisjoint(LLVMValueRef Inst, LLVMBool IsDisjoint)
Sets the disjoint flag for the instruction.
Definition Core.cpp:3913
LLVM_C_ABI LLVMBool LLVMIsAtomicSingleThread(LLVMValueRef AtomicInst)
Definition Core.cpp:4499
LLVM_C_ABI LLVMValueRef LLVMBuildResume(LLVMBuilderRef B, LLVMValueRef Exn)
Definition Core.cpp:3562
LLVM_C_ABI void LLVMSetAtomicRMWBinOp(LLVMValueRef AtomicRMWInst, LLVMAtomicRMWBinOp BinOp)
Definition Core.cpp:4200
LLVM_C_ABI LLVMValueRef LLVMBuildFDiv(LLVMBuilderRef, LLVMValueRef LHS, LLVMValueRef RHS, const char *Name)
Definition Core.cpp:3770
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:3518
LLVM_C_ABI LLVMValueRef LLVMBuildXor(LLVMBuilderRef, LLVMValueRef LHS, LLVMValueRef RHS, const char *Name)
Definition Core.cpp:3815
LLVM_C_ABI LLVMBool LLVMGetExact(LLVMValueRef DivOrShrInst)
Definition Core.cpp:3872
LLVM_C_ABI LLVMValueRef LLVMBuildAddrSpaceCast(LLVMBuilderRef, LLVMValueRef Val, LLVMTypeRef DestTy, const char *Name)
Definition Core.cpp:4266
LLVM_C_ABI unsigned LLVMGetNumMaskElements(LLVMValueRef ShuffleVectorInst)
Get the number of elements in the mask of a ShuffleVector instruction.
Definition Core.cpp:4481
LLVM_C_ABI void LLVMInsertIntoBuilder(LLVMBuilderRef Builder, LLVMValueRef Instr)
Definition Core.cpp:3394
LLVM_C_ABI LLVMValueRef LLVMBuildCleanupRet(LLVMBuilderRef B, LLVMValueRef CatchPad, LLVMBasicBlockRef BB)
Definition Core.cpp:3583
LLVM_C_ABI LLVMValueRef LLVMBuildFPToSI(LLVMBuilderRef, LLVMValueRef Val, LLVMTypeRef DestTy, const char *Name)
Definition Core.cpp:4226
LLVM_C_ABI void LLVMGetHandlers(LLVMValueRef CatchSwitch, LLVMBasicBlockRef *Handlers)
Obtain the basic blocks acting as handlers for a catchswitch instruction.
Definition Core.cpp:3630
LLVM_C_ABI LLVMValueRef LLVMBuildTrunc(LLVMBuilderRef, LLVMValueRef Val, LLVMTypeRef DestTy, const char *Name)
Definition Core.cpp:4206
LLVM_C_ABI LLVMValueRef LLVMGetArgOperand(LLVMValueRef Funclet, unsigned i)
Definition Core.cpp:3647
LLVM_C_ABI LLVMValueRef LLVMBuildAnd(LLVMBuilderRef, LLVMValueRef LHS, LLVMValueRef RHS, const char *Name)
Definition Core.cpp:3805
LLVM_C_ABI unsigned LLVMGetNumHandlers(LLVMValueRef CatchSwitch)
Definition Core.cpp:3626
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:3490
LLVM_C_ABI LLVMBasicBlockRef LLVMGetInsertBlock(LLVMBuilderRef Builder)
Definition Core.cpp:3386
LLVM_C_ABI LLVMValueRef LLVMBuildSDiv(LLVMBuilderRef, LLVMValueRef LHS, LLVMValueRef RHS, const char *Name)
Definition Core.cpp:3760
LLVM_C_ABI LLVMValueRef LLVMBuildSExtOrBitCast(LLVMBuilderRef, LLVMValueRef Val, LLVMTypeRef DestTy, const char *Name)
Definition Core.cpp:4277
LLVM_C_ABI LLVMValueRef LLVMBuildCall2(LLVMBuilderRef, LLVMTypeRef, LLVMValueRef Fn, LLVMValueRef *Args, unsigned NumArgs, const char *Name)
Definition Core.cpp:4346
LLVM_C_ABI void LLVMSetNSW(LLVMValueRef ArithInst, LLVMBool HasNSW)
Definition Core.cpp:3867
LLVM_C_ABI LLVMMetadataRef LLVMGetCurrentDebugLocation2(LLVMBuilderRef Builder)
Get location information used by debugging information.
Definition Core.cpp:3409
LLVM_C_ABI LLVMValueRef LLVMBuildUDiv(LLVMBuilderRef, LLVMValueRef LHS, LLVMValueRef RHS, const char *Name)
Definition Core.cpp:3750
LLVM_C_ABI LLVMValueRef LLVMBuildSelect(LLVMBuilderRef, LLVMValueRef If, LLVMValueRef Then, LLVMValueRef Else, const char *Name)
Definition Core.cpp:4369
LLVM_C_ABI void LLVMPositionBuilderBefore(LLVMBuilderRef Builder, LLVMValueRef Instr)
Set the builder position before Instr but after any attached debug records.
Definition Core.cpp:3370
LLVM_C_ABI LLVMBool LLVMCanValueUseFastMathFlags(LLVMValueRef Inst)
Check if a given value can potentially have fast math flags.
Definition Core.cpp:3903
LLVM_C_ABI void LLVMSetArgOperand(LLVMValueRef Funclet, unsigned i, LLVMValueRef value)
Definition Core.cpp:3651
LLVM_C_ABI LLVMValueRef LLVMBuildCondBr(LLVMBuilderRef, LLVMValueRef If, LLVMBasicBlockRef Then, LLVMBasicBlockRef Else)
Definition Core.cpp:3475
LLVM_C_ABI LLVMBool LLVMGetNUW(LLVMValueRef ArithInst)
Definition Core.cpp:3852
LLVM_C_ABI LLVMOpcode LLVMGetCastOpcode(LLVMValueRef Src, LLVMBool SrcIsSigned, LLVMTypeRef DestTy, LLVMBool DestIsSigned)
Definition Core.cpp:4318
LLVM_C_ABI void LLVMInsertIntoBuilderWithName(LLVMBuilderRef Builder, LLVMValueRef Instr, const char *Name)
Definition Core.cpp:3398
LLVM_C_ABI LLVMValueRef LLVMBuildSRem(LLVMBuilderRef, LLVMValueRef LHS, LLVMValueRef RHS, const char *Name)
Definition Core.cpp:3780
LLVM_C_ABI LLVMValueRef LLVMBuildCleanupPad(LLVMBuilderRef B, LLVMValueRef ParentPad, LLVMValueRef *Args, unsigned NumArgs, const char *Name)
Definition Core.cpp:3551
LLVM_C_ABI LLVMValueRef LLVMBuildIntCast(LLVMBuilderRef, LLVMValueRef Val, LLVMTypeRef DestTy, const char *Name)
Deprecated: This cast is always signed.
Definition Core.cpp:4307
LLVM_C_ABI LLVMValueRef LLVMGetCurrentDebugLocation(LLVMBuilderRef Builder)
Deprecated: Returning the NULL location will crash.
Definition Core.cpp:3426
LLVM_C_ABI LLVMValueRef LLVMBuildExtractElement(LLVMBuilderRef, LLVMValueRef VecVal, LLVMValueRef Index, const char *Name)
Definition Core.cpp:4381
LLVM_C_ABI LLVMValueRef LLVMBuildShl(LLVMBuilderRef, LLVMValueRef LHS, LLVMValueRef RHS, const char *Name)
Definition Core.cpp:3790
LLVM_C_ABI LLVMBuilderRef LLVMCreateBuilderInContext(LLVMContextRef C)
Definition Core.cpp:3342
LLVM_C_ABI LLVMValueRef LLVMBuildCatchRet(LLVMBuilderRef B, LLVMValueRef CatchPad, LLVMBasicBlockRef BB)
Definition Core.cpp:3577
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:3954
LLVM_C_ABI LLVMAtomicOrdering LLVMGetOrdering(LLVMValueRef MemoryAccessInst)
Definition Core.cpp:4169
LLVM_C_ABI LLVMValueRef LLVMBuildStructGEP2(LLVMBuilderRef B, LLVMTypeRef Ty, LLVMValueRef Pointer, unsigned Idx, const char *Name)
Definition Core.cpp:4129
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:4487
LLVM_C_ABI void LLVMAddCase(LLVMValueRef Switch, LLVMValueRef OnVal, LLVMBasicBlockRef Dest)
Definition Core.cpp:3593
LLVM_C_ABI LLVMValueRef LLVMBuildBr(LLVMBuilderRef, LLVMBasicBlockRef Dest)
Definition Core.cpp:3471
LLVM_C_ABI LLVMValueRef LLVMBuildInsertElement(LLVMBuilderRef, LLVMValueRef VecVal, LLVMValueRef EltVal, LLVMValueRef Index, const char *Name)
Definition Core.cpp:4387
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:3363
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:3898
LLVM_C_ABI LLVMValueRef LLVMBuildIntCast2(LLVMBuilderRef, LLVMValueRef Val, LLVMTypeRef DestTy, LLVMBool IsSigned, const char *Name)
Definition Core.cpp:4300
LLVM_C_ABI LLVMValueRef LLVMBuildNUWSub(LLVMBuilderRef, LLVMValueRef LHS, LLVMValueRef RHS, const char *Name)
Definition Core.cpp:3720
LLVM_C_ABI LLVMValueRef LLVMBuildFAdd(LLVMBuilderRef, LLVMValueRef LHS, LLVMValueRef RHS, const char *Name)
Definition Core.cpp:3705
LLVM_C_ABI LLVMValueRef LLVMBuildCatchPad(LLVMBuilderRef B, LLVMValueRef ParentPad, LLVMValueRef *Args, unsigned NumArgs, const char *Name)
Definition Core.cpp:3544
LLVM_C_ABI LLVMValueRef LLVMBuildCallWithOperandBundles(LLVMBuilderRef, LLVMTypeRef, LLVMValueRef Fn, LLVMValueRef *Args, unsigned NumArgs, LLVMOperandBundleRef *Bundles, unsigned NumBundles, const char *Name)
Definition Core.cpp:4355
LLVM_C_ABI LLVMBool LLVMIsCleanup(LLVMValueRef LandingPad)
Definition Core.cpp:3614
LLVM_C_ABI LLVMValueRef LLVMBuildZExtOrBitCast(LLVMBuilderRef, LLVMValueRef Val, LLVMTypeRef DestTy, const char *Name)
Definition Core.cpp:4271
LLVM_C_ABI LLVMBool LLVMGetVolatile(LLVMValueRef Inst)
Definition Core.cpp:4146
LLVM_C_ABI LLVMValueRef LLVMBuildFPCast(LLVMBuilderRef, LLVMValueRef Val, LLVMTypeRef DestTy, const char *Name)
Definition Core.cpp:4313
LLVM_C_ABI LLVMValueRef LLVMBuildPtrToInt(LLVMBuilderRef, LLVMValueRef Val, LLVMTypeRef DestTy, const char *Name)
Definition Core.cpp:4251
LLVM_C_ABI LLVMValueRef LLVMBuildPtrDiff2(LLVMBuilderRef, LLVMTypeRef ElemTy, LLVMValueRef LHS, LLVMValueRef RHS, const char *Name)
Definition Core.cpp:4428
LLVM_C_ABI LLVMValueRef LLVMBuildTruncOrBitCast(LLVMBuilderRef, LLVMValueRef Val, LLVMTypeRef DestTy, const char *Name)
Definition Core.cpp:4283
LLVM_C_ABI LLVMValueRef LLVMBuildArrayAlloca(LLVMBuilderRef, LLVMTypeRef Ty, LLVMValueRef Val, const char *Name)
Definition Core.cpp:3968
LLVM_C_ABI LLVMValueRef LLVMGetClause(LLVMValueRef LandingPad, unsigned Idx)
Definition Core.cpp:3606
LLVM_C_ABI unsigned LLVMGetAtomicSyncScopeID(LLVMValueRef AtomicInst)
Returns the synchronization scope ID of an atomic instruction.
Definition Core.cpp:4518
LLVM_C_ABI LLVMValueRef LLVMBuildVAArg(LLVMBuilderRef, LLVMValueRef List, LLVMTypeRef Ty, const char *Name)
Definition Core.cpp:4376
LLVM_C_ABI LLVMValueRef LLVMBuildAtomicCmpXchgSyncScope(LLVMBuilderRef B, LLVMValueRef Ptr, LLVMValueRef Cmp, LLVMValueRef New, LLVMAtomicOrdering SuccessOrdering, LLVMAtomicOrdering FailureOrdering, unsigned SSID)
Definition Core.cpp:4470
LLVM_C_ABI LLVMValueRef LLVMBuildBinOp(LLVMBuilderRef B, LLVMOpcode Op, LLVMValueRef LHS, LLVMValueRef RHS, const char *Name)
Definition Core.cpp:3820
LLVM_C_ABI LLVMBool LLVMIsAtomic(LLVMValueRef Inst)
Returns whether an instruction is an atomic instruction, e.g., atomicrmw, cmpxchg,...
Definition Core.cpp:4495
LLVM_C_ABI void LLVMSetVolatile(LLVMValueRef MemoryAccessInst, LLVMBool IsVolatile)
Definition Core.cpp:4150
LLVM_C_ABI void LLVMSetAtomicSingleThread(LLVMValueRef AtomicInst, LLVMBool SingleThread)
Definition Core.cpp:4508
LLVM_C_ABI LLVMValueRef LLVMBuildFRem(LLVMBuilderRef, LLVMValueRef LHS, LLVMValueRef RHS, const char *Name)
Definition Core.cpp:3785
LLVM_C_ABI LLVMValueRef LLVMBuildURem(LLVMBuilderRef, LLVMValueRef LHS, LLVMValueRef RHS, const char *Name)
Definition Core.cpp:3775
LLVM_C_ABI LLVMValueRef LLVMBuildIntToPtr(LLVMBuilderRef, LLVMValueRef Val, LLVMTypeRef DestTy, const char *Name)
Definition Core.cpp:4256
LLVM_C_ABI LLVMBool LLVMGetNSW(LLVMValueRef ArithInst)
Definition Core.cpp:3862
LLVM_C_ABI LLVMValueRef LLVMBuildNSWMul(LLVMBuilderRef, LLVMValueRef LHS, LLVMValueRef RHS, const char *Name)
Definition Core.cpp:3735
LLVM_C_ABI LLVMValueRef LLVMBuildFree(LLVMBuilderRef, LLVMValueRef PointerVal)
Definition Core.cpp:3973
LLVM_C_ABI LLVMValueRef LLVMBuildNeg(LLVMBuilderRef, LLVMValueRef V, const char *Name)
Definition Core.cpp:3827
LLVM_C_ABI LLVMValueRef LLVMBuildFSub(LLVMBuilderRef, LLVMValueRef LHS, LLVMValueRef RHS, const char *Name)
Definition Core.cpp:3725
LLVM_C_ABI LLVMValueRef LLVMBuildCatchSwitch(LLVMBuilderRef B, LLVMValueRef ParentPad, LLVMBasicBlockRef UnwindBB, unsigned NumHandlers, const char *Name)
Definition Core.cpp:3566
LLVM_C_ABI LLVMValueRef LLVMBuildLoad2(LLVMBuilderRef, LLVMTypeRef Ty, LLVMValueRef PointerVal, const char *Name)
Definition Core.cpp:3977
LLVM_C_ABI LLVMValueRef LLVMBuildInBoundsGEP2(LLVMBuilderRef B, LLVMTypeRef Ty, LLVMValueRef Pointer, LLVMValueRef *Indices, unsigned NumIndices, const char *Name)
Definition Core.cpp:4111
LLVM_C_ABI LLVMValueRef LLVMBuildArrayMalloc(LLVMBuilderRef, LLVMTypeRef Ty, LLVMValueRef Val, const char *Name)
Definition Core.cpp:3929
LLVM_C_ABI LLVMValueRef LLVMBuildAtomicCmpXchg(LLVMBuilderRef B, LLVMValueRef Ptr, LLVMValueRef Cmp, LLVMValueRef New, LLVMAtomicOrdering SuccessOrdering, LLVMAtomicOrdering FailureOrdering, LLVMBool SingleThread)
Definition Core.cpp:4457
LLVM_C_ABI LLVMValueRef LLVMBuildIndirectBr(LLVMBuilderRef B, LLVMValueRef Addr, unsigned NumDests)
Definition Core.cpp:3485
LLVM_C_ABI LLVMValueRef LLVMBuildUnreachable(LLVMBuilderRef)
Definition Core.cpp:3589
LLVM_C_ABI LLVMValueRef LLVMBuildSIToFP(LLVMBuilderRef, LLVMValueRef Val, LLVMTypeRef DestTy, const char *Name)
Definition Core.cpp:4236
LLVM_C_ABI LLVMValueRef LLVMBuildSExt(LLVMBuilderRef, LLVMValueRef Val, LLVMTypeRef DestTy, const char *Name)
Definition Core.cpp:4216
LLVM_C_ABI LLVMValueRef LLVMBuildFPToUI(LLVMBuilderRef, LLVMValueRef Val, LLVMTypeRef DestTy, const char *Name)
Definition Core.cpp:4221
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:3432
LLVM_C_ABI void LLVMSetCurrentDebugLocation2(LLVMBuilderRef Builder, LLVMMetadataRef Loc)
Set location information used by debugging information.
Definition Core.cpp:3413
LLVM_C_ABI LLVMValueRef LLVMBuildAlloca(LLVMBuilderRef, LLVMTypeRef Ty, const char *Name)
Definition Core.cpp:3963
LLVM_C_ABI void LLVMSetCurrentDebugLocation(LLVMBuilderRef Builder, LLVMValueRef L)
Deprecated: Passing the NULL location will crash.
Definition Core.cpp:3420
LLVM_C_ABI LLVMValueRef LLVMBuildPhi(LLVMBuilderRef, LLVMTypeRef Ty, const char *Name)
Definition Core.cpp:4342
LLVM_C_ABI void LLVMAddDestination(LLVMValueRef IndirectBr, LLVMBasicBlockRef Dest)
Definition Core.cpp:3598
LLVM_C_ABI LLVMBool LLVMGetNNeg(LLVMValueRef NonNegInst)
Gets if the instruction has the non-negative flag set.
Definition Core.cpp:3882
LLVM_C_ABI LLVMValueRef LLVMBuildAtomicRMWSyncScope(LLVMBuilderRef B, LLVMAtomicRMWBinOp op, LLVMValueRef PTR, LLVMValueRef Val, LLVMAtomicOrdering ordering, unsigned SSID)
Definition Core.cpp:4446
LLVM_C_ABI LLVMValueRef LLVMBuildRet(LLVMBuilderRef, LLVMValueRef V)
Definition Core.cpp:3462
LLVM_C_ABI LLVMMetadataRef LLVMBuilderGetDefaultFPMathTag(LLVMBuilderRef Builder)
Get the dafult floating-point math metadata for a given builder.
Definition Core.cpp:3452
LLVM_C_ABI LLVMValueRef LLVMBuildExtractValue(LLVMBuilderRef, LLVMValueRef AggVal, unsigned Index, const char *Name)
Definition Core.cpp:4401
LLVM_C_ABI LLVMValueRef LLVMBuildGlobalStringPtr(LLVMBuilderRef B, const char *Str, const char *Name)
Deprecated: Use LLVMBuildGlobalString instead, which has identical behavior.
Definition Core.cpp:4141
LLVM_C_ABI LLVMValueRef LLVMBuildNSWAdd(LLVMBuilderRef, LLVMValueRef LHS, LLVMValueRef RHS, const char *Name)
Definition Core.cpp:3695
LLVM_C_ABI void LLVMPositionBuilderAtEnd(LLVMBuilderRef Builder, LLVMBasicBlockRef Block)
Definition Core.cpp:3381
LLVM_C_ABI LLVMValueRef LLVMBuildFMul(LLVMBuilderRef, LLVMValueRef LHS, LLVMValueRef RHS, const char *Name)
Definition Core.cpp:3745
LLVM_C_ABI LLVMValueRef LLVMBuildLShr(LLVMBuilderRef, LLVMValueRef LHS, LLVMValueRef RHS, const char *Name)
Definition Core.cpp:3795
LLVM_C_ABI LLVMAtomicRMWBinOp LLVMGetAtomicRMWBinOp(LLVMValueRef AtomicRMWInst)
Definition Core.cpp:4196
LLVM_C_ABI LLVMValueRef LLVMBuildFNeg(LLVMBuilderRef, LLVMValueRef V, const char *Name)
Definition Core.cpp:3844
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:3938
LLVM_C_ABI void LLVMSetAtomicSyncScopeID(LLVMValueRef AtomicInst, unsigned SSID)
Sets the synchronization scope ID of an atomic instruction.
Definition Core.cpp:4524
LLVM_C_ABI LLVMContextRef LLVMGetBuilderContext(LLVMBuilderRef Builder)
Obtain the context to which this builder is associated.
Definition Core.cpp:3448
LLVM_C_ABI LLVMValueRef LLVMBuildMalloc(LLVMBuilderRef, LLVMTypeRef Ty, const char *Name)
Definition Core.cpp:3920
LLVM_C_ABI LLVMValueRef LLVMBuildFreeze(LLVMBuilderRef, LLVMValueRef Val, const char *Name)
Definition Core.cpp:4413
LLVM_C_ABI LLVMValueRef LLVMBuildGlobalString(LLVMBuilderRef B, const char *Str, const char *Name)
Definition Core.cpp:4136
LLVM_C_ABI void LLVMSetNUW(LLVMValueRef ArithInst, LLVMBool HasNUW)
Definition Core.cpp:3857
LLVM_C_ABI LLVMAtomicOrdering LLVMGetCmpXchgSuccessOrdering(LLVMValueRef CmpXchgInst)
Definition Core.cpp:4530
LLVM_C_ABI LLVMValueRef LLVMBuildFCmp(LLVMBuilderRef, LLVMRealPredicate Op, LLVMValueRef LHS, LLVMValueRef RHS, const char *Name)
Definition Core.cpp:4333
LLVM_C_ABI LLVMValueRef LLVMBuildPointerCast(LLVMBuilderRef, LLVMValueRef Val, LLVMTypeRef DestTy, const char *Name)
Definition Core.cpp:4295
LLVM_C_ABI LLVMValueRef LLVMBuildExactSDiv(LLVMBuilderRef, LLVMValueRef LHS, LLVMValueRef RHS, const char *Name)
Definition Core.cpp:3765
LLVM_C_ABI LLVMValueRef LLVMBuildShuffleVector(LLVMBuilderRef, LLVMValueRef V1, LLVMValueRef V2, LLVMValueRef Mask, const char *Name)
Definition Core.cpp:4394
LLVM_C_ABI LLVMValueRef LLVMBuildFPExt(LLVMBuilderRef, LLVMValueRef Val, LLVMTypeRef DestTy, const char *Name)
Definition Core.cpp:4246
LLVM_C_ABI void LLVMSetCleanup(LLVMValueRef LandingPad, LLVMBool Val)
Definition Core.cpp:3618
LLVM_C_ABI LLVMValueRef LLVMBuildICmp(LLVMBuilderRef, LLVMIntPredicate Op, LLVMValueRef LHS, LLVMValueRef RHS, const char *Name)
Definition Core.cpp:4326
LLVM_C_ABI void LLVMSetCmpXchgFailureOrdering(LLVMValueRef CmpXchgInst, LLVMAtomicOrdering Ordering)
Definition Core.cpp:4548
LLVM_C_ABI void LLVMAddClause(LLVMValueRef LandingPad, LLVMValueRef ClauseVal)
Definition Core.cpp:3610
LLVM_C_ABI LLVMValueRef LLVMBuildFence(LLVMBuilderRef B, LLVMAtomicOrdering ordering, LLVMBool singleThread, const char *Name)
Definition Core.cpp:4088
LLVM_C_ABI void LLVMSetParentCatchSwitch(LLVMValueRef CatchPad, LLVMValueRef CatchSwitch)
Set the parent catchswitch instruction of a catchpad instruction.
Definition Core.cpp:3640
LLVM_C_ABI LLVMValueRef LLVMBuildFenceSyncScope(LLVMBuilderRef B, LLVMAtomicOrdering ordering, unsigned SSID, const char *Name)
Definition Core.cpp:4097
LLVM_C_ABI LLVMValueRef LLVMBuildUIToFP(LLVMBuilderRef, LLVMValueRef Val, LLVMTypeRef DestTy, const char *Name)
Definition Core.cpp:4231
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:3357
LLVM_C_ABI unsigned LLVMGetNumClauses(LLVMValueRef LandingPad)
Definition Core.cpp:3602
LLVM_C_ABI int LLVMGetUndefMaskElem(void)
Definition Core.cpp:4493
LLVM_C_ABI void LLVMSetCmpXchgSuccessOrdering(LLVMValueRef CmpXchgInst, LLVMAtomicOrdering Ordering)
Definition Core.cpp:4535
LLVM_C_ABI LLVMValueRef LLVMGetParentCatchSwitch(LLVMValueRef CatchPad)
Get the parent catchswitch instruction of a catchpad instruction.
Definition Core.cpp:3636
LLVM_C_ABI LLVMFastMathFlags LLVMGetFastMathFlags(LLVMValueRef FPMathInst)
Get the flags for which fast-math-style optimizations are allowed for this value.
Definition Core.cpp:3892
LLVM_C_ABI LLVMBool LLVMGetIsDisjoint(LLVMValueRef Inst)
Gets whether the instruction has the disjoint flag set.
Definition Core.cpp:3908
LLVM_C_ABI LLVMValueRef LLVMBuildSwitch(LLVMBuilderRef, LLVMValueRef V, LLVMBasicBlockRef Else, unsigned NumCases)
Definition Core.cpp:3480
LLVM_C_ABI void LLVMSetNNeg(LLVMValueRef NonNegInst, LLVMBool IsNonNeg)
Sets the non-negative flag for the instruction.
Definition Core.cpp:3887
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:3945
LLVM_C_ABI void LLVMAddHandler(LLVMValueRef CatchSwitch, LLVMBasicBlockRef Dest)
Definition Core.cpp:3622
LLVM_C_ABI void LLVMSetExact(LLVMValueRef DivOrShrInst, LLVMBool IsExact)
Definition Core.cpp:3877
LLVM_C_ABI LLVMValueRef LLVMBuildNSWNeg(LLVMBuilderRef B, LLVMValueRef V, const char *Name)
Definition Core.cpp:3831
LLVM_C_ABI LLVMValueRef LLVMBuildAShr(LLVMBuilderRef, LLVMValueRef LHS, LLVMValueRef RHS, const char *Name)
Definition Core.cpp:3800
LLVM_C_ABI LLVMValueRef LLVMBuildInvoke2(LLVMBuilderRef, LLVMTypeRef Ty, LLVMValueRef Fn, LLVMValueRef *Args, unsigned NumArgs, LLVMBasicBlockRef Then, LLVMBasicBlockRef Catch, const char *Name)
Definition Core.cpp:3509
LLVM_C_ABI void LLVMSetOrdering(LLVMValueRef MemoryAccessInst, LLVMAtomicOrdering Ordering)
Definition Core.cpp:4183
LLVM_C_ABI LLVMValueRef LLVMBuildFPTrunc(LLVMBuilderRef, LLVMValueRef Val, LLVMTypeRef DestTy, const char *Name)
Definition Core.cpp:4241
LLVM_C_ABI LLVMValueRef LLVMBuildStore(LLVMBuilderRef, LLVMValueRef Val, LLVMValueRef Ptr)
Definition Core.cpp:3982
LLVM_C_ABI void LLVMAddMetadataToInst(LLVMBuilderRef Builder, LLVMValueRef Inst)
Adds the metadata registered with the given builder to the given instruction.
Definition Core.cpp:3436
LLVM_C_ABI LLVMAtomicOrdering LLVMGetCmpXchgFailureOrdering(LLVMValueRef CmpXchgInst)
Definition Core.cpp:4543
LLVM_C_ABI LLVMValueRef LLVMBuildNUWAdd(LLVMBuilderRef, LLVMValueRef LHS, LLVMValueRef RHS, const char *Name)
Definition Core.cpp:3700
LLVM_C_ABI LLVMValueRef LLVMBuildInsertValue(LLVMBuilderRef, LLVMValueRef AggVal, LLVMValueRef EltVal, unsigned Index, const char *Name)
Definition Core.cpp:4406
LLVM_C_ABI void LLVMBuilderSetDefaultFPMathTag(LLVMBuilderRef Builder, LLVMMetadataRef FPMathTag)
Set the default floating-point math metadata for the given builder.
Definition Core.cpp:3440
LLVM_C_ABI LLVMValueRef LLVMBuildZExt(LLVMBuilderRef, LLVMValueRef Val, LLVMTypeRef DestTy, const char *Name)
Definition Core.cpp:4211
LLVM_C_ABI LLVMValueRef LLVMBuildNot(LLVMBuilderRef, LLVMValueRef V, const char *Name)
Definition Core.cpp:3848
LLVM_C_ABI LLVMValueRef LLVMBuildAtomicRMW(LLVMBuilderRef B, LLVMAtomicRMWBinOp op, LLVMValueRef PTR, LLVMValueRef Val, LLVMAtomicOrdering ordering, LLVMBool singleThread)
Definition Core.cpp:4435
LLVM_C_ABI LLVMMemoryBufferRef LLVMCreateMemoryBufferWithMemoryRange(const char *InputData, size_t InputDataLength, const char *BufferName, LLVMBool RequiresNullTerminator)
Definition Core.cpp:4595
LLVM_C_ABI size_t LLVMGetBufferSize(LLVMMemoryBufferRef MemBuf)
Definition Core.cpp:4620
LLVM_C_ABI LLVMMemoryBufferRef LLVMCreateMemoryBufferWithMemoryRangeCopy(const char *InputData, size_t InputDataLength, const char *BufferName)
Definition Core.cpp:4606
LLVM_C_ABI const char * LLVMGetBufferStart(LLVMMemoryBufferRef MemBuf)
Definition Core.cpp:4616
LLVM_C_ABI LLVMBool LLVMCreateMemoryBufferWithContentsOfFile(const char *Path, LLVMMemoryBufferRef *OutMemBuf, char **OutMessage)
Definition Core.cpp:4570
LLVM_C_ABI LLVMBool LLVMCreateMemoryBufferWithSTDIN(LLVMMemoryBufferRef *OutMemBuf, char **OutMessage)
Definition Core.cpp:4584
LLVM_C_ABI void LLVMDisposeMemoryBuffer(LLVMMemoryBufferRef MemBuf)
Definition Core.cpp:4624
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:4559
LLVM_C_ABI void LLVMDisposeModuleProvider(LLVMModuleProviderRef M)
Destroys the module M.
Definition Core.cpp:4563
LLVM_C_ABI char * LLVMPrintModuleToString(LLVMModuleRef M)
Return a string representation of the module.
Definition Core.cpp:475
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:1404
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:2432
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:1532
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:1399
LLVM_C_ABI LLVMModuleRef LLVMModuleCreateWithNameInContext(const char *ModuleID, LLVMContextRef C)
Create a new, empty module in a specific context.
Definition Core.cpp:284
LLVM_C_ABI const char * LLVMGetTarget(LLVMModuleRef M)
Obtain the target triple for a module.
Definition Core.cpp:327
LLVM_C_ABI LLVMBool LLVMGetInlineAsmCanUnwind(LLVMValueRef InlineAsmVal)
Get if the inline asm snippet may unwind the stack.
Definition Core.cpp:573
LLVM_C_ABI const char * LLVMGetModuleInlineAsm(LLVMModuleRef M, size_t *Len)
Get inline assembly for a module.
Definition Core.cpp:498
LLVM_C_ABI LLVMBool LLVMGetInlineAsmNeedsAlignedStack(LLVMValueRef InlineAsmVal)
Get if the inline asm snippet needs an aligned stack.
Definition Core.cpp:568
LLVM_C_ABI LLVMBool LLVMGetInlineAsmHasSideEffects(LLVMValueRef InlineAsmVal)
Get if the inline asm snippet has side effects.
Definition Core.cpp:563
LLVM_C_ABI unsigned LLVMGetNamedMetadataNumOperands(LLVMModuleRef M, const char *Name)
Obtain the number of operands for named metadata in a module.
Definition Core.cpp:1435
LLVM_C_ABI void LLVMDumpModule(LLVMModuleRef M)
Dump a representation of a module to stderr.
Definition Core.cpp:448
LLVM_C_ABI void LLVMSetTarget(LLVMModuleRef M, const char *Triple)
Set the target triple for a module.
Definition Core.cpp:331
LLVM_C_ABI LLVMTypeRef LLVMGetInlineAsmFunctionType(LLVMValueRef InlineAsmVal)
Get the function type of the inline assembly snippet.
Definition Core.cpp:558
LLVM_C_ABI LLVMBool LLVMIsNewDbgInfoFormat(LLVMModuleRef M)
Soon to be deprecated.
Definition Core.cpp:438
LLVM_C_ABI LLVMContextRef LLVMGetModuleContext(LLVMModuleRef M)
Obtain the context to which this module is associated.
Definition Core.cpp:579
LLVM_C_ABI LLVMInlineAsmDialect LLVMGetInlineAsmDialect(LLVMValueRef InlineAsmVal)
Get the dialect used by the inline asm snippet.
Definition Core.cpp:542
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:490
LLVM_C_ABI LLVMValueRef LLVMGetNextFunction(LLVMValueRef Fn)
Advance a Function iterator to the next Function.
Definition Core.cpp:2453
LLVM_C_ABI const char * LLVMGetModuleIdentifier(LLVMModuleRef M, size_t *Len)
Obtain the identifier of a module.
Definition Core.cpp:293
LLVM_C_ABI const char * LLVMGetSourceFileName(LLVMModuleRef M, size_t *Len)
Obtain the module's original source file name.
Definition Core.cpp:303
LLVM_C_ABI const char * LLVMGetDataLayoutStr(LLVMModuleRef M)
Obtain the data layout for a module.
Definition Core.cpp:314
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:404
LLVM_C_ABI void LLVMSetIsNewDbgInfoFormat(LLVMModuleRef M, LLVMBool UseNewFormat)
Soon to be deprecated.
Definition Core.cpp:440
LLVM_C_ABI LLVMTypeRef LLVMGetTypeByName(LLVMModuleRef M, const char *Name)
Deprecated: Use LLVMGetTypeByName2 instead.
Definition Core.cpp:852
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:299
LLVM_C_ABI const char * LLVMGetInlineAsmAsmString(LLVMValueRef InlineAsmVal, size_t *Len)
Get the template string used for an inline assembly snippet.
Definition Core.cpp:524
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:504
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:2420
LLVM_C_ABI const char * LLVMGetInlineAsmConstraintString(LLVMValueRef InlineAsmVal, size_t *Len)
Get the raw constraint string for an inline assembly snippet.
Definition Core.cpp:533
LLVM_C_ABI LLVMNamedMDNodeRef LLVMGetNextNamedMetadata(LLVMNamedMDNodeRef NamedMDNode)
Advance a NamedMDNode iterator to the next NamedMDNode.
Definition Core.cpp:1383
LLVM_C_ABI void LLVMGetNamedMetadataOperands(LLVMModuleRef M, const char *Name, LLVMValueRef *Dest)
Obtain the named metadata operands for a module.
Definition Core.cpp:1442
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:426
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:2414
LLVM_C_ABI LLVMValueRef LLVMGetPreviousFunction(LLVMValueRef Fn)
Decrement a Function iterator to the previous Function.
Definition Core.cpp:2461
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:1462
LLVM_C_ABI void LLVMAddNamedMetadataOperand(LLVMModuleRef M, const char *Name, LLVMValueRef Val)
Add an operand to named metadata.
Definition Core.cpp:1452
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:1510
LLVM_C_ABI LLVMMetadataRef LLVMModuleFlagEntriesGetMetadata(LLVMModuleFlagEntry *Entries, unsigned Index)
Returns the metadata for a module flag entry at a specific index.
Definition Core.cpp:419
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:431
LLVM_C_ABI LLVMValueRef LLVMGetLastFunction(LLVMModuleRef M)
Obtain an iterator to the last Function in a Module.
Definition Core.cpp:2445
LLVM_C_ABI LLVMNamedMDNodeRef LLVMGetPreviousNamedMetadata(LLVMNamedMDNodeRef NamedMDNode)
Decrement a NamedMDNode iterator to the previous NamedMDNode.
Definition Core.cpp:1391
LLVM_C_ABI const char * LLVMGetNamedMetadataName(LLVMNamedMDNodeRef NamedMD, size_t *NameLen)
Retrieve the name of a NamedMDNode.
Definition Core.cpp:1409
LLVM_C_ABI LLVMValueRef LLVMGetNamedFunction(LLVMModuleRef M, const char *Name)
Obtain a Function value from a Module by its name.
Definition Core.cpp:2428
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:1486
LLVM_C_ABI void LLVMAppendModuleInlineAsm(LLVMModuleRef M, const char *Asm, size_t Len)
Append inline assembly to a module.
Definition Core.cpp:494
LLVM_C_ABI void LLVMSetDataLayout(LLVMModuleRef M, const char *DataLayoutStr)
Set the data layout for a module.
Definition Core.cpp:322
LLVM_C_ABI void LLVMDisposeModuleFlagsMetadata(LLVMModuleFlagEntry *Entries)
Destroys module flags metadata entries.
Definition Core.cpp:399
LLVM_C_ABI void LLVMDisposeModule(LLVMModuleRef M)
Destroy a module instance.
Definition Core.cpp:289
LLVM_C_ABI LLVMNamedMDNodeRef LLVMGetLastNamedMetadata(LLVMModuleRef M)
Obtain an iterator to the last NamedMDNode in a Module.
Definition Core.cpp:1375
LLVM_C_ABI void LLVMSetModuleInlineAsm2(LLVMModuleRef M, const char *Asm, size_t Len)
Set inline assembly for a module.
Definition Core.cpp:486
LLVM_C_ABI LLVMValueRef LLVMGetFirstFunction(LLVMModuleRef M)
Obtain an iterator to the first Function in a Module.
Definition Core.cpp:2437
LLVM_C_ABI LLVMNamedMDNodeRef LLVMGetFirstNamedMetadata(LLVMModuleRef M)
Obtain an iterator to the first NamedMDNode in a Module.
Definition Core.cpp:1367
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:411
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:309
LLVM_C_ABI LLVMBool LLVMPrintModuleToFile(LLVMModuleRef M, const char *Filename, char **ErrorMessage)
Print a representation of a module to a file.
Definition Core.cpp:453
LLVM_C_ABI const char * LLVMGetDataLayout(LLVMModuleRef M)
Definition Core.cpp:318
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:382
LLVM_C_ABI LLVMOperandBundleRef LLVMCreateOperandBundle(const char *Tag, size_t TagLen, LLVMValueRef *Args, unsigned NumArgs)
Create a new operand bundle.
Definition Core.cpp:2776
LLVM_C_ABI unsigned LLVMGetNumOperandBundleArgs(LLVMOperandBundleRef Bundle)
Obtain the number of operands for an operand bundle.
Definition Core.cpp:2793
LLVM_C_ABI const char * LLVMGetOperandBundleTag(LLVMOperandBundleRef Bundle, size_t *Len)
Obtain the tag of an operand bundle as a string.
Definition Core.cpp:2787
LLVM_C_ABI void LLVMDisposeOperandBundle(LLVMOperandBundleRef Bundle)
Destroy an operand bundle.
Definition Core.cpp:2783
LLVM_C_ABI LLVMValueRef LLVMGetOperandBundleArgAtIndex(LLVMOperandBundleRef Bundle, unsigned Index)
Obtain the operand for an operand bundle at the given index.
Definition Core.cpp:2797
LLVM_C_ABI LLVMPassManagerRef LLVMCreateFunctionPassManager(LLVMModuleProviderRef MP)
Deprecated: Use LLVMCreateFunctionPassManagerForModule instead.
Definition Core.cpp:4638
LLVM_C_ABI LLVMPassManagerRef LLVMCreateFunctionPassManagerForModule(LLVMModuleRef M)
Constructs a new function-by-function pass pipeline over the module provider.
Definition Core.cpp:4634
LLVM_C_ABI LLVMBool LLVMFinalizeFunctionPassManager(LLVMPassManagerRef FPM)
Finalizes all of the function passes scheduled in the function pass manager.
Definition Core.cpp:4655
LLVM_C_ABI void LLVMDisposePassManager(LLVMPassManagerRef PM)
Frees the memory of a pass pipeline.
Definition Core.cpp:4659
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:4651
LLVM_C_ABI LLVMBool LLVMInitializeFunctionPassManager(LLVMPassManagerRef FPM)
Initializes all of the function passes scheduled in the function pass manager.
Definition Core.cpp:4647
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:4643
LLVM_C_ABI LLVMPassManagerRef LLVMCreatePassManager(void)
Constructs a new whole-module pass pipeline.
Definition Core.cpp:4630
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:4669
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:4665
LLVM_C_ABI LLVMBool LLVMIsMultithreaded(void)
Check whether LLVM is executing in thread-safe mode or not.
Definition Core.cpp:4672
LLVM_C_ABI LLVMTypeRef LLVMHalfTypeInContext(LLVMContextRef C)
Obtain a 16-bit floating point type from a context.
Definition Core.cpp:715
LLVM_C_ABI LLVMTypeRef LLVMBFloatTypeInContext(LLVMContextRef C)
Obtain a 16-bit brain floating point type from a context.
Definition Core.cpp:718
LLVM_C_ABI LLVMTypeRef LLVMPPCFP128TypeInContext(LLVMContextRef C)
Obtain a 128-bit floating point type (two 64-bits) from a context.
Definition Core.cpp:733
LLVM_C_ABI LLVMTypeRef LLVMDoubleTypeInContext(LLVMContextRef C)
Obtain a 64-bit floating point type from a context.
Definition Core.cpp:724
LLVM_C_ABI LLVMTypeRef LLVMFloatTypeInContext(LLVMContextRef C)
Obtain a 32-bit floating point type from a context.
Definition Core.cpp:721
LLVM_C_ABI LLVMTypeRef LLVMFP128TypeInContext(LLVMContextRef C)
Obtain a 128-bit floating point type (112-bit mantissa) from a context.
Definition Core.cpp:730
LLVM_C_ABI LLVMTypeRef LLVMX86FP80TypeInContext(LLVMContextRef C)
Obtain a 80-bit floating point type (X87) from a context.
Definition Core.cpp:727
LLVM_C_ABI LLVMTypeRef LLVMGetReturnType(LLVMTypeRef FunctionTy)
Obtain the Type this function Type returns.
Definition Core.cpp:778
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:767
LLVM_C_ABI LLVMBool LLVMIsFunctionVarArg(LLVMTypeRef FunctionTy)
Returns whether a function type is variadic.
Definition Core.cpp:774
LLVM_C_ABI unsigned LLVMCountParamTypes(LLVMTypeRef FunctionTy)
Obtain the number of parameters this function accepts.
Definition Core.cpp:782
LLVM_C_ABI void LLVMGetParamTypes(LLVMTypeRef FunctionTy, LLVMTypeRef *Dest)
Obtain the types of a function's parameters.
Definition Core.cpp:786
LLVM_C_ABI LLVMTypeRef LLVMInt1TypeInContext(LLVMContextRef C)
Obtain an integer type from a context with specified bit width.
Definition Core.cpp:665
LLVM_C_ABI LLVMTypeRef LLVMInt8TypeInContext(LLVMContextRef C)
Definition Core.cpp:668
LLVM_C_ABI LLVMTypeRef LLVMInt32TypeInContext(LLVMContextRef C)
Definition Core.cpp:674
LLVM_C_ABI LLVMTypeRef LLVMIntTypeInContext(LLVMContextRef C, unsigned NumBits)
Definition Core.cpp:683
LLVM_C_ABI LLVMTypeRef LLVMInt64TypeInContext(LLVMContextRef C)
Definition Core.cpp:677
LLVM_C_ABI LLVMTypeRef LLVMInt16TypeInContext(LLVMContextRef C)
Definition Core.cpp:671
LLVM_C_ABI unsigned LLVMGetIntTypeWidth(LLVMTypeRef IntegerTy)
Definition Core.cpp:709
LLVM_C_ABI LLVMTypeRef LLVMInt128TypeInContext(LLVMContextRef C)
Definition Core.cpp:680
LLVM_C_ABI unsigned LLVMGetTargetExtTypeNumTypeParams(LLVMTypeRef TargetExtTy)
Obtain the number of type parameters for this target extension type.
Definition Core.cpp:981
LLVM_C_ABI LLVMTypeRef LLVMX86AMXTypeInContext(LLVMContextRef C)
Create a X86 AMX type in a context.
Definition Core.cpp:736
LLVM_C_ABI const char * LLVMGetTargetExtTypeName(LLVMTypeRef TargetExtTy)
Obtain the name for this target extension type.
Definition Core.cpp:976
LLVM_C_ABI LLVMTypeRef LLVMVoidTypeInContext(LLVMContextRef C)
Create a void type in a context.
Definition Core.cpp:945
LLVM_C_ABI LLVMTypeRef LLVMTokenTypeInContext(LLVMContextRef C)
Create a token type in a context.
Definition Core.cpp:951
LLVM_C_ABI unsigned LLVMGetTargetExtTypeNumIntParams(LLVMTypeRef TargetExtTy)
Obtain the number of int parameters for this target extension type.
Definition Core.cpp:992
LLVM_C_ABI LLVMTypeRef LLVMLabelTypeInContext(LLVMContextRef C)
Create a label type in a context.
Definition Core.cpp:948
LLVM_C_ABI LLVMTypeRef LLVMMetadataTypeInContext(LLVMContextRef C)
Create a metadata type in a context.
Definition Core.cpp:954
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:986
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:965
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:997
LLVM_C_ABI LLVMValueRef LLVMGetConstantPtrAuthAddrDiscriminator(LLVMValueRef PtrAuth)
Get the address discriminator value for the associated ConstantPtrAuth constant.
Definition Core.cpp:935
LLVM_C_ABI LLVMBool LLVMPointerTypeIsOpaque(LLVMTypeRef Ty)
Determine whether a pointer is opaque.
Definition Core.cpp:883
LLVM_C_ABI LLVMTypeRef LLVMPointerTypeInContext(LLVMContextRef C, unsigned AddressSpace)
Create an opaque pointer type in a context.
Definition Core.cpp:941
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:887
LLVM_C_ABI LLVMTypeRef LLVMGetElementType(LLVMTypeRef Ty)
Obtain the element type of an array or vector type.
Definition Core.cpp:896
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:891
LLVM_C_ABI LLVMValueRef LLVMGetConstantPtrAuthDiscriminator(LLVMValueRef PtrAuth)
Get the discriminator value for the associated ConstantPtrAuth constant.
Definition Core.cpp:931
LLVM_C_ABI uint64_t LLVMGetArrayLength2(LLVMTypeRef ArrayTy)
Obtain the length of an array type.
Definition Core.cpp:911
LLVM_C_ABI LLVMValueRef LLVMGetConstantPtrAuthKey(LLVMValueRef PtrAuth)
Get the key value for the associated ConstantPtrAuth constant.
Definition Core.cpp:927
LLVM_C_ABI unsigned LLVMGetArrayLength(LLVMTypeRef ArrayTy)
Obtain the length of an array type.
Definition Core.cpp:907
LLVM_C_ABI LLVMValueRef LLVMGetConstantPtrAuthPointer(LLVMValueRef PtrAuth)
Get the pointer value for the associated ConstantPtrAuth constant.
Definition Core.cpp:923
LLVM_C_ABI unsigned LLVMGetPointerAddressSpace(LLVMTypeRef PointerTy)
Obtain the address space of a pointer type.
Definition Core.cpp:915
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:874
LLVM_C_ABI unsigned LLVMGetVectorSize(LLVMTypeRef VectorTy)
Obtain the (possibly scalable) number of elements in a vector type.
Definition Core.cpp:919
LLVM_C_ABI LLVMTypeRef LLVMArrayType(LLVMTypeRef ElementType, unsigned ElementCount)
Create a fixed size array type that refers to a specific type.
Definition Core.cpp:870
LLVM_C_ABI void LLVMGetSubtypes(LLVMTypeRef Tp, LLVMTypeRef *Arr)
Returns type's subtypes.
Definition Core.cpp:862
LLVM_C_ABI LLVMTypeRef LLVMPointerType(LLVMTypeRef ElementType, unsigned AddressSpace)
Create a pointer type that points to a defined type.
Definition Core.cpp:878
LLVM_C_ABI unsigned LLVMGetNumContainedTypes(LLVMTypeRef Tp)
Return the number of types in the derived type.
Definition Core.cpp:903
LLVM_C_ABI LLVMTypeRef LLVMStructTypeInContext(LLVMContextRef C, LLVMTypeRef *ElementTypes, unsigned ElementCount, LLVMBool Packed)
Create a new structure type in a context.
Definition Core.cpp:794
LLVM_C_ABI void LLVMGetStructElementTypes(LLVMTypeRef StructTy, LLVMTypeRef *Dest)
Get the elements within a structure.
Definition Core.cpp:829
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:835
LLVM_C_ABI LLVMBool LLVMIsPackedStruct(LLVMTypeRef StructTy)
Determine whether a structure is packed.
Definition Core.cpp:840
LLVM_C_ABI LLVMTypeRef LLVMStructCreateNamed(LLVMContextRef C, const char *Name)
Create an empty structure in a context having a specified name.
Definition Core.cpp:806
LLVM_C_ABI void LLVMStructSetBody(LLVMTypeRef StructTy, LLVMTypeRef *ElementTypes, unsigned ElementCount, LLVMBool Packed)
Set the contents of a structure type.
Definition Core.cpp:819
LLVM_C_ABI LLVMBool LLVMIsOpaqueStruct(LLVMTypeRef StructTy)
Determine whether a structure is opaque.
Definition Core.cpp:844
LLVM_C_ABI unsigned LLVMCountStructElementTypes(LLVMTypeRef StructTy)
Get the number of elements defined inside the structure.
Definition Core.cpp:825
LLVM_C_ABI const char * LLVMGetStructName(LLVMTypeRef Ty)
Obtain the name of a structure.
Definition Core.cpp:811
LLVM_C_ABI LLVMBool LLVMIsLiteralStruct(LLVMTypeRef StructTy)
Determine whether a structure is literal.
Definition Core.cpp:848
LLVM_C_ABI void LLVMDumpType(LLVMTypeRef Val)
Dump a representation of a type to stderr.
Definition Core.cpp:645
LLVM_C_ABI LLVMBool LLVMTypeIsSized(LLVMTypeRef Ty)
Whether the type has a known size.
Definition Core.cpp:636
LLVM_C_ABI LLVMContextRef LLVMGetTypeContext(LLVMTypeRef Ty)
Obtain the context to which this type instance is associated.
Definition Core.cpp:641
LLVM_C_ABI char * LLVMPrintTypeToString(LLVMTypeRef Val)
Return a string representation of the type.
Definition Core.cpp:649
LLVM_C_ABI LLVMTypeKind LLVMGetTypeKind(LLVMTypeRef Ty)
Obtain the enumerated type of a Type instance.
Definition Core.cpp:588
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:2944
LLVM_C_ABI void LLVMMoveBasicBlockAfter(LLVMBasicBlockRef BB, LLVMBasicBlockRef MovePos)
Move a basic block to after another one.
Definition Core.cpp:2926
LLVM_C_ABI LLVMBasicBlockRef LLVMGetFirstBasicBlock(LLVMValueRef Fn)
Obtain the first basic block in a function.
Definition Core.cpp:2842
LLVM_C_ABI LLVMBasicBlockRef LLVMCreateBasicBlockInContext(LLVMContextRef C, const char *Name)
Create a new basic block without inserting it into a function.
Definition Core.cpp:2874
LLVM_C_ABI LLVMBasicBlockRef LLVMGetPreviousBasicBlock(LLVMBasicBlockRef BB)
Go backwards in a basic block iterator.
Definition Core.cpp:2866
LLVM_C_ABI LLVMBasicBlockRef LLVMGetLastBasicBlock(LLVMValueRef Fn)
Obtain the last basic block in a function.
Definition Core.cpp:2850
LLVM_C_ABI LLVMValueRef LLVMGetBasicBlockTerminator(LLVMBasicBlockRef BB)
Obtain the terminator instruction for a basic block.
Definition Core.cpp:2824
LLVM_C_ABI const char * LLVMGetBasicBlockName(LLVMBasicBlockRef BB)
Obtain the string name of a basic block.
Definition Core.cpp:2816
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:2887
LLVM_C_ABI void LLVMDeleteBasicBlock(LLVMBasicBlockRef BB)
Remove a basic block from a function and delete it.
Definition Core.cpp:2914
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:2902
LLVM_C_ABI void LLVMGetBasicBlocks(LLVMValueRef Fn, LLVMBasicBlockRef *BasicBlocks)
Obtain all of the basic blocks in a function.
Definition Core.cpp:2832
LLVM_C_ABI void LLVMMoveBasicBlockBefore(LLVMBasicBlockRef BB, LLVMBasicBlockRef MovePos)
Move a basic block to before another one.
Definition Core.cpp:2922
LLVM_C_ABI LLVMValueRef LLVMGetBasicBlockParent(LLVMBasicBlockRef BB)
Obtain the function to which a basic block belongs.
Definition Core.cpp:2820
LLVM_C_ABI LLVMBasicBlockRef LLVMGetEntryBasicBlock(LLVMValueRef Fn)
Obtain the basic block that corresponds to the entry point of a function.
Definition Core.cpp:2838
LLVM_C_ABI LLVMValueRef LLVMGetFirstInstruction(LLVMBasicBlockRef BB)
Obtain the first instruction in a basic block.
Definition Core.cpp:2936
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:2879
LLVM_C_ABI LLVMValueRef LLVMBasicBlockAsValue(LLVMBasicBlockRef BB)
Convert a basic block instance to a value type.
Definition Core.cpp:2804
LLVM_C_ABI LLVMBasicBlockRef LLVMValueAsBasicBlock(LLVMValueRef Val)
Convert an LLVMValueRef to an LLVMBasicBlockRef instance.
Definition Core.cpp:2812
LLVM_C_ABI void LLVMRemoveBasicBlockFromParent(LLVMBasicBlockRef BB)
Remove a basic block from a function.
Definition Core.cpp:2918
LLVM_C_ABI LLVMBasicBlockRef LLVMGetNextBasicBlock(LLVMBasicBlockRef BB)
Advance a basic block iterator.
Definition Core.cpp:2858
LLVM_C_ABI unsigned LLVMCountBasicBlocks(LLVMValueRef Fn)
Obtain the number of basic blocks in a function.
Definition Core.cpp:2828
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:2892
LLVM_C_ABI LLVMBool LLVMValueIsBasicBlock(LLVMValueRef Val)
Determine whether an LLVMValueRef is itself a basic block.
Definition Core.cpp:2808
LLVM_C_ABI LLVMValueRef LLVMConstantPtrAuth(LLVMValueRef Ptr, LLVMValueRef Key, LLVMValueRef Disc, LLVMValueRef AddrDisc)
Create a ConstantPtrAuth constant with the given values.
Definition Core.cpp:1710
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:1639
LLVM_C_ABI LLVMValueRef LLVMConstVector(LLVMValueRef *ScalarConstantVals, unsigned Size)
Create a ConstantVector from values.
Definition Core.cpp:1705
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:1624
LLVM_C_ABI LLVMValueRef LLVMConstDataArray(LLVMTypeRef ElementTy, const char *Data, size_t SizeInBytes)
Create a ConstantDataArray from raw values.
Definition Core.cpp:1675
LLVM_C_ABI LLVMValueRef LLVMConstArray(LLVMTypeRef ElementTy, LLVMValueRef *ConstantVals, unsigned Length)
Create a ConstantArray from values.
Definition Core.cpp:1663
LLVM_C_ABI LLVMBool LLVMIsConstantString(LLVMValueRef c)
Returns true if the specified constant is an array of i8.
Definition Core.cpp:1647
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:1615
LLVM_C_ABI LLVMValueRef LLVMConstArray2(LLVMTypeRef ElementTy, LLVMValueRef *ConstantVals, uint64_t Length)
Create a ConstantArray from values.
Definition Core.cpp:1669
LLVM_C_ABI const char * LLVMGetAsString(LLVMValueRef c, size_t *Length)
Get the given constant data sequential as a string.
Definition Core.cpp:1651
LLVM_C_ABI LLVMValueRef LLVMConstNamedStruct(LLVMTypeRef StructTy, LLVMValueRef *ConstantVals, unsigned Count)
Create a non-anonymous ConstantStruct from values.
Definition Core.cpp:1696
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:1657
LLVM_C_ABI LLVMValueRef LLVMConstStructInContext(LLVMContextRef C, LLVMValueRef *ConstantVals, unsigned Count, LLVMBool Packed)
Create an anonymous ConstantStruct with the specified values.
Definition Core.cpp:1682
LLVM_C_ABI LLVMValueRef LLVMConstAddrSpaceCast(LLVMValueRef ConstantVal, LLVMTypeRef ToType)
Definition Core.cpp:1886
LLVM_C_ABI LLVMValueRef LLVMSizeOf(LLVMTypeRef Ty)
Definition Core.cpp:1777
LLVM_C_ABI LLVMValueRef LLVMConstAdd(LLVMValueRef LHSConstant, LLVMValueRef RHSConstant)
Definition Core.cpp:1798
LLVM_C_ABI LLVMValueRef LLVMConstSub(LLVMValueRef LHSConstant, LLVMValueRef RHSConstant)
Definition Core.cpp:1815
LLVM_C_ABI LLVMValueRef LLVMConstTruncOrBitCast(LLVMValueRef ConstantVal, LLVMTypeRef ToType)
Definition Core.cpp:1892
LLVM_C_ABI LLVMValueRef LLVMAlignOf(LLVMTypeRef Ty)
Definition Core.cpp:1773
LLVM_C_ABI LLVMValueRef LLVMConstBitCast(LLVMValueRef ConstantVal, LLVMTypeRef ToType)
Definition Core.cpp:1881
LLVM_C_ABI LLVMValueRef LLVMConstNUWSub(LLVMValueRef LHSConstant, LLVMValueRef RHSConstant)
Definition Core.cpp:1826
LLVM_C_ABI LLVMValueRef LLVMConstGEPWithNoWrapFlags(LLVMTypeRef Ty, LLVMValueRef ConstantVal, LLVMValueRef *ConstantIndices, unsigned NumIndices, LLVMGEPNoWrapFlags NoWrapFlags)
Creates a constant GetElementPtr expression.
Definition Core.cpp:1854
LLVM_C_ABI LLVMOpcode LLVMGetConstOpcode(LLVMValueRef ConstantVal)
Definition Core.cpp:1769
LLVM_C_ABI LLVMValueRef LLVMConstExtractElement(LLVMValueRef VectorConstant, LLVMValueRef IndexConstant)
Definition Core.cpp:1904
LLVM_C_ABI LLVMValueRef LLVMConstNSWAdd(LLVMValueRef LHSConstant, LLVMValueRef RHSConstant)
Definition Core.cpp:1803
LLVM_C_ABI LLVMValueRef LLVMConstNeg(LLVMValueRef ConstantVal)
Definition Core.cpp:1781
LLVM_C_ABI LLVMValueRef LLVMConstPointerCast(LLVMValueRef ConstantVal, LLVMTypeRef ToType)
Definition Core.cpp:1898
LLVM_C_ABI LLVMValueRef LLVMConstInsertElement(LLVMValueRef VectorConstant, LLVMValueRef ElementValueConstant, LLVMValueRef IndexConstant)
Definition Core.cpp:1910
LLVM_C_ABI LLVMValueRef LLVMConstXor(LLVMValueRef LHSConstant, LLVMValueRef RHSConstant)
Definition Core.cpp:1832
LLVM_C_ABI LLVMValueRef LLVMConstNSWSub(LLVMValueRef LHSConstant, LLVMValueRef RHSConstant)
Definition Core.cpp:1820
LLVM_C_ABI LLVMValueRef LLVMConstShuffleVector(LLVMValueRef VectorAConstant, LLVMValueRef VectorBConstant, LLVMValueRef MaskConstant)
Definition Core.cpp:1918
LLVM_C_ABI LLVMValueRef LLVMConstTrunc(LLVMValueRef ConstantVal, LLVMTypeRef ToType)
Definition Core.cpp:1866
LLVM_C_ABI LLVMValueRef LLVMConstGEP2(LLVMTypeRef Ty, LLVMValueRef ConstantVal, LLVMValueRef *ConstantIndices, unsigned NumIndices)
Definition Core.cpp:1837
LLVM_C_ABI LLVMValueRef LLVMBlockAddress(LLVMValueRef F, LLVMBasicBlockRef BB)
Definition Core.cpp:1936
LLVM_C_ABI LLVMValueRef LLVMConstNot(LLVMValueRef ConstantVal)
Definition Core.cpp:1794
LLVM_C_ABI LLVMValueRef LLVMConstNUWAdd(LLVMValueRef LHSConstant, LLVMValueRef RHSConstant)
Definition Core.cpp:1809
LLVM_C_ABI LLVMValueRef LLVMConstPtrToInt(LLVMValueRef ConstantVal, LLVMTypeRef ToType)
Definition Core.cpp:1871
LLVM_C_ABI LLVMValueRef LLVMConstIntToPtr(LLVMValueRef ConstantVal, LLVMTypeRef ToType)
Definition Core.cpp:1876
LLVM_C_ABI LLVMValueRef LLVMConstInBoundsGEP2(LLVMTypeRef Ty, LLVMValueRef ConstantVal, LLVMValueRef *ConstantIndices, unsigned NumIndices)
Definition Core.cpp:1845
LLVM_C_ABI LLVMValueRef LLVMConstInlineAsm(LLVMTypeRef Ty, const char *AsmString, const char *Constraints, LLVMBool HasSideEffects, LLVMBool IsAlignStack)
Deprecated: Use LLVMGetInlineAsm instead.
Definition Core.cpp:1928
LLVM_C_ABI LLVMValueRef LLVMConstNSWNeg(LLVMValueRef ConstantVal)
Definition Core.cpp:1785
LLVM_C_ABI LLVMValueRef LLVMGetBlockAddressFunction(LLVMValueRef BlockAddr)
Gets the function associated with a given BlockAddress constant value.
Definition Core.cpp:1940
LLVM_C_ABI LLVMBasicBlockRef LLVMGetBlockAddressBasicBlock(LLVMValueRef BlockAddr)
Gets the basic block associated with a given BlockAddress constant value.
Definition Core.cpp:1944
LLVM_C_ABI LLVMUnnamedAddr LLVMGetUnnamedAddress(LLVMValueRef Global)
Definition Core.cpp:2082
LLVM_C_ABI LLVMTypeRef LLVMGlobalGetValueType(LLVMValueRef Global)
Returns the "value type" of a global value.
Definition Core.cpp:2117
LLVM_C_ABI unsigned LLVMGetAlignment(LLVMValueRef V)
Obtain the preferred alignment of the value.
Definition Core.cpp:2123
LLVM_C_ABI void LLVMSetSection(LLVMValueRef Global, const char *Section)
Definition Core.cpp:2058
LLVM_C_ABI void LLVMSetUnnamedAddress(LLVMValueRef Global, LLVMUnnamedAddr UnnamedAddr)
Definition Core.cpp:2094
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:2198
LLVM_C_ABI void LLVMSetLinkage(LLVMValueRef Global, LLVMLinkage Linkage)
Definition Core.cpp:1987
LLVM_C_ABI void LLVMSetUnnamedAddr(LLVMValueRef Global, LLVMBool HasUnnamedAddr)
Deprecated: Use LLVMSetUnnamedAddress instead.
Definition Core.cpp:2111
LLVM_C_ABI LLVMModuleRef LLVMGetGlobalParent(LLVMValueRef Global)
Definition Core.cpp:1950
LLVM_C_ABI unsigned LLVMValueMetadataEntriesGetKind(LLVMValueMetadataEntry *Entries, unsigned Index)
Returns the kind of a value metadata entry at a specific index.
Definition Core.cpp:2179
LLVM_C_ABI void LLVMSetDLLStorageClass(LLVMValueRef Global, LLVMDLLStorageClass Class)
Definition Core.cpp:2077
LLVM_C_ABI LLVMVisibility LLVMGetVisibility(LLVMValueRef Global)
Definition Core.cpp:2062
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:2167
LLVM_C_ABI void LLVMSetAlignment(LLVMValueRef V, unsigned Bytes)
Set the preferred alignment of the value.
Definition Core.cpp:2145
LLVM_C_ABI const char * LLVMGetSection(LLVMValueRef Global)
Definition Core.cpp:2052
LLVM_C_ABI void LLVMSetVisibility(LLVMValueRef Global, LLVMVisibility Viz)
Definition Core.cpp:2067
LLVM_C_ABI LLVMLinkage LLVMGetLinkage(LLVMValueRef Global)
Definition Core.cpp:1958
LLVM_C_ABI void LLVMGlobalEraseMetadata(LLVMValueRef Global, unsigned Kind)
Erases a metadata attachment of the given kind if it exists.
Definition Core.cpp:2208
LLVM_C_ABI LLVMDLLStorageClass LLVMGetDLLStorageClass(LLVMValueRef Global)
Definition Core.cpp:2072
LLVM_C_ABI LLVMBool LLVMIsDeclaration(LLVMValueRef Global)
Definition Core.cpp:1954
LLVM_C_ABI void LLVMGlobalClearMetadata(LLVMValueRef Global)
Removes all metadata attachments from this value.
Definition Core.cpp:2212
LLVM_C_ABI void LLVMGlobalAddMetadata(LLVMValueRef Global, unsigned Kind, LLVMMetadataRef MD)
Adds a metadata attachment.
Definition Core.cpp:2203
LLVM_C_ABI LLVMBool LLVMHasUnnamedAddr(LLVMValueRef Global)
Deprecated: Use LLVMGetUnnamedAddress instead.
Definition Core.cpp:2107
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:2187
LLVM_C_ABI void LLVMDisposeValueMetadataEntries(LLVMValueMetadataEntry *Entries)
Destroys value metadata entries.
Definition Core.cpp:2194
LLVM_C_ABI void LLVMGlobalAddDebugInfo(LLVMValueRef Global, LLVMMetadataRef GVE)
Add debuginfo metadata to this global.
Definition Core.cpp:2216
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:1542
LLVM_C_ABI LLVMValueRef LLVMConstFPFromBits(LLVMTypeRef Ty, const uint64_t N[])
Obtain a constant for a floating point value from array of 64 bit values.
Definition Core.cpp:1580
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:1547
LLVM_C_ABI long long LLVMConstIntGetSExtValue(LLVMValueRef ConstantVal)
Obtain the sign extended value for an integer constant value.
Definition Core.cpp:1592
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:1571
LLVM_C_ABI double LLVMConstRealGetDouble(LLVMValueRef ConstantVal, LLVMBool *losesInfo)
Obtain the double value for an floating point constant value.
Definition Core.cpp:1596
LLVM_C_ABI LLVMValueRef LLVMConstReal(LLVMTypeRef RealTy, double N)
Obtain a constant value referring to a double floating point value.
Definition Core.cpp:1567
LLVM_C_ABI unsigned long long LLVMConstIntGetZExtValue(LLVMValueRef ConstantVal)
Obtain the zero extended value for an integer constant value.
Definition Core.cpp:1588
LLVM_C_ABI LLVMValueRef LLVMGetPoison(LLVMTypeRef Ty)
Obtain a constant value referring to a poison value of a type.
Definition Core.cpp:1257
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:1279
LLVM_C_ABI LLVMValueRef LLVMGetUndef(LLVMTypeRef Ty)
Obtain a constant value referring to an undefined value of a type.
Definition Core.cpp:1253
LLVM_C_ABI LLVMBool LLVMIsNull(LLVMValueRef Val)
Determine whether a value instance is null.
Definition Core.cpp:1265
LLVM_C_ABI LLVMValueRef LLVMConstNull(LLVMTypeRef Ty)
Obtain a constant value referring to the null instance of a type.
Definition Core.cpp:1245
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:1249
LLVM_C_ABI LLVMValueRef LLVMGetPreviousParam(LLVMValueRef Arg)
Obtain the previous parameter to a function.
Definition Core.cpp:2697
LLVM_C_ABI void LLVMSetParamAlignment(LLVMValueRef Arg, unsigned Align)
Set the alignment for a function parameter.
Definition Core.cpp:2704
LLVM_C_ABI unsigned LLVMCountParams(LLVMValueRef Fn)
Obtain the number of parameters in a function.
Definition Core.cpp:2652
LLVM_C_ABI void LLVMGetParams(LLVMValueRef Fn, LLVMValueRef *Params)
Obtain the parameters in a function.
Definition Core.cpp:2658
LLVM_C_ABI LLVMValueRef LLVMGetFirstParam(LLVMValueRef Fn)
Obtain the first parameter to a function.
Definition Core.cpp:2673
LLVM_C_ABI LLVMValueRef LLVMGetLastParam(LLVMValueRef Fn)
Obtain the last parameter to a function.
Definition Core.cpp:2681
LLVM_C_ABI LLVMValueRef LLVMGetParam(LLVMValueRef Fn, unsigned Index)
Obtain the parameter at the specified index.
Definition Core.cpp:2664
LLVM_C_ABI LLVMValueRef LLVMGetNextParam(LLVMValueRef Arg)
Obtain the next parameter to a function.
Definition Core.cpp:2689
LLVM_C_ABI LLVMValueRef LLVMGetParamParent(LLVMValueRef Inst)
Obtain the function to which this argument belongs.
Definition Core.cpp:2669
LLVM_C_ABI void LLVMAddAttributeAtIndex(LLVMValueRef F, LLVMAttributeIndex Idx, LLVMAttributeRef A)
Add an attribute to a function.
Definition Core.cpp:2602
LLVM_C_ABI LLVMValueRef LLVMGetPrefixData(LLVMValueRef Fn)
Gets the prefix data associated with a function.
Definition Core.cpp:2570
LLVM_C_ABI LLVMValueRef LLVMGetPrologueData(LLVMValueRef Fn)
Gets the prologue data associated with a function.
Definition Core.cpp:2586
LLVM_C_ABI LLVMTypeRef LLVMIntrinsicGetType(LLVMContextRef Ctx, unsigned ID, LLVMTypeRef *ParamTypes, size_t ParamCount)
Retrieves the type of an intrinsic.
Definition Core.cpp:2513
LLVM_C_ABI unsigned LLVMGetIntrinsicID(LLVMValueRef Fn)
Obtain the ID number from a function instance.
Definition Core.cpp:2486
LLVM_C_ABI LLVMValueRef LLVMGetPersonalityFn(LLVMValueRef Fn)
Obtain the personality function attached to the function.
Definition Core.cpp:2477
LLVM_C_ABI unsigned LLVMGetAttributeCountAtIndex(LLVMValueRef F, LLVMAttributeIndex Idx)
Definition Core.cpp:2607
LLVM_C_ABI LLVMBool LLVMHasPersonalityFn(LLVMValueRef Fn)
Check whether the given function has a personality function.
Definition Core.cpp:2473
LLVM_C_ABI void LLVMRemoveStringAttributeAtIndex(LLVMValueRef F, LLVMAttributeIndex Idx, const char *K, unsigned KLen)
Definition Core.cpp:2638
LLVM_C_ABI void LLVMSetPrefixData(LLVMValueRef Fn, LLVMValueRef prefixData)
Sets the prefix data for the function.
Definition Core.cpp:2580
LLVM_C_ABI char * LLVMIntrinsicCopyOverloadedName(unsigned ID, LLVMTypeRef *ParamTypes, size_t ParamCount, size_t *NameLength)
Deprecated: Use LLVMIntrinsicCopyOverloadedName2 instead.
Definition Core.cpp:2520
LLVM_C_ABI const char * LLVMGetGC(LLVMValueRef Fn)
Obtain the name of the garbage collector to use during code generation.
Definition Core.cpp:2557
LLVM_C_ABI void LLVMSetGC(LLVMValueRef Fn, const char *Name)
Define the garbage collector to use during code generation.
Definition Core.cpp:2562
LLVM_C_ABI void LLVMSetPrologueData(LLVMValueRef Fn, LLVMValueRef prologueData)
Sets the prologue data for the function.
Definition Core.cpp:2596
LLVM_C_ABI void LLVMSetPersonalityFn(LLVMValueRef Fn, LLVMValueRef PersonalityFn)
Set the personality function attached to the function.
Definition Core.cpp:2481
LLVM_C_ABI void LLVMGetAttributesAtIndex(LLVMValueRef F, LLVMAttributeIndex Idx, LLVMAttributeRef *Attrs)
Definition Core.cpp:2612
LLVM_C_ABI unsigned LLVMGetFunctionCallConv(LLVMValueRef Fn)
Obtain the calling function of a function.
Definition Core.cpp:2548
LLVM_C_ABI LLVMBool LLVMIntrinsicIsOverloaded(unsigned ID)
Obtain if the intrinsic identified by the given ID is overloaded.
Definition Core.cpp:2543
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:2529
LLVM_C_ABI void LLVMDeleteFunction(LLVMValueRef Fn)
Remove a function from its containing module and deletes it.
Definition Core.cpp:2469
LLVM_C_ABI void LLVMRemoveEnumAttributeAtIndex(LLVMValueRef F, LLVMAttributeIndex Idx, unsigned KindID)
Definition Core.cpp:2633
LLVM_C_ABI LLVMAttributeRef LLVMGetEnumAttributeAtIndex(LLVMValueRef F, LLVMAttributeIndex Idx, unsigned KindID)
Definition Core.cpp:2619
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:2539
LLVM_C_ABI const char * LLVMIntrinsicGetName(unsigned ID, size_t *NameLength)
Retrieves the name of an intrinsic.
Definition Core.cpp:2506
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:2497
LLVM_C_ABI LLVMBool LLVMHasPrologueData(LLVMValueRef Fn)
Check if a given function has prologue data.
Definition Core.cpp:2591
LLVM_C_ABI LLVMBool LLVMHasPrefixData(LLVMValueRef Fn)
Check if a given function has prefix data.
Definition Core.cpp:2575
LLVM_C_ABI void LLVMSetFunctionCallConv(LLVMValueRef Fn, unsigned CC)
Set the calling convention of a function.
Definition Core.cpp:2552
LLVM_C_ABI void LLVMAddTargetDependentFunctionAttr(LLVMValueRef Fn, const char *A, const char *V)
Add a target-dependent attribute to a function.
Definition Core.cpp:2643
LLVM_C_ABI LLVMAttributeRef LLVMGetStringAttributeAtIndex(LLVMValueRef F, LLVMAttributeIndex Idx, const char *K, unsigned KLen)
Definition Core.cpp:2626
LLVM_C_ABI LLVMValueRef LLVMIsAMDString(LLVMValueRef Val)
Definition Core.cpp:1169
LLVM_C_ABI LLVMBool LLVMIsPoison(LLVMValueRef Val)
Determine whether a value instance is poisonous.
Definition Core.cpp:1275
LLVM_C_ABI LLVMValueKind LLVMGetValueKind(LLVMValueRef Val)
Obtain the enumerated type of a Value instance.
Definition Core.cpp:1010
LLVM_C_ABI void LLVMDumpValue(LLVMValueRef Val)
Dump a representation of a value to stderr.
Definition Core.cpp:1040
LLVM_C_ABI const char * LLVMGetValueName(LLVMValueRef Val)
Deprecated: Use LLVMGetValueName2 instead.
Definition Core.cpp:1032
LLVM_C_ABI LLVMContextRef LLVMGetValueContext(LLVMValueRef Val)
Obtain the context to which this value is associated.
Definition Core.cpp:1058
LLVM_C_ABI void LLVMReplaceAllUsesWith(LLVMValueRef OldVal, LLVMValueRef NewVal)
Replace all uses of a value with another one.
Definition Core.cpp:1076
LLVM_C_ABI const char * LLVMGetValueName2(LLVMValueRef Val, size_t *Length)
Obtain the string name of a value.
Definition Core.cpp:1022
LLVM_C_ABI void LLVMSetValueName(LLVMValueRef Val, const char *Name)
Deprecated: Use LLVMSetValueName2 instead.
Definition Core.cpp:1036
LLVM_C_ABI LLVMValueRef LLVMIsAMDNode(LLVMValueRef Val)
Definition Core.cpp:1154
LLVM_C_ABI char * LLVMPrintDbgRecordToString(LLVMDbgRecordRef Record)
Return a string representation of the DbgRecord.
Definition Core.cpp:1062
LLVM_C_ABI LLVMBool LLVMIsUndef(LLVMValueRef Val)
Determine whether a value instance is undefined.
Definition Core.cpp:1271
LLVM_C_ABI LLVMTypeRef LLVMTypeOf(LLVMValueRef Val)
Obtain the type of a value.
Definition Core.cpp:1006
LLVM_C_ABI char * LLVMPrintValueToString(LLVMValueRef Val)
Return a string representation of the value.
Definition Core.cpp:1044
LLVM_C_ABI LLVMValueRef LLVMIsAValueAsMetadata(LLVMValueRef Val)
Definition Core.cpp:1162
#define LLVM_DECLARE_VALUE_CAST(name)
Convert value instances between types.
Definition Core.h:2162
LLVM_C_ABI LLVMBool LLVMIsConstant(LLVMValueRef Val)
Determine whether the specified value instance is constant.
Definition Core.cpp:1261
LLVM_C_ABI void LLVMSetValueName2(LLVMValueRef Val, const char *Name, size_t NameLen)
Set the string name of a value.
Definition Core.cpp:1028
LLVM_C_ABI LLVMValueRef LLVMGetFirstGlobalIFunc(LLVMModuleRef M)
Obtain an iterator to the first GlobalIFunc in a Module.
Definition Core.cpp:2726
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:2721
LLVM_C_ABI void LLVMRemoveGlobalIFunc(LLVMValueRef IFunc)
Remove a global indirect function from its parent module.
Definition Core.cpp:2770
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:2711
LLVM_C_ABI LLVMValueRef LLVMGetNextGlobalIFunc(LLVMValueRef IFunc)
Advance a GlobalIFunc iterator to the next GlobalIFunc.
Definition Core.cpp:2742
LLVM_C_ABI LLVMValueRef LLVMGetPreviousGlobalIFunc(LLVMValueRef IFunc)
Decrement a GlobalIFunc iterator to the previous GlobalIFunc.
Definition Core.cpp:2750
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:2758
LLVM_C_ABI void LLVMSetGlobalIFuncResolver(LLVMValueRef IFunc, LLVMValueRef Resolver)
Sets the resolver function associated with this indirect function.
Definition Core.cpp:2762
LLVM_C_ABI LLVMValueRef LLVMGetLastGlobalIFunc(LLVMModuleRef M)
Obtain an iterator to the last GlobalIFunc in a Module.
Definition Core.cpp:2734
LLVM_C_ABI void LLVMEraseGlobalIFunc(LLVMValueRef IFunc)
Remove a global indirect function from its parent module and delete it.
Definition Core.cpp:2766
LLVM_C_ABI LLVMTypeRef LLVMGetAllocatedType(LLVMValueRef Alloca)
Obtain the type that is being allocated by the alloca instruction.
Definition Core.cpp:3266
LLVM_C_ABI void LLVMSetTailCall(LLVMValueRef CallInst, LLVMBool IsTailCall)
Set whether a call instruction is a tail call.
Definition Core.cpp:3178
LLVM_C_ABI void LLVMAddCallSiteAttribute(LLVMValueRef C, LLVMAttributeIndex Idx, LLVMAttributeRef A)
Definition Core.cpp:3110
LLVM_C_ABI unsigned LLVMGetNumOperandBundles(LLVMValueRef C)
Obtain the number of operand bundles attached to this instruction.
Definition Core.cpp:3162
LLVM_C_ABI void LLVMRemoveCallSiteEnumAttribute(LLVMValueRef C, LLVMAttributeIndex Idx, unsigned KindID)
Definition Core.cpp:3144
LLVM_C_ABI void LLVMRemoveCallSiteStringAttribute(LLVMValueRef C, LLVMAttributeIndex Idx, const char *K, unsigned KLen)
Definition Core.cpp:3149
LLVM_C_ABI LLVMAttributeRef LLVMGetCallSiteEnumAttribute(LLVMValueRef C, LLVMAttributeIndex Idx, unsigned KindID)
Definition Core.cpp:3130
LLVM_C_ABI unsigned LLVMGetInstructionCallConv(LLVMValueRef Instr)
Obtain the calling convention for a call instruction.
Definition Core.cpp:3093
LLVM_C_ABI LLVMBasicBlockRef LLVMGetCallBrDefaultDest(LLVMValueRef CallBr)
Get the default destination of a CallBr instruction.
Definition Core.cpp:3218
LLVM_C_ABI LLVMValueRef LLVMGetCalledValue(LLVMValueRef Instr)
Obtain the pointer to the function invoked by this instruction.
Definition Core.cpp:3154
LLVM_C_ABI void LLVMSetNormalDest(LLVMValueRef InvokeInst, LLVMBasicBlockRef B)
Set the normal destination basic block.
Definition Core.cpp:3205
LLVM_C_ABI LLVMBool LLVMIsTailCall(LLVMValueRef CallInst)
Obtain whether a call instruction is a tail call.
Definition Core.cpp:3174
LLVM_C_ABI LLVMAttributeRef LLVMGetCallSiteStringAttribute(LLVMValueRef C, LLVMAttributeIndex Idx, const char *K, unsigned KLen)
Definition Core.cpp:3137
LLVM_C_ABI unsigned LLVMGetCallBrNumIndirectDests(LLVMValueRef CallBr)
Get the number of indirect destinations of a CallBr instruction.
Definition Core.cpp:3222
LLVM_C_ABI void LLVMGetCallSiteAttributes(LLVMValueRef C, LLVMAttributeIndex Idx, LLVMAttributeRef *Attrs)
Definition Core.cpp:3122
LLVM_C_ABI LLVMBasicBlockRef LLVMGetNormalDest(LLVMValueRef InvokeInst)
Return the normal destination basic block.
Definition Core.cpp:3192
LLVM_C_ABI unsigned LLVMGetNumArgOperands(LLVMValueRef Instr)
Obtain the argument count for a call instruction.
Definition Core.cpp:3084
LLVM_C_ABI void LLVMSetTailCallKind(LLVMValueRef CallInst, LLVMTailCallKind kind)
Set the call kind of the call instruction.
Definition Core.cpp:3186
LLVM_C_ABI LLVMOperandBundleRef LLVMGetOperandBundleAtIndex(LLVMValueRef C, unsigned Index)
Obtain the operand bundle attached to this instruction at the given index.
Definition Core.cpp:3166
LLVM_C_ABI LLVMBasicBlockRef LLVMGetCallBrIndirectDest(LLVMValueRef CallBr, unsigned Idx)
Get the indirect destination of a CallBr instruction at the given index.
Definition Core.cpp:3226
LLVM_C_ABI LLVMTailCallKind LLVMGetTailCallKind(LLVMValueRef CallInst)
Obtain a tail call kind of the call instruction.
Definition Core.cpp:3182
LLVM_C_ABI void LLVMSetUnwindDest(LLVMValueRef InvokeInst, LLVMBasicBlockRef B)
Set the unwind destination basic block.
Definition Core.cpp:3209
LLVM_C_ABI LLVMTypeRef LLVMGetCalledFunctionType(LLVMValueRef C)
Obtain the function type called by this instruction.
Definition Core.cpp:3158
LLVM_C_ABI LLVMBasicBlockRef LLVMGetUnwindDest(LLVMValueRef InvokeInst)
Return the unwind destination basic block.
Definition Core.cpp:3196
LLVM_C_ABI void LLVMSetInstrParamAlignment(LLVMValueRef Instr, LLVMAttributeIndex Idx, unsigned Align)
Definition Core.cpp:3102
LLVM_C_ABI unsigned LLVMGetCallSiteAttributeCount(LLVMValueRef C, LLVMAttributeIndex Idx)
Definition Core.cpp:3115
LLVM_C_ABI void LLVMSetInstructionCallConv(LLVMValueRef Instr, unsigned CC)
Set the calling convention for a call instruction.
Definition Core.cpp:3097
LLVM_C_ABI LLVMGEPNoWrapFlags LLVMGEPGetNoWrapFlags(LLVMValueRef GEP)
Get the no-wrap related flags for the given GEP instruction.
Definition Core.cpp:3284
LLVM_C_ABI LLVMBool LLVMIsInBounds(LLVMValueRef GEP)
Check whether the given GEP operator is inbounds.
Definition Core.cpp:3272
LLVM_C_ABI void LLVMSetIsInBounds(LLVMValueRef GEP, LLVMBool InBounds)
Set the given GEP instruction to be inbounds or not.
Definition Core.cpp:3276
LLVM_C_ABI LLVMTypeRef LLVMGetGEPSourceElementType(LLVMValueRef GEP)
Get the source element type of the given GEP operator.
Definition Core.cpp:3280
LLVM_C_ABI void LLVMGEPSetNoWrapFlags(LLVMValueRef GEP, LLVMGEPNoWrapFlags NoWrapFlags)
Set the no-wrap related flags for the given GEP instruction.
Definition Core.cpp:3289
LLVM_C_ABI unsigned LLVMGetNumIndices(LLVMValueRef Inst)
Obtain the number of indices.
Definition Core.cpp:3317
LLVM_C_ABI const unsigned * LLVMGetIndices(LLVMValueRef Inst)
Obtain the indices as an array.
Definition Core.cpp:3329
LLVM_C_ABI LLVMBasicBlockRef LLVMGetIncomingBlock(LLVMValueRef PhiNode, unsigned Index)
Obtain an incoming value to a PHI node as an LLVMBasicBlockRef.
Definition Core.cpp:3311
LLVM_C_ABI LLVMValueRef LLVMGetIncomingValue(LLVMValueRef PhiNode, unsigned Index)
Obtain an incoming value to a PHI node as an LLVMValueRef.
Definition Core.cpp:3307
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:3296
LLVM_C_ABI unsigned LLVMCountIncoming(LLVMValueRef PhiNode)
Obtain the number of incoming basic blocks to a PHI node.
Definition Core.cpp:3303
LLVM_C_ABI LLVMValueRef LLVMGetCondition(LLVMValueRef Branch)
Return the condition of a branch instruction.
Definition Core.cpp:3250
LLVM_C_ABI LLVMBasicBlockRef LLVMGetSuccessor(LLVMValueRef Term, unsigned i)
Return the specified successor.
Definition Core.cpp:3236
LLVM_C_ABI void LLVMSetCondition(LLVMValueRef Branch, LLVMValueRef Cond)
Set the condition of a branch instruction.
Definition Core.cpp:3254
LLVM_C_ABI void LLVMSetSuccessor(LLVMValueRef Term, unsigned i, LLVMBasicBlockRef block)
Update the specified successor to point at the provided block.
Definition Core.cpp:3240
LLVM_C_ABI LLVMBool LLVMIsConditional(LLVMValueRef Branch)
Return if a branch is conditional.
Definition Core.cpp:3246
LLVM_C_ABI LLVMBasicBlockRef LLVMGetSwitchDefaultDest(LLVMValueRef SwitchInstr)
Obtain the default destination basic block of a switch instruction.
Definition Core.cpp:3260
LLVM_C_ABI unsigned LLVMGetNumSuccessors(LLVMValueRef Term)
Return the number of successors that this terminator has.
Definition Core.cpp:3232
LLVM_C_ABI LLVMRealPredicate LLVMGetFCmpPredicate(LLVMValueRef Inst)
Obtain the float predicate of an instruction.
Definition Core.cpp:2994
LLVM_C_ABI int LLVMHasMetadata(LLVMValueRef Val)
Determine whether an instruction has any metadata attached.
Definition Core.cpp:1080
LLVM_C_ABI void LLVMInstructionRemoveFromParent(LLVMValueRef Inst)
Remove an instruction.
Definition Core.cpp:2968
LLVM_C_ABI LLVMValueRef LLVMGetPreviousInstruction(LLVMValueRef Inst)
Obtain the instruction that occurred before this one.
Definition Core.cpp:2960
LLVM_C_ABI LLVMDbgRecordRef LLVMGetPreviousDbgRecord(LLVMDbgRecordRef DbgRecord)
Obtain the previous DbgRecord in the sequence or NULL if there are no more.
Definition Core.cpp:3045
LLVM_C_ABI LLVMDbgRecordRef LLVMGetFirstDbgRecord(LLVMValueRef Inst)
Obtain the first debug record attached to an instruction.
Definition Core.cpp:3017
LLVM_C_ABI LLVMOpcode LLVMGetInstructionOpcode(LLVMValueRef Inst)
Obtain the code opcode for an individual instruction.
Definition Core.cpp:3000
LLVM_C_ABI LLVMDbgRecordRef LLVMGetNextDbgRecord(LLVMDbgRecordRef DbgRecord)
Obtain the next DbgRecord in the sequence or NULL if there are no more.
Definition Core.cpp:3037
LLVM_C_ABI LLVMDbgRecordRef LLVMGetLastDbgRecord(LLVMValueRef Inst)
Obtain the last debug record attached to an instruction.
Definition Core.cpp:3027
LLVM_C_ABI LLVMValueRef LLVMIsATerminatorInst(LLVMValueRef Inst)
Determine whether an instruction is a terminator.
Definition Core.cpp:3012
LLVMMetadataRef LLVMDbgVariableRecordGetExpression(LLVMDbgRecordRef Rec)
Get the debug info expression of the DbgVariableRecord.
Definition Core.cpp:3080
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:1137
LLVM_C_ABI void LLVMDeleteInstruction(LLVMValueRef Inst)
Delete an instruction.
Definition Core.cpp:2976
LLVMMetadataRef LLVMDbgRecordGetDebugLoc(LLVMDbgRecordRef Rec)
Get the debug location attached to the debug record.
Definition Core.cpp:3053
LLVM_C_ABI LLVMBasicBlockRef LLVMGetInstructionParent(LLVMValueRef Inst)
Obtain the basic block to which an instruction belongs.
Definition Core.cpp:2932
LLVMValueRef LLVMDbgVariableRecordGetValue(LLVMDbgRecordRef Rec, unsigned OpIdx)
Get the value of the DbgVariableRecord.
Definition Core.cpp:3071
LLVM_C_ABI LLVMBool LLVMGetICmpSameSign(LLVMValueRef Inst)
Get whether or not an icmp instruction has the samesign flag.
Definition Core.cpp:2986
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:3006
LLVM_C_ABI void LLVMInstructionEraseFromParent(LLVMValueRef Inst)
Remove and delete an instruction.
Definition Core.cpp:2972
LLVM_C_ABI void LLVMSetMetadata(LLVMValueRef Val, unsigned KindID, LLVMValueRef Node)
Set metadata associated with an instruction value.
Definition Core.cpp:1106
LLVM_C_ABI LLVMValueRef LLVMGetMetadata(LLVMValueRef Val, unsigned KindID)
Return metadata associated with an instruction value.
Definition Core.cpp:1084
LLVM_C_ABI LLVMIntPredicate LLVMGetICmpPredicate(LLVMValueRef Inst)
Obtain the predicate of an instruction.
Definition Core.cpp:2980
LLVM_C_ABI LLVMValueRef LLVMGetNextInstruction(LLVMValueRef Inst)
Obtain the instruction that occurs after the one specified.
Definition Core.cpp:2952
LLVMMetadataRef LLVMDbgVariableRecordGetVariable(LLVMDbgRecordRef Rec)
Get the debug info variable of the DbgVariableRecord.
Definition Core.cpp:3076
LLVMDbgRecordKind LLVMDbgRecordGetKind(LLVMDbgRecordRef Rec)
Definition Core.cpp:3057
LLVM_C_ABI void LLVMSetICmpSameSign(LLVMValueRef Inst, LLVMBool SameSign)
Set the samesign flag on an icmp instruction.
Definition Core.cpp:2990
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:1290
LLVM_C_ABI const char * LLVMGetMDString(LLVMValueRef V, unsigned *Length)
Obtain the underlying string from a MDString value.
Definition Core.cpp:1350
LLVM_C_ABI LLVMValueRef LLVMMetadataAsValue(LLVMContextRef C, LLVMMetadataRef MD)
Obtain a Metadata as a Value.
Definition Core.cpp:1337
LLVM_C_ABI unsigned LLVMGetMDNodeNumOperands(LLVMValueRef V)
Obtain the number of operands from an MDNode value.
Definition Core.cpp:1360
LLVM_C_ABI LLVMValueRef LLVMMDStringInContext(LLVMContextRef C, const char *Str, unsigned SLen)
Deprecated: Use LLVMMDStringInContext2 instead.
Definition Core.cpp:1295
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:1285
LLVM_C_ABI LLVMValueRef LLVMMDNodeInContext(LLVMContextRef C, LLVMValueRef *Vals, unsigned Count)
Deprecated: Use LLVMMDNodeInContext2 instead.
Definition Core.cpp:1306
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:1428
LLVM_C_ABI LLVMMetadataRef LLVMValueAsMetadata(LLVMValueRef Val)
Obtain a Value as a Metadata.
Definition Core.cpp:1341
LLVM_C_ABI void LLVMGetMDNodeOperands(LLVMValueRef V, LLVMValueRef *Dest)
Obtain the given MDNode's operands.
Definition Core.cpp:1415
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:1226
LLVM_C_ABI int LLVMGetNumOperands(LLVMValueRef Val)
Obtain the number of operands in a llvm::User value.
Definition Core.cpp:1235
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:1231
LLVM_C_ABI LLVMValueRef LLVMGetOperand(LLVMValueRef Val, unsigned Index)
Obtain an operand at a specific index in a llvm::User value.
Definition Core.cpp:1212
LLVM_C_ABI LLVMValueRef LLVMGetUser(LLVMUseRef U)
Obtain the user value for a user.
Definition Core.cpp:1192
LLVM_C_ABI LLVMValueRef LLVMGetUsedValue(LLVMUseRef U)
Obtain the value this use corresponds to.
Definition Core.cpp:1196
LLVM_C_ABI LLVMUseRef LLVMGetNextUse(LLVMUseRef U)
Obtain the next use of a value.
Definition Core.cpp:1185
LLVM_C_ABI LLVMUseRef LLVMGetFirstUse(LLVMValueRef Val)
Obtain the first use of a value.
Definition Core.cpp:1177
#define LLVM_FOR_EACH_VALUE_SUBCLASS(macro)
Definition Core.h:1966
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:2359
LLVM_C_ABI LLVMValueRef LLVMGetLastGlobalAlias(LLVMModuleRef M)
Obtain an iterator to the last GlobalAlias in a Module.
Definition Core.cpp:2380
LLVM_C_ABI LLVMValueRef LLVMGetPreviousGlobalAlias(LLVMValueRef GA)
Decrement a GlobalAlias iterator to the previous GlobalAlias.
Definition Core.cpp:2396
LLVM_C_ABI void LLVMAliasSetAliasee(LLVMValueRef Alias, LLVMValueRef Aliasee)
Set the target value of an alias.
Definition Core.cpp:2408
LLVM_C_ABI LLVMValueRef LLVMGetFirstGlobalAlias(LLVMModuleRef M)
Obtain an iterator to the first GlobalAlias in a Module.
Definition Core.cpp:2372
LLVM_C_ABI LLVMValueRef LLVMAliasGetAliasee(LLVMValueRef Alias)
Retrieve the target value of an alias.
Definition Core.cpp:2404
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:2367
LLVM_C_ABI LLVMValueRef LLVMGetNextGlobalAlias(LLVMValueRef GA)
Advance a GlobalAlias iterator to the next GlobalAlias.
Definition Core.cpp:2388
LLVM_C_ABI LLVMBool LLVMIsThreadLocal(LLVMValueRef GlobalVar)
Definition Core.cpp:2294
LLVM_C_ABI LLVMThreadLocalMode LLVMGetThreadLocalMode(LLVMValueRef GlobalVar)
Definition Core.cpp:2310
LLVM_C_ABI LLVMBool LLVMIsGlobalConstant(LLVMValueRef GlobalVar)
Definition Core.cpp:2302
LLVM_C_ABI LLVMValueRef LLVMGetPreviousGlobal(LLVMValueRef GlobalVar)
Definition Core.cpp:2270
LLVM_C_ABI void LLVMSetThreadLocal(LLVMValueRef GlobalVar, LLVMBool IsThreadLocal)
Definition Core.cpp:2298
LLVM_C_ABI LLVMBool LLVMIsExternallyInitialized(LLVMValueRef GlobalVar)
Definition Core.cpp:2349
LLVM_C_ABI LLVMValueRef LLVMGetLastGlobal(LLVMModuleRef M)
Definition Core.cpp:2254
LLVM_C_ABI LLVMValueRef LLVMGetNamedGlobalWithLength(LLVMModuleRef M, const char *Name, size_t Length)
Definition Core.cpp:2241
LLVM_C_ABI LLVMValueRef LLVMGetFirstGlobal(LLVMModuleRef M)
Definition Core.cpp:2246
LLVM_C_ABI void LLVMSetThreadLocalMode(LLVMValueRef GlobalVar, LLVMThreadLocalMode Mode)
Definition Core.cpp:2327
LLVM_C_ABI LLVMValueRef LLVMGetNextGlobal(LLVMValueRef GlobalVar)
Definition Core.cpp:2262
LLVM_C_ABI void LLVMSetExternallyInitialized(LLVMValueRef GlobalVar, LLVMBool IsExtInit)
Definition Core.cpp:2353
LLVM_C_ABI LLVMValueRef LLVMGetNamedGlobal(LLVMModuleRef M, const char *Name)
Definition Core.cpp:2237
LLVM_C_ABI LLVMValueRef LLVMAddGlobalInAddressSpace(LLVMModuleRef M, LLVMTypeRef Ty, const char *Name, unsigned AddressSpace)
Definition Core.cpp:2228
LLVM_C_ABI void LLVMDeleteGlobal(LLVMValueRef GlobalVar)
Definition Core.cpp:2278
LLVM_C_ABI void LLVMSetGlobalConstant(LLVMValueRef GlobalVar, LLVMBool IsConstant)
Definition Core.cpp:2306
LLVM_C_ABI LLVMValueRef LLVMAddGlobal(LLVMModuleRef M, LLVMTypeRef Ty, const char *Name)
Definition Core.cpp:2223
LLVM_C_ABI LLVMValueRef LLVMGetInitializer(LLVMValueRef GlobalVar)
Definition Core.cpp:2282
LLVM_C_ABI void LLVMSetInitializer(LLVMValueRef GlobalVar, LLVMValueRef ConstantVal)
Definition Core.cpp:2289
#define N