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