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