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 whether the global value is marked as dso_local, i.e. whether it
2895 * will resolve to a symbol within the same linkage unit.
2896 *
2897 * @see llvm::GlobalValue::isDSOLocal()
2898 */
2900
2901/**
2902 * Sets whether the global value is marked as dso_local.
2903 *
2904 * Note that globals with local linkage or non-default visibility are always
2905 * implicitly dso_local.
2906 *
2907 * @see llvm::GlobalValue::setDSOLocal()
2908 */
2909LLVM_C_ABI void LLVMSetDSOLocal(LLVMValueRef Global, LLVMBool IsDSOLocal);
2910
2911/**
2912 * Returns the "value type" of a global value. This differs from the formal
2913 * type of a global value which is always a pointer type.
2914 *
2915 * @see llvm::GlobalValue::getValueType()
2916 * @see llvm::Function::getFunctionType()
2917 */
2919
2920/** Deprecated: Use LLVMGetUnnamedAddress instead. */
2922/** Deprecated: Use LLVMSetUnnamedAddress instead. */
2924 LLVMBool HasUnnamedAddr);
2925
2926/**
2927 * @defgroup LLVMCCoreValueWithAlignment Values with alignment
2928 *
2929 * Functions in this group only apply to values with alignment, i.e.
2930 * global variables, load and store instructions.
2931 */
2932
2933/**
2934 * Obtain the preferred alignment of the value.
2935 * @see llvm::AllocaInst::getAlignment()
2936 * @see llvm::LoadInst::getAlignment()
2937 * @see llvm::StoreInst::getAlignment()
2938 * @see llvm::AtomicRMWInst::setAlignment()
2939 * @see llvm::AtomicCmpXchgInst::setAlignment()
2940 * @see llvm::GlobalValue::getAlignment()
2941 */
2943
2944/**
2945 * Set the preferred alignment of the value.
2946 * @see llvm::AllocaInst::setAlignment()
2947 * @see llvm::LoadInst::setAlignment()
2948 * @see llvm::StoreInst::setAlignment()
2949 * @see llvm::AtomicRMWInst::setAlignment()
2950 * @see llvm::AtomicCmpXchgInst::setAlignment()
2951 * @see llvm::GlobalValue::setAlignment()
2952 */
2953LLVM_C_ABI void LLVMSetAlignment(LLVMValueRef V, unsigned Bytes);
2954
2955/**
2956 * Sets a metadata attachment, erasing the existing metadata attachment if
2957 * it already exists for the given kind.
2958 *
2959 * @see llvm::GlobalObject::setMetadata()
2960 */
2961LLVM_C_ABI void LLVMGlobalSetMetadata(LLVMValueRef Global, unsigned Kind,
2962 LLVMMetadataRef MD);
2963
2964/**
2965 * Adds a metadata attachment.
2966 *
2967 * @see llvm::GlobalObject::addMetadata()
2968 */
2969LLVM_C_ABI void LLVMGlobalAddMetadata(LLVMValueRef Global, unsigned Kind,
2970 LLVMMetadataRef MD);
2971
2972/**
2973 * Erases a metadata attachment of the given kind if it exists.
2974 *
2975 * @see llvm::GlobalObject::eraseMetadata()
2976 */
2977LLVM_C_ABI void LLVMGlobalEraseMetadata(LLVMValueRef Global, unsigned Kind);
2978
2979/**
2980 * Removes all metadata attachments from this value.
2981 *
2982 * @see llvm::GlobalObject::clearMetadata()
2983 */
2985
2986/**
2987 * Add debuginfo metadata to this global.
2988 *
2989 * @see llvm::GlobalVariable::addDebugInfo()
2990 */
2992 LLVMMetadataRef GVE);
2993
2994/**
2995 * Retrieves an array of metadata entries representing the metadata attached to
2996 * this value. The caller is responsible for freeing this array by calling
2997 * \c LLVMDisposeValueMetadataEntries.
2998 *
2999 * @see llvm::GlobalObject::getAllMetadata()
3000 */
3002LLVMGlobalCopyAllMetadata(LLVMValueRef Value, size_t *NumEntries);
3003
3004/**
3005 * Destroys value metadata entries.
3006 */
3007LLVM_C_ABI void
3009
3010/**
3011 * Returns the kind of a value metadata entry at a specific index.
3012 */
3013LLVM_C_ABI unsigned
3015 unsigned Index);
3016
3017/**
3018 * Returns the underlying metadata node of a value metadata entry at a
3019 * specific index.
3020 */
3022 LLVMValueMetadataEntry *Entries, unsigned Index);
3023
3024/**
3025 * @}
3026 */
3027
3028/**
3029 * @defgroup LLVMCoreValueConstantGlobalVariable Global Variables
3030 *
3031 * This group contains functions that operate on global variable values.
3032 *
3033 * @see llvm::GlobalVariable
3034 *
3035 * @{
3036 */
3038 const char *Name);
3040 LLVMTypeRef Ty,
3041 const char *Name,
3042 unsigned AddressSpace);
3045 const char *Name,
3046 size_t Length);
3054 LLVMValueRef ConstantVal);
3057 LLVMBool IsThreadLocal);
3060 LLVMBool IsConstant);
3066 LLVMBool IsExtInit);
3067
3068/**
3069 * @}
3070 */
3071
3072/**
3073 * @defgroup LLVMCoreValueConstantGlobalAlias Global Aliases
3074 *
3075 * This group contains function that operate on global alias values.
3076 *
3077 * @see llvm::GlobalAlias
3078 *
3079 * @{
3080 */
3081
3082/**
3083 * Add a GlobalAlias with the given value type, address space and aliasee.
3084 *
3085 * @see llvm::GlobalAlias::create()
3086 */
3088 unsigned AddrSpace, LLVMValueRef Aliasee,
3089 const char *Name);
3090
3091/**
3092 * Obtain a GlobalAlias value from a Module by its name.
3093 *
3094 * The returned value corresponds to a llvm::GlobalAlias value.
3095 *
3096 * @see llvm::Module::getNamedAlias()
3097 */
3099 const char *Name,
3100 size_t NameLen);
3101
3102/**
3103 * Obtain an iterator to the first GlobalAlias in a Module.
3104 *
3105 * @see llvm::Module::alias_begin()
3106 */
3108
3109/**
3110 * Obtain an iterator to the last GlobalAlias in a Module.
3111 *
3112 * @see llvm::Module::alias_end()
3113 */
3115
3116/**
3117 * Advance a GlobalAlias iterator to the next GlobalAlias.
3118 *
3119 * Returns NULL if the iterator was already at the end and there are no more
3120 * global aliases.
3121 */
3123
3124/**
3125 * Decrement a GlobalAlias iterator to the previous GlobalAlias.
3126 *
3127 * Returns NULL if the iterator was already at the beginning and there are
3128 * no previous global aliases.
3129 */
3131
3132/**
3133 * Retrieve the target value of an alias.
3134 */
3136
3137/**
3138 * Set the target value of an alias.
3139 */
3141
3142/**
3143 * @}
3144 */
3145
3146/**
3147 * @defgroup LLVMCCoreValueFunction Function values
3148 *
3149 * Functions in this group operate on LLVMValueRef instances that
3150 * correspond to llvm::Function instances.
3151 *
3152 * @see llvm::Function
3153 *
3154 * @{
3155 */
3156
3157/**
3158 * Remove a function from its containing module and deletes it.
3159 *
3160 * @see llvm::Function::eraseFromParent()
3161 */
3163
3164/**
3165 * Check whether the given function has a personality function.
3166 *
3167 * @see llvm::Function::hasPersonalityFn()
3168 */
3170
3171/**
3172 * Obtain the personality function attached to the function.
3173 *
3174 * @see llvm::Function::getPersonalityFn()
3175 */
3177
3178/**
3179 * Set the personality function attached to the function.
3180 *
3181 * @see llvm::Function::setPersonalityFn()
3182 */
3184 LLVMValueRef PersonalityFn);
3185
3186/**
3187 * Obtain the intrinsic ID number which matches the given function name.
3188 *
3189 * @see llvm::Intrinsic::lookupIntrinsicID()
3190 */
3191LLVM_C_ABI unsigned LLVMLookupIntrinsicID(const char *Name, size_t NameLen);
3192
3193/**
3194 * Obtain the ID number from a function instance.
3195 *
3196 * @see llvm::Function::getIntrinsicID()
3197 */
3199
3200/**
3201 * Get or insert the declaration of an intrinsic. For overloaded intrinsics,
3202 * overload types must be provided to uniquely identify an overload.
3203 *
3204 * @see llvm::Intrinsic::getOrInsertDeclaration()
3205 */
3207 unsigned ID,
3208 LLVMTypeRef *OverloadTypes,
3209 size_t OverloadCount);
3210
3211/**
3212 * Retrieves the type of an intrinsic. For overloaded intrinsics, overload
3213 * types must be provided to uniquely identify an overload.
3214 *
3215 * @see llvm::Intrinsic::getType()
3216 */
3218 LLVMTypeRef *OverloadTypes,
3219 size_t OverloadCount);
3220
3221/**
3222 * Retrieves the name of an intrinsic.
3223 *
3224 * @see llvm::Intrinsic::getName()
3225 */
3226LLVM_C_ABI const char *LLVMIntrinsicGetName(unsigned ID, size_t *NameLength);
3227
3228/** Deprecated: Use LLVMIntrinsicCopyOverloadedName2 instead. */
3230 LLVMTypeRef *OverloadTypes,
3231 size_t OverloadCount,
3232 size_t *NameLength);
3233
3234/**
3235 * Copies the name of an overloaded intrinsic identified by a given list of
3236 * overload types.
3237 *
3238 * Unlike LLVMIntrinsicGetName, the caller is responsible for freeing the
3239 * returned string.
3240 *
3241 * This version also supports unnamed types.
3242 *
3243 * @see llvm::Intrinsic::getName()
3244 */
3246 unsigned ID,
3247 LLVMTypeRef *OverloadTypes,
3248 size_t OverloadCount,
3249 size_t *NameLength);
3250
3251/**
3252 * Obtain if the intrinsic identified by the given ID is overloaded.
3253 *
3254 * @see llvm::Intrinsic::isOverloaded()
3255 */
3257
3258/**
3259 * Obtain the calling function of a function.
3260 *
3261 * The returned value corresponds to the LLVMCallConv enumeration.
3262 *
3263 * @see llvm::Function::getCallingConv()
3264 */
3266
3267/**
3268 * Set the calling convention of a function.
3269 *
3270 * @see llvm::Function::setCallingConv()
3271 *
3272 * @param Fn Function to operate on
3273 * @param CC LLVMCallConv to set calling convention to
3274 */
3276
3277/**
3278 * Obtain the name of the garbage collector to use during code
3279 * generation.
3280 *
3281 * @see llvm::Function::getGC()
3282 */
3284
3285/**
3286 * Define the garbage collector to use during code generation.
3287 *
3288 * @see llvm::Function::setGC()
3289 */
3290LLVM_C_ABI void LLVMSetGC(LLVMValueRef Fn, const char *Name);
3291
3292/**
3293 * Gets the prefix data associated with a function. Only valid on functions, and
3294 * only if LLVMHasPrefixData returns true.
3295 * See https://llvm.org/docs/LangRef.html#prefix-data
3296 */
3298
3299/**
3300 * Check if a given function has prefix data. Only valid on functions.
3301 * See https://llvm.org/docs/LangRef.html#prefix-data
3302 */
3304
3305/**
3306 * Sets the prefix data for the function. Only valid on functions.
3307 * See https://llvm.org/docs/LangRef.html#prefix-data
3308 */
3310
3311/**
3312 * Gets the prologue data associated with a function. Only valid on functions,
3313 * and only if LLVMHasPrologueData returns true.
3314 * See https://llvm.org/docs/LangRef.html#prologue-data
3315 */
3317
3318/**
3319 * Check if a given function has prologue data. Only valid on functions.
3320 * See https://llvm.org/docs/LangRef.html#prologue-data
3321 */
3323
3324/**
3325 * Sets the prologue data for the function. Only valid on functions.
3326 * See https://llvm.org/docs/LangRef.html#prologue-data
3327 */
3329
3330/**
3331 * Add an attribute to a function.
3332 *
3333 * @see llvm::Function::addAttribute()
3334 */
3338 LLVMAttributeIndex Idx);
3340 LLVMAttributeRef *Attrs);
3343 unsigned KindID);
3345 LLVMValueRef F, LLVMAttributeIndex Idx, const char *K, unsigned KLen);
3348 unsigned KindID);
3351 const char *K, unsigned KLen);
3352
3353/**
3354 * Add a target-dependent attribute to a function
3355 * @see llvm::AttrBuilder::addAttribute()
3356 */
3358 const char *A,
3359 const char *V);
3360
3361/**
3362 * @defgroup LLVMCCoreValueFunctionParameters Function Parameters
3363 *
3364 * Functions in this group relate to arguments/parameters on functions.
3365 *
3366 * Functions in this group expect LLVMValueRef instances that correspond
3367 * to llvm::Function instances.
3368 *
3369 * @{
3370 */
3371
3372/**
3373 * Obtain the number of parameters in a function.
3374 *
3375 * @see llvm::Function::arg_size()
3376 */
3378
3379/**
3380 * Obtain the parameters in a function.
3381 *
3382 * The takes a pointer to a pre-allocated array of LLVMValueRef that is
3383 * at least LLVMCountParams() long. This array will be filled with
3384 * LLVMValueRef instances which correspond to the parameters the
3385 * function receives. Each LLVMValueRef corresponds to a llvm::Argument
3386 * instance.
3387 *
3388 * @see llvm::Function::arg_begin()
3389 */
3391
3392/**
3393 * Obtain the parameter at the specified index.
3394 *
3395 * Parameters are indexed from 0.
3396 *
3397 * @see llvm::Function::arg_begin()
3398 */
3400
3401/**
3402 * Obtain the function to which this argument belongs.
3403 *
3404 * Unlike other functions in this group, this one takes an LLVMValueRef
3405 * that corresponds to a llvm::Attribute.
3406 *
3407 * The returned LLVMValueRef is the llvm::Function to which this
3408 * argument belongs.
3409 */
3411
3412/**
3413 * Obtain the first parameter to a function.
3414 *
3415 * @see llvm::Function::arg_begin()
3416 */
3418
3419/**
3420 * Obtain the last parameter to a function.
3421 *
3422 * @see llvm::Function::arg_end()
3423 */
3425
3426/**
3427 * Obtain the next parameter to a function.
3428 *
3429 * This takes an LLVMValueRef obtained from LLVMGetFirstParam() (which is
3430 * actually a wrapped iterator) and obtains the next parameter from the
3431 * underlying iterator.
3432 */
3434
3435/**
3436 * Obtain the previous parameter to a function.
3437 *
3438 * This is the opposite of LLVMGetNextParam().
3439 */
3441
3442/**
3443 * Set the alignment for a function parameter.
3444 *
3445 * @see llvm::Argument::addAttr()
3446 * @see llvm::AttrBuilder::addAlignmentAttr()
3447 */
3448LLVM_C_ABI void LLVMSetParamAlignment(LLVMValueRef Arg, unsigned Align);
3449
3450/**
3451 * @}
3452 */
3453
3454/**
3455 * @defgroup LLVMCCoreValueGlobalIFunc IFuncs
3456 *
3457 * Functions in this group relate to indirect functions.
3458 *
3459 * Functions in this group expect LLVMValueRef instances that correspond
3460 * to llvm::GlobalIFunc instances.
3461 *
3462 * @{
3463 */
3464
3465/**
3466 * Add a global indirect function to a module under a specified name.
3467 *
3468 * @see llvm::GlobalIFunc::create()
3469 */
3471 size_t NameLen, LLVMTypeRef Ty,
3472 unsigned AddrSpace,
3473 LLVMValueRef Resolver);
3474
3475/**
3476 * Obtain a GlobalIFunc value from a Module by its name.
3477 *
3478 * The returned value corresponds to a llvm::GlobalIFunc value.
3479 *
3480 * @see llvm::Module::getNamedIFunc()
3481 */
3483 const char *Name,
3484 size_t NameLen);
3485
3486/**
3487 * Obtain an iterator to the first GlobalIFunc in a Module.
3488 *
3489 * @see llvm::Module::ifunc_begin()
3490 */
3492
3493/**
3494 * Obtain an iterator to the last GlobalIFunc in a Module.
3495 *
3496 * @see llvm::Module::ifunc_end()
3497 */
3499
3500/**
3501 * Advance a GlobalIFunc iterator to the next GlobalIFunc.
3502 *
3503 * Returns NULL if the iterator was already at the end and there are no more
3504 * global aliases.
3505 */
3507
3508/**
3509 * Decrement a GlobalIFunc iterator to the previous GlobalIFunc.
3510 *
3511 * Returns NULL if the iterator was already at the beginning and there are
3512 * no previous global aliases.
3513 */
3515
3516/**
3517 * Retrieves the resolver function associated with this indirect function, or
3518 * NULL if it doesn't not exist.
3519 *
3520 * @see llvm::GlobalIFunc::getResolver()
3521 */
3523
3524/**
3525 * Sets the resolver function associated with this indirect function.
3526 *
3527 * @see llvm::GlobalIFunc::setResolver()
3528 */
3530 LLVMValueRef Resolver);
3531
3532/**
3533 * Remove a global indirect function from its parent module and delete it.
3534 *
3535 * @see llvm::GlobalIFunc::eraseFromParent()
3536 */
3538
3539/**
3540 * Remove a global indirect function from its parent module.
3541 *
3542 * This unlinks the global indirect function from its containing module but
3543 * keeps it alive.
3544 *
3545 * @see llvm::GlobalIFunc::removeFromParent()
3546 */
3548
3549/**
3550 * @}
3551 */
3552
3553/**
3554 * @}
3555 */
3556
3557/**
3558 * @}
3559 */
3560
3561/**
3562 * @}
3563 */
3564
3565/**
3566 * @defgroup LLVMCCoreValueMetadata Metadata
3567 *
3568 * @{
3569 */
3570
3571/**
3572 * Create an MDString value from a given string value.
3573 *
3574 * The MDString value does not take ownership of the given string, it remains
3575 * the responsibility of the caller to free it.
3576 *
3577 * @see llvm::MDString::get()
3578 */
3580 const char *Str, size_t SLen);
3581
3582/**
3583 * Create an MDNode value with the given array of operands.
3584 *
3585 * @see llvm::MDNode::get()
3586 */
3588 LLVMMetadataRef *MDs,
3589 size_t Count);
3590
3591/**
3592 * Obtain a Metadata as a Value.
3593 */
3595 LLVMMetadataRef MD);
3596
3597/**
3598 * Obtain a Value as a Metadata.
3599 */
3601
3602/**
3603 * Return a string representation of the metadata. Use
3604 * LLVMDisposeMessage to free the string.
3605 *
3606 * @see llvm::Metadata::print()
3607 */
3609
3610/**
3611 * Obtain the underlying string from a MDString value.
3612 *
3613 * @param V Instance to obtain string from.
3614 * @param Length Memory address which will hold length of returned string.
3615 * @return String data in MDString.
3616 */
3617LLVM_C_ABI const char *LLVMGetMDString(LLVMValueRef V, unsigned *Length);
3618
3619/**
3620 * Obtain the number of operands from an MDNode value.
3621 *
3622 * @param V MDNode to get number of operands from.
3623 * @return Number of operands of the MDNode.
3624 */
3626
3627/**
3628 * Obtain the given MDNode's operands.
3629 *
3630 * The passed LLVMValueRef pointer should point to enough memory to hold all of
3631 * the operands of the given MDNode (see LLVMGetMDNodeNumOperands) as
3632 * LLVMValueRefs. This memory will be populated with the LLVMValueRefs of the
3633 * MDNode's operands.
3634 *
3635 * @param V MDNode to get the operands from.
3636 * @param Dest Destination array for operands.
3637 */
3639
3640/**
3641 * Replace an operand at a specific index in a llvm::MDNode value.
3642 *
3643 * @see llvm::MDNode::replaceOperandWith()
3644 */
3646 LLVMMetadataRef Replacement);
3647
3648/** Deprecated: Use LLVMMDStringInContext2 instead. */
3650 unsigned SLen);
3651/** Deprecated: Use LLVMMDStringInContext2 instead. */
3653 LLVMValueRef LLVMMDString(const char *Str, unsigned SLen),
3654 "Use of the global context is deprecated, use LLVMMDStringInContext2 "
3655 "instead");
3656/** Deprecated: Use LLVMMDNodeInContext2 instead. */
3658 LLVMValueRef *Vals, unsigned Count);
3659/** Deprecated: Use LLVMMDNodeInContext2 instead. */
3661 LLVMValueRef LLVMMDNode(LLVMValueRef *Vals, unsigned Count),
3662 "Use of the global context is deprecated, use LLVMMDNodeInContext2 "
3663 "instead");
3664
3665/**
3666 * @}
3667 */
3668
3669/**
3670 * @defgroup LLVMCCoreOperandBundle Operand Bundles
3671 *
3672 * Functions in this group operate on LLVMOperandBundleRef instances that
3673 * correspond to llvm::OperandBundleDef instances.
3674 *
3675 * @see llvm::OperandBundleDef
3676 *
3677 * @{
3678 */
3679
3680/**
3681 * Create a new operand bundle.
3682 *
3683 * Every invocation should be paired with LLVMDisposeOperandBundle() or memory
3684 * will be leaked.
3685 *
3686 * @param Tag Tag name of the operand bundle
3687 * @param TagLen Length of Tag
3688 * @param Args Memory address of an array of bundle operands
3689 * @param NumArgs Length of Args
3690 */
3692 size_t TagLen,
3693 LLVMValueRef *Args,
3694 unsigned NumArgs);
3695
3696/**
3697 * Destroy an operand bundle.
3698 *
3699 * This must be called for every created operand bundle or memory will be
3700 * leaked.
3701 */
3703
3704/**
3705 * Obtain the tag of an operand bundle as a string.
3706 *
3707 * @param Bundle Operand bundle to obtain tag of.
3708 * @param Len Out parameter which holds the length of the returned string.
3709 * @return The tag name of Bundle.
3710 * @see OperandBundleDef::getTag()
3711 */
3713 size_t *Len);
3714
3715/**
3716 * Obtain the number of operands for an operand bundle.
3717 *
3718 * @param Bundle Operand bundle to obtain operand count of.
3719 * @return The number of operands.
3720 * @see OperandBundleDef::input_size()
3721 */
3723
3724/**
3725 * Obtain the operand for an operand bundle at the given index.
3726 *
3727 * @param Bundle Operand bundle to obtain operand of.
3728 * @param Index An operand index, must be less than
3729 * LLVMGetNumOperandBundleArgs().
3730 * @return The operand.
3731 */
3734
3735/**
3736 * @}
3737 */
3738
3739/**
3740 * @defgroup LLVMCCoreValueBasicBlock Basic Block
3741 *
3742 * A basic block represents a single entry single exit section of code.
3743 * Basic blocks contain a list of instructions which form the body of
3744 * the block.
3745 *
3746 * Basic blocks belong to functions. They have the type of label.
3747 *
3748 * Basic blocks are themselves values. However, the C API models them as
3749 * LLVMBasicBlockRef.
3750 *
3751 * @see llvm::BasicBlock
3752 *
3753 * @{
3754 */
3755
3756/**
3757 * Convert a basic block instance to a value type.
3758 */
3760
3761/**
3762 * Determine whether an LLVMValueRef is itself a basic block.
3763 */
3765
3766/**
3767 * Convert an LLVMValueRef to an LLVMBasicBlockRef instance.
3768 */
3770
3771/**
3772 * Obtain the string name of a basic block.
3773 */
3775
3776/**
3777 * Obtain the function to which a basic block belongs.
3778 *
3779 * @see llvm::BasicBlock::getParent()
3780 */
3782
3783/**
3784 * Obtain the terminator instruction for a basic block.
3785 *
3786 * If the basic block does not have a terminator (it is not well-formed
3787 * if it doesn't), then NULL is returned.
3788 *
3789 * The returned LLVMValueRef corresponds to an llvm::Instruction.
3790 *
3791 * @see llvm::BasicBlock::getTerminator()
3792 */
3794
3795/**
3796 * Obtain the number of basic blocks in a function.
3797 *
3798 * @param Fn Function value to operate on.
3799 */
3801
3802/**
3803 * Obtain all of the basic blocks in a function.
3804 *
3805 * This operates on a function value. The BasicBlocks parameter is a
3806 * pointer to a pre-allocated array of LLVMBasicBlockRef of at least
3807 * LLVMCountBasicBlocks() in length. This array is populated with
3808 * LLVMBasicBlockRef instances.
3809 */
3811 LLVMBasicBlockRef *BasicBlocks);
3812
3813/**
3814 * Obtain the first basic block in a function.
3815 *
3816 * The returned basic block can be used as an iterator. You will likely
3817 * eventually call into LLVMGetNextBasicBlock() with it.
3818 *
3819 * @see llvm::Function::begin()
3820 */
3822
3823/**
3824 * Obtain the last basic block in a function.
3825 *
3826 * @see llvm::Function::end()
3827 */
3829
3830/**
3831 * Advance a basic block iterator.
3832 */
3834
3835/**
3836 * Go backwards in a basic block iterator.
3837 */
3839
3840/**
3841 * Obtain the basic block that corresponds to the entry point of a
3842 * function.
3843 *
3844 * @see llvm::Function::getEntryBlock()
3845 */
3847
3848/**
3849 * Insert the given basic block after the insertion point of the given builder.
3850 *
3851 * The insertion point must be valid.
3852 *
3853 * @see llvm::Function::BasicBlockListType::insertAfter()
3854 */
3855LLVM_C_ABI void
3858
3859/**
3860 * Append the given basic block to the basic block list of the given function.
3861 *
3862 * @see llvm::Function::BasicBlockListType::push_back()
3863 */
3866
3867/**
3868 * Create a new basic block without inserting it into a function.
3869 *
3870 * @see llvm::BasicBlock::Create()
3871 */
3873 const char *Name);
3874
3875/**
3876 * Append a basic block to the end of a function.
3877 *
3878 * @see llvm::BasicBlock::Create()
3879 */
3881 LLVMValueRef Fn,
3882 const char *Name);
3883
3884/**
3885 * Append a basic block to the end of a function using the global
3886 * context.
3887 *
3888 * @see llvm::BasicBlock::Create()
3889 */
3892 "Use of the global context is deprecated, use "
3893 "LLVMAppendBasicBlockInContext instead");
3894
3895/**
3896 * Insert a basic block in a function before another basic block.
3897 *
3898 * The function to add to is determined by the function of the
3899 * passed basic block.
3900 *
3901 * @see llvm::BasicBlock::Create()
3902 */
3905 const char *Name);
3906
3907/**
3908 * Insert a basic block in a function using the global context.
3909 *
3910 * @see llvm::BasicBlock::Create()
3911 */
3914 const char *Name),
3915 "Use of the global context is deprecated, use "
3916 "LLVMInsertBasicBlockInContext instead");
3917
3918/**
3919 * Remove a basic block from a function and delete it.
3920 *
3921 * This deletes the basic block from its containing function and deletes
3922 * the basic block itself.
3923 *
3924 * @see llvm::BasicBlock::eraseFromParent()
3925 */
3927
3928/**
3929 * Remove a basic block from a function.
3930 *
3931 * This deletes the basic block from its containing function but keep
3932 * the basic block alive.
3933 *
3934 * @see llvm::BasicBlock::removeFromParent()
3935 */
3937
3938/**
3939 * Move a basic block to before another one.
3940 *
3941 * @see llvm::BasicBlock::moveBefore()
3942 */
3944 LLVMBasicBlockRef MovePos);
3945
3946/**
3947 * Move a basic block to after another one.
3948 *
3949 * @see llvm::BasicBlock::moveAfter()
3950 */
3952 LLVMBasicBlockRef MovePos);
3953
3954/**
3955 * Obtain the first instruction in a basic block.
3956 *
3957 * The returned LLVMValueRef corresponds to a llvm::Instruction
3958 * instance.
3959 */
3961
3962/**
3963 * Obtain the last instruction in a basic block.
3964 *
3965 * The returned LLVMValueRef corresponds to an LLVM:Instruction.
3966 */
3968
3969/**
3970 * @}
3971 */
3972
3973/**
3974 * @defgroup LLVMCCoreValueInstruction Instructions
3975 *
3976 * Functions in this group relate to the inspection and manipulation of
3977 * individual instructions.
3978 *
3979 * In the C++ API, an instruction is modeled by llvm::Instruction. This
3980 * class has a large number of descendents. llvm::Instruction is a
3981 * llvm::Value and in the C API, instructions are modeled by
3982 * LLVMValueRef.
3983 *
3984 * This group also contains sub-groups which operate on specific
3985 * llvm::Instruction types, e.g. llvm::CallInst.
3986 *
3987 * @{
3988 */
3989
3990/**
3991 * Determine whether an instruction has any metadata attached.
3992 */
3994
3995/**
3996 * Return metadata associated with an instruction value.
3997 */
3999
4000/**
4001 * Set metadata associated with an instruction value.
4002 */
4003LLVM_C_ABI void LLVMSetMetadata(LLVMValueRef Val, unsigned KindID,
4005
4006/**
4007 * Returns the metadata associated with an instruction value, but filters out
4008 * all the debug locations.
4009 *
4010 * @see llvm::Instruction::getAllMetadataOtherThanDebugLoc()
4011 */
4014 size_t *NumEntries);
4015
4016/**
4017 * Obtain the basic block to which an instruction belongs.
4018 *
4019 * @see llvm::Instruction::getParent()
4020 */
4022
4023/**
4024 * Obtain the instruction that occurs after the one specified.
4025 *
4026 * The next instruction will be from the same basic block.
4027 *
4028 * If this is the last instruction in a basic block, NULL will be
4029 * returned.
4030 */
4032
4033/**
4034 * Obtain the instruction that occurred before this one.
4035 *
4036 * If the instruction is the first instruction in a basic block, NULL
4037 * will be returned.
4038 */
4040
4041/**
4042 * Remove an instruction.
4043 *
4044 * The instruction specified is removed from its containing building
4045 * block but is kept alive.
4046 *
4047 * @see llvm::Instruction::removeFromParent()
4048 */
4050
4051/**
4052 * Remove and delete an instruction.
4053 *
4054 * The instruction specified is removed from its containing building
4055 * block and then deleted.
4056 *
4057 * @see llvm::Instruction::eraseFromParent()
4058 */
4060
4061/**
4062 * Delete an instruction.
4063 *
4064 * The instruction specified is deleted. It must have previously been
4065 * removed from its containing building block.
4066 *
4067 * @see llvm::Value::deleteValue()
4068 */
4070
4071/**
4072 * Obtain the code opcode for an individual instruction.
4073 *
4074 * @see llvm::Instruction::getOpCode()
4075 */
4077
4078/**
4079 * Obtain the predicate of an instruction.
4080 *
4081 * This is only valid for instructions that correspond to llvm::ICmpInst.
4082 *
4083 * @see llvm::ICmpInst::getPredicate()
4084 */
4086
4087/**
4088 * Get whether or not an icmp instruction has the samesign flag.
4089 *
4090 * This is only valid for instructions that correspond to llvm::ICmpInst.
4091 *
4092 * @see llvm::ICmpInst::hasSameSign()
4093 */
4095
4096/**
4097 * Set the samesign flag on an icmp instruction.
4098 *
4099 * This is only valid for instructions that correspond to llvm::ICmpInst.
4100 *
4101 * @see llvm::ICmpInst::setSameSign()
4102 */
4104
4105/**
4106 * Obtain the float predicate of an instruction.
4107 *
4108 * This is only valid for instructions that correspond to llvm::FCmpInst.
4109 *
4110 * @see llvm::FCmpInst::getPredicate()
4111 */
4113
4114/**
4115 * Create a copy of 'this' instruction that is identical in all ways
4116 * except the following:
4117 * * The instruction has no parent
4118 * * The instruction has no name
4119 *
4120 * @see llvm::Instruction::clone()
4121 */
4123
4124/**
4125 * Determine whether an instruction is a terminator. This routine is named to
4126 * be compatible with historical functions that did this by querying the
4127 * underlying C++ type.
4128 *
4129 * @see llvm::Instruction::isTerminator()
4130 */
4132
4133/**
4134 * Obtain the first debug record attached to an instruction.
4135 *
4136 * Use LLVMGetNextDbgRecord() and LLVMGetPreviousDbgRecord() to traverse the
4137 * sequence of DbgRecords.
4138 *
4139 * Return the first DbgRecord attached to Inst or NULL if there are none.
4140 *
4141 * @see llvm::Instruction::getDbgRecordRange()
4142 */
4144
4145/**
4146 * Obtain the last debug record attached to an instruction.
4147 *
4148 * Return the last DbgRecord attached to Inst or NULL if there are none.
4149 *
4150 * @see llvm::Instruction::getDbgRecordRange()
4151 */
4153
4154/**
4155 * Obtain the next DbgRecord in the sequence or NULL if there are no more.
4156 *
4157 * @see llvm::Instruction::getDbgRecordRange()
4158 */
4160
4161/**
4162 * Obtain the previous DbgRecord in the sequence or NULL if there are no more.
4163 *
4164 * @see llvm::Instruction::getDbgRecordRange()
4165 */
4168
4169/**
4170 * Get the debug location attached to the debug record.
4171 *
4172 * @see llvm::DbgRecord::getDebugLoc()
4173 */
4175
4177
4178/**
4179 * Get the value of the DbgVariableRecord.
4180 *
4181 * @see llvm::DbgVariableRecord::getValue()
4182 */
4184 unsigned OpIdx);
4185
4186/**
4187 * Get the debug info variable of the DbgVariableRecord.
4188 *
4189 * @see llvm::DbgVariableRecord::getVariable()
4190 */
4193
4194/**
4195 * Get the debug info expression of the DbgVariableRecord.
4196 *
4197 * @see llvm::DbgVariableRecord::getExpression()
4198 */
4201
4202/**
4203 * @defgroup LLVMCCoreValueInstructionCall Call Sites and Invocations
4204 *
4205 * Functions in this group apply to instructions that refer to call
4206 * sites and invocations. These correspond to C++ types in the
4207 * llvm::CallInst class tree.
4208 *
4209 * @{
4210 */
4211
4212/**
4213 * Obtain the argument count for a call instruction.
4214 *
4215 * This expects an LLVMValueRef that corresponds to a llvm::CallInst,
4216 * llvm::InvokeInst, or llvm:FuncletPadInst.
4217 *
4218 * @see llvm::CallInst::getNumArgOperands()
4219 * @see llvm::InvokeInst::getNumArgOperands()
4220 * @see llvm::FuncletPadInst::getNumArgOperands()
4221 */
4223
4224/**
4225 * Set the calling convention for a call instruction.
4226 *
4227 * This expects an LLVMValueRef that corresponds to a llvm::CallInst or
4228 * llvm::InvokeInst.
4229 *
4230 * @see llvm::CallInst::setCallingConv()
4231 * @see llvm::InvokeInst::setCallingConv()
4232 */
4234
4235/**
4236 * Obtain the calling convention for a call instruction.
4237 *
4238 * This is the opposite of LLVMSetInstructionCallConv(). Reads its
4239 * usage.
4240 *
4241 * @see LLVMSetInstructionCallConv()
4242 */
4244
4247 unsigned Align);
4248
4252 LLVMAttributeIndex Idx);
4255 LLVMAttributeRef *Attrs);
4258 unsigned KindID);
4260 LLVMValueRef C, LLVMAttributeIndex Idx, const char *K, unsigned KLen);
4263 unsigned KindID);
4266 const char *K, unsigned KLen);
4267
4268/**
4269 * Obtain the function type called by this instruction.
4270 *
4271 * @see llvm::CallBase::getFunctionType()
4272 */
4274
4275/**
4276 * Obtain the pointer to the function invoked by this instruction.
4277 *
4278 * This expects an LLVMValueRef that corresponds to a llvm::CallInst or
4279 * llvm::InvokeInst.
4280 *
4281 * @see llvm::CallInst::getCalledOperand()
4282 * @see llvm::InvokeInst::getCalledOperand()
4283 */
4285
4286/**
4287 * Obtain the number of operand bundles attached to this instruction.
4288 *
4289 * This only works on llvm::CallInst and llvm::InvokeInst instructions.
4290 *
4291 * @see llvm::CallBase::getNumOperandBundles()
4292 */
4294
4295/**
4296 * Obtain the operand bundle attached to this instruction at the given index.
4297 * Use LLVMDisposeOperandBundle to free the operand bundle.
4298 *
4299 * This only works on llvm::CallInst and llvm::InvokeInst instructions.
4300 */
4302 unsigned Index);
4303
4304/**
4305 * Obtain whether a call instruction is a tail call.
4306 *
4307 * This only works on llvm::CallInst instructions.
4308 *
4309 * @see llvm::CallInst::isTailCall()
4310 */
4312
4313/**
4314 * Set whether a call instruction is a tail call.
4315 *
4316 * This only works on llvm::CallInst instructions.
4317 *
4318 * @see llvm::CallInst::setTailCall()
4319 */
4320LLVM_C_ABI void LLVMSetTailCall(LLVMValueRef CallInst, LLVMBool IsTailCall);
4321
4322/**
4323 * Obtain a tail call kind of the call instruction.
4324 *
4325 * @see llvm::CallInst::setTailCallKind()
4326 */
4328
4329/**
4330 * Set the call kind of the call instruction.
4331 *
4332 * @see llvm::CallInst::getTailCallKind()
4333 */
4335 LLVMTailCallKind kind);
4336
4337/**
4338 * Return the normal destination basic block.
4339 *
4340 * This only works on llvm::InvokeInst instructions.
4341 *
4342 * @see llvm::InvokeInst::getNormalDest()
4343 */
4345
4346/**
4347 * Return the unwind destination basic block.
4348 *
4349 * Works on llvm::InvokeInst, llvm::CleanupReturnInst, and
4350 * llvm::CatchSwitchInst instructions.
4351 *
4352 * @see llvm::InvokeInst::getUnwindDest()
4353 * @see llvm::CleanupReturnInst::getUnwindDest()
4354 * @see llvm::CatchSwitchInst::getUnwindDest()
4355 */
4357
4358/**
4359 * Set the normal destination basic block.
4360 *
4361 * This only works on llvm::InvokeInst instructions.
4362 *
4363 * @see llvm::InvokeInst::setNormalDest()
4364 */
4366
4367/**
4368 * Set the unwind destination basic block.
4369 *
4370 * Works on llvm::InvokeInst, llvm::CleanupReturnInst, and
4371 * llvm::CatchSwitchInst instructions.
4372 *
4373 * @see llvm::InvokeInst::setUnwindDest()
4374 * @see llvm::CleanupReturnInst::setUnwindDest()
4375 * @see llvm::CatchSwitchInst::setUnwindDest()
4376 */
4378
4379/**
4380 * Get the default destination of a CallBr instruction.
4381 *
4382 * @see llvm::CallBrInst::getDefaultDest()
4383 */
4385
4386/**
4387 * Get the number of indirect destinations of a CallBr instruction.
4388 *
4389 * @see llvm::CallBrInst::getNumIndirectDests()
4390
4391 */
4393
4394/**
4395 * Get the indirect destination of a CallBr instruction at the given index.
4396 *
4397 * @see llvm::CallBrInst::getIndirectDest()
4398 */
4400 unsigned Idx);
4401
4402/**
4403 * @}
4404 */
4405
4406/**
4407 * @defgroup LLVMCCoreValueInstructionTerminator Terminators
4408 *
4409 * Functions in this group only apply to instructions for which
4410 * LLVMIsATerminatorInst returns true.
4411 *
4412 * @{
4413 */
4414
4415/**
4416 * Return the number of successors that this terminator has.
4417 *
4418 * @see llvm::Instruction::getNumSuccessors
4419 */
4421
4422/**
4423 * Return the specified successor.
4424 *
4425 * @see llvm::Instruction::getSuccessor
4426 */
4428
4429/**
4430 * Update the specified successor to point at the provided block.
4431 *
4432 * @see llvm::Instruction::setSuccessor
4433 */
4434LLVM_C_ABI void LLVMSetSuccessor(LLVMValueRef Term, unsigned i,
4436
4437/**
4438 * Return if an instruction is a conditional branch.
4439 *
4440 * Deprecated: Use LLVMIsACondBrInst instead.
4441 */
4443
4444/**
4445 * Return the condition of a branch instruction.
4446 *
4447 * This only works on llvm::CondBrInst instructions.
4448 *
4449 * @see llvm::CondBrInst::getCondition
4450 */
4452
4453/**
4454 * Set the condition of a branch instruction.
4455 *
4456 * This only works on llvm::CondBrInst instructions.
4457 *
4458 * @see llvm::CondBrInst::setCondition
4459 */
4461
4462/**
4463 * Obtain the default destination basic block of a switch instruction.
4464 *
4465 * This only works on llvm::SwitchInst instructions.
4466 *
4467 * @see llvm::SwitchInst::getDefaultDest()
4468 */
4470
4471/**
4472 * Obtain the case value for a successor of a switch instruction. i corresponds
4473 * to the successor index. The first successor is the default destination, so i
4474 * must be greater than zero.
4475 *
4476 * This only works on llvm::SwitchInst instructions.
4477 *
4478 * @see llvm::SwitchInst::CaseHandle::getCaseValue()
4479 */
4481 unsigned i);
4482
4483/**
4484 * Set the case value for a successor of a switch instruction. i corresponds to
4485 * the successor index. The first successor is the default destination, so i
4486 * must be greater than zero.
4487 *
4488 * This only works on llvm::SwitchInst instructions.
4489 *
4490 * @see llvm::SwitchInst::CaseHandle::setValue()
4491 */
4492LLVM_C_ABI void LLVMSetSwitchCaseValue(LLVMValueRef SwitchInstr, unsigned i,
4493 LLVMValueRef CaseValue);
4494
4495/**
4496 * @}
4497 */
4498
4499/**
4500 * @defgroup LLVMCCoreValueInstructionAlloca Allocas
4501 *
4502 * Functions in this group only apply to instructions that map to
4503 * llvm::AllocaInst instances.
4504 *
4505 * @{
4506 */
4507
4508/**
4509 * Obtain the type that is being allocated by the alloca instruction.
4510 */
4512
4513/**
4514 * @}
4515 */
4516
4517/**
4518 * @defgroup LLVMCCoreValueInstructionGetElementPointer GEPs
4519 *
4520 * Functions in this group only apply to instructions that map to
4521 * llvm::GetElementPtrInst instances.
4522 *
4523 * @{
4524 */
4525
4526/**
4527 * Check whether the given GEP operator is inbounds.
4528 */
4530
4531/**
4532 * Set the given GEP instruction to be inbounds or not.
4533 */
4535
4536/**
4537 * Get the source element type of the given GEP operator.
4538 */
4540
4541/**
4542 * Get the no-wrap related flags for the given GEP instruction.
4543 *
4544 * @see llvm::GetElementPtrInst::getNoWrapFlags
4545 */
4547
4548/**
4549 * Set the no-wrap related flags for the given GEP instruction.
4550 *
4551 * @see llvm::GetElementPtrInst::setNoWrapFlags
4552 */
4554 LLVMGEPNoWrapFlags NoWrapFlags);
4555
4556/**
4557 * @}
4558 */
4559
4560/**
4561 * @defgroup LLVMCCoreValueInstructionPHINode PHI Nodes
4562 *
4563 * Functions in this group only apply to instructions that map to
4564 * llvm::PHINode instances.
4565 *
4566 * @{
4567 */
4568
4569/**
4570 * Add an incoming value to the end of a PHI list.
4571 */
4573 LLVMValueRef *IncomingValues,
4574 LLVMBasicBlockRef *IncomingBlocks,
4575 unsigned Count);
4576
4577/**
4578 * Obtain the number of incoming basic blocks to a PHI node.
4579 */
4580LLVM_C_ABI unsigned LLVMCountIncoming(LLVMValueRef PhiNode);
4581
4582/**
4583 * Obtain an incoming value to a PHI node as an LLVMValueRef.
4584 */
4586 unsigned Index);
4587
4588/**
4589 * Obtain an incoming value to a PHI node as an LLVMBasicBlockRef.
4590 */
4592 unsigned Index);
4593
4594/**
4595 * @}
4596 */
4597
4598/**
4599 * @defgroup LLVMCCoreValueInstructionExtractValue ExtractValue
4600 * @defgroup LLVMCCoreValueInstructionInsertValue InsertValue
4601 *
4602 * Functions in this group only apply to instructions that map to
4603 * llvm::ExtractValue and llvm::InsertValue instances.
4604 *
4605 * @{
4606 */
4607
4608/**
4609 * Obtain the number of indices.
4610 * NB: This also works on GEP operators.
4611 */
4613
4614/**
4615 * Obtain the indices as an array.
4616 */
4618
4619/**
4620 * @}
4621 */
4622
4623/**
4624 * @}
4625 */
4626
4627/**
4628 * @}
4629 */
4630
4631/**
4632 * @defgroup LLVMCCoreInstructionBuilder Instruction Builders
4633 *
4634 * An instruction builder represents a point within a basic block and is
4635 * the exclusive means of building instructions using the C interface.
4636 *
4637 * @{
4638 */
4639
4643 "Use LLVMCreateBuilderForModule instead");
4646 "Use of the global context is deprecated, use "
4647 "LLVMCreateBuilderForModule instead");
4648
4650/**
4651 * Set the builder position before Instr but after any attached debug records,
4652 * or if Instr is null set the position to the end of Block.
4653 */
4655 LLVMBasicBlockRef Block,
4656 LLVMValueRef Instr);
4657/**
4658 * Set the builder position before Instr and any attached debug records,
4659 * or if Instr is null set the position to the end of Block.
4660 */
4662 LLVMBasicBlockRef Block,
4663 LLVMValueRef Inst);
4664/**
4665 * Set the builder position before Instr but after any attached debug records.
4666 */
4668 LLVMValueRef Instr);
4669/**
4670 * Set the builder position before Instr and any attached debug records.
4671 */
4672LLVM_C_ABI void
4674 LLVMValueRef Instr);
4676 LLVMBasicBlockRef Block);
4680 LLVMValueRef Instr);
4682 LLVMValueRef Instr,
4683 const char *Name);
4685
4686/* Metadata */
4687
4688/**
4689 * Get location information used by debugging information.
4690 *
4691 * @see llvm::IRBuilder::getCurrentDebugLocation()
4692 */
4694
4695/**
4696 * Set location information used by debugging information.
4697 *
4698 * To clear the location metadata of the given instruction, pass NULL to \p Loc.
4699 *
4700 * @see llvm::IRBuilder::SetCurrentDebugLocation()
4701 */
4703 LLVMMetadataRef Loc);
4704
4705/**
4706 * Attempts to set the debug location for the given instruction using the
4707 * current debug location for the given builder. If the builder has no current
4708 * debug location, this function is a no-op.
4709 *
4710 * @see llvm::IRBuilder::SetInstDebugLocation()
4711 */
4713 LLVMValueRef Inst);
4714
4715/**
4716 * Same as LLVMSetInstDebugLocation.
4717 *
4718 * @deprecated Use the identical LLVMSetInstDebugLocation.
4719 *
4720 * @see llvm::IRBuilder::SetInstDebugLocation()
4721 */
4723 LLVMValueRef Inst);
4724
4725/**
4726 * Get the dafult floating-point math metadata for a given builder.
4727 *
4728 * @see llvm::IRBuilder::getDefaultFPMathTag()
4729 */
4732
4733/**
4734 * Set the default floating-point math metadata for the given builder.
4735 *
4736 * To clear the metadata, pass NULL to \p FPMathTag.
4737 *
4738 * @see llvm::IRBuilder::setDefaultFPMathTag()
4739 */
4741 LLVMMetadataRef FPMathTag);
4742
4743/**
4744 * Obtain the context to which this builder is associated.
4745 *
4746 * @see llvm::IRBuilder::getContext()
4747 */
4749
4750/**
4751 * Deprecated: Passing the NULL location will crash.
4752 * Use LLVMGetCurrentDebugLocation2 instead.
4753 */
4755 LLVMValueRef L);
4756/**
4757 * Deprecated: Returning the NULL location will crash.
4758 * Use LLVMGetCurrentDebugLocation2 instead.
4759 */
4761
4762/* Terminators */
4766 LLVMValueRef *RetVals,
4767 unsigned N);
4770 LLVMBasicBlockRef Then,
4771 LLVMBasicBlockRef Else);
4773 LLVMBasicBlockRef Else,
4774 unsigned NumCases);
4776 unsigned NumDests);
4779 LLVMBasicBlockRef DefaultDest, LLVMBasicBlockRef *IndirectDests,
4780 unsigned NumIndirectDests, LLVMValueRef *Args, unsigned NumArgs,
4781 LLVMOperandBundleRef *Bundles, unsigned NumBundles, const char *Name);
4783 LLVMValueRef Fn, LLVMValueRef *Args,
4784 unsigned NumArgs,
4785 LLVMBasicBlockRef Then,
4786 LLVMBasicBlockRef Catch,
4787 const char *Name);
4790 unsigned NumArgs, LLVMBasicBlockRef Then, LLVMBasicBlockRef Catch,
4791 LLVMOperandBundleRef *Bundles, unsigned NumBundles, const char *Name);
4793
4794/* Exception Handling */
4797 LLVMValueRef PersFn,
4798 unsigned NumClauses,
4799 const char *Name);
4801 LLVMValueRef CatchPad,
4804 LLVMValueRef CatchPad,
4807 LLVMValueRef ParentPad,
4808 LLVMValueRef *Args, unsigned NumArgs,
4809 const char *Name);
4811 LLVMValueRef ParentPad,
4812 LLVMValueRef *Args,
4813 unsigned NumArgs, const char *Name);
4815 LLVMValueRef ParentPad,
4816 LLVMBasicBlockRef UnwindBB,
4817 unsigned NumHandlers,
4818 const char *Name);
4819
4820/* Add a case to the switch instruction */
4822 LLVMBasicBlockRef Dest);
4823
4824/* Add a destination to the indirectbr instruction */
4826 LLVMBasicBlockRef Dest);
4827
4828/* Get the number of clauses on the landingpad instruction */
4829LLVM_C_ABI unsigned LLVMGetNumClauses(LLVMValueRef LandingPad);
4830
4831/* Get the value of the clause at index Idx on the landingpad instruction */
4832LLVM_C_ABI LLVMValueRef LLVMGetClause(LLVMValueRef LandingPad, unsigned Idx);
4833
4834/* Add a catch or filter clause to the landingpad instruction */
4835LLVM_C_ABI void LLVMAddClause(LLVMValueRef LandingPad, LLVMValueRef ClauseVal);
4836
4837/* Get the 'cleanup' flag in the landingpad instruction */
4839
4840/* Set the 'cleanup' flag in the landingpad instruction */
4841LLVM_C_ABI void LLVMSetCleanup(LLVMValueRef LandingPad, LLVMBool Val);
4842
4843/* Add a destination to the catchswitch instruction */
4844LLVM_C_ABI void LLVMAddHandler(LLVMValueRef CatchSwitch,
4845 LLVMBasicBlockRef Dest);
4846
4847/* Get the number of handlers on the catchswitch instruction */
4848LLVM_C_ABI unsigned LLVMGetNumHandlers(LLVMValueRef CatchSwitch);
4849
4850/**
4851 * Obtain the basic blocks acting as handlers for a catchswitch instruction.
4852 *
4853 * The Handlers parameter should point to a pre-allocated array of
4854 * LLVMBasicBlockRefs at least LLVMGetNumHandlers() large. On return, the
4855 * first LLVMGetNumHandlers() entries in the array will be populated
4856 * with LLVMBasicBlockRef instances.
4857 *
4858 * @param CatchSwitch The catchswitch instruction to operate on.
4859 * @param Handlers Memory address of an array to be filled with basic blocks.
4860 */
4861LLVM_C_ABI void LLVMGetHandlers(LLVMValueRef CatchSwitch,
4862 LLVMBasicBlockRef *Handlers);
4863
4864/* Funclets */
4865
4866/* Get the number of funcletpad arguments. */
4868
4869/* Set a funcletpad argument at the given index. */
4870LLVM_C_ABI void LLVMSetArgOperand(LLVMValueRef Funclet, unsigned i,
4871 LLVMValueRef value);
4872
4873/**
4874 * Get the parent catchswitch instruction of a catchpad instruction.
4875 *
4876 * This only works on llvm::CatchPadInst instructions.
4877 *
4878 * @see llvm::CatchPadInst::getCatchSwitch()
4879 */
4881
4882/**
4883 * Set the parent catchswitch instruction of a catchpad instruction.
4884 *
4885 * This only works on llvm::CatchPadInst instructions.
4886 *
4887 * @see llvm::CatchPadInst::setCatchSwitch()
4888 */
4890 LLVMValueRef CatchSwitch);
4891
4892/* Arithmetic */
4894 LLVMValueRef RHS, const char *Name);
4896 LLVMValueRef RHS, const char *Name);
4898 LLVMValueRef RHS, const char *Name);
4900 LLVMValueRef RHS, const char *Name);
4902 LLVMValueRef RHS, const char *Name);
4904 LLVMValueRef RHS, const char *Name);
4906 LLVMValueRef RHS, const char *Name);
4908 LLVMValueRef RHS, const char *Name);
4910 LLVMValueRef RHS, const char *Name);
4912 LLVMValueRef RHS, const char *Name);
4914 LLVMValueRef RHS, const char *Name);
4916 LLVMValueRef RHS, const char *Name);
4918 LLVMValueRef RHS, const char *Name);
4920 LLVMValueRef RHS, const char *Name);
4922 LLVMValueRef RHS, const char *Name);
4924 LLVMValueRef RHS, const char *Name);
4926 LLVMValueRef RHS, const char *Name);
4928 LLVMValueRef RHS, const char *Name);
4930 LLVMValueRef RHS, const char *Name);
4932 LLVMValueRef RHS, const char *Name);
4934 LLVMValueRef RHS, const char *Name);
4936 LLVMValueRef RHS, const char *Name);
4938 LLVMValueRef RHS, const char *Name);
4940 LLVMValueRef RHS, const char *Name);
4942 LLVMValueRef RHS, const char *Name);
4944 LLVMValueRef RHS, const char *Name);
4947 const char *Name);
4949 const char *Name);
4951 const char *Name);
4954 const char *Name),
4955 "Use LLVMBuildNeg + LLVMSetNUW instead.");
4957 const char *Name);
4959 const char *Name);
4960
4962LLVM_C_ABI void LLVMSetNUW(LLVMValueRef ArithInst, LLVMBool HasNUW);
4964LLVM_C_ABI void LLVMSetNSW(LLVMValueRef ArithInst, LLVMBool HasNSW);
4966LLVM_C_ABI void LLVMSetExact(LLVMValueRef DivOrShrInst, LLVMBool IsExact);
4967
4968/**
4969 * Gets if the instruction has the non-negative flag set.
4970 * Only valid for zext instructions.
4971 */
4973/**
4974 * Sets the non-negative flag for the instruction.
4975 * Only valid for zext instructions.
4976 */
4977LLVM_C_ABI void LLVMSetNNeg(LLVMValueRef NonNegInst, LLVMBool IsNonNeg);
4978
4979/**
4980 * Get the flags for which fast-math-style optimizations are allowed for this
4981 * value.
4982 *
4983 * Only valid on floating point instructions.
4984 * @see LLVMCanValueUseFastMathFlags
4985 */
4987
4988/**
4989 * Sets the flags for which fast-math-style optimizations are allowed for this
4990 * value.
4991 *
4992 * Only valid on floating point instructions.
4993 * @see LLVMCanValueUseFastMathFlags
4994 */
4996 LLVMFastMathFlags FMF);
4997
4998/**
4999 * Check if a given value can potentially have fast math flags.
5000 *
5001 * Will return true for floating point arithmetic instructions, and for select,
5002 * phi, and call instructions whose type is a floating point type, or a vector
5003 * or array thereof. See https://llvm.org/docs/LangRef.html#fast-math-flags
5004 */
5006
5007/**
5008 * Gets whether the instruction has the disjoint flag set.
5009 * Only valid for or instructions.
5010 */
5012/**
5013 * Sets the disjoint flag for the instruction.
5014 * Only valid for or instructions.
5015 */
5016LLVM_C_ABI void LLVMSetIsDisjoint(LLVMValueRef Inst, LLVMBool IsDisjoint);
5017
5018/* Memory */
5020 const char *Name);
5022 LLVMValueRef Val,
5023 const char *Name);
5024
5025/**
5026 * Creates and inserts a memset to the specified pointer and the
5027 * specified value.
5028 *
5029 * @see llvm::IRRBuilder::CreateMemSet()
5030 */
5032 LLVMValueRef Val, LLVMValueRef Len,
5033 unsigned Align);
5034/**
5035 * Creates and inserts a memcpy between the specified pointers.
5036 *
5037 * @see llvm::IRRBuilder::CreateMemCpy()
5038 */
5040 unsigned DstAlign, LLVMValueRef Src,
5041 unsigned SrcAlign, LLVMValueRef Size);
5042/**
5043 * Creates and inserts a memmove between the specified pointers.
5044 *
5045 * @see llvm::IRRBuilder::CreateMemMove()
5046 */
5048 unsigned DstAlign, LLVMValueRef Src,
5049 unsigned SrcAlign, LLVMValueRef Size);
5050
5052 const char *Name);
5054 LLVMValueRef Val,
5055 const char *Name);
5058 LLVMValueRef PointerVal,
5059 const char *Name);
5061 LLVMValueRef Ptr);
5063 LLVMValueRef Pointer,
5064 LLVMValueRef *Indices,
5065 unsigned NumIndices, const char *Name);
5067 LLVMValueRef Pointer,
5068 LLVMValueRef *Indices,
5069 unsigned NumIndices,
5070 const char *Name);
5071/**
5072 * Creates a GetElementPtr instruction. Similar to LLVMBuildGEP2, but allows
5073 * specifying the no-wrap flags.
5074 *
5075 * @see llvm::IRBuilder::CreateGEP()
5076 */
5079 LLVMValueRef *Indices, unsigned NumIndices, const char *Name,
5080 LLVMGEPNoWrapFlags NoWrapFlags);
5082 LLVMValueRef Pointer, unsigned Idx,
5083 const char *Name);
5085 const char *Name);
5086/**
5087 * Deprecated: Use LLVMBuildGlobalString instead, which has identical behavior.
5088 */
5090 const char *Str,
5091 const char *Name);
5093LLVM_C_ABI void LLVMSetVolatile(LLVMValueRef MemoryAccessInst,
5094 LLVMBool IsVolatile);
5096LLVM_C_ABI void LLVMSetWeak(LLVMValueRef CmpXchgInst, LLVMBool IsWeak);
5098LLVM_C_ABI void LLVMSetOrdering(LLVMValueRef MemoryAccessInst,
5099 LLVMAtomicOrdering Ordering);
5102 LLVMAtomicRMWBinOp BinOp);
5103
5104/* Casts */
5106 LLVMTypeRef DestTy, const char *Name);
5108 LLVMTypeRef DestTy, const char *Name);
5110 LLVMTypeRef DestTy, const char *Name);
5112 LLVMTypeRef DestTy, const char *Name);
5114 LLVMTypeRef DestTy, const char *Name);
5116 LLVMTypeRef DestTy, const char *Name);
5118 LLVMTypeRef DestTy, const char *Name);
5120 LLVMTypeRef DestTy, const char *Name);
5122 LLVMTypeRef DestTy, const char *Name);
5124 LLVMTypeRef DestTy, const char *Name);
5126 LLVMTypeRef DestTy, const char *Name);
5128 LLVMTypeRef DestTy, const char *Name);
5130 LLVMTypeRef DestTy,
5131 const char *Name);
5133 LLVMTypeRef DestTy,
5134 const char *Name);
5136 LLVMTypeRef DestTy,
5137 const char *Name);
5139 LLVMValueRef Val,
5140 LLVMTypeRef DestTy,
5141 const char *Name);
5143 LLVMValueRef Val, LLVMTypeRef DestTy,
5144 const char *Name);
5146 LLVMTypeRef DestTy,
5147 const char *Name);
5149 LLVMTypeRef DestTy, LLVMBool IsSigned,
5150 const char *Name);
5152 LLVMTypeRef DestTy, const char *Name);
5153
5154/** Deprecated: This cast is always signed. Use LLVMBuildIntCast2 instead. */
5156 LLVMValueRef Val, /*Signed cast!*/
5157 LLVMTypeRef DestTy, const char *Name);
5158
5160 LLVMTypeRef DestTy,
5161 LLVMBool DestIsSigned);
5162
5163/* Comparisons */
5166 const char *Name);
5169 const char *Name);
5170
5171/* Miscellaneous instructions */
5173 const char *Name);
5175 LLVMValueRef Fn, LLVMValueRef *Args,
5176 unsigned NumArgs, const char *Name);
5179 unsigned NumArgs, LLVMOperandBundleRef *Bundles, unsigned NumBundles,
5180 const char *Name);
5182 LLVMValueRef Then, LLVMValueRef Else,
5183 const char *Name);
5185 LLVMTypeRef Ty, const char *Name);
5187 LLVMValueRef VecVal,
5188 LLVMValueRef Index,
5189 const char *Name);
5191 LLVMValueRef VecVal,
5192 LLVMValueRef EltVal,
5193 LLVMValueRef Index,
5194 const char *Name);
5196 LLVMValueRef V2,
5197 LLVMValueRef Mask,
5198 const char *Name);
5200 LLVMValueRef AggVal,
5201 unsigned Index, const char *Name);
5203 LLVMValueRef AggVal,
5204 LLVMValueRef EltVal,
5205 unsigned Index, const char *Name);
5207 const char *Name);
5209 LLVMValueRef Src,
5210 LLVMValueRef Offset,
5211 const char *Name);
5213 LLVMValueRef Val,
5214 LLVMValueRef Offset,
5215 const char *Name);
5216
5218 const char *Name);
5220 const char *Name);
5223 const char *Name);
5225 LLVMAtomicOrdering ordering,
5226 LLVMBool singleThread, const char *Name);
5228 LLVMAtomicOrdering ordering,
5229 unsigned SSID,
5230 const char *Name);
5233 LLVMValueRef PTR, LLVMValueRef Val,
5234 LLVMAtomicOrdering ordering,
5235 LLVMBool singleThread);
5238 LLVMAtomicOrdering ordering, unsigned SSID);
5241 LLVMAtomicOrdering SuccessOrdering, LLVMAtomicOrdering FailureOrdering,
5242 LLVMBool SingleThread);
5245 LLVMAtomicOrdering SuccessOrdering, LLVMAtomicOrdering FailureOrdering,
5246 unsigned SSID);
5247
5248/**
5249 * Get the number of elements in the mask of a ShuffleVector instruction.
5250 */
5251LLVM_C_ABI unsigned LLVMGetNumMaskElements(LLVMValueRef ShuffleVectorInst);
5252
5253/**
5254 * \returns a constant that specifies that the result of a \c ShuffleVectorInst
5255 * is undefined.
5256 */
5258
5259/**
5260 * Get the mask value at position Elt in the mask of a ShuffleVector
5261 * instruction.
5262 *
5263 * \Returns the result of \c LLVMGetUndefMaskElem() if the mask value is
5264 * poison at that position.
5265 */
5266LLVM_C_ABI int LLVMGetMaskValue(LLVMValueRef ShuffleVectorInst, unsigned Elt);
5267
5270 LLVMBool SingleThread);
5271
5272/**
5273 * Returns whether an instruction is an atomic instruction, e.g., atomicrmw,
5274 * cmpxchg, fence, or loads and stores with atomic ordering.
5275 */
5277
5278/**
5279 * Returns the synchronization scope ID of an atomic instruction.
5280 */
5282
5283/**
5284 * Sets the synchronization scope ID of an atomic instruction.
5285 */
5287 unsigned SSID);
5288
5292 LLVMAtomicOrdering Ordering);
5296 LLVMAtomicOrdering Ordering);
5297
5298/**
5299 * @}
5300 */
5301
5302/**
5303 * @defgroup LLVMCCoreModuleProvider Module Providers
5304 *
5305 * @{
5306 */
5307
5308/**
5309 * Changes the type of M so it can be passed to FunctionPassManagers and the
5310 * JIT. They take ModuleProviders for historical reasons.
5311 */
5314
5315/**
5316 * Destroys the module M.
5317 */
5319
5320/**
5321 * @}
5322 */
5323
5324/**
5325 * @defgroup LLVMCCoreMemoryBuffers Memory Buffers
5326 *
5327 * @{
5328 */
5329
5331 const char *Path, LLVMMemoryBufferRef *OutMemBuf, char **OutMessage);
5333 LLVMMemoryBufferRef *OutMemBuf, char **OutMessage);
5335 const char *InputData, size_t InputDataLength, const char *BufferName,
5336 LLVMBool RequiresNullTerminator);
5338 const char *InputData, size_t InputDataLength, const char *BufferName);
5342
5343/**
5344 * @}
5345 */
5346
5347/**
5348 * @defgroup LLVMCCorePassManagers Pass Managers
5349 * @ingroup LLVMCCore
5350 *
5351 * @{
5352 */
5353
5354/** Constructs a new whole-module pass pipeline. This type of pipeline is
5355 suitable for link-time optimization and whole-module transformations.
5356 @see llvm::PassManager::PassManager */
5358
5359/** Constructs a new function-by-function pass pipeline over the module
5360 provider. It does not take ownership of the module provider. This type of
5361 pipeline is suitable for code generation and JIT compilation tasks.
5362 @see llvm::FunctionPassManager::FunctionPassManager */
5365
5366/** Deprecated: Use LLVMCreateFunctionPassManagerForModule instead. */
5369
5370/** Initializes, executes on the provided module, and finalizes all of the
5371 passes scheduled in the pass manager. Returns 1 if any of the passes
5372 modified the module, 0 otherwise.
5373 @see llvm::PassManager::run(Module&) */
5375
5376/** Initializes all of the function passes scheduled in the function pass
5377 manager. Returns 1 if any of the passes modified the module, 0 otherwise.
5378 @see llvm::FunctionPassManager::doInitialization */
5380
5381/** Executes all of the function passes scheduled in the function pass manager
5382 on the provided function. Returns 1 if any of the passes modified the
5383 function, false otherwise.
5384 @see llvm::FunctionPassManager::run(Function&) */
5386 LLVMValueRef F);
5387
5388/** Finalizes all of the function passes scheduled in the function pass
5389 manager. Returns 1 if any of the passes modified the module, 0 otherwise.
5390 @see llvm::FunctionPassManager::doFinalization */
5392
5393/** Frees the memory of a pass pipeline. For function pipelines, does not free
5394 the module provider.
5395 @see llvm::PassManagerBase::~PassManagerBase. */
5397
5398/**
5399 * @}
5400 */
5401
5402/**
5403 * @defgroup LLVMCCoreThreading Threading
5404 *
5405 * Handle the structures needed to make LLVM safe for multithreading.
5406 *
5407 * @{
5408 */
5409
5410/** Deprecated: Multi-threading can only be enabled/disabled with the compile
5411 time define LLVM_ENABLE_THREADS. This function always returns
5412 LLVMIsMultithreaded(). */
5414
5415/** Deprecated: Multi-threading can only be enabled/disabled with the compile
5416 time define LLVM_ENABLE_THREADS. */
5418
5419/** Check whether LLVM is executing in thread-safe mode or not.
5420 @see llvm::llvm_is_multithreaded */
5422
5423/**
5424 * @}
5425 */
5426
5427/**
5428 * @defgroup LLVMCCoreDataLayout Data Layout
5429 *
5430 * @{
5431 */
5432
5434
5435/**
5436 * Obtain the data layout for a module.
5437 *
5438 * @see Module::getDataLayout()
5439 */
5441
5442/**
5443 * Set the data layout for a module.
5444 *
5445 * @see Module::setDataLayout()
5446 */
5448
5449/** Creates target data from a target layout string.
5450 See the constructor llvm::DataLayout::DataLayout. */
5452
5453/** Deallocates a TargetData.
5454 See the destructor llvm::DataLayout::~DataLayout. */
5456
5457/** Converts target data to a target layout string. The string must be disposed
5458 with LLVMDisposeMessage.
5459 See the constructor llvm::DataLayout::DataLayout. */
5461
5462/** Returns the byte order of a target, either LLVMBigEndian or
5463 LLVMLittleEndian.
5464 See the method llvm::DataLayout::isLittleEndian. */
5466
5467/** Returns the pointer size in bytes for a target.
5468 See the method llvm::DataLayout::getPointerSize. */
5470
5471/** Returns the pointer size in bytes for a target for a specified
5472 address space.
5473 See the method llvm::DataLayout::getPointerSize. */
5474LLVM_C_ABI unsigned LLVMPointerSizeForAS(LLVMTargetDataRef TD, unsigned AS);
5475
5476/** Returns the integer type that is the same size as a pointer on a target.
5477 See the method llvm::DataLayout::getIntPtrType. */
5480 "Use of the global context is deprecated, use "
5481 "LLVMIntPtrTypeInContext instead");
5482
5483/** Returns the integer type that is the same size as a pointer on a target.
5484 This version allows the address space to be specified.
5485 See the method llvm::DataLayout::getIntPtrType. */
5488 "Use of the global context is deprecated, use LLVMIntPtrTypeForASInContext "
5489 "instead");
5490
5491/** Returns the integer type that is the same size as a pointer on a target.
5492 See the method llvm::DataLayout::getIntPtrType. */
5495
5496/** Returns the integer type that is the same size as a pointer on a target.
5497 This version allows the address space to be specified.
5498 See the method llvm::DataLayout::getIntPtrType. */
5501 unsigned AS);
5502
5503/** Computes the size of a type in bits for a target.
5504 See the method llvm::DataLayout::getTypeSizeInBits. */
5506 LLVMTypeRef Ty);
5507
5508/** Computes the storage size of a type in bytes for a target.
5509 See the method llvm::DataLayout::getTypeStoreSize. */
5511 LLVMTypeRef Ty);
5512
5513/** Computes the ABI size of a type in bytes for a target.
5514 See the method llvm::DataLayout::getTypeAllocSize. */
5515LLVM_C_ABI unsigned long long LLVMABISizeOfType(LLVMTargetDataRef TD,
5516 LLVMTypeRef Ty);
5517
5518/** Computes the ABI alignment of a type in bytes for a target.
5519 See the method llvm::DataLayout::getTypeABISize. */
5521 LLVMTypeRef Ty);
5522
5523/** Computes the call frame alignment of a type in bytes for a target.
5524 See the method llvm::DataLayout::getTypeABISize. */
5526 LLVMTypeRef Ty);
5527
5528/** Computes the preferred alignment of a type in bytes for a target.
5529 See the method llvm::DataLayout::getTypeABISize. */
5531 LLVMTypeRef Ty);
5532
5533/** Computes the preferred alignment of a global variable in bytes for a target.
5534 See the method llvm::DataLayout::getPreferredAlignment. */
5536 LLVMValueRef GlobalVar);
5537
5538/** Computes the structure element that contains the byte offset for a target.
5539 See the method llvm::StructLayout::getElementContainingOffset. */
5541 LLVMTypeRef StructTy,
5542 unsigned long long Offset);
5543
5544/** Computes the byte offset of the indexed struct element for a target.
5545 See the method llvm::StructLayout::getElementContainingOffset. */
5547 LLVMTypeRef StructTy,
5548 unsigned Element);
5549
5550/**
5551 * @}
5552 */
5553
5554/**
5555 * @}
5556 */
5557
5558/**
5559 * @}
5560 */
5561
5563
5564#endif /* LLVM_C_CORE_H */
aarch64 promote const
uint64_t 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:800
LLVMValueRef LLVMGetElementAsConstant(LLVMValueRef C, unsigned idx)
Definition Core.cpp:1734
LLVMTypeRef LLVMInt64Type(void)
Definition Core.cpp:744
LLVMValueRef LLVMConstStruct(LLVMValueRef *ConstantVals, unsigned Count, LLVMBool Packed)
Definition Core.cpp:1781
LLVMBasicBlockRef LLVMAppendBasicBlock(LLVMValueRef FnRef, const char *Name)
Definition Core.cpp:3031
LLVMTypeRef LLVMVoidType(void)
Definition Core.cpp:1003
LLVMValueRef LLVMMDString(const char *Str, unsigned SLen)
Definition Core.cpp:1349
LLVMValueRef LLVMSizeOf(LLVMTypeRef Ty)
Definition Core.cpp:1870
LLVMTypeRef LLVMBFloatType(void)
Definition Core.cpp:788
LLVMTypeRef LLVMInt32Type(void)
Definition Core.cpp:741
LLVMTypeRef LLVMHalfType(void)
Definition Core.cpp:785
LLVMTypeRef LLVMIntType(unsigned NumBits)
Definition Core.cpp:750
LLVMTypeRef LLVMX86AMXType(void)
Definition Core.cpp:806
LLVMTypeRef LLVMIntPtrType(LLVMTargetDataRef TD)
Definition Core.cpp:4943
LLVMBuilderRef LLVMCreateBuilderInContext(LLVMContextRef C)
Definition Core.cpp:3540
LLVMTypeRef LLVMStructType(LLVMTypeRef *ElementTypes, unsigned ElementCount, LLVMBool Packed)
Definition Core.cpp:845
LLVMValueRef LLVMConstInBoundsGEP2(LLVMTypeRef Ty, LLVMValueRef ConstantVal, LLVMValueRef *ConstantIndices, unsigned NumIndices)
Definition Core.cpp:1942
LLVMModuleRef LLVMModuleCreateWithName(const char *ModuleID)
Definition Core.cpp:303
LLVMValueRef LLVMAlignOf(LLVMTypeRef Ty)
Definition Core.cpp:1864
LLVMTypeRef LLVMX86FP80Type(void)
Definition Core.cpp:797
LLVMBasicBlockRef LLVMInsertBasicBlock(LLVMBasicBlockRef BBRef, const char *Name)
Definition Core.cpp:3042
LLVMValueRef LLVMBuildNUWNeg(LLVMBuilderRef B, LLVMValueRef V, const char *Name)
Definition Core.cpp:4043
LLVMTypeRef LLVMPPCFP128Type(void)
Definition Core.cpp:803
LLVMTypeRef LLVMFloatType(void)
Definition Core.cpp:791
LLVMTypeRef LLVMLabelType(void)
Definition Core.cpp:1006
LLVMValueRef LLVMConstString(const char *Str, unsigned Length, LLVMBool DontNullTerminate)
Definition Core.cpp:1724
unsigned LLVMGetMDKindID(const char *Name, unsigned SLen)
Definition Core.cpp:160
LLVMTypeRef LLVMIntPtrTypeForAS(LLVMTargetDataRef TD, unsigned AS)
Definition Core.cpp:4947
LLVMTypeRef LLVMInt8Type(void)
Definition Core.cpp:735
LLVMTypeRef LLVMDoubleType(void)
Definition Core.cpp:794
LLVMTypeRef LLVMInt1Type(void)
Definition Core.cpp:732
LLVMBuilderRef LLVMCreateBuilder(void)
Definition Core.cpp:3544
LLVMTypeRef LLVMInt128Type(void)
Definition Core.cpp:747
LLVMValueRef LLVMConstGEPWithNoWrapFlags(LLVMTypeRef Ty, LLVMValueRef ConstantVal, LLVMValueRef *ConstantIndices, unsigned NumIndices, LLVMGEPNoWrapFlags NoWrapFlags)
Definition Core.cpp:1953
LLVMValueRef LLVMIsABranchInst(LLVMValueRef Val)
Definition Core.cpp:1195
LLVMValueRef LLVMConstNUWNeg(LLVMValueRef ConstantVal)
Definition Core.cpp:1884
LLVMValueRef LLVMConstGEP2(LLVMTypeRef Ty, LLVMValueRef ConstantVal, LLVMValueRef *ConstantIndices, unsigned NumIndices)
Definition Core.cpp:1932
LLVMTypeRef LLVMInt16Type(void)
Definition Core.cpp:738
LLVMValueRef LLVMMDNode(LLVMValueRef *Vals, unsigned Count)
Definition Core.cpp:1380
LLVMContextRef LLVMGetGlobalContext()
Definition Core.cpp:116
#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
SmallVector< MachineOperand, 4 > Cond
RISCVCC::CondCode CC
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:901
LLVM_C_ABI LLVMBool LLVMIsEnumAttribute(LLVMAttributeRef A)
Check for the different types of attributes.
Definition Core.cpp:257
LLVM_C_ABI LLVMTypeRef LLVMGetTypeAttributeValue(LLVMAttributeRef A)
Get the type attribute's value.
Definition Core.cpp:201
LLVM_C_ABI void LLVMContextSetDiagnosticHandler(LLVMContextRef C, LLVMDiagnosticHandler Handler, void *DiagnosticContext)
Set the diagnostic handler for this context.
Definition Core.cpp:118
LLVM_C_ABI LLVMAttributeRef LLVMCreateDenormalFPEnvAttribute(LLVMContextRef C, LLVMDenormalModeKind DefaultModeOutput, LLVMDenormalModeKind DefaultModeInput, LLVMDenormalModeKind FloatModeOutput, LLVMDenormalModeKind FloatModeInput)
Create a DenormalFPEnv attribute.
Definition Core.cpp:220
LLVM_C_ABI const char * LLVMGetStringAttributeValue(LLVMAttributeRef A, unsigned *Length)
Get the string attribute's value.
Definition Core.cpp:250
LLVM_C_ABI uint64_t LLVMGetEnumAttributeValue(LLVMAttributeRef A)
Get the enum attribute's value.
Definition Core.cpp:187
LLVMDenormalModeKind
Represent different denormal handling kinds for use with LLVMCreateDenormalFPEnvAttribute.
Definition Core.h:753
LLVM_C_ABI LLVMBool LLVMIsStringAttribute(LLVMAttributeRef A)
Definition Core.cpp:262
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:206
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:168
LLVM_C_ABI LLVMDiagnosticHandler LLVMContextGetDiagnosticHandler(LLVMContextRef C)
Get the diagnostic handler of this context.
Definition Core.cpp:127
LLVM_C_ABI void LLVMContextSetYieldCallback(LLVMContextRef C, LLVMYieldCallback Callback, void *OpaqueHandle)
Set the yield callback function for this context.
Definition Core.cpp:136
LLVM_C_ABI char * LLVMGetDiagInfoDescription(LLVMDiagnosticInfoRef DI)
Return a string representation of the DiagnosticInfo.
Definition Core.cpp:270
LLVM_C_ABI LLVMAttributeRef LLVMCreateStringAttribute(LLVMContextRef C, const char *K, unsigned KLength, const char *V, unsigned VLength)
Create a string attribute.
Definition Core.cpp:236
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:164
LLVM_C_ABI void LLVMContextSetDiscardValueNames(LLVMContextRef C, LLVMBool Discard)
Set whether the given context discards all value names.
Definition Core.cpp:147
LLVM_C_ABI unsigned LLVMGetMDKindIDInContext(LLVMContextRef C, const char *Name, unsigned SLen)
Definition Core.cpp:155
LLVM_C_ABI unsigned LLVMGetEnumAttributeKind(LLVMAttributeRef A)
Get the unique id corresponding to the enum attribute passed as argument.
Definition Core.cpp:183
LLVM_C_ABI void * LLVMContextGetDiagnosticContext(LLVMContextRef C)
Get the diagnostic context of this context.
Definition Core.cpp:132
LLVM_C_ABI LLVMAttributeRef LLVMCreateTypeAttribute(LLVMContextRef C, unsigned KindID, LLVMTypeRef type_ref)
Create a type attribute.
Definition Core.cpp:194
LLVM_C_ABI unsigned LLVMGetLastEnumAttributeKind(void)
Definition Core.cpp:172
LLVM_C_ABI LLVMBool LLVMContextShouldDiscardValueNames(LLVMContextRef C)
Retrieve whether the given context is set to discard all value names.
Definition Core.cpp:143
LLVM_C_ABI LLVMBool LLVMIsTypeAttribute(LLVMAttributeRef A)
Definition Core.cpp:266
LLVM_C_ABI void LLVMContextDispose(LLVMContextRef C)
Destroy a context instance.
Definition Core.cpp:151
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:176
LLVM_C_ABI const char * LLVMGetStringAttributeKind(LLVMAttributeRef A, unsigned *Length)
Get the string attribute's kind.
Definition Core.cpp:243
LLVM_C_ABI LLVMContextRef LLVMContextCreate(void)
Create a new context.
Definition Core.cpp:110
void(* LLVMDiagnosticHandler)(LLVMDiagnosticInfoRef, void *)
Definition Core.h:593
LLVM_C_ABI LLVMDiagnosticSeverity LLVMGetDiagInfoSeverity(LLVMDiagnosticInfoRef DI)
Return an enum LLVMDiagnosticSeverity.
Definition Core.cpp:280
@ 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:4912
LLVM_C_ABI LLVMTargetDataRef LLVMCreateTargetData(const char *StringRep)
Creates target data from a target layout string.
Definition Core.cpp:4920
LLVM_C_ABI unsigned LLVMPreferredAlignmentOfType(LLVMTargetDataRef TD, LLVMTypeRef Ty)
Computes the preferred alignment of a type in bytes for a target.
Definition Core.cpp:4981
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:4977
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:4998
LLVM_C_ABI void LLVMDisposeTargetData(LLVMTargetDataRef TD)
Deallocates a TargetData.
Definition Core.cpp:4924
LLVM_C_ABI enum LLVMByteOrdering LLVMByteOrder(LLVMTargetDataRef TD)
Returns the byte order of a target, either LLVMBigEndian or LLVMLittleEndian.
Definition Core.cpp:4931
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:4985
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:4965
LLVMByteOrdering
Definition Core.h:5433
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:4969
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:4939
LLVM_C_ABI unsigned LLVMABIAlignmentOfType(LLVMTargetDataRef TD, LLVMTypeRef Ty)
Computes the ABI alignment of a type in bytes for a target.
Definition Core.cpp:4973
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:4992
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:4952
LLVM_C_ABI char * LLVMCopyStringRepOfTargetData(LLVMTargetDataRef TD)
Converts target data to a target layout string.
Definition Core.cpp:4926
LLVM_C_ABI unsigned LLVMPointerSize(LLVMTargetDataRef TD)
Returns the pointer size in bytes for a target.
Definition Core.cpp:4935
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:4956
LLVM_C_ABI void LLVMSetModuleDataLayout(LLVMModuleRef M, LLVMTargetDataRef DL)
Set the data layout for a module.
Definition Core.cpp:4916
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:4961
@ LLVMBigEndian
Definition Core.h:5433
@ LLVMLittleEndian
Definition Core.h:5433
LLVM_C_ABI LLVMValueRef LLVMBuildAggregateRet(LLVMBuilderRef, LLVMValueRef *RetVals, unsigned N)
Definition Core.cpp:3673
LLVM_C_ABI LLVMValueRef LLVMBuildMul(LLVMBuilderRef, LLVMValueRef LHS, LLVMValueRef RHS, const char *Name)
Definition Core.cpp:3937
LLVM_C_ABI LLVMValueRef LLVMBuildRetVoid(LLVMBuilderRef)
Definition Core.cpp:3665
LLVM_C_ABI LLVMValueRef LLVMBuildSub(LLVMBuilderRef, LLVMValueRef LHS, LLVMValueRef RHS, const char *Name)
Definition Core.cpp:3917
LLVM_C_ABI LLVMValueRef LLVMBuildNUWMul(LLVMBuilderRef, LLVMValueRef LHS, LLVMValueRef RHS, const char *Name)
Definition Core.cpp:3947
LLVM_C_ABI LLVMBool LLVMGetWeak(LLVMValueRef CmpXchgInst)
Definition Core.cpp:4379
LLVM_C_ABI LLVMValueRef LLVMBuildCast(LLVMBuilderRef B, LLVMOpcode Op, LLVMValueRef Val, LLVMTypeRef DestTy, const char *Name)
Definition Core.cpp:4507
LLVM_C_ABI LLVMValueRef LLVMBuildIsNull(LLVMBuilderRef, LLVMValueRef Val, const char *Name)
Definition Core.cpp:4650
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:4337
LLVM_C_ABI LLVMValueRef LLVMBuildAdd(LLVMBuilderRef, LLVMValueRef LHS, LLVMValueRef RHS, const char *Name)
Definition Core.cpp:3897
LLVM_C_ABI void LLVMSetWeak(LLVMValueRef CmpXchgInst, LLVMBool IsWeak)
Definition Core.cpp:4383
LLVM_C_ABI LLVMValueRef LLVMBuildOr(LLVMBuilderRef, LLVMValueRef LHS, LLVMValueRef RHS, const char *Name)
Definition Core.cpp:4017
LLVM_C_ABI LLVMValueRef LLVMBuildBitCast(LLVMBuilderRef, LLVMValueRef Val, LLVMTypeRef DestTy, const char *Name)
Definition Core.cpp:4479
LLVM_C_ABI LLVMValueRef LLVMBuildExactUDiv(LLVMBuilderRef, LLVMValueRef LHS, LLVMValueRef RHS, const char *Name)
Definition Core.cpp:3962
LLVM_C_ABI LLVMValueRef LLVMBuildGEP2(LLVMBuilderRef B, LLVMTypeRef Ty, LLVMValueRef Pointer, LLVMValueRef *Indices, unsigned NumIndices, const char *Name)
Definition Core.cpp:4322
LLVM_C_ABI LLVMValueRef LLVMBuildNSWSub(LLVMBuilderRef, LLVMValueRef LHS, LLVMValueRef RHS, const char *Name)
Definition Core.cpp:3922
LLVM_C_ABI void LLVMPositionBuilderBeforeInstrAndDbgRecords(LLVMBuilderRef Builder, LLVMValueRef Instr)
Set the builder position before Instr and any attached debug records.
Definition Core.cpp:3581
LLVM_C_ABI LLVMValueRef LLVMBuildIsNotNull(LLVMBuilderRef, LLVMValueRef Val, const char *Name)
Definition Core.cpp:4655
LLVM_C_ABI void LLVMDisposeBuilder(LLVMBuilderRef Builder)
Definition Core.cpp:3610
LLVM_C_ABI void LLVMClearInsertionPosition(LLVMBuilderRef Builder)
Definition Core.cpp:3597
LLVM_C_ABI LLVMValueRef LLVMBuildLandingPad(LLVMBuilderRef B, LLVMTypeRef Ty, LLVMValueRef PersFn, unsigned NumClauses, const char *Name)
Definition Core.cpp:3739
LLVM_C_ABI void LLVMSetIsDisjoint(LLVMValueRef Inst, LLVMBool IsDisjoint)
Sets the disjoint flag for the instruction.
Definition Core.cpp:4120
LLVM_C_ABI LLVMBool LLVMIsAtomicSingleThread(LLVMValueRef AtomicInst)
Definition Core.cpp:4733
LLVM_C_ABI LLVMValueRef LLVMBuildResume(LLVMBuilderRef B, LLVMValueRef Exn)
Definition Core.cpp:3769
LLVM_C_ABI void LLVMSetAtomicRMWBinOp(LLVMValueRef AtomicRMWInst, LLVMAtomicRMWBinOp BinOp)
Definition Core.cpp:4418
LLVM_C_ABI LLVMValueRef LLVMBuildFDiv(LLVMBuilderRef, LLVMValueRef LHS, LLVMValueRef RHS, const char *Name)
Definition Core.cpp:3977
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:3725
LLVM_C_ABI LLVMValueRef LLVMBuildXor(LLVMBuilderRef, LLVMValueRef LHS, LLVMValueRef RHS, const char *Name)
Definition Core.cpp:4022
LLVM_C_ABI LLVMValueRef LLVMBuildBitExtract(LLVMBuilderRef, LLVMTypeRef Type, LLVMValueRef Src, LLVMValueRef Offset, const char *Name)
Definition Core.cpp:4643
LLVM_C_ABI LLVMBool LLVMGetExact(LLVMValueRef DivOrShrInst)
Definition Core.cpp:4079
LLVM_C_ABI LLVMValueRef LLVMBuildAddrSpaceCast(LLVMBuilderRef, LLVMValueRef Val, LLVMTypeRef DestTy, const char *Name)
Definition Core.cpp:4484
LLVM_C_ABI unsigned LLVMGetNumMaskElements(LLVMValueRef ShuffleVectorInst)
Get the number of elements in the mask of a ShuffleVector instruction.
Definition Core.cpp:4715
LLVM_C_ABI void LLVMInsertIntoBuilder(LLVMBuilderRef Builder, LLVMValueRef Instr)
Definition Core.cpp:3601
LLVM_C_ABI LLVMValueRef LLVMBuildCleanupRet(LLVMBuilderRef B, LLVMValueRef CatchPad, LLVMBasicBlockRef BB)
Definition Core.cpp:3790
LLVM_C_ABI LLVMValueRef LLVMBuildFPToSI(LLVMBuilderRef, LLVMValueRef Val, LLVMTypeRef DestTy, const char *Name)
Definition Core.cpp:4444
LLVM_C_ABI void LLVMGetHandlers(LLVMValueRef CatchSwitch, LLVMBasicBlockRef *Handlers)
Obtain the basic blocks acting as handlers for a catchswitch instruction.
Definition Core.cpp:3837
LLVM_C_ABI LLVMValueRef LLVMBuildTrunc(LLVMBuilderRef, LLVMValueRef Val, LLVMTypeRef DestTy, const char *Name)
Definition Core.cpp:4424
LLVM_C_ABI LLVMValueRef LLVMGetArgOperand(LLVMValueRef Funclet, unsigned i)
Definition Core.cpp:3854
LLVM_C_ABI LLVMValueRef LLVMBuildAnd(LLVMBuilderRef, LLVMValueRef LHS, LLVMValueRef RHS, const char *Name)
Definition Core.cpp:4012
LLVM_C_ABI unsigned LLVMGetNumHandlers(LLVMValueRef CatchSwitch)
Definition Core.cpp:3833
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:3697
LLVM_C_ABI LLVMBasicBlockRef LLVMGetInsertBlock(LLVMBuilderRef Builder)
Definition Core.cpp:3593
LLVM_C_ABI LLVMValueRef LLVMBuildSDiv(LLVMBuilderRef, LLVMValueRef LHS, LLVMValueRef RHS, const char *Name)
Definition Core.cpp:3967
LLVM_C_ABI LLVMValueRef LLVMBuildSExtOrBitCast(LLVMBuilderRef, LLVMValueRef Val, LLVMTypeRef DestTy, const char *Name)
Definition Core.cpp:4495
LLVM_C_ABI LLVMValueRef LLVMBuildCall2(LLVMBuilderRef, LLVMTypeRef, LLVMValueRef Fn, LLVMValueRef *Args, unsigned NumArgs, const char *Name)
Definition Core.cpp:4564
LLVM_C_ABI void LLVMSetNSW(LLVMValueRef ArithInst, LLVMBool HasNSW)
Definition Core.cpp:4074
LLVM_C_ABI LLVMMetadataRef LLVMGetCurrentDebugLocation2(LLVMBuilderRef Builder)
Get location information used by debugging information.
Definition Core.cpp:3616
LLVM_C_ABI LLVMValueRef LLVMBuildUDiv(LLVMBuilderRef, LLVMValueRef LHS, LLVMValueRef RHS, const char *Name)
Definition Core.cpp:3957
LLVM_C_ABI LLVMValueRef LLVMBuildSelect(LLVMBuilderRef, LLVMValueRef If, LLVMValueRef Then, LLVMValueRef Else, const char *Name)
Definition Core.cpp:4587
LLVM_C_ABI void LLVMPositionBuilderBefore(LLVMBuilderRef Builder, LLVMValueRef Instr)
Set the builder position before Instr but after any attached debug records.
Definition Core.cpp:3575
LLVM_C_ABI LLVMBool LLVMCanValueUseFastMathFlags(LLVMValueRef Inst)
Check if a given value can potentially have fast math flags.
Definition Core.cpp:4110
LLVM_C_ABI void LLVMSetArgOperand(LLVMValueRef Funclet, unsigned i, LLVMValueRef value)
Definition Core.cpp:3858
LLVM_C_ABI LLVMValueRef LLVMBuildCondBr(LLVMBuilderRef, LLVMValueRef If, LLVMBasicBlockRef Then, LLVMBasicBlockRef Else)
Definition Core.cpp:3682
LLVM_C_ABI LLVMBool LLVMGetNUW(LLVMValueRef ArithInst)
Definition Core.cpp:4059
LLVM_C_ABI LLVMOpcode LLVMGetCastOpcode(LLVMValueRef Src, LLVMBool SrcIsSigned, LLVMTypeRef DestTy, LLVMBool DestIsSigned)
Definition Core.cpp:4536
LLVM_C_ABI void LLVMInsertIntoBuilderWithName(LLVMBuilderRef Builder, LLVMValueRef Instr, const char *Name)
Definition Core.cpp:3605
LLVM_C_ABI LLVMValueRef LLVMBuildSRem(LLVMBuilderRef, LLVMValueRef LHS, LLVMValueRef RHS, const char *Name)
Definition Core.cpp:3987
LLVM_C_ABI LLVMValueRef LLVMBuildCleanupPad(LLVMBuilderRef B, LLVMValueRef ParentPad, LLVMValueRef *Args, unsigned NumArgs, const char *Name)
Definition Core.cpp:3758
LLVM_C_ABI LLVMValueRef LLVMBuildIntCast(LLVMBuilderRef, LLVMValueRef Val, LLVMTypeRef DestTy, const char *Name)
Deprecated: This cast is always signed.
Definition Core.cpp:4525
LLVM_C_ABI LLVMValueRef LLVMGetCurrentDebugLocation(LLVMBuilderRef Builder)
Deprecated: Returning the NULL location will crash.
Definition Core.cpp:3633
LLVM_C_ABI LLVMValueRef LLVMBuildExtractElement(LLVMBuilderRef, LLVMValueRef VecVal, LLVMValueRef Index, const char *Name)
Definition Core.cpp:4599
LLVM_C_ABI LLVMValueRef LLVMBuildShl(LLVMBuilderRef, LLVMValueRef LHS, LLVMValueRef RHS, const char *Name)
Definition Core.cpp:3997
LLVM_C_ABI LLVMValueRef LLVMBuildCatchRet(LLVMBuilderRef B, LLVMValueRef CatchPad, LLVMBasicBlockRef BB)
Definition Core.cpp:3784
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:4164
LLVM_C_ABI LLVMAtomicOrdering LLVMGetOrdering(LLVMValueRef MemoryAccessInst)
Definition Core.cpp:4387
LLVM_C_ABI LLVMValueRef LLVMBuildStructGEP2(LLVMBuilderRef B, LLVMTypeRef Ty, LLVMValueRef Pointer, unsigned Idx, const char *Name)
Definition Core.cpp:4347
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:4721
LLVM_C_ABI void LLVMAddCase(LLVMValueRef Switch, LLVMValueRef OnVal, LLVMBasicBlockRef Dest)
Definition Core.cpp:3800
LLVM_C_ABI LLVMValueRef LLVMBuildBr(LLVMBuilderRef, LLVMBasicBlockRef Dest)
Definition Core.cpp:3678
LLVM_C_ABI LLVMValueRef LLVMBuildInsertElement(LLVMBuilderRef, LLVMValueRef VecVal, LLVMValueRef EltVal, LLVMValueRef Index, const char *Name)
Definition Core.cpp:4605
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:3568
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:4105
LLVM_C_ABI LLVMValueRef LLVMBuildIntCast2(LLVMBuilderRef, LLVMValueRef Val, LLVMTypeRef DestTy, LLVMBool IsSigned, const char *Name)
Definition Core.cpp:4518
LLVM_C_ABI LLVMValueRef LLVMBuildNUWSub(LLVMBuilderRef, LLVMValueRef LHS, LLVMValueRef RHS, const char *Name)
Definition Core.cpp:3927
LLVM_C_ABI LLVMValueRef LLVMBuildFAdd(LLVMBuilderRef, LLVMValueRef LHS, LLVMValueRef RHS, const char *Name)
Definition Core.cpp:3912
LLVM_C_ABI LLVMValueRef LLVMBuildCatchPad(LLVMBuilderRef B, LLVMValueRef ParentPad, LLVMValueRef *Args, unsigned NumArgs, const char *Name)
Definition Core.cpp:3751
LLVM_C_ABI LLVMValueRef LLVMBuildCallWithOperandBundles(LLVMBuilderRef, LLVMTypeRef, LLVMValueRef Fn, LLVMValueRef *Args, unsigned NumArgs, LLVMOperandBundleRef *Bundles, unsigned NumBundles, const char *Name)
Definition Core.cpp:4573
LLVM_C_ABI LLVMBool LLVMIsCleanup(LLVMValueRef LandingPad)
Definition Core.cpp:3821
LLVM_C_ABI LLVMValueRef LLVMBuildZExtOrBitCast(LLVMBuilderRef, LLVMValueRef Val, LLVMTypeRef DestTy, const char *Name)
Definition Core.cpp:4489
LLVM_C_ABI LLVMBool LLVMGetVolatile(LLVMValueRef Inst)
Definition Core.cpp:4364
LLVM_C_ABI LLVMValueRef LLVMBuildFPCast(LLVMBuilderRef, LLVMValueRef Val, LLVMTypeRef DestTy, const char *Name)
Definition Core.cpp:4531
LLVM_C_ABI LLVMValueRef LLVMBuildPtrToInt(LLVMBuilderRef, LLVMValueRef Val, LLVMTypeRef DestTy, const char *Name)
Definition Core.cpp:4469
LLVM_C_ABI LLVMValueRef LLVMBuildPtrDiff2(LLVMBuilderRef, LLVMTypeRef ElemTy, LLVMValueRef LHS, LLVMValueRef RHS, const char *Name)
Definition Core.cpp:4660
LLVM_C_ABI LLVMValueRef LLVMBuildTruncOrBitCast(LLVMBuilderRef, LLVMValueRef Val, LLVMTypeRef DestTy, const char *Name)
Definition Core.cpp:4501
LLVM_C_ABI LLVMValueRef LLVMBuildArrayAlloca(LLVMBuilderRef, LLVMTypeRef Ty, LLVMValueRef Val, const char *Name)
Definition Core.cpp:4178
LLVM_C_ABI LLVMValueRef LLVMGetClause(LLVMValueRef LandingPad, unsigned Idx)
Definition Core.cpp:3813
LLVM_C_ABI unsigned LLVMGetAtomicSyncScopeID(LLVMValueRef AtomicInst)
Returns the synchronization scope ID of an atomic instruction.
Definition Core.cpp:4752
LLVM_C_ABI LLVMValueRef LLVMBuildVAArg(LLVMBuilderRef, LLVMValueRef List, LLVMTypeRef Ty, const char *Name)
Definition Core.cpp:4594
LLVM_C_ABI LLVMValueRef LLVMBuildAtomicCmpXchgSyncScope(LLVMBuilderRef B, LLVMValueRef Ptr, LLVMValueRef Cmp, LLVMValueRef New, LLVMAtomicOrdering SuccessOrdering, LLVMAtomicOrdering FailureOrdering, unsigned SSID)
Definition Core.cpp:4704
LLVM_C_ABI LLVMValueRef LLVMBuildBinOp(LLVMBuilderRef B, LLVMOpcode Op, LLVMValueRef LHS, LLVMValueRef RHS, const char *Name)
Definition Core.cpp:4027
LLVM_C_ABI LLVMBool LLVMIsAtomic(LLVMValueRef Inst)
Returns whether an instruction is an atomic instruction, e.g., atomicrmw, cmpxchg,...
Definition Core.cpp:4729
LLVM_C_ABI void LLVMSetVolatile(LLVMValueRef MemoryAccessInst, LLVMBool IsVolatile)
Definition Core.cpp:4368
LLVM_C_ABI void LLVMSetAtomicSingleThread(LLVMValueRef AtomicInst, LLVMBool SingleThread)
Definition Core.cpp:4742
LLVM_C_ABI LLVMValueRef LLVMBuildFRem(LLVMBuilderRef, LLVMValueRef LHS, LLVMValueRef RHS, const char *Name)
Definition Core.cpp:3992
LLVM_C_ABI LLVMValueRef LLVMBuildURem(LLVMBuilderRef, LLVMValueRef LHS, LLVMValueRef RHS, const char *Name)
Definition Core.cpp:3982
LLVM_C_ABI LLVMValueRef LLVMBuildIntToPtr(LLVMBuilderRef, LLVMValueRef Val, LLVMTypeRef DestTy, const char *Name)
Definition Core.cpp:4474
LLVM_C_ABI LLVMBool LLVMGetNSW(LLVMValueRef ArithInst)
Definition Core.cpp:4069
LLVM_C_ABI LLVMValueRef LLVMBuildNSWMul(LLVMBuilderRef, LLVMValueRef LHS, LLVMValueRef RHS, const char *Name)
Definition Core.cpp:3942
LLVM_C_ABI LLVMValueRef LLVMBuildFree(LLVMBuilderRef, LLVMValueRef PointerVal)
Definition Core.cpp:4183
LLVM_C_ABI LLVMValueRef LLVMBuildNeg(LLVMBuilderRef, LLVMValueRef V, const char *Name)
Definition Core.cpp:4034
LLVM_C_ABI LLVMValueRef LLVMBuildFSub(LLVMBuilderRef, LLVMValueRef LHS, LLVMValueRef RHS, const char *Name)
Definition Core.cpp:3932
LLVM_C_ABI LLVMValueRef LLVMBuildCatchSwitch(LLVMBuilderRef B, LLVMValueRef ParentPad, LLVMBasicBlockRef UnwindBB, unsigned NumHandlers, const char *Name)
Definition Core.cpp:3773
LLVM_C_ABI LLVMValueRef LLVMBuildLoad2(LLVMBuilderRef, LLVMTypeRef Ty, LLVMValueRef PointerVal, const char *Name)
Definition Core.cpp:4187
LLVM_C_ABI LLVMValueRef LLVMBuildInBoundsGEP2(LLVMBuilderRef B, LLVMTypeRef Ty, LLVMValueRef Pointer, LLVMValueRef *Indices, unsigned NumIndices, const char *Name)
Definition Core.cpp:4329
LLVM_C_ABI LLVMValueRef LLVMBuildArrayMalloc(LLVMBuilderRef, LLVMTypeRef Ty, LLVMValueRef Val, const char *Name)
Definition Core.cpp:4137
LLVM_C_ABI LLVMValueRef LLVMBuildAtomicCmpXchg(LLVMBuilderRef B, LLVMValueRef Ptr, LLVMValueRef Cmp, LLVMValueRef New, LLVMAtomicOrdering SuccessOrdering, LLVMAtomicOrdering FailureOrdering, LLVMBool SingleThread)
Definition Core.cpp:4691
LLVM_C_ABI LLVMValueRef LLVMBuildIndirectBr(LLVMBuilderRef B, LLVMValueRef Addr, unsigned NumDests)
Definition Core.cpp:3692
LLVM_C_ABI LLVMValueRef LLVMBuildUnreachable(LLVMBuilderRef)
Definition Core.cpp:3796
LLVM_C_ABI LLVMValueRef LLVMBuildSIToFP(LLVMBuilderRef, LLVMValueRef Val, LLVMTypeRef DestTy, const char *Name)
Definition Core.cpp:4454
LLVM_C_ABI LLVMValueRef LLVMBuildSExt(LLVMBuilderRef, LLVMValueRef Val, LLVMTypeRef DestTy, const char *Name)
Definition Core.cpp:4434
LLVM_C_ABI LLVMValueRef LLVMBuildFPToUI(LLVMBuilderRef, LLVMValueRef Val, LLVMTypeRef DestTy, const char *Name)
Definition Core.cpp:4439
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:3639
LLVM_C_ABI void LLVMSetCurrentDebugLocation2(LLVMBuilderRef Builder, LLVMMetadataRef Loc)
Set location information used by debugging information.
Definition Core.cpp:3620
LLVM_C_ABI LLVMBuilderRef LLVMCreateBuilderForModule(LLVMModuleRef M)
Definition Core.cpp:3550
LLVM_C_ABI LLVMValueRef LLVMBuildAlloca(LLVMBuilderRef, LLVMTypeRef Ty, const char *Name)
Definition Core.cpp:4173
LLVM_C_ABI void LLVMSetCurrentDebugLocation(LLVMBuilderRef Builder, LLVMValueRef L)
Deprecated: Passing the NULL location will crash.
Definition Core.cpp:3627
LLVM_C_ABI LLVMValueRef LLVMBuildPhi(LLVMBuilderRef, LLVMTypeRef Ty, const char *Name)
Definition Core.cpp:4560
LLVM_C_ABI void LLVMAddDestination(LLVMValueRef IndirectBr, LLVMBasicBlockRef Dest)
Definition Core.cpp:3805
LLVM_C_ABI LLVMBool LLVMGetNNeg(LLVMValueRef NonNegInst)
Gets if the instruction has the non-negative flag set.
Definition Core.cpp:4089
LLVM_C_ABI LLVMValueRef LLVMBuildAtomicRMWSyncScope(LLVMBuilderRef B, LLVMAtomicRMWBinOp op, LLVMValueRef PTR, LLVMValueRef Val, LLVMAtomicOrdering ordering, unsigned SSID)
Definition Core.cpp:4680
LLVM_C_ABI LLVMValueRef LLVMBuildRet(LLVMBuilderRef, LLVMValueRef V)
Definition Core.cpp:3669
LLVM_C_ABI LLVMMetadataRef LLVMBuilderGetDefaultFPMathTag(LLVMBuilderRef Builder)
Get the dafult floating-point math metadata for a given builder.
Definition Core.cpp:3659
LLVM_C_ABI LLVMValueRef LLVMBuildExtractValue(LLVMBuilderRef, LLVMValueRef AggVal, unsigned Index, const char *Name)
Definition Core.cpp:4619
LLVM_C_ABI LLVMValueRef LLVMBuildGlobalStringPtr(LLVMBuilderRef B, const char *Str, const char *Name)
Deprecated: Use LLVMBuildGlobalString instead, which has identical behavior.
Definition Core.cpp:4359
LLVM_C_ABI LLVMValueRef LLVMBuildNSWAdd(LLVMBuilderRef, LLVMValueRef LHS, LLVMValueRef RHS, const char *Name)
Definition Core.cpp:3902
LLVM_C_ABI void LLVMPositionBuilderAtEnd(LLVMBuilderRef Builder, LLVMBasicBlockRef Block)
Definition Core.cpp:3588
LLVM_C_ABI LLVMValueRef LLVMBuildFMul(LLVMBuilderRef, LLVMValueRef LHS, LLVMValueRef RHS, const char *Name)
Definition Core.cpp:3952
LLVM_C_ABI LLVMValueRef LLVMBuildLShr(LLVMBuilderRef, LLVMValueRef LHS, LLVMValueRef RHS, const char *Name)
Definition Core.cpp:4002
LLVM_C_ABI LLVMAtomicRMWBinOp LLVMGetAtomicRMWBinOp(LLVMValueRef AtomicRMWInst)
Definition Core.cpp:4414
LLVM_C_ABI LLVMValueRef LLVMBuildFNeg(LLVMBuilderRef, LLVMValueRef V, const char *Name)
Definition Core.cpp:4051
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:4148
LLVM_C_ABI void LLVMSetAtomicSyncScopeID(LLVMValueRef AtomicInst, unsigned SSID)
Sets the synchronization scope ID of an atomic instruction.
Definition Core.cpp:4758
LLVM_C_ABI LLVMContextRef LLVMGetBuilderContext(LLVMBuilderRef Builder)
Obtain the context to which this builder is associated.
Definition Core.cpp:3655
LLVM_C_ABI LLVMValueRef LLVMBuildMalloc(LLVMBuilderRef, LLVMTypeRef Ty, const char *Name)
Definition Core.cpp:4127
LLVM_C_ABI LLVMValueRef LLVMBuildFreeze(LLVMBuilderRef, LLVMValueRef Val, const char *Name)
Definition Core.cpp:4631
LLVM_C_ABI LLVMValueRef LLVMBuildGlobalString(LLVMBuilderRef B, const char *Str, const char *Name)
Definition Core.cpp:4354
LLVM_C_ABI void LLVMSetNUW(LLVMValueRef ArithInst, LLVMBool HasNUW)
Definition Core.cpp:4064
LLVM_C_ABI LLVMAtomicOrdering LLVMGetCmpXchgSuccessOrdering(LLVMValueRef CmpXchgInst)
Definition Core.cpp:4764
LLVM_C_ABI LLVMValueRef LLVMBuildFCmp(LLVMBuilderRef, LLVMRealPredicate Op, LLVMValueRef LHS, LLVMValueRef RHS, const char *Name)
Definition Core.cpp:4551
LLVM_C_ABI LLVMValueRef LLVMBuildPointerCast(LLVMBuilderRef, LLVMValueRef Val, LLVMTypeRef DestTy, const char *Name)
Definition Core.cpp:4513
LLVM_C_ABI LLVMValueRef LLVMBuildExactSDiv(LLVMBuilderRef, LLVMValueRef LHS, LLVMValueRef RHS, const char *Name)
Definition Core.cpp:3972
LLVM_C_ABI LLVMValueRef LLVMBuildShuffleVector(LLVMBuilderRef, LLVMValueRef V1, LLVMValueRef V2, LLVMValueRef Mask, const char *Name)
Definition Core.cpp:4612
LLVM_C_ABI LLVMValueRef LLVMBuildFPExt(LLVMBuilderRef, LLVMValueRef Val, LLVMTypeRef DestTy, const char *Name)
Definition Core.cpp:4464
LLVM_C_ABI void LLVMSetCleanup(LLVMValueRef LandingPad, LLVMBool Val)
Definition Core.cpp:3825
LLVM_C_ABI LLVMValueRef LLVMBuildICmp(LLVMBuilderRef, LLVMIntPredicate Op, LLVMValueRef LHS, LLVMValueRef RHS, const char *Name)
Definition Core.cpp:4544
LLVM_C_ABI void LLVMSetCmpXchgFailureOrdering(LLVMValueRef CmpXchgInst, LLVMAtomicOrdering Ordering)
Definition Core.cpp:4782
LLVM_C_ABI void LLVMAddClause(LLVMValueRef LandingPad, LLVMValueRef ClauseVal)
Definition Core.cpp:3817
LLVM_C_ABI LLVMValueRef LLVMBuildFence(LLVMBuilderRef B, LLVMAtomicOrdering ordering, LLVMBool singleThread, const char *Name)
Definition Core.cpp:4306
LLVM_C_ABI void LLVMSetParentCatchSwitch(LLVMValueRef CatchPad, LLVMValueRef CatchSwitch)
Set the parent catchswitch instruction of a catchpad instruction.
Definition Core.cpp:3847
LLVM_C_ABI LLVMValueRef LLVMBuildFenceSyncScope(LLVMBuilderRef B, LLVMAtomicOrdering ordering, unsigned SSID, const char *Name)
Definition Core.cpp:4315
LLVM_C_ABI LLVMValueRef LLVMBuildUIToFP(LLVMBuilderRef, LLVMValueRef Val, LLVMTypeRef DestTy, const char *Name)
Definition Core.cpp:4449
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:3562
LLVM_C_ABI unsigned LLVMGetNumClauses(LLVMValueRef LandingPad)
Definition Core.cpp:3809
LLVM_C_ABI int LLVMGetUndefMaskElem(void)
Definition Core.cpp:4727
LLVM_C_ABI void LLVMSetCmpXchgSuccessOrdering(LLVMValueRef CmpXchgInst, LLVMAtomicOrdering Ordering)
Definition Core.cpp:4769
LLVM_C_ABI LLVMValueRef LLVMGetParentCatchSwitch(LLVMValueRef CatchPad)
Get the parent catchswitch instruction of a catchpad instruction.
Definition Core.cpp:3843
LLVM_C_ABI LLVMFastMathFlags LLVMGetFastMathFlags(LLVMValueRef FPMathInst)
Get the flags for which fast-math-style optimizations are allowed for this value.
Definition Core.cpp:4099
LLVM_C_ABI LLVMBool LLVMGetIsDisjoint(LLVMValueRef Inst)
Gets whether the instruction has the disjoint flag set.
Definition Core.cpp:4115
LLVM_C_ABI LLVMValueRef LLVMBuildSwitch(LLVMBuilderRef, LLVMValueRef V, LLVMBasicBlockRef Else, unsigned NumCases)
Definition Core.cpp:3687
LLVM_C_ABI void LLVMSetNNeg(LLVMValueRef NonNegInst, LLVMBool IsNonNeg)
Sets the non-negative flag for the instruction.
Definition Core.cpp:4094
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:4155
LLVM_C_ABI void LLVMAddHandler(LLVMValueRef CatchSwitch, LLVMBasicBlockRef Dest)
Definition Core.cpp:3829
LLVM_C_ABI void LLVMSetExact(LLVMValueRef DivOrShrInst, LLVMBool IsExact)
Definition Core.cpp:4084
LLVM_C_ABI LLVMValueRef LLVMBuildNSWNeg(LLVMBuilderRef B, LLVMValueRef V, const char *Name)
Definition Core.cpp:4038
LLVM_C_ABI LLVMValueRef LLVMBuildAShr(LLVMBuilderRef, LLVMValueRef LHS, LLVMValueRef RHS, const char *Name)
Definition Core.cpp:4007
LLVM_C_ABI LLVMValueRef LLVMBuildInvoke2(LLVMBuilderRef, LLVMTypeRef Ty, LLVMValueRef Fn, LLVMValueRef *Args, unsigned NumArgs, LLVMBasicBlockRef Then, LLVMBasicBlockRef Catch, const char *Name)
Definition Core.cpp:3716
LLVM_C_ABI LLVMValueRef LLVMBuildBitInsert(LLVMBuilderRef, LLVMValueRef Base, LLVMValueRef Val, LLVMValueRef Offset, const char *Name)
Definition Core.cpp:4636
LLVM_C_ABI void LLVMSetOrdering(LLVMValueRef MemoryAccessInst, LLVMAtomicOrdering Ordering)
Definition Core.cpp:4401
LLVM_C_ABI LLVMValueRef LLVMBuildFPTrunc(LLVMBuilderRef, LLVMValueRef Val, LLVMTypeRef DestTy, const char *Name)
Definition Core.cpp:4459
LLVM_C_ABI LLVMValueRef LLVMBuildStore(LLVMBuilderRef, LLVMValueRef Val, LLVMValueRef Ptr)
Definition Core.cpp:4192
LLVM_C_ABI void LLVMAddMetadataToInst(LLVMBuilderRef Builder, LLVMValueRef Inst)
Same as LLVMSetInstDebugLocation.
Definition Core.cpp:3643
LLVM_C_ABI LLVMAtomicOrdering LLVMGetCmpXchgFailureOrdering(LLVMValueRef CmpXchgInst)
Definition Core.cpp:4777
LLVM_C_ABI LLVMValueRef LLVMBuildNUWAdd(LLVMBuilderRef, LLVMValueRef LHS, LLVMValueRef RHS, const char *Name)
Definition Core.cpp:3907
LLVM_C_ABI LLVMValueRef LLVMBuildInsertValue(LLVMBuilderRef, LLVMValueRef AggVal, LLVMValueRef EltVal, unsigned Index, const char *Name)
Definition Core.cpp:4624
LLVM_C_ABI void LLVMBuilderSetDefaultFPMathTag(LLVMBuilderRef Builder, LLVMMetadataRef FPMathTag)
Set the default floating-point math metadata for the given builder.
Definition Core.cpp:3647
LLVM_C_ABI LLVMValueRef LLVMBuildZExt(LLVMBuilderRef, LLVMValueRef Val, LLVMTypeRef DestTy, const char *Name)
Definition Core.cpp:4429
LLVM_C_ABI LLVMValueRef LLVMBuildNot(LLVMBuilderRef, LLVMValueRef V, const char *Name)
Definition Core.cpp:4055
LLVM_C_ABI LLVMValueRef LLVMBuildAtomicRMW(LLVMBuilderRef B, LLVMAtomicRMWBinOp op, LLVMValueRef PTR, LLVMValueRef Val, LLVMAtomicOrdering ordering, LLVMBool singleThread)
Definition Core.cpp:4669
LLVM_C_ABI LLVMMemoryBufferRef LLVMCreateMemoryBufferWithMemoryRange(const char *InputData, size_t InputDataLength, const char *BufferName, LLVMBool RequiresNullTerminator)
Definition Core.cpp:4829
LLVM_C_ABI size_t LLVMGetBufferSize(LLVMMemoryBufferRef MemBuf)
Definition Core.cpp:4854
LLVM_C_ABI LLVMMemoryBufferRef LLVMCreateMemoryBufferWithMemoryRangeCopy(const char *InputData, size_t InputDataLength, const char *BufferName)
Definition Core.cpp:4840
LLVM_C_ABI const char * LLVMGetBufferStart(LLVMMemoryBufferRef MemBuf)
Definition Core.cpp:4850
LLVM_C_ABI LLVMBool LLVMCreateMemoryBufferWithContentsOfFile(const char *Path, LLVMMemoryBufferRef *OutMemBuf, char **OutMessage)
Definition Core.cpp:4804
LLVM_C_ABI LLVMBool LLVMCreateMemoryBufferWithSTDIN(LLVMMemoryBufferRef *OutMemBuf, char **OutMessage)
Definition Core.cpp:4818
LLVM_C_ABI void LLVMDisposeMemoryBuffer(LLVMMemoryBufferRef MemBuf)
Definition Core.cpp:4858
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:4793
LLVM_C_ABI void LLVMDisposeModuleProvider(LLVMModuleProviderRef M)
Destroys the module M.
Definition Core.cpp:4797
LLVM_C_ABI char * LLVMPrintModuleToString(LLVMModuleRef M)
Return a string representation of the module.
Definition Core.cpp:499
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:1463
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:2562
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:1591
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:1458
LLVM_C_ABI LLVMModuleRef LLVMModuleCreateWithNameInContext(const char *ModuleID, LLVMContextRef C)
Create a new, empty module in a specific context.
Definition Core.cpp:307
LLVM_C_ABI const char * LLVMGetTarget(LLVMModuleRef M)
Obtain the target triple for a module.
Definition Core.cpp:350
LLVM_C_ABI LLVMBool LLVMGetInlineAsmCanUnwind(LLVMValueRef InlineAsmVal)
Get if the inline asm snippet may unwind the stack.
Definition Core.cpp:608
LLVM_C_ABI const char * LLVMGetModuleInlineAsm(LLVMModuleRef M, size_t *Len)
Get inline assembly for a module.
Definition Core.cpp:522
LLVM_C_ABI LLVMBool LLVMGetInlineAsmNeedsAlignedStack(LLVMValueRef InlineAsmVal)
Get if the inline asm snippet needs an aligned stack.
Definition Core.cpp:603
LLVM_C_ABI LLVMBool LLVMGetInlineAsmHasSideEffects(LLVMValueRef InlineAsmVal)
Get if the inline asm snippet has side effects.
Definition Core.cpp:598
LLVM_C_ABI unsigned LLVMGetNamedMetadataNumOperands(LLVMModuleRef M, const char *Name)
Obtain the number of operands for named metadata in a module.
Definition Core.cpp:1494
LLVM_C_ABI void LLVMDumpModule(LLVMModuleRef M)
Dump a representation of a module to stderr.
Definition Core.cpp:471
LLVM_C_ABI void LLVMSetTarget(LLVMModuleRef M, const char *Triple)
Set the target triple for a module.
Definition Core.cpp:354
LLVM_C_ABI LLVMTypeRef LLVMGetInlineAsmFunctionType(LLVMValueRef InlineAsmVal)
Get the function type of the inline assembly snippet.
Definition Core.cpp:593
LLVM_C_ABI LLVMBool LLVMIsNewDbgInfoFormat(LLVMModuleRef M)
Soon to be deprecated.
Definition Core.cpp:461
LLVM_C_ABI LLVMContextRef LLVMGetModuleContext(LLVMModuleRef M)
Obtain the context to which this module is associated.
Definition Core.cpp:614
LLVM_C_ABI LLVMInlineAsmDialect LLVMGetInlineAsmDialect(LLVMValueRef InlineAsmVal)
Get the dialect used by the inline asm snippet.
Definition Core.cpp:577
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:514
LLVM_C_ABI LLVMValueRef LLVMGetNextFunction(LLVMValueRef Fn)
Advance a Function iterator to the next Function.
Definition Core.cpp:2583
LLVM_C_ABI const char * LLVMGetModuleIdentifier(LLVMModuleRef M, size_t *Len)
Obtain the identifier of a module.
Definition Core.cpp:316
LLVM_C_ABI const char * LLVMGetSourceFileName(LLVMModuleRef M, size_t *Len)
Obtain the module's original source file name.
Definition Core.cpp:326
LLVM_C_ABI const char * LLVMGetDataLayoutStr(LLVMModuleRef M)
Obtain the data layout for a module.
Definition Core.cpp:337
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:427
LLVM_C_ABI void LLVMSetIsNewDbgInfoFormat(LLVMModuleRef M, LLVMBool UseNewFormat)
Soon to be deprecated.
Definition Core.cpp:463
LLVM_C_ABI LLVMTypeRef LLVMGetTypeByName(LLVMModuleRef M, const char *Name)
Deprecated: Use LLVMGetTypeByName2 instead.
Definition Core.cpp:897
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:322
LLVM_C_ABI const char * LLVMGetInlineAsmAsmString(LLVMValueRef InlineAsmVal, size_t *Len)
Get the template string used for an inline assembly snippet.
Definition Core.cpp:559
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:539
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:2550
LLVM_C_ABI const char * LLVMGetInlineAsmConstraintString(LLVMValueRef InlineAsmVal, size_t *Len)
Get the raw constraint string for an inline assembly snippet.
Definition Core.cpp:568
LLVM_C_ABI LLVMNamedMDNodeRef LLVMGetNextNamedMetadata(LLVMNamedMDNodeRef NamedMDNode)
Advance a NamedMDNode iterator to the next NamedMDNode.
Definition Core.cpp:1442
LLVM_C_ABI void LLVMGetNamedMetadataOperands(LLVMModuleRef M, const char *Name, LLVMValueRef *Dest)
Obtain the named metadata operands for a module.
Definition Core.cpp:1501
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:449
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:2544
LLVM_C_ABI LLVMValueRef LLVMGetPreviousFunction(LLVMValueRef Fn)
Decrement a Function iterator to the previous Function.
Definition Core.cpp:2591
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:1521
LLVM_C_ABI void LLVMAddNamedMetadataOperand(LLVMModuleRef M, const char *Name, LLVMValueRef Val)
Add an operand to named metadata.
Definition Core.cpp:1511
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:1569
LLVM_C_ABI LLVMMetadataRef LLVMModuleFlagEntriesGetMetadata(LLVMModuleFlagEntry *Entries, unsigned Index)
Returns the metadata for a module flag entry at a specific index.
Definition Core.cpp:442
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:454
LLVM_C_ABI LLVMValueRef LLVMGetLastFunction(LLVMModuleRef M)
Obtain an iterator to the last Function in a Module.
Definition Core.cpp:2575
LLVM_C_ABI LLVMNamedMDNodeRef LLVMGetPreviousNamedMetadata(LLVMNamedMDNodeRef NamedMDNode)
Decrement a NamedMDNode iterator to the previous NamedMDNode.
Definition Core.cpp:1450
LLVM_C_ABI const char * LLVMGetNamedMetadataName(LLVMNamedMDNodeRef NamedMD, size_t *NameLen)
Retrieve the name of a NamedMDNode.
Definition Core.cpp:1468
LLVM_C_ABI LLVMValueRef LLVMGetNamedFunction(LLVMModuleRef M, const char *Name)
Obtain a Function value from a Module by its name.
Definition Core.cpp:2558
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:1545
LLVM_C_ABI void LLVMAppendModuleInlineAsm(LLVMModuleRef M, const char *Asm, size_t Len)
Append inline assembly to a module.
Definition Core.cpp:518
LLVM_C_ABI void LLVMSetDataLayout(LLVMModuleRef M, const char *DataLayoutStr)
Set the data layout for a module.
Definition Core.cpp:345
LLVM_C_ABI void LLVMDisposeModuleFlagsMetadata(LLVMModuleFlagEntry *Entries)
Destroys module flags metadata entries.
Definition Core.cpp:422
LLVM_C_ABI void LLVMDisposeModule(LLVMModuleRef M)
Destroy a module instance.
Definition Core.cpp:312
LLVM_C_ABI LLVMNamedMDNodeRef LLVMGetLastNamedMetadata(LLVMModuleRef M)
Obtain an iterator to the last NamedMDNode in a Module.
Definition Core.cpp:1434
LLVM_C_ABI void LLVMSetModuleInlineAsm2(LLVMModuleRef M, const char *Asm, size_t Len)
Set inline assembly for a module.
Definition Core.cpp:510
LLVM_C_ABI LLVMValueRef LLVMGetFirstFunction(LLVMModuleRef M)
Obtain an iterator to the first Function in a Module.
Definition Core.cpp:2567
LLVM_C_ABI LLVMNamedMDNodeRef LLVMGetFirstNamedMetadata(LLVMModuleRef M)
Obtain an iterator to the first NamedMDNode in a Module.
Definition Core.cpp:1426
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:434
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:332
LLVM_C_ABI LLVMBool LLVMPrintModuleToFile(LLVMModuleRef M, const char *Filename, char **ErrorMessage)
Print a representation of a module to a file.
Definition Core.cpp:476
LLVM_C_ABI const char * LLVMGetDataLayout(LLVMModuleRef M)
Definition Core.cpp:341
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:405
LLVM_C_ABI LLVMOperandBundleRef LLVMCreateOperandBundle(const char *Tag, size_t TagLen, LLVMValueRef *Args, unsigned NumArgs)
Create a new operand bundle.
Definition Core.cpp:2909
LLVM_C_ABI unsigned LLVMGetNumOperandBundleArgs(LLVMOperandBundleRef Bundle)
Obtain the number of operands for an operand bundle.
Definition Core.cpp:2926
LLVM_C_ABI const char * LLVMGetOperandBundleTag(LLVMOperandBundleRef Bundle, size_t *Len)
Obtain the tag of an operand bundle as a string.
Definition Core.cpp:2920
LLVM_C_ABI void LLVMDisposeOperandBundle(LLVMOperandBundleRef Bundle)
Destroy an operand bundle.
Definition Core.cpp:2916
LLVM_C_ABI LLVMValueRef LLVMGetOperandBundleArgAtIndex(LLVMOperandBundleRef Bundle, unsigned Index)
Obtain the operand for an operand bundle at the given index.
Definition Core.cpp:2930
LLVM_C_ABI LLVMPassManagerRef LLVMCreateFunctionPassManager(LLVMModuleProviderRef MP)
Deprecated: Use LLVMCreateFunctionPassManagerForModule instead.
Definition Core.cpp:4872
LLVM_C_ABI LLVMPassManagerRef LLVMCreateFunctionPassManagerForModule(LLVMModuleRef M)
Constructs a new function-by-function pass pipeline over the module provider.
Definition Core.cpp:4868
LLVM_C_ABI LLVMBool LLVMFinalizeFunctionPassManager(LLVMPassManagerRef FPM)
Finalizes all of the function passes scheduled in the function pass manager.
Definition Core.cpp:4889
LLVM_C_ABI void LLVMDisposePassManager(LLVMPassManagerRef PM)
Frees the memory of a pass pipeline.
Definition Core.cpp:4893
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:4885
LLVM_C_ABI LLVMBool LLVMInitializeFunctionPassManager(LLVMPassManagerRef FPM)
Initializes all of the function passes scheduled in the function pass manager.
Definition Core.cpp:4881
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:4877
LLVM_C_ABI LLVMPassManagerRef LLVMCreatePassManager(void)
Constructs a new whole-module pass pipeline.
Definition Core.cpp:4864
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:4903
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:4899
LLVM_C_ABI LLVMBool LLVMIsMultithreaded(void)
Check whether LLVM is executing in thread-safe mode or not.
Definition Core.cpp:4906
LLVM_C_ABI LLVMTypeRef LLVMByteTypeInContext(LLVMContextRef C, unsigned NumBits)
Obtain a byte type from a context with specified bit width.
Definition Core.cpp:700
LLVM_C_ABI unsigned LLVMGetByteTypeWidth(LLVMTypeRef ByteTy)
Definition Core.cpp:704
LLVM_C_ABI LLVMTypeRef LLVMHalfTypeInContext(LLVMContextRef C)
Obtain a 16-bit floating point type from a context.
Definition Core.cpp:760
LLVM_C_ABI LLVMTypeRef LLVMBFloatTypeInContext(LLVMContextRef C)
Obtain a 16-bit brain floating point type from a context.
Definition Core.cpp:763
LLVM_C_ABI LLVMTypeRef LLVMPPCFP128TypeInContext(LLVMContextRef C)
Obtain a 128-bit floating point type (two 64-bits) from a context.
Definition Core.cpp:778
LLVM_C_ABI LLVMTypeRef LLVMDoubleTypeInContext(LLVMContextRef C)
Obtain a 64-bit floating point type from a context.
Definition Core.cpp:769
LLVM_C_ABI LLVMTypeRef LLVMFloatTypeInContext(LLVMContextRef C)
Obtain a 32-bit floating point type from a context.
Definition Core.cpp:766
LLVM_C_ABI LLVMTypeRef LLVMFP128TypeInContext(LLVMContextRef C)
Obtain a 128-bit floating point type (112-bit mantissa) from a context.
Definition Core.cpp:775
LLVM_C_ABI LLVMTypeRef LLVMX86FP80TypeInContext(LLVMContextRef C)
Obtain a 80-bit floating point type (X87) from a context.
Definition Core.cpp:772
LLVM_C_ABI LLVMTypeRef LLVMGetReturnType(LLVMTypeRef FunctionTy)
Obtain the Type this function Type returns.
Definition Core.cpp:823
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:812
LLVM_C_ABI LLVMBool LLVMIsFunctionVarArg(LLVMTypeRef FunctionTy)
Returns whether a function type is variadic.
Definition Core.cpp:819
LLVM_C_ABI unsigned LLVMCountParamTypes(LLVMTypeRef FunctionTy)
Obtain the number of parameters this function accepts.
Definition Core.cpp:827
LLVM_C_ABI void LLVMGetParamTypes(LLVMTypeRef FunctionTy, LLVMTypeRef *Dest)
Obtain the types of a function's parameters.
Definition Core.cpp:831
LLVM_C_ABI LLVMTypeRef LLVMInt1TypeInContext(LLVMContextRef C)
Obtain an integer type from a context with specified bit width.
Definition Core.cpp:710
LLVM_C_ABI LLVMTypeRef LLVMInt8TypeInContext(LLVMContextRef C)
Definition Core.cpp:713
LLVM_C_ABI LLVMTypeRef LLVMInt32TypeInContext(LLVMContextRef C)
Definition Core.cpp:719
LLVM_C_ABI LLVMTypeRef LLVMIntTypeInContext(LLVMContextRef C, unsigned NumBits)
Definition Core.cpp:728
LLVM_C_ABI LLVMTypeRef LLVMInt64TypeInContext(LLVMContextRef C)
Definition Core.cpp:722
LLVM_C_ABI LLVMTypeRef LLVMInt16TypeInContext(LLVMContextRef C)
Definition Core.cpp:716
LLVM_C_ABI unsigned LLVMGetIntTypeWidth(LLVMTypeRef IntegerTy)
Definition Core.cpp:754
LLVM_C_ABI LLVMTypeRef LLVMInt128TypeInContext(LLVMContextRef C)
Definition Core.cpp:725
LLVM_C_ABI unsigned LLVMGetTargetExtTypeNumTypeParams(LLVMTypeRef TargetExtTy)
Obtain the number of type parameters for this target extension type.
Definition Core.cpp:1026
LLVM_C_ABI LLVMTypeRef LLVMX86AMXTypeInContext(LLVMContextRef C)
Create a X86 AMX type in a context.
Definition Core.cpp:781
LLVM_C_ABI const char * LLVMGetTargetExtTypeName(LLVMTypeRef TargetExtTy)
Obtain the name for this target extension type.
Definition Core.cpp:1021
LLVM_C_ABI LLVMTypeRef LLVMVoidTypeInContext(LLVMContextRef C)
Create a void type in a context.
Definition Core.cpp:990
LLVM_C_ABI LLVMTypeRef LLVMTokenTypeInContext(LLVMContextRef C)
Create a token type in a context.
Definition Core.cpp:996
LLVM_C_ABI unsigned LLVMGetTargetExtTypeNumIntParams(LLVMTypeRef TargetExtTy)
Obtain the number of int parameters for this target extension type.
Definition Core.cpp:1037
LLVM_C_ABI LLVMTypeRef LLVMLabelTypeInContext(LLVMContextRef C)
Create a label type in a context.
Definition Core.cpp:993
LLVM_C_ABI LLVMTypeRef LLVMMetadataTypeInContext(LLVMContextRef C)
Create a metadata type in a context.
Definition Core.cpp:999
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:1031
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:1010
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:1042
LLVM_C_ABI LLVMValueRef LLVMGetConstantPtrAuthAddrDiscriminator(LLVMValueRef PtrAuth)
Get the address discriminator value for the associated ConstantPtrAuth constant.
Definition Core.cpp:980
LLVM_C_ABI LLVMBool LLVMPointerTypeIsOpaque(LLVMTypeRef Ty)
Determine whether a pointer is opaque.
Definition Core.cpp:928
LLVM_C_ABI LLVMTypeRef LLVMPointerTypeInContext(LLVMContextRef C, unsigned AddressSpace)
Create an opaque pointer type in a context.
Definition Core.cpp:986
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:932
LLVM_C_ABI LLVMTypeRef LLVMGetElementType(LLVMTypeRef Ty)
Obtain the element type of an array or vector type.
Definition Core.cpp:941
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:936
LLVM_C_ABI LLVMValueRef LLVMGetConstantPtrAuthDiscriminator(LLVMValueRef PtrAuth)
Get the discriminator value for the associated ConstantPtrAuth constant.
Definition Core.cpp:976
LLVM_C_ABI uint64_t LLVMGetArrayLength2(LLVMTypeRef ArrayTy)
Obtain the length of an array type.
Definition Core.cpp:956
LLVM_C_ABI LLVMValueRef LLVMGetConstantPtrAuthKey(LLVMValueRef PtrAuth)
Get the key value for the associated ConstantPtrAuth constant.
Definition Core.cpp:972
LLVM_C_ABI unsigned LLVMGetArrayLength(LLVMTypeRef ArrayTy)
Obtain the length of an array type.
Definition Core.cpp:952
LLVM_C_ABI LLVMValueRef LLVMGetConstantPtrAuthPointer(LLVMValueRef PtrAuth)
Get the pointer value for the associated ConstantPtrAuth constant.
Definition Core.cpp:968
LLVM_C_ABI unsigned LLVMGetPointerAddressSpace(LLVMTypeRef PointerTy)
Obtain the address space of a pointer type.
Definition Core.cpp:960
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:919
LLVM_C_ABI unsigned LLVMGetVectorSize(LLVMTypeRef VectorTy)
Obtain the (possibly scalable) number of elements in a vector type.
Definition Core.cpp:964
LLVM_C_ABI LLVMTypeRef LLVMArrayType(LLVMTypeRef ElementType, unsigned ElementCount)
Create a fixed size array type that refers to a specific type.
Definition Core.cpp:915
LLVM_C_ABI void LLVMGetSubtypes(LLVMTypeRef Tp, LLVMTypeRef *Arr)
Returns type's subtypes.
Definition Core.cpp:907
LLVM_C_ABI LLVMTypeRef LLVMPointerType(LLVMTypeRef ElementType, unsigned AddressSpace)
Create a pointer type that points to a defined type.
Definition Core.cpp:923
LLVM_C_ABI unsigned LLVMGetNumContainedTypes(LLVMTypeRef Tp)
Return the number of types in the derived type.
Definition Core.cpp:948
LLVM_C_ABI LLVMTypeRef LLVMStructTypeInContext(LLVMContextRef C, LLVMTypeRef *ElementTypes, unsigned ElementCount, LLVMBool Packed)
Create a new structure type in a context.
Definition Core.cpp:839
LLVM_C_ABI void LLVMGetStructElementTypes(LLVMTypeRef StructTy, LLVMTypeRef *Dest)
Get the elements within a structure.
Definition Core.cpp:874
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:880
LLVM_C_ABI LLVMBool LLVMIsPackedStruct(LLVMTypeRef StructTy)
Determine whether a structure is packed.
Definition Core.cpp:885
LLVM_C_ABI LLVMTypeRef LLVMStructCreateNamed(LLVMContextRef C, const char *Name)
Create an empty structure in a context having a specified name.
Definition Core.cpp:851
LLVM_C_ABI void LLVMStructSetBody(LLVMTypeRef StructTy, LLVMTypeRef *ElementTypes, unsigned ElementCount, LLVMBool Packed)
Set the contents of a structure type.
Definition Core.cpp:864
LLVM_C_ABI LLVMBool LLVMIsOpaqueStruct(LLVMTypeRef StructTy)
Determine whether a structure is opaque.
Definition Core.cpp:889
LLVM_C_ABI unsigned LLVMCountStructElementTypes(LLVMTypeRef StructTy)
Get the number of elements defined inside the structure.
Definition Core.cpp:870
LLVM_C_ABI const char * LLVMGetStructName(LLVMTypeRef Ty)
Obtain the name of a structure.
Definition Core.cpp:856
LLVM_C_ABI LLVMBool LLVMIsLiteralStruct(LLVMTypeRef StructTy)
Determine whether a structure is literal.
Definition Core.cpp:893
LLVM_C_ABI void LLVMDumpType(LLVMTypeRef Val)
Dump a representation of a type to stderr.
Definition Core.cpp:682
LLVM_C_ABI LLVMBool LLVMTypeIsSized(LLVMTypeRef Ty)
Whether the type has a known size.
Definition Core.cpp:673
LLVM_C_ABI LLVMContextRef LLVMGetTypeContext(LLVMTypeRef Ty)
Obtain the context to which this type instance is associated.
Definition Core.cpp:678
LLVM_C_ABI char * LLVMPrintTypeToString(LLVMTypeRef Val)
Return a string representation of the type.
Definition Core.cpp:686
LLVM_C_ABI LLVMTypeKind LLVMGetTypeKind(LLVMTypeRef Ty)
Obtain the enumerated type of a Type instance.
Definition Core.cpp:623
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:3077
LLVM_C_ABI void LLVMMoveBasicBlockAfter(LLVMBasicBlockRef BB, LLVMBasicBlockRef MovePos)
Move a basic block to after another one.
Definition Core.cpp:3059
LLVM_C_ABI LLVMBasicBlockRef LLVMGetFirstBasicBlock(LLVMValueRef Fn)
Obtain the first basic block in a function.
Definition Core.cpp:2975
LLVM_C_ABI LLVMBasicBlockRef LLVMCreateBasicBlockInContext(LLVMContextRef C, const char *Name)
Create a new basic block without inserting it into a function.
Definition Core.cpp:3007
LLVM_C_ABI LLVMBasicBlockRef LLVMGetPreviousBasicBlock(LLVMBasicBlockRef BB)
Go backwards in a basic block iterator.
Definition Core.cpp:2999
LLVM_C_ABI LLVMBasicBlockRef LLVMGetLastBasicBlock(LLVMValueRef Fn)
Obtain the last basic block in a function.
Definition Core.cpp:2983
LLVM_C_ABI LLVMValueRef LLVMGetBasicBlockTerminator(LLVMBasicBlockRef BB)
Obtain the terminator instruction for a basic block.
Definition Core.cpp:2957
LLVM_C_ABI const char * LLVMGetBasicBlockName(LLVMBasicBlockRef BB)
Obtain the string name of a basic block.
Definition Core.cpp:2949
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:3020
LLVM_C_ABI void LLVMDeleteBasicBlock(LLVMBasicBlockRef BB)
Remove a basic block from a function and delete it.
Definition Core.cpp:3047
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:3035
LLVM_C_ABI void LLVMGetBasicBlocks(LLVMValueRef Fn, LLVMBasicBlockRef *BasicBlocks)
Obtain all of the basic blocks in a function.
Definition Core.cpp:2965
LLVM_C_ABI void LLVMMoveBasicBlockBefore(LLVMBasicBlockRef BB, LLVMBasicBlockRef MovePos)
Move a basic block to before another one.
Definition Core.cpp:3055
LLVM_C_ABI LLVMValueRef LLVMGetBasicBlockParent(LLVMBasicBlockRef BB)
Obtain the function to which a basic block belongs.
Definition Core.cpp:2953
LLVM_C_ABI LLVMBasicBlockRef LLVMGetEntryBasicBlock(LLVMValueRef Fn)
Obtain the basic block that corresponds to the entry point of a function.
Definition Core.cpp:2971
LLVM_C_ABI LLVMValueRef LLVMGetFirstInstruction(LLVMBasicBlockRef BB)
Obtain the first instruction in a basic block.
Definition Core.cpp:3069
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:3012
LLVM_C_ABI LLVMValueRef LLVMBasicBlockAsValue(LLVMBasicBlockRef BB)
Convert a basic block instance to a value type.
Definition Core.cpp:2937
LLVM_C_ABI LLVMBasicBlockRef LLVMValueAsBasicBlock(LLVMValueRef Val)
Convert an LLVMValueRef to an LLVMBasicBlockRef instance.
Definition Core.cpp:2945
LLVM_C_ABI void LLVMRemoveBasicBlockFromParent(LLVMBasicBlockRef BB)
Remove a basic block from a function.
Definition Core.cpp:3051
LLVM_C_ABI LLVMBasicBlockRef LLVMGetNextBasicBlock(LLVMBasicBlockRef BB)
Advance a basic block iterator.
Definition Core.cpp:2991
LLVM_C_ABI unsigned LLVMCountBasicBlocks(LLVMValueRef Fn)
Obtain the number of basic blocks in a function.
Definition Core.cpp:2961
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:3025
LLVM_C_ABI LLVMBool LLVMValueIsBasicBlock(LLVMValueRef Val)
Determine whether an LLVMValueRef is itself a basic block.
Definition Core.cpp:2941
LLVM_C_ABI LLVMValueRef LLVMConstantPtrAuth(LLVMValueRef Ptr, LLVMValueRef Key, LLVMValueRef Disc, LLVMValueRef AddrDisc)
Create a ConstantPtrAuth constant with the given values.
Definition Core.cpp:1801
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:1730
LLVM_C_ABI LLVMValueRef LLVMConstVector(LLVMValueRef *ScalarConstantVals, unsigned Size)
Create a ConstantVector from values.
Definition Core.cpp:1796
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:1715
LLVM_C_ABI LLVMValueRef LLVMConstDataArray(LLVMTypeRef ElementTy, const char *Data, size_t SizeInBytes)
Create a ConstantDataArray from raw values.
Definition Core.cpp:1766
LLVM_C_ABI LLVMValueRef LLVMConstArray(LLVMTypeRef ElementTy, LLVMValueRef *ConstantVals, unsigned Length)
Create a ConstantArray from values.
Definition Core.cpp:1754
LLVM_C_ABI LLVMBool LLVMIsConstantString(LLVMValueRef c)
Returns true if the specified constant is an array of i8.
Definition Core.cpp:1738
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:1706
LLVM_C_ABI LLVMValueRef LLVMConstArray2(LLVMTypeRef ElementTy, LLVMValueRef *ConstantVals, uint64_t Length)
Create a ConstantArray from values.
Definition Core.cpp:1760
LLVM_C_ABI const char * LLVMGetAsString(LLVMValueRef c, size_t *Length)
Get the given constant data sequential as a string.
Definition Core.cpp:1742
LLVM_C_ABI LLVMValueRef LLVMConstNamedStruct(LLVMTypeRef StructTy, LLVMValueRef *ConstantVals, unsigned Count)
Create a non-anonymous ConstantStruct from values.
Definition Core.cpp:1787
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:1748
LLVM_C_ABI LLVMValueRef LLVMConstStructInContext(LLVMContextRef C, LLVMValueRef *ConstantVals, unsigned Count, LLVMBool Packed)
Create an anonymous ConstantStruct with the specified values.
Definition Core.cpp:1773
LLVM_C_ABI LLVMValueRef LLVMConstAddrSpaceCast(LLVMValueRef ConstantVal, LLVMTypeRef ToType)
Definition Core.cpp:2008
LLVM_C_ABI LLVMValueRef LLVMConstAdd(LLVMValueRef LHSConstant, LLVMValueRef RHSConstant)
Definition Core.cpp:1893
LLVM_C_ABI LLVMValueRef LLVMConstSub(LLVMValueRef LHSConstant, LLVMValueRef RHSConstant)
Definition Core.cpp:1910
LLVM_C_ABI LLVMValueRef LLVMConstPtrAdd(LLVMValueRef ConstantVal, LLVMValueRef ConstantOffset, LLVMGEPNoWrapFlags NoWrapFlags)
Creates a constant ptradd expression (getelementptr i8).
Definition Core.cpp:1967
LLVM_C_ABI LLVMValueRef LLVMConstTruncOrBitCast(LLVMValueRef ConstantVal, LLVMTypeRef ToType)
Definition Core.cpp:2014
LLVM_C_ABI LLVMValueRef LLVMConstBitCast(LLVMValueRef ConstantVal, LLVMTypeRef ToType)
Definition Core.cpp:2003
LLVM_C_ABI LLVMValueRef LLVMConstNUWSub(LLVMValueRef LHSConstant, LLVMValueRef RHSConstant)
Definition Core.cpp:1921
LLVM_C_ABI LLVMOpcode LLVMGetConstOpcode(LLVMValueRef ConstantVal)
Definition Core.cpp:1860
LLVM_C_ABI LLVMValueRef LLVMConstExtractElement(LLVMValueRef VectorConstant, LLVMValueRef IndexConstant)
Definition Core.cpp:2026
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:1975
LLVM_C_ABI LLVMValueRef LLVMConstNSWAdd(LLVMValueRef LHSConstant, LLVMValueRef RHSConstant)
Definition Core.cpp:1898
LLVM_C_ABI LLVMValueRef LLVMConstNeg(LLVMValueRef ConstantVal)
Definition Core.cpp:1876
LLVM_C_ABI LLVMValueRef LLVMConstPointerCast(LLVMValueRef ConstantVal, LLVMTypeRef ToType)
Definition Core.cpp:2020
LLVM_C_ABI LLVMValueRef LLVMConstInsertElement(LLVMValueRef VectorConstant, LLVMValueRef ElementValueConstant, LLVMValueRef IndexConstant)
Definition Core.cpp:2032
LLVM_C_ABI LLVMValueRef LLVMConstXor(LLVMValueRef LHSConstant, LLVMValueRef RHSConstant)
Definition Core.cpp:1927
LLVM_C_ABI LLVMValueRef LLVMConstNSWSub(LLVMValueRef LHSConstant, LLVMValueRef RHSConstant)
Definition Core.cpp:1915
LLVM_C_ABI LLVMValueRef LLVMConstShuffleVector(LLVMValueRef VectorAConstant, LLVMValueRef VectorBConstant, LLVMValueRef MaskConstant)
Definition Core.cpp:2040
LLVM_C_ABI LLVMValueRef LLVMConstTrunc(LLVMValueRef ConstantVal, LLVMTypeRef ToType)
Definition Core.cpp:1988
LLVM_C_ABI LLVMValueRef LLVMBlockAddress(LLVMValueRef F, LLVMBasicBlockRef BB)
Definition Core.cpp:2058
LLVM_C_ABI LLVMValueRef LLVMConstNot(LLVMValueRef ConstantVal)
Definition Core.cpp:1889
LLVM_C_ABI LLVMValueRef LLVMConstNUWAdd(LLVMValueRef LHSConstant, LLVMValueRef RHSConstant)
Definition Core.cpp:1904
LLVM_C_ABI LLVMValueRef LLVMConstPtrToInt(LLVMValueRef ConstantVal, LLVMTypeRef ToType)
Definition Core.cpp:1993
LLVM_C_ABI LLVMValueRef LLVMConstIntToPtr(LLVMValueRef ConstantVal, LLVMTypeRef ToType)
Definition Core.cpp:1998
LLVM_C_ABI LLVMValueRef LLVMConstInlineAsm(LLVMTypeRef Ty, const char *AsmString, const char *Constraints, LLVMBool HasSideEffects, LLVMBool IsAlignStack)
Deprecated: Use LLVMGetInlineAsm instead.
Definition Core.cpp:2050
LLVM_C_ABI LLVMValueRef LLVMConstNSWNeg(LLVMValueRef ConstantVal)
Definition Core.cpp:1880
LLVM_C_ABI LLVMValueRef LLVMGetBlockAddressFunction(LLVMValueRef BlockAddr)
Gets the function associated with a given BlockAddress constant value.
Definition Core.cpp:2062
LLVM_C_ABI LLVMBasicBlockRef LLVMGetBlockAddressBasicBlock(LLVMValueRef BlockAddr)
Gets the basic block associated with a given BlockAddress constant value.
Definition Core.cpp:2066
LLVM_C_ABI void LLVMSetDSOLocal(LLVMValueRef Global, LLVMBool IsDSOLocal)
Sets whether the global value is marked as dso_local.
Definition Core.cpp:2233
LLVM_C_ABI LLVMUnnamedAddr LLVMGetUnnamedAddress(LLVMValueRef Global)
Definition Core.cpp:2204
LLVM_C_ABI LLVMTypeRef LLVMGlobalGetValueType(LLVMValueRef Global)
Returns the "value type" of a global value.
Definition Core.cpp:2247
LLVM_C_ABI unsigned LLVMGetAlignment(LLVMValueRef V)
Obtain the preferred alignment of the value.
Definition Core.cpp:2253
LLVM_C_ABI void LLVMSetSection(LLVMValueRef Global, const char *Section)
Definition Core.cpp:2180
LLVM_C_ABI void LLVMSetUnnamedAddress(LLVMValueRef Global, LLVMUnnamedAddr UnnamedAddr)
Definition Core.cpp:2216
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:2328
LLVM_C_ABI void LLVMSetLinkage(LLVMValueRef Global, LLVMLinkage Linkage)
Definition Core.cpp:2109
LLVM_C_ABI void LLVMSetUnnamedAddr(LLVMValueRef Global, LLVMBool HasUnnamedAddr)
Deprecated: Use LLVMSetUnnamedAddress instead.
Definition Core.cpp:2241
LLVM_C_ABI LLVMModuleRef LLVMGetGlobalParent(LLVMValueRef Global)
Definition Core.cpp:2072
LLVM_C_ABI LLVMBool LLVMIsDSOLocal(LLVMValueRef Global)
Returns whether the global value is marked as dso_local, i.e.
Definition Core.cpp:2229
LLVM_C_ABI unsigned LLVMValueMetadataEntriesGetKind(LLVMValueMetadataEntry *Entries, unsigned Index)
Returns the kind of a value metadata entry at a specific index.
Definition Core.cpp:2309
LLVM_C_ABI void LLVMSetDLLStorageClass(LLVMValueRef Global, LLVMDLLStorageClass Class)
Definition Core.cpp:2199
LLVM_C_ABI LLVMVisibility LLVMGetVisibility(LLVMValueRef Global)
Definition Core.cpp:2184
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:2297
LLVM_C_ABI void LLVMSetAlignment(LLVMValueRef V, unsigned Bytes)
Set the preferred alignment of the value.
Definition Core.cpp:2275
LLVM_C_ABI const char * LLVMGetSection(LLVMValueRef Global)
Definition Core.cpp:2174
LLVM_C_ABI void LLVMSetVisibility(LLVMValueRef Global, LLVMVisibility Viz)
Definition Core.cpp:2189
LLVM_C_ABI LLVMLinkage LLVMGetLinkage(LLVMValueRef Global)
Definition Core.cpp:2080
LLVM_C_ABI void LLVMGlobalEraseMetadata(LLVMValueRef Global, unsigned Kind)
Erases a metadata attachment of the given kind if it exists.
Definition Core.cpp:2338
LLVM_C_ABI LLVMDLLStorageClass LLVMGetDLLStorageClass(LLVMValueRef Global)
Definition Core.cpp:2194
LLVM_C_ABI LLVMBool LLVMIsDeclaration(LLVMValueRef Global)
Definition Core.cpp:2076
LLVM_C_ABI void LLVMGlobalClearMetadata(LLVMValueRef Global)
Removes all metadata attachments from this value.
Definition Core.cpp:2342
LLVM_C_ABI void LLVMGlobalAddMetadata(LLVMValueRef Global, unsigned Kind, LLVMMetadataRef MD)
Adds a metadata attachment.
Definition Core.cpp:2333
LLVM_C_ABI LLVMBool LLVMHasUnnamedAddr(LLVMValueRef Global)
Deprecated: Use LLVMGetUnnamedAddress instead.
Definition Core.cpp:2237
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:2317
LLVM_C_ABI void LLVMDisposeValueMetadataEntries(LLVMValueMetadataEntry *Entries)
Destroys value metadata entries.
Definition Core.cpp:2324
LLVM_C_ABI void LLVMGlobalAddDebugInfo(LLVMValueRef Global, LLVMMetadataRef GVE)
Add debuginfo metadata to this global.
Definition Core.cpp:2346
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:1601
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:1663
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:1606
LLVM_C_ABI long long LLVMConstIntGetSExtValue(LLVMValueRef ConstantVal)
Obtain the sign extended value for an integer constant value.
Definition Core.cpp:1675
LLVM_C_ABI unsigned long long LLVMConstByteGetZExtValue(LLVMValueRef ConstantVal)
Obtain the zero extended value for a byte constant value.
Definition Core.cpp:1679
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:1654
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:1630
LLVM_C_ABI double LLVMConstRealGetDouble(LLVMValueRef ConstantVal, LLVMBool *losesInfo)
Obtain the double value for an floating point constant value.
Definition Core.cpp:1687
LLVM_C_ABI LLVMValueRef LLVMConstByte(LLVMTypeRef ByteTy, unsigned long long N)
Obtain a constant value for a byte type.
Definition Core.cpp:1626
LLVM_C_ABI LLVMValueRef LLVMConstReal(LLVMTypeRef RealTy, double N)
Obtain a constant value referring to a double floating point value.
Definition Core.cpp:1650
LLVM_C_ABI long long LLVMConstByteGetSExtValue(LLVMValueRef ConstantVal)
Obtain the sign extended value for a byte constant value.
Definition Core.cpp:1683
LLVM_C_ABI unsigned long long LLVMConstIntGetZExtValue(LLVMValueRef ConstantVal)
Obtain the zero extended value for an integer constant value.
Definition Core.cpp:1671
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:1304
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:1326
LLVM_C_ABI LLVMValueRef LLVMGetUndef(LLVMTypeRef Ty)
Obtain a constant value referring to an undefined value of a type.
Definition Core.cpp:1300
LLVM_C_ABI LLVMBool LLVMIsNull(LLVMValueRef Val)
Determine whether a value instance is null.
Definition Core.cpp:1312
LLVM_C_ABI LLVMValueRef LLVMConstNull(LLVMTypeRef Ty)
Obtain a constant value referring to the null instance of a type.
Definition Core.cpp:1292
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:1296
LLVM_C_ABI LLVMValueRef LLVMGetPreviousParam(LLVMValueRef Arg)
Obtain the previous parameter to a function.
Definition Core.cpp:2830
LLVM_C_ABI void LLVMSetParamAlignment(LLVMValueRef Arg, unsigned Align)
Set the alignment for a function parameter.
Definition Core.cpp:2837
LLVM_C_ABI unsigned LLVMCountParams(LLVMValueRef Fn)
Obtain the number of parameters in a function.
Definition Core.cpp:2785
LLVM_C_ABI void LLVMGetParams(LLVMValueRef Fn, LLVMValueRef *Params)
Obtain the parameters in a function.
Definition Core.cpp:2791
LLVM_C_ABI LLVMValueRef LLVMGetFirstParam(LLVMValueRef Fn)
Obtain the first parameter to a function.
Definition Core.cpp:2806
LLVM_C_ABI LLVMValueRef LLVMGetLastParam(LLVMValueRef Fn)
Obtain the last parameter to a function.
Definition Core.cpp:2814
LLVM_C_ABI LLVMValueRef LLVMGetParam(LLVMValueRef Fn, unsigned Index)
Obtain the parameter at the specified index.
Definition Core.cpp:2797
LLVM_C_ABI LLVMValueRef LLVMGetNextParam(LLVMValueRef Arg)
Obtain the next parameter to a function.
Definition Core.cpp:2822
LLVM_C_ABI LLVMValueRef LLVMGetParamParent(LLVMValueRef Inst)
Obtain the function to which this argument belongs.
Definition Core.cpp:2802
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:2661
LLVM_C_ABI void LLVMAddAttributeAtIndex(LLVMValueRef F, LLVMAttributeIndex Idx, LLVMAttributeRef A)
Add an attribute to a function.
Definition Core.cpp:2735
LLVM_C_ABI LLVMValueRef LLVMGetPrefixData(LLVMValueRef Fn)
Gets the prefix data associated with a function.
Definition Core.cpp:2703
LLVM_C_ABI LLVMValueRef LLVMGetPrologueData(LLVMValueRef Fn)
Gets the prologue data associated with a function.
Definition Core.cpp:2719
LLVM_C_ABI unsigned LLVMGetIntrinsicID(LLVMValueRef Fn)
Obtain the ID number from a function instance.
Definition Core.cpp:2616
LLVM_C_ABI LLVMValueRef LLVMGetPersonalityFn(LLVMValueRef Fn)
Obtain the personality function attached to the function.
Definition Core.cpp:2607
LLVM_C_ABI unsigned LLVMGetAttributeCountAtIndex(LLVMValueRef F, LLVMAttributeIndex Idx)
Definition Core.cpp:2740
LLVM_C_ABI LLVMBool LLVMHasPersonalityFn(LLVMValueRef Fn)
Check whether the given function has a personality function.
Definition Core.cpp:2603
LLVM_C_ABI void LLVMRemoveStringAttributeAtIndex(LLVMValueRef F, LLVMAttributeIndex Idx, const char *K, unsigned KLen)
Definition Core.cpp:2771
LLVM_C_ABI void LLVMSetPrefixData(LLVMValueRef Fn, LLVMValueRef prefixData)
Sets the prefix data for the function.
Definition Core.cpp:2713
LLVM_C_ABI const char * LLVMGetGC(LLVMValueRef Fn)
Obtain the name of the garbage collector to use during code generation.
Definition Core.cpp:2690
LLVM_C_ABI char * LLVMIntrinsicCopyOverloadedName(unsigned ID, LLVMTypeRef *OverloadTypes, size_t OverloadCount, size_t *NameLength)
Deprecated: Use LLVMIntrinsicCopyOverloadedName2 instead.
Definition Core.cpp:2651
LLVM_C_ABI void LLVMSetGC(LLVMValueRef Fn, const char *Name)
Define the garbage collector to use during code generation.
Definition Core.cpp:2695
LLVM_C_ABI void LLVMSetPrologueData(LLVMValueRef Fn, LLVMValueRef prologueData)
Sets the prologue data for the function.
Definition Core.cpp:2729
LLVM_C_ABI void LLVMSetPersonalityFn(LLVMValueRef Fn, LLVMValueRef PersonalityFn)
Set the personality function attached to the function.
Definition Core.cpp:2611
LLVM_C_ABI void LLVMGetAttributesAtIndex(LLVMValueRef F, LLVMAttributeIndex Idx, LLVMAttributeRef *Attrs)
Definition Core.cpp:2745
LLVM_C_ABI unsigned LLVMGetFunctionCallConv(LLVMValueRef Fn)
Obtain the calling function of a function.
Definition Core.cpp:2681
LLVM_C_ABI LLVMBool LLVMIntrinsicIsOverloaded(unsigned ID)
Obtain if the intrinsic identified by the given ID is overloaded.
Definition Core.cpp:2676
LLVM_C_ABI void LLVMDeleteFunction(LLVMValueRef Fn)
Remove a function from its containing module and deletes it.
Definition Core.cpp:2599
LLVM_C_ABI void LLVMRemoveEnumAttributeAtIndex(LLVMValueRef F, LLVMAttributeIndex Idx, unsigned KindID)
Definition Core.cpp:2766
LLVM_C_ABI LLVMAttributeRef LLVMGetEnumAttributeAtIndex(LLVMValueRef F, LLVMAttributeIndex Idx, unsigned KindID)
Definition Core.cpp:2752
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:2672
LLVM_C_ABI const char * LLVMIntrinsicGetName(unsigned ID, size_t *NameLength)
Retrieves the name of an intrinsic.
Definition Core.cpp:2636
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:2627
LLVM_C_ABI LLVMBool LLVMHasPrologueData(LLVMValueRef Fn)
Check if a given function has prologue data.
Definition Core.cpp:2724
LLVM_C_ABI LLVMBool LLVMHasPrefixData(LLVMValueRef Fn)
Check if a given function has prefix data.
Definition Core.cpp:2708
LLVM_C_ABI void LLVMSetFunctionCallConv(LLVMValueRef Fn, unsigned CC)
Set the calling convention of a function.
Definition Core.cpp:2685
LLVM_C_ABI LLVMTypeRef LLVMIntrinsicGetType(LLVMContextRef Ctx, unsigned ID, LLVMTypeRef *OverloadTypes, size_t OverloadCount)
Retrieves the type of an intrinsic.
Definition Core.cpp:2643
LLVM_C_ABI void LLVMAddTargetDependentFunctionAttr(LLVMValueRef Fn, const char *A, const char *V)
Add a target-dependent attribute to a function.
Definition Core.cpp:2776
LLVM_C_ABI LLVMAttributeRef LLVMGetStringAttributeAtIndex(LLVMValueRef F, LLVMAttributeIndex Idx, const char *K, unsigned KLen)
Definition Core.cpp:2759
LLVM_C_ABI LLVMValueRef LLVMIsAMDString(LLVMValueRef Val)
Definition Core.cpp:1216
LLVM_C_ABI LLVMBool LLVMIsPoison(LLVMValueRef Val)
Determine whether a value instance is poisonous.
Definition Core.cpp:1322
LLVM_C_ABI LLVMValueKind LLVMGetValueKind(LLVMValueRef Val)
Obtain the enumerated type of a Value instance.
Definition Core.cpp:1055
LLVM_C_ABI void LLVMDumpValue(LLVMValueRef Val)
Dump a representation of a value to stderr.
Definition Core.cpp:1085
LLVM_C_ABI const char * LLVMGetValueName(LLVMValueRef Val)
Deprecated: Use LLVMGetValueName2 instead.
Definition Core.cpp:1077
LLVM_C_ABI LLVMContextRef LLVMGetValueContext(LLVMValueRef Val)
Obtain the context to which this value is associated.
Definition Core.cpp:1101
LLVM_C_ABI void LLVMReplaceAllUsesWith(LLVMValueRef OldVal, LLVMValueRef NewVal)
Replace all uses of a value with another one.
Definition Core.cpp:1117
LLVM_C_ABI const char * LLVMGetValueName2(LLVMValueRef Val, size_t *Length)
Obtain the string name of a value.
Definition Core.cpp:1067
LLVM_C_ABI void LLVMSetValueName(LLVMValueRef Val, const char *Name)
Deprecated: Use LLVMSetValueName2 instead.
Definition Core.cpp:1081
LLVM_C_ABI LLVMValueRef LLVMIsAMDNode(LLVMValueRef Val)
Definition Core.cpp:1201
LLVM_C_ABI char * LLVMPrintDbgRecordToString(LLVMDbgRecordRef Record)
Return a string representation of the DbgRecord.
Definition Core.cpp:1105
LLVM_C_ABI LLVMBool LLVMIsUndef(LLVMValueRef Val)
Determine whether a value instance is undefined.
Definition Core.cpp:1318
LLVM_C_ABI LLVMTypeRef LLVMTypeOf(LLVMValueRef Val)
Obtain the type of a value.
Definition Core.cpp:1051
LLVM_C_ABI char * LLVMPrintValueToString(LLVMValueRef Val)
Return a string representation of the value.
Definition Core.cpp:1089
LLVM_C_ABI LLVMValueRef LLVMIsAValueAsMetadata(LLVMValueRef Val)
Definition Core.cpp:1209
#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:1308
LLVM_C_ABI void LLVMSetValueName2(LLVMValueRef Val, const char *Name, size_t NameLen)
Set the string name of a value.
Definition Core.cpp:1073
LLVM_C_ABI LLVMValueRef LLVMGetFirstGlobalIFunc(LLVMModuleRef M)
Obtain an iterator to the first GlobalIFunc in a Module.
Definition Core.cpp:2859
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:2854
LLVM_C_ABI void LLVMRemoveGlobalIFunc(LLVMValueRef IFunc)
Remove a global indirect function from its parent module.
Definition Core.cpp:2903
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:2844
LLVM_C_ABI LLVMValueRef LLVMGetNextGlobalIFunc(LLVMValueRef IFunc)
Advance a GlobalIFunc iterator to the next GlobalIFunc.
Definition Core.cpp:2875
LLVM_C_ABI LLVMValueRef LLVMGetPreviousGlobalIFunc(LLVMValueRef IFunc)
Decrement a GlobalIFunc iterator to the previous GlobalIFunc.
Definition Core.cpp:2883
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:2891
LLVM_C_ABI void LLVMSetGlobalIFuncResolver(LLVMValueRef IFunc, LLVMValueRef Resolver)
Sets the resolver function associated with this indirect function.
Definition Core.cpp:2895
LLVM_C_ABI LLVMValueRef LLVMGetLastGlobalIFunc(LLVMModuleRef M)
Obtain an iterator to the last GlobalIFunc in a Module.
Definition Core.cpp:2867
LLVM_C_ABI void LLVMEraseGlobalIFunc(LLVMValueRef IFunc)
Remove a global indirect function from its parent module and delete it.
Definition Core.cpp:2899
LLVM_C_ABI LLVMTypeRef LLVMGetAllocatedType(LLVMValueRef Alloca)
Obtain the type that is being allocated by the alloca instruction.
Definition Core.cpp:3412
LLVM_C_ABI void LLVMSetTailCall(LLVMValueRef CallInst, LLVMBool IsTailCall)
Set whether a call instruction is a tail call.
Definition Core.cpp:3311
LLVM_C_ABI void LLVMAddCallSiteAttribute(LLVMValueRef C, LLVMAttributeIndex Idx, LLVMAttributeRef A)
Definition Core.cpp:3243
LLVM_C_ABI unsigned LLVMGetNumOperandBundles(LLVMValueRef C)
Obtain the number of operand bundles attached to this instruction.
Definition Core.cpp:3295
LLVM_C_ABI void LLVMRemoveCallSiteEnumAttribute(LLVMValueRef C, LLVMAttributeIndex Idx, unsigned KindID)
Definition Core.cpp:3277
LLVM_C_ABI void LLVMRemoveCallSiteStringAttribute(LLVMValueRef C, LLVMAttributeIndex Idx, const char *K, unsigned KLen)
Definition Core.cpp:3282
LLVM_C_ABI LLVMAttributeRef LLVMGetCallSiteEnumAttribute(LLVMValueRef C, LLVMAttributeIndex Idx, unsigned KindID)
Definition Core.cpp:3263
LLVM_C_ABI unsigned LLVMGetInstructionCallConv(LLVMValueRef Instr)
Obtain the calling convention for a call instruction.
Definition Core.cpp:3226
LLVM_C_ABI LLVMBasicBlockRef LLVMGetCallBrDefaultDest(LLVMValueRef CallBr)
Get the default destination of a CallBr instruction.
Definition Core.cpp:3351
LLVM_C_ABI LLVMValueRef LLVMGetCalledValue(LLVMValueRef Instr)
Obtain the pointer to the function invoked by this instruction.
Definition Core.cpp:3287
LLVM_C_ABI void LLVMSetNormalDest(LLVMValueRef InvokeInst, LLVMBasicBlockRef B)
Set the normal destination basic block.
Definition Core.cpp:3338
LLVM_C_ABI LLVMBool LLVMIsTailCall(LLVMValueRef CallInst)
Obtain whether a call instruction is a tail call.
Definition Core.cpp:3307
LLVM_C_ABI LLVMAttributeRef LLVMGetCallSiteStringAttribute(LLVMValueRef C, LLVMAttributeIndex Idx, const char *K, unsigned KLen)
Definition Core.cpp:3270
LLVM_C_ABI unsigned LLVMGetCallBrNumIndirectDests(LLVMValueRef CallBr)
Get the number of indirect destinations of a CallBr instruction.
Definition Core.cpp:3355
LLVM_C_ABI void LLVMGetCallSiteAttributes(LLVMValueRef C, LLVMAttributeIndex Idx, LLVMAttributeRef *Attrs)
Definition Core.cpp:3255
LLVM_C_ABI LLVMBasicBlockRef LLVMGetNormalDest(LLVMValueRef InvokeInst)
Return the normal destination basic block.
Definition Core.cpp:3325
LLVM_C_ABI unsigned LLVMGetNumArgOperands(LLVMValueRef Instr)
Obtain the argument count for a call instruction.
Definition Core.cpp:3217
LLVM_C_ABI void LLVMSetTailCallKind(LLVMValueRef CallInst, LLVMTailCallKind kind)
Set the call kind of the call instruction.
Definition Core.cpp:3319
LLVM_C_ABI LLVMOperandBundleRef LLVMGetOperandBundleAtIndex(LLVMValueRef C, unsigned Index)
Obtain the operand bundle attached to this instruction at the given index.
Definition Core.cpp:3299
LLVM_C_ABI LLVMBasicBlockRef LLVMGetCallBrIndirectDest(LLVMValueRef CallBr, unsigned Idx)
Get the indirect destination of a CallBr instruction at the given index.
Definition Core.cpp:3359
LLVM_C_ABI LLVMTailCallKind LLVMGetTailCallKind(LLVMValueRef CallInst)
Obtain a tail call kind of the call instruction.
Definition Core.cpp:3315
LLVM_C_ABI void LLVMSetUnwindDest(LLVMValueRef InvokeInst, LLVMBasicBlockRef B)
Set the unwind destination basic block.
Definition Core.cpp:3342
LLVM_C_ABI LLVMTypeRef LLVMGetCalledFunctionType(LLVMValueRef C)
Obtain the function type called by this instruction.
Definition Core.cpp:3291
LLVM_C_ABI LLVMBasicBlockRef LLVMGetUnwindDest(LLVMValueRef InvokeInst)
Return the unwind destination basic block.
Definition Core.cpp:3329
LLVM_C_ABI void LLVMSetInstrParamAlignment(LLVMValueRef Instr, LLVMAttributeIndex Idx, unsigned Align)
Definition Core.cpp:3235
LLVM_C_ABI unsigned LLVMGetCallSiteAttributeCount(LLVMValueRef C, LLVMAttributeIndex Idx)
Definition Core.cpp:3248
LLVM_C_ABI void LLVMSetInstructionCallConv(LLVMValueRef Instr, unsigned CC)
Set the calling convention for a call instruction.
Definition Core.cpp:3230
LLVM_C_ABI LLVMGEPNoWrapFlags LLVMGEPGetNoWrapFlags(LLVMValueRef GEP)
Get the no-wrap related flags for the given GEP instruction.
Definition Core.cpp:3430
LLVM_C_ABI LLVMBool LLVMIsInBounds(LLVMValueRef GEP)
Check whether the given GEP operator is inbounds.
Definition Core.cpp:3418
LLVM_C_ABI void LLVMSetIsInBounds(LLVMValueRef GEP, LLVMBool InBounds)
Set the given GEP instruction to be inbounds or not.
Definition Core.cpp:3422
LLVM_C_ABI LLVMTypeRef LLVMGetGEPSourceElementType(LLVMValueRef GEP)
Get the source element type of the given GEP operator.
Definition Core.cpp:3426
LLVM_C_ABI void LLVMGEPSetNoWrapFlags(LLVMValueRef GEP, LLVMGEPNoWrapFlags NoWrapFlags)
Set the no-wrap related flags for the given GEP instruction.
Definition Core.cpp:3435
LLVM_C_ABI unsigned LLVMGetNumIndices(LLVMValueRef Inst)
Obtain the number of indices.
Definition Core.cpp:3463
LLVM_C_ABI const unsigned * LLVMGetIndices(LLVMValueRef Inst)
Obtain the indices as an array.
Definition Core.cpp:3475
LLVM_C_ABI LLVMBasicBlockRef LLVMGetIncomingBlock(LLVMValueRef PhiNode, unsigned Index)
Obtain an incoming value to a PHI node as an LLVMBasicBlockRef.
Definition Core.cpp:3457
LLVM_C_ABI LLVMValueRef LLVMGetIncomingValue(LLVMValueRef PhiNode, unsigned Index)
Obtain an incoming value to a PHI node as an LLVMValueRef.
Definition Core.cpp:3453
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:3442
LLVM_C_ABI unsigned LLVMCountIncoming(LLVMValueRef PhiNode)
Obtain the number of incoming basic blocks to a PHI node.
Definition Core.cpp:3449
LLVM_C_ABI LLVMValueRef LLVMGetCondition(LLVMValueRef Branch)
Return the condition of a branch instruction.
Definition Core.cpp:3383
LLVM_C_ABI LLVMBasicBlockRef LLVMGetSuccessor(LLVMValueRef Term, unsigned i)
Return the specified successor.
Definition Core.cpp:3369
LLVM_C_ABI void LLVMSetCondition(LLVMValueRef Branch, LLVMValueRef Cond)
Set the condition of a branch instruction.
Definition Core.cpp:3387
LLVM_C_ABI void LLVMSetSuccessor(LLVMValueRef Term, unsigned i, LLVMBasicBlockRef block)
Update the specified successor to point at the provided block.
Definition Core.cpp:3373
LLVM_C_ABI LLVMValueRef LLVMGetSwitchCaseValue(LLVMValueRef SwitchInstr, unsigned i)
Obtain the case value for a successor of a switch instruction.
Definition Core.cpp:3397
LLVM_C_ABI LLVMBool LLVMIsConditional(LLVMValueRef Branch)
Return if an instruction is a conditional branch.
Definition Core.cpp:3379
LLVM_C_ABI LLVMBasicBlockRef LLVMGetSwitchDefaultDest(LLVMValueRef SwitchInstr)
Obtain the default destination basic block of a switch instruction.
Definition Core.cpp:3393
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:3403
LLVM_C_ABI unsigned LLVMGetNumSuccessors(LLVMValueRef Term)
Return the number of successors that this terminator has.
Definition Core.cpp:3365
LLVM_C_ABI LLVMRealPredicate LLVMGetFCmpPredicate(LLVMValueRef Inst)
Obtain the float predicate of an instruction.
Definition Core.cpp:3127
LLVM_C_ABI int LLVMHasMetadata(LLVMValueRef Val)
Determine whether an instruction has any metadata attached.
Definition Core.cpp:1121
LLVM_C_ABI void LLVMInstructionRemoveFromParent(LLVMValueRef Inst)
Remove an instruction.
Definition Core.cpp:3101
LLVM_C_ABI LLVMValueRef LLVMGetPreviousInstruction(LLVMValueRef Inst)
Obtain the instruction that occurred before this one.
Definition Core.cpp:3093
LLVM_C_ABI LLVMDbgRecordRef LLVMGetPreviousDbgRecord(LLVMDbgRecordRef DbgRecord)
Obtain the previous DbgRecord in the sequence or NULL if there are no more.
Definition Core.cpp:3178
LLVM_C_ABI LLVMMetadataRef LLVMDbgVariableRecordGetExpression(LLVMDbgRecordRef Rec)
Get the debug info expression of the DbgVariableRecord.
Definition Core.cpp:3213
LLVM_C_ABI LLVMDbgRecordRef LLVMGetFirstDbgRecord(LLVMValueRef Inst)
Obtain the first debug record attached to an instruction.
Definition Core.cpp:3150
LLVM_C_ABI LLVMOpcode LLVMGetInstructionOpcode(LLVMValueRef Inst)
Obtain the code opcode for an individual instruction.
Definition Core.cpp:3133
LLVM_C_ABI LLVMDbgRecordRef LLVMGetNextDbgRecord(LLVMDbgRecordRef DbgRecord)
Obtain the next DbgRecord in the sequence or NULL if there are no more.
Definition Core.cpp:3170
LLVM_C_ABI LLVMDbgRecordRef LLVMGetLastDbgRecord(LLVMValueRef Inst)
Obtain the last debug record attached to an instruction.
Definition Core.cpp:3160
LLVM_C_ABI LLVMMetadataRef LLVMDbgVariableRecordGetVariable(LLVMDbgRecordRef Rec)
Get the debug info variable of the DbgVariableRecord.
Definition Core.cpp:3209
LLVM_C_ABI LLVMValueRef LLVMIsATerminatorInst(LLVMValueRef Inst)
Determine whether an instruction is a terminator.
Definition Core.cpp:3145
LLVM_C_ABI LLVMValueRef LLVMDbgVariableRecordGetValue(LLVMDbgRecordRef Rec, unsigned OpIdx)
Get the value of the DbgVariableRecord.
Definition Core.cpp:3204
LLVM_C_ABI LLVMDbgRecordKind LLVMDbgRecordGetKind(LLVMDbgRecordRef Rec)
Definition Core.cpp:3190
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:1178
LLVM_C_ABI void LLVMDeleteInstruction(LLVMValueRef Inst)
Delete an instruction.
Definition Core.cpp:3109
LLVM_C_ABI LLVMBasicBlockRef LLVMGetInstructionParent(LLVMValueRef Inst)
Obtain the basic block to which an instruction belongs.
Definition Core.cpp:3065
LLVM_C_ABI LLVMMetadataRef LLVMDbgRecordGetDebugLoc(LLVMDbgRecordRef Rec)
Get the debug location attached to the debug record.
Definition Core.cpp:3186
LLVM_C_ABI LLVMBool LLVMGetICmpSameSign(LLVMValueRef Inst)
Get whether or not an icmp instruction has the samesign flag.
Definition Core.cpp:3119
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:3139
LLVM_C_ABI void LLVMInstructionEraseFromParent(LLVMValueRef Inst)
Remove and delete an instruction.
Definition Core.cpp:3105
LLVM_C_ABI void LLVMSetMetadata(LLVMValueRef Val, unsigned KindID, LLVMValueRef Node)
Set metadata associated with an instruction value.
Definition Core.cpp:1147
LLVM_C_ABI LLVMValueRef LLVMGetMetadata(LLVMValueRef Val, unsigned KindID)
Return metadata associated with an instruction value.
Definition Core.cpp:1125
LLVM_C_ABI LLVMIntPredicate LLVMGetICmpPredicate(LLVMValueRef Inst)
Obtain the predicate of an instruction.
Definition Core.cpp:3113
LLVM_C_ABI LLVMValueRef LLVMGetNextInstruction(LLVMValueRef Inst)
Obtain the instruction that occurs after the one specified.
Definition Core.cpp:3085
LLVM_C_ABI void LLVMSetICmpSameSign(LLVMValueRef Inst, LLVMBool SameSign)
Set the samesign flag on an icmp instruction.
Definition Core.cpp:3123
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:1337
LLVM_C_ABI const char * LLVMGetMDString(LLVMValueRef V, unsigned *Length)
Obtain the underlying string from a MDString value.
Definition Core.cpp:1409
LLVM_C_ABI LLVMValueRef LLVMMetadataAsValue(LLVMContextRef C, LLVMMetadataRef MD)
Obtain a Metadata as a Value.
Definition Core.cpp:1384
LLVM_C_ABI unsigned LLVMGetMDNodeNumOperands(LLVMValueRef V)
Obtain the number of operands from an MDNode value.
Definition Core.cpp:1419
LLVM_C_ABI LLVMValueRef LLVMMDStringInContext(LLVMContextRef C, const char *Str, unsigned SLen)
Deprecated: Use LLVMMDStringInContext2 instead.
Definition Core.cpp:1342
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:1332
LLVM_C_ABI LLVMValueRef LLVMMDNodeInContext(LLVMContextRef C, LLVMValueRef *Vals, unsigned Count)
Deprecated: Use LLVMMDNodeInContext2 instead.
Definition Core.cpp:1353
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:1487
LLVM_C_ABI char * LLVMPrintMetadataToString(LLVMMetadataRef MD)
Return a string representation of the metadata.
Definition Core.cpp:1397
LLVM_C_ABI LLVMMetadataRef LLVMValueAsMetadata(LLVMValueRef Val)
Obtain a Value as a Metadata.
Definition Core.cpp:1388
LLVM_C_ABI void LLVMGetMDNodeOperands(LLVMValueRef V, LLVMValueRef *Dest)
Obtain the given MDNode's operands.
Definition Core.cpp:1474
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:1273
LLVM_C_ABI int LLVMGetNumOperands(LLVMValueRef Val)
Obtain the number of operands in a llvm::User value.
Definition Core.cpp:1282
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:1278
LLVM_C_ABI LLVMValueRef LLVMGetOperand(LLVMValueRef Val, unsigned Index)
Obtain an operand at a specific index in a llvm::User value.
Definition Core.cpp:1259
LLVM_C_ABI LLVMValueRef LLVMGetUser(LLVMUseRef U)
Obtain the user value for a user.
Definition Core.cpp:1239
LLVM_C_ABI LLVMValueRef LLVMGetUsedValue(LLVMUseRef U)
Obtain the value this use corresponds to.
Definition Core.cpp:1243
LLVM_C_ABI LLVMUseRef LLVMGetNextUse(LLVMUseRef U)
Obtain the next use of a value.
Definition Core.cpp:1232
LLVM_C_ABI LLVMUseRef LLVMGetFirstUse(LLVMValueRef Val)
Obtain the first use of a value.
Definition Core.cpp:1224
#define LLVM_FOR_EACH_VALUE_SUBCLASS(macro)
Definition Core.h:2035
LLVM_C_ABI void LLVMDisposeMessage(char *Message)
Definition Core.cpp:90
LLVM_C_ABI char * LLVMCreateMessage(const char *Message)
Definition Core.cpp:86
LLVM_C_ABI void LLVMGetVersion(unsigned *Major, unsigned *Minor, unsigned *Patch)
Return the major, minor, and patch version of LLVM.
Definition Core.cpp:75
LLVM_C_ABI void LLVMShutdown(void)
Deallocate and destroy all ManagedStatic variables.
Definition Core.cpp:69
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:2489
LLVM_C_ABI LLVMValueRef LLVMGetLastGlobalAlias(LLVMModuleRef M)
Obtain an iterator to the last GlobalAlias in a Module.
Definition Core.cpp:2510
LLVM_C_ABI LLVMValueRef LLVMGetPreviousGlobalAlias(LLVMValueRef GA)
Decrement a GlobalAlias iterator to the previous GlobalAlias.
Definition Core.cpp:2526
LLVM_C_ABI void LLVMAliasSetAliasee(LLVMValueRef Alias, LLVMValueRef Aliasee)
Set the target value of an alias.
Definition Core.cpp:2538
LLVM_C_ABI LLVMValueRef LLVMGetFirstGlobalAlias(LLVMModuleRef M)
Obtain an iterator to the first GlobalAlias in a Module.
Definition Core.cpp:2502
LLVM_C_ABI LLVMValueRef LLVMAliasGetAliasee(LLVMValueRef Alias)
Retrieve the target value of an alias.
Definition Core.cpp:2534
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:2497
LLVM_C_ABI LLVMValueRef LLVMGetNextGlobalAlias(LLVMValueRef GA)
Advance a GlobalAlias iterator to the next GlobalAlias.
Definition Core.cpp:2518
LLVM_C_ABI LLVMBool LLVMIsThreadLocal(LLVMValueRef GlobalVar)
Definition Core.cpp:2424
LLVM_C_ABI LLVMThreadLocalMode LLVMGetThreadLocalMode(LLVMValueRef GlobalVar)
Definition Core.cpp:2440
LLVM_C_ABI LLVMBool LLVMIsGlobalConstant(LLVMValueRef GlobalVar)
Definition Core.cpp:2432
LLVM_C_ABI LLVMValueRef LLVMGetPreviousGlobal(LLVMValueRef GlobalVar)
Definition Core.cpp:2400
LLVM_C_ABI void LLVMSetThreadLocal(LLVMValueRef GlobalVar, LLVMBool IsThreadLocal)
Definition Core.cpp:2428
LLVM_C_ABI LLVMBool LLVMIsExternallyInitialized(LLVMValueRef GlobalVar)
Definition Core.cpp:2479
LLVM_C_ABI LLVMValueRef LLVMGetLastGlobal(LLVMModuleRef M)
Definition Core.cpp:2384
LLVM_C_ABI LLVMValueRef LLVMGetNamedGlobalWithLength(LLVMModuleRef M, const char *Name, size_t Length)
Definition Core.cpp:2371
LLVM_C_ABI LLVMValueRef LLVMGetFirstGlobal(LLVMModuleRef M)
Definition Core.cpp:2376
LLVM_C_ABI void LLVMSetThreadLocalMode(LLVMValueRef GlobalVar, LLVMThreadLocalMode Mode)
Definition Core.cpp:2457
LLVM_C_ABI LLVMValueRef LLVMGetNextGlobal(LLVMValueRef GlobalVar)
Definition Core.cpp:2392
LLVM_C_ABI void LLVMSetExternallyInitialized(LLVMValueRef GlobalVar, LLVMBool IsExtInit)
Definition Core.cpp:2483
LLVM_C_ABI LLVMValueRef LLVMGetNamedGlobal(LLVMModuleRef M, const char *Name)
Definition Core.cpp:2367
LLVM_C_ABI LLVMValueRef LLVMAddGlobalInAddressSpace(LLVMModuleRef M, LLVMTypeRef Ty, const char *Name, unsigned AddressSpace)
Definition Core.cpp:2358
LLVM_C_ABI void LLVMDeleteGlobal(LLVMValueRef GlobalVar)
Definition Core.cpp:2408
LLVM_C_ABI void LLVMSetGlobalConstant(LLVMValueRef GlobalVar, LLVMBool IsConstant)
Definition Core.cpp:2436
LLVM_C_ABI LLVMValueRef LLVMAddGlobal(LLVMModuleRef M, LLVMTypeRef Ty, const char *Name)
Definition Core.cpp:2353
LLVM_C_ABI LLVMValueRef LLVMGetInitializer(LLVMValueRef GlobalVar)
Definition Core.cpp:2412
LLVM_C_ABI void LLVMSetInitializer(LLVMValueRef GlobalVar, LLVMValueRef ConstantVal)
Definition Core.cpp:2419
#define N