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 a Function value from a Module by its name.
1211 *
1212 * The returned value corresponds to a llvm::Function value.
1213 *
1214 * @see llvm::Module::getFunction()
1215 */
1217
1218/**
1219 * Obtain a Function value from a Module by its name.
1220 *
1221 * The returned value corresponds to a llvm::Function value.
1222 *
1223 * @see llvm::Module::getFunction()
1224 */
1226 const char *Name,
1227 size_t Length);
1228
1229/**
1230 * Obtain an iterator to the first Function in a Module.
1231 *
1232 * @see llvm::Module::begin()
1233 */
1235
1236/**
1237 * Obtain an iterator to the last Function in a Module.
1238 *
1239 * @see llvm::Module::end()
1240 */
1242
1243/**
1244 * Advance a Function iterator to the next Function.
1245 *
1246 * Returns NULL if the iterator was already at the end and there are no more
1247 * functions.
1248 */
1250
1251/**
1252 * Decrement a Function iterator to the previous Function.
1253 *
1254 * Returns NULL if the iterator was already at the beginning and there are
1255 * no previous functions.
1256 */
1258
1259/** Deprecated: Use LLVMSetModuleInlineAsm2 instead. */
1260LLVM_C_ABI void LLVMSetModuleInlineAsm(LLVMModuleRef M, const char *Asm);
1261
1262/**
1263 * @}
1264 */
1265
1266/**
1267 * @defgroup LLVMCCoreType Types
1268 *
1269 * Types represent the type of a value.
1270 *
1271 * Types are associated with a context instance. The context internally
1272 * deduplicates types so there is only 1 instance of a specific type
1273 * alive at a time. In other words, a unique type is shared among all
1274 * consumers within a context.
1275 *
1276 * A Type in the C API corresponds to llvm::Type.
1277 *
1278 * Types have the following hierarchy:
1279 *
1280 * types:
1281 * integer type
1282 * real type
1283 * function type
1284 * sequence types:
1285 * array type
1286 * pointer type
1287 * vector type
1288 * void type
1289 * label type
1290 * opaque type
1291 *
1292 * @{
1293 */
1294
1295/**
1296 * Obtain the enumerated type of a Type instance.
1297 *
1298 * @see llvm::Type:getTypeID()
1299 */
1301
1302/**
1303 * Whether the type has a known size.
1304 *
1305 * Things that don't have a size are abstract types, labels, and void.a
1306 *
1307 * @see llvm::Type::isSized()
1308 */
1310
1311/**
1312 * Obtain the context to which this type instance is associated.
1313 *
1314 * @see llvm::Type::getContext()
1315 */
1317
1318/**
1319 * Dump a representation of a type to stderr.
1320 *
1321 * @see llvm::Type::dump()
1322 */
1324
1325/**
1326 * Return a string representation of the type. Use
1327 * LLVMDisposeMessage to free the string.
1328 *
1329 * @see llvm::Type::print()
1330 */
1332
1333/**
1334 * @defgroup LLVMCCoreTypeInt Integer Types
1335 *
1336 * Functions in this section operate on integer types.
1337 *
1338 * @{
1339 */
1340
1341/**
1342 * Obtain an integer type from a context with specified bit width.
1343 */
1351
1352/**
1353 * Obtain an integer type from the global context with a specified bit
1354 * width.
1355 */
1362LLVM_C_ABI LLVMTypeRef LLVMIntType(unsigned NumBits);
1363LLVM_C_ABI unsigned LLVMGetIntTypeWidth(LLVMTypeRef IntegerTy);
1364
1365/**
1366 * @}
1367 */
1368
1369/**
1370 * @defgroup LLVMCCoreTypeFloat Floating Point Types
1371 *
1372 * @{
1373 */
1374
1375/**
1376 * Obtain a 16-bit floating point type from a context.
1377 */
1379
1380/**
1381 * Obtain a 16-bit brain floating point type from a context.
1382 */
1384
1385/**
1386 * Obtain a 32-bit floating point type from a context.
1387 */
1389
1390/**
1391 * Obtain a 64-bit floating point type from a context.
1392 */
1394
1395/**
1396 * Obtain a 80-bit floating point type (X87) from a context.
1397 */
1399
1400/**
1401 * Obtain a 128-bit floating point type (112-bit mantissa) from a
1402 * context.
1403 */
1405
1406/**
1407 * Obtain a 128-bit floating point type (two 64-bits) from a context.
1408 */
1410
1411/**
1412 * Obtain a floating point type from the global context.
1413 *
1414 * These map to the functions in this group of the same name.
1415 */
1423
1424/**
1425 * @}
1426 */
1427
1428/**
1429 * @defgroup LLVMCCoreTypeFunction Function Types
1430 *
1431 * @{
1432 */
1433
1434/**
1435 * Obtain a function type consisting of a specified signature.
1436 *
1437 * The function is defined as a tuple of a return Type, a list of
1438 * parameter types, and whether the function is variadic.
1439 */
1441 LLVMTypeRef *ParamTypes,
1442 unsigned ParamCount, LLVMBool IsVarArg);
1443
1444/**
1445 * Returns whether a function type is variadic.
1446 */
1448
1449/**
1450 * Obtain the Type this function Type returns.
1451 */
1453
1454/**
1455 * Obtain the number of parameters this function accepts.
1456 */
1457LLVM_C_ABI unsigned LLVMCountParamTypes(LLVMTypeRef FunctionTy);
1458
1459/**
1460 * Obtain the types of a function's parameters.
1461 *
1462 * The Dest parameter should point to a pre-allocated array of
1463 * LLVMTypeRef at least LLVMCountParamTypes() large. On return, the
1464 * first LLVMCountParamTypes() entries in the array will be populated
1465 * with LLVMTypeRef instances.
1466 *
1467 * @param FunctionTy The function type to operate on.
1468 * @param Dest Memory address of an array to be filled with result.
1469 */
1470LLVM_C_ABI void LLVMGetParamTypes(LLVMTypeRef FunctionTy, LLVMTypeRef *Dest);
1471
1472/**
1473 * @}
1474 */
1475
1476/**
1477 * @defgroup LLVMCCoreTypeStruct Structure Types
1478 *
1479 * These functions relate to LLVMTypeRef instances.
1480 *
1481 * @see llvm::StructType
1482 *
1483 * @{
1484 */
1485
1486/**
1487 * Create a new structure type in a context.
1488 *
1489 * A structure is specified by a list of inner elements/types and
1490 * whether these can be packed together.
1491 *
1492 * @see llvm::StructType::create()
1493 */
1495 LLVMTypeRef *ElementTypes,
1496 unsigned ElementCount,
1497 LLVMBool Packed);
1498
1499/**
1500 * Create a new structure type in the global context.
1501 *
1502 * @see llvm::StructType::create()
1503 */
1505 unsigned ElementCount, LLVMBool Packed);
1506
1507/**
1508 * Create an empty structure in a context having a specified name.
1509 *
1510 * @see llvm::StructType::create()
1511 */
1513 const char *Name);
1514
1515/**
1516 * Obtain the name of a structure.
1517 *
1518 * @see llvm::StructType::getName()
1519 */
1521
1522/**
1523 * Set the contents of a structure type.
1524 *
1525 * @see llvm::StructType::setBody()
1526 */
1528 LLVMTypeRef *ElementTypes,
1529 unsigned ElementCount, LLVMBool Packed);
1530
1531/**
1532 * Get the number of elements defined inside the structure.
1533 *
1534 * @see llvm::StructType::getNumElements()
1535 */
1537
1538/**
1539 * Get the elements within a structure.
1540 *
1541 * The function is passed the address of a pre-allocated array of
1542 * LLVMTypeRef at least LLVMCountStructElementTypes() long. After
1543 * invocation, this array will be populated with the structure's
1544 * elements. The objects in the destination array will have a lifetime
1545 * of the structure type itself, which is the lifetime of the context it
1546 * is contained in.
1547 */
1549 LLVMTypeRef *Dest);
1550
1551/**
1552 * Get the type of the element at a given index in the structure.
1553 *
1554 * @see llvm::StructType::getTypeAtIndex()
1555 */
1557 unsigned i);
1558
1559/**
1560 * Determine whether a structure is packed.
1561 *
1562 * @see llvm::StructType::isPacked()
1563 */
1565
1566/**
1567 * Determine whether a structure is opaque.
1568 *
1569 * @see llvm::StructType::isOpaque()
1570 */
1572
1573/**
1574 * Determine whether a structure is literal.
1575 *
1576 * @see llvm::StructType::isLiteral()
1577 */
1579
1580/**
1581 * @}
1582 */
1583
1584/**
1585 * @defgroup LLVMCCoreTypeSequential Sequential Types
1586 *
1587 * Sequential types represents "arrays" of types. This is a super class
1588 * for array, vector, and pointer types.
1589 *
1590 * @{
1591 */
1592
1593/**
1594 * Obtain the element type of an array or vector type.
1595 *
1596 * @see llvm::SequentialType::getElementType()
1597 */
1599
1600/**
1601 * Returns type's subtypes
1602 *
1603 * @see llvm::Type::subtypes()
1604 */
1606
1607/**
1608 * Return the number of types in the derived type.
1609 *
1610 * @see llvm::Type::getNumContainedTypes()
1611 */
1613
1614/**
1615 * Create a fixed size array type that refers to a specific type.
1616 *
1617 * The created type will exist in the context that its element type
1618 * exists in.
1619 *
1620 * @deprecated LLVMArrayType is deprecated in favor of the API accurate
1621 * LLVMArrayType2
1622 * @see llvm::ArrayType::get()
1623 */
1625 unsigned ElementCount);
1626
1627/**
1628 * Create a fixed size array type that refers to a specific type.
1629 *
1630 * The created type will exist in the context that its element type
1631 * exists in.
1632 *
1633 * @see llvm::ArrayType::get()
1634 */
1636 uint64_t ElementCount);
1637
1638/**
1639 * Obtain the length of an array type.
1640 *
1641 * This only works on types that represent arrays.
1642 *
1643 * @deprecated LLVMGetArrayLength is deprecated in favor of the API accurate
1644 * LLVMGetArrayLength2
1645 * @see llvm::ArrayType::getNumElements()
1646 */
1647LLVM_C_ABI unsigned LLVMGetArrayLength(LLVMTypeRef ArrayTy);
1648
1649/**
1650 * Obtain the length of an array type.
1651 *
1652 * This only works on types that represent arrays.
1653 *
1654 * @see llvm::ArrayType::getNumElements()
1655 */
1657
1658/**
1659 * Create a pointer type that points to a defined type.
1660 *
1661 * The created type will exist in the context that its pointee type
1662 * exists in.
1663 *
1664 * @see llvm::PointerType::get()
1665 */
1667 unsigned AddressSpace);
1668
1669/**
1670 * Determine whether a pointer is opaque.
1671 *
1672 * True if this is an instance of an opaque PointerType.
1673 *
1674 * @see llvm::Type::isOpaquePointerTy()
1675 */
1677
1678/**
1679 * Create an opaque pointer type in a context.
1680 *
1681 * @see llvm::PointerType::get()
1682 */
1684 unsigned AddressSpace);
1685
1686/**
1687 * Obtain the address space of a pointer type.
1688 *
1689 * This only works on types that represent pointers.
1690 *
1691 * @see llvm::PointerType::getAddressSpace()
1692 */
1694
1695/**
1696 * Create a vector type that contains a defined type and has a specific
1697 * number of elements.
1698 *
1699 * The created type will exist in the context thats its element type
1700 * exists in.
1701 *
1702 * @see llvm::VectorType::get()
1703 */
1705 unsigned ElementCount);
1706
1707/**
1708 * Create a vector type that contains a defined type and has a scalable
1709 * number of elements.
1710 *
1711 * The created type will exist in the context thats its element type
1712 * exists in.
1713 *
1714 * @see llvm::ScalableVectorType::get()
1715 */
1717 unsigned ElementCount);
1718
1719/**
1720 * Obtain the (possibly scalable) number of elements in a vector type.
1721 *
1722 * This only works on types that represent vectors (fixed or scalable).
1723 *
1724 * @see llvm::VectorType::getNumElements()
1725 */
1726LLVM_C_ABI unsigned LLVMGetVectorSize(LLVMTypeRef VectorTy);
1727
1728/**
1729 * Get the pointer value for the associated ConstantPtrAuth constant.
1730 *
1731 * @see llvm::ConstantPtrAuth::getPointer
1732 */
1734
1735/**
1736 * Get the key value for the associated ConstantPtrAuth constant.
1737 *
1738 * @see llvm::ConstantPtrAuth::getKey
1739 */
1741
1742/**
1743 * Get the discriminator value for the associated ConstantPtrAuth constant.
1744 *
1745 * @see llvm::ConstantPtrAuth::getDiscriminator
1746 */
1749
1750/**
1751 * Get the address discriminator value for the associated ConstantPtrAuth
1752 * constant.
1753 *
1754 * @see llvm::ConstantPtrAuth::getAddrDiscriminator
1755 */
1758
1759/**
1760 * @}
1761 */
1762
1763/**
1764 * @defgroup LLVMCCoreTypeOther Other Types
1765 *
1766 * @{
1767 */
1768
1769/**
1770 * Create a void type in a context.
1771 */
1773
1774/**
1775 * Create a label type in a context.
1776 */
1778
1779/**
1780 * Create a X86 AMX type in a context.
1781 */
1783
1784/**
1785 * Create a token type in a context.
1786 */
1788
1789/**
1790 * Create a metadata type in a context.
1791 */
1793
1794/**
1795 * These are similar to the above functions except they operate on the
1796 * global context.
1797 */
1801
1802/**
1803 * Create a target extension type in LLVM context.
1804 */
1806 LLVMContextRef C, const char *Name, LLVMTypeRef *TypeParams,
1807 unsigned TypeParamCount, unsigned *IntParams, unsigned IntParamCount);
1808
1809/**
1810 * Obtain the name for this target extension type.
1811 *
1812 * @see llvm::TargetExtType::getName()
1813 */
1814LLVM_C_ABI const char *LLVMGetTargetExtTypeName(LLVMTypeRef TargetExtTy);
1815
1816/**
1817 * Obtain the number of type parameters for this target extension type.
1818 *
1819 * @see llvm::TargetExtType::getNumTypeParameters()
1820 */
1822
1823/**
1824 * Get the type parameter at the given index for the target extension type.
1825 *
1826 * @see llvm::TargetExtType::getTypeParameter()
1827 */
1829 unsigned Idx);
1830
1831/**
1832 * Obtain the number of int parameters for this target extension type.
1833 *
1834 * @see llvm::TargetExtType::getNumIntParameters()
1835 */
1837
1838/**
1839 * Get the int parameter at the given index for the target extension type.
1840 *
1841 * @see llvm::TargetExtType::getIntParameter()
1842 */
1844 unsigned Idx);
1845
1846/**
1847 * @}
1848 */
1849
1850/**
1851 * @}
1852 */
1853
1854/**
1855 * @defgroup LLVMCCoreValues Values
1856 *
1857 * The bulk of LLVM's object model consists of values, which comprise a very
1858 * rich type hierarchy.
1859 *
1860 * LLVMValueRef essentially represents llvm::Value. There is a rich
1861 * hierarchy of classes within this type. Depending on the instance
1862 * obtained, not all APIs are available.
1863 *
1864 * Callers can determine the type of an LLVMValueRef by calling the
1865 * LLVMIsA* family of functions (e.g. LLVMIsAArgument()). These
1866 * functions are defined by a macro, so it isn't obvious which are
1867 * available by looking at the Doxygen source code. Instead, look at the
1868 * source definition of LLVM_FOR_EACH_VALUE_SUBCLASS and note the list
1869 * of value names given. These value names also correspond to classes in
1870 * the llvm::Value hierarchy.
1871 *
1872 * @{
1873 */
1874
1875// Currently, clang-format tries to format the LLVM_FOR_EACH_VALUE_SUBCLASS
1876// macro in a progressively-indented fashion, which is not desired
1877// clang-format off
1878
1879#define LLVM_FOR_EACH_VALUE_SUBCLASS(macro) \
1880 macro(Argument) \
1881 macro(BasicBlock) \
1882 macro(InlineAsm) \
1883 macro(User) \
1884 macro(Constant) \
1885 macro(BlockAddress) \
1886 macro(ConstantAggregateZero) \
1887 macro(ConstantArray) \
1888 macro(ConstantDataSequential) \
1889 macro(ConstantDataArray) \
1890 macro(ConstantDataVector) \
1891 macro(ConstantExpr) \
1892 macro(ConstantFP) \
1893 macro(ConstantInt) \
1894 macro(ConstantPointerNull) \
1895 macro(ConstantStruct) \
1896 macro(ConstantTokenNone) \
1897 macro(ConstantVector) \
1898 macro(ConstantPtrAuth) \
1899 macro(GlobalValue) \
1900 macro(GlobalAlias) \
1901 macro(GlobalObject) \
1902 macro(Function) \
1903 macro(GlobalVariable) \
1904 macro(GlobalIFunc) \
1905 macro(UndefValue) \
1906 macro(PoisonValue) \
1907 macro(Instruction) \
1908 macro(UnaryOperator) \
1909 macro(BinaryOperator) \
1910 macro(CallInst) \
1911 macro(IntrinsicInst) \
1912 macro(DbgInfoIntrinsic) \
1913 macro(DbgVariableIntrinsic) \
1914 macro(DbgDeclareInst) \
1915 macro(DbgLabelInst) \
1916 macro(MemIntrinsic) \
1917 macro(MemCpyInst) \
1918 macro(MemMoveInst) \
1919 macro(MemSetInst) \
1920 macro(CmpInst) \
1921 macro(FCmpInst) \
1922 macro(ICmpInst) \
1923 macro(ExtractElementInst) \
1924 macro(GetElementPtrInst) \
1925 macro(InsertElementInst) \
1926 macro(InsertValueInst) \
1927 macro(LandingPadInst) \
1928 macro(PHINode) \
1929 macro(SelectInst) \
1930 macro(ShuffleVectorInst) \
1931 macro(StoreInst) \
1932 macro(BranchInst) \
1933 macro(IndirectBrInst) \
1934 macro(InvokeInst) \
1935 macro(ReturnInst) \
1936 macro(SwitchInst) \
1937 macro(UnreachableInst) \
1938 macro(ResumeInst) \
1939 macro(CleanupReturnInst) \
1940 macro(CatchReturnInst) \
1941 macro(CatchSwitchInst) \
1942 macro(CallBrInst) \
1943 macro(FuncletPadInst) \
1944 macro(CatchPadInst) \
1945 macro(CleanupPadInst) \
1946 macro(UnaryInstruction) \
1947 macro(AllocaInst) \
1948 macro(CastInst) \
1949 macro(AddrSpaceCastInst) \
1950 macro(BitCastInst) \
1951 macro(FPExtInst) \
1952 macro(FPToSIInst) \
1953 macro(FPToUIInst) \
1954 macro(FPTruncInst) \
1955 macro(IntToPtrInst) \
1956 macro(PtrToIntInst) \
1957 macro(SExtInst) \
1958 macro(SIToFPInst) \
1959 macro(TruncInst) \
1960 macro(UIToFPInst) \
1961 macro(ZExtInst) \
1962 macro(ExtractValueInst) \
1963 macro(LoadInst) \
1964 macro(VAArgInst) \
1965 macro(FreezeInst) \
1966 macro(AtomicCmpXchgInst) \
1967 macro(AtomicRMWInst) \
1968 macro(FenceInst)
1969
1970// clang-format on
1971
1972/**
1973 * @defgroup LLVMCCoreValueGeneral General APIs
1974 *
1975 * Functions in this section work on all LLVMValueRef instances,
1976 * regardless of their sub-type. They correspond to functions available
1977 * on llvm::Value.
1978 *
1979 * @{
1980 */
1981
1982/**
1983 * Obtain the type of a value.
1984 *
1985 * @see llvm::Value::getType()
1986 */
1988
1989/**
1990 * Obtain the enumerated type of a Value instance.
1991 *
1992 * @see llvm::Value::getValueID()
1993 */
1995
1996/**
1997 * Obtain the string name of a value.
1998 *
1999 * @see llvm::Value::getName()
2000 */
2001LLVM_C_ABI const char *LLVMGetValueName2(LLVMValueRef Val, size_t *Length);
2002
2003/**
2004 * Set the string name of a value.
2005 *
2006 * @see llvm::Value::setName()
2007 */
2008LLVM_C_ABI void LLVMSetValueName2(LLVMValueRef Val, const char *Name,
2009 size_t NameLen);
2010
2011/**
2012 * Dump a representation of a value to stderr.
2013 *
2014 * @see llvm::Value::dump()
2015 */
2017
2018/**
2019 * Return a string representation of the value. Use
2020 * LLVMDisposeMessage to free the string.
2021 *
2022 * @see llvm::Value::print()
2023 */
2025
2026/**
2027 * Obtain the context to which this value is associated.
2028 *
2029 * @see llvm::Value::getContext()
2030 */
2032
2033/**
2034 * Return a string representation of the DbgRecord. Use
2035 * LLVMDisposeMessage to free the string.
2036 *
2037 * @see llvm::DbgRecord::print()
2038 */
2040
2041/**
2042 * Replace all uses of a value with another one.
2043 *
2044 * @see llvm::Value::replaceAllUsesWith()
2045 */
2047 LLVMValueRef NewVal);
2048
2049/**
2050 * Determine whether the specified value instance is constant.
2051 */
2053
2054/**
2055 * Determine whether a value instance is undefined.
2056 */
2058
2059/**
2060 * Determine whether a value instance is poisonous.
2061 */
2063
2064/**
2065 * Convert value instances between types.
2066 *
2067 * Internally, an LLVMValueRef is "pinned" to a specific type. This
2068 * series of functions allows you to cast an instance to a specific
2069 * type.
2070 *
2071 * If the cast is not valid for the specified type, NULL is returned.
2072 *
2073 * @see llvm::dyn_cast_or_null<>
2074 */
2075#define LLVM_DECLARE_VALUE_CAST(name) \
2076 LLVM_C_ABI LLVMValueRef LLVMIsA##name(LLVMValueRef Val);
2078
2082
2083/** Deprecated: Use LLVMGetValueName2 instead. */
2085/** Deprecated: Use LLVMSetValueName2 instead. */
2086LLVM_C_ABI void LLVMSetValueName(LLVMValueRef Val, const char *Name);
2087
2088/**
2089 * @}
2090 */
2091
2092/**
2093 * @defgroup LLVMCCoreValueUses Usage
2094 *
2095 * This module defines functions that allow you to inspect the uses of a
2096 * LLVMValueRef.
2097 *
2098 * It is possible to obtain an LLVMUseRef for any LLVMValueRef instance.
2099 * Each LLVMUseRef (which corresponds to a llvm::Use instance) holds a
2100 * llvm::User and llvm::Value.
2101 *
2102 * @{
2103 */
2104
2105/**
2106 * Obtain the first use of a value.
2107 *
2108 * Uses are obtained in an iterator fashion. First, call this function
2109 * to obtain a reference to the first use. Then, call LLVMGetNextUse()
2110 * on that instance and all subsequently obtained instances until
2111 * LLVMGetNextUse() returns NULL.
2112 *
2113 * @see llvm::Value::use_begin()
2114 */
2116
2117/**
2118 * Obtain the next use of a value.
2119 *
2120 * This effectively advances the iterator. It returns NULL if you are on
2121 * the final use and no more are available.
2122 */
2124
2125/**
2126 * Obtain the user value for a user.
2127 *
2128 * The returned value corresponds to a llvm::User type.
2129 *
2130 * @see llvm::Use::getUser()
2131 */
2133
2134/**
2135 * Obtain the value this use corresponds to.
2136 *
2137 * @see llvm::Use::get().
2138 */
2140
2141/**
2142 * @}
2143 */
2144
2145/**
2146 * @defgroup LLVMCCoreValueUser User value
2147 *
2148 * Function in this group pertain to LLVMValueRef instances that descent
2149 * from llvm::User. This includes constants, instructions, and
2150 * operators.
2151 *
2152 * @{
2153 */
2154
2155/**
2156 * Obtain an operand at a specific index in a llvm::User value.
2157 *
2158 * @see llvm::User::getOperand()
2159 */
2161
2162/**
2163 * Obtain the use of an operand at a specific index in a llvm::User value.
2164 *
2165 * @see llvm::User::getOperandUse()
2166 */
2168
2169/**
2170 * Set an operand at a specific index in a llvm::User value.
2171 *
2172 * @see llvm::User::setOperand()
2173 */
2174LLVM_C_ABI void LLVMSetOperand(LLVMValueRef User, unsigned Index,
2175 LLVMValueRef Val);
2176
2177/**
2178 * Obtain the number of operands in a llvm::User value.
2179 *
2180 * @see llvm::User::getNumOperands()
2181 */
2183
2184/**
2185 * @}
2186 */
2187
2188/**
2189 * @defgroup LLVMCCoreValueConstant Constants
2190 *
2191 * This section contains APIs for interacting with LLVMValueRef that
2192 * correspond to llvm::Constant instances.
2193 *
2194 * These functions will work for any LLVMValueRef in the llvm::Constant
2195 * class hierarchy.
2196 *
2197 * @{
2198 */
2199
2200/**
2201 * Obtain a constant value referring to the null instance of a type.
2202 *
2203 * @see llvm::Constant::getNullValue()
2204 */
2206
2207/**
2208 * Obtain a constant value referring to the instance of a type
2209 * consisting of all ones.
2210 *
2211 * This is only valid for integer types.
2212 *
2213 * @see llvm::Constant::getAllOnesValue()
2214 */
2216
2217/**
2218 * Obtain a constant value referring to an undefined value of a type.
2219 *
2220 * @see llvm::UndefValue::get()
2221 */
2223
2224/**
2225 * Obtain a constant value referring to a poison value of a type.
2226 *
2227 * @see llvm::PoisonValue::get()
2228 */
2230
2231/**
2232 * Determine whether a value instance is null.
2233 *
2234 * @see llvm::Constant::isNullValue()
2235 */
2237
2238/**
2239 * Obtain a constant that is a constant pointer pointing to NULL for a
2240 * specified type.
2241 */
2243
2244/**
2245 * @defgroup LLVMCCoreValueConstantScalar Scalar constants
2246 *
2247 * Functions in this group model LLVMValueRef instances that correspond
2248 * to constants referring to scalar types.
2249 *
2250 * For integer types, the LLVMTypeRef parameter should correspond to a
2251 * llvm::IntegerType instance and the returned LLVMValueRef will
2252 * correspond to a llvm::ConstantInt.
2253 *
2254 * For floating point types, the LLVMTypeRef returned corresponds to a
2255 * llvm::ConstantFP.
2256 *
2257 * @{
2258 */
2259
2260/**
2261 * Obtain a constant value for an integer type.
2262 *
2263 * The returned value corresponds to a llvm::ConstantInt.
2264 *
2265 * @see llvm::ConstantInt::get()
2266 *
2267 * @param IntTy Integer type to obtain value of.
2268 * @param N The value the returned instance should refer to.
2269 * @param SignExtend Whether to sign extend the produced value.
2270 */
2271LLVM_C_ABI LLVMValueRef LLVMConstInt(LLVMTypeRef IntTy, unsigned long long N,
2272 LLVMBool SignExtend);
2273
2274/**
2275 * Obtain a constant value for an integer of arbitrary precision.
2276 *
2277 * @see llvm::ConstantInt::get()
2278 */
2280 LLVMTypeRef IntTy, unsigned NumWords, const uint64_t Words[]);
2281
2282/**
2283 * Obtain a constant value for an integer parsed from a string.
2284 *
2285 * A similar API, LLVMConstIntOfStringAndSize is also available. If the
2286 * string's length is available, it is preferred to call that function
2287 * instead.
2288 *
2289 * @see llvm::ConstantInt::get()
2290 */
2292 const char *Text, uint8_t Radix);
2293
2294/**
2295 * Obtain a constant value for an integer parsed from a string with
2296 * specified length.
2297 *
2298 * @see llvm::ConstantInt::get()
2299 */
2301 const char *Text,
2302 unsigned SLen,
2303 uint8_t Radix);
2304
2305/**
2306 * Obtain a constant value referring to a double floating point value.
2307 */
2309
2310/**
2311 * Obtain a constant for a floating point value parsed from a string.
2312 *
2313 * A similar API, LLVMConstRealOfStringAndSize is also available. It
2314 * should be used if the input string's length is known.
2315 */
2317 const char *Text);
2318
2319/**
2320 * Obtain a constant for a floating point value parsed from a string.
2321 */
2323 const char *Text,
2324 unsigned SLen);
2325
2326/**
2327 * Obtain the zero extended value for an integer constant value.
2328 *
2329 * @see llvm::ConstantInt::getZExtValue()
2330 */
2331LLVM_C_ABI unsigned long long
2333
2334/**
2335 * Obtain the sign extended value for an integer constant value.
2336 *
2337 * @see llvm::ConstantInt::getSExtValue()
2338 */
2339LLVM_C_ABI long long LLVMConstIntGetSExtValue(LLVMValueRef ConstantVal);
2340
2341/**
2342 * Obtain the double value for an floating point constant value.
2343 * losesInfo indicates if some precision was lost in the conversion.
2344 *
2345 * @see llvm::ConstantFP::getDoubleValue
2346 */
2348 LLVMBool *losesInfo);
2349
2350/**
2351 * @}
2352 */
2353
2354/**
2355 * @defgroup LLVMCCoreValueConstantComposite Composite Constants
2356 *
2357 * Functions in this group operate on composite constants.
2358 *
2359 * @{
2360 */
2361
2362/**
2363 * Create a ConstantDataSequential and initialize it with a string.
2364 *
2365 * @deprecated LLVMConstStringInContext is deprecated in favor of the API
2366 * accurate LLVMConstStringInContext2
2367 * @see llvm::ConstantDataArray::getString()
2368 */
2370 const char *Str,
2371 unsigned Length,
2372 LLVMBool DontNullTerminate);
2373
2374/**
2375 * Create a ConstantDataSequential and initialize it with a string.
2376 *
2377 * @see llvm::ConstantDataArray::getString()
2378 */
2380 const char *Str,
2381 size_t Length,
2382 LLVMBool DontNullTerminate);
2383
2384/**
2385 * Create a ConstantDataSequential with string content in the global context.
2386 *
2387 * This is the same as LLVMConstStringInContext except it operates on the
2388 * global context.
2389 *
2390 * @see LLVMConstStringInContext()
2391 * @see llvm::ConstantDataArray::getString()
2392 */
2393LLVM_C_ABI LLVMValueRef LLVMConstString(const char *Str, unsigned Length,
2394 LLVMBool DontNullTerminate);
2395
2396/**
2397 * Returns true if the specified constant is an array of i8.
2398 *
2399 * @see ConstantDataSequential::getAsString()
2400 */
2402
2403/**
2404 * Get the given constant data sequential as a string.
2405 *
2406 * @see ConstantDataSequential::getAsString()
2407 */
2408LLVM_C_ABI const char *LLVMGetAsString(LLVMValueRef c, size_t *Length);
2409
2410/**
2411 * Get the raw, underlying bytes of the given constant data sequential.
2412 *
2413 * This is the same as LLVMGetAsString except it works for all constant data
2414 * sequentials, not just i8 arrays.
2415 *
2416 * @see ConstantDataSequential::getRawDataValues()
2417 */
2419 size_t *SizeInBytes);
2420
2421/**
2422 * Create an anonymous ConstantStruct with the specified values.
2423 *
2424 * @see llvm::ConstantStruct::getAnon()
2425 */
2427 LLVMValueRef *ConstantVals,
2428 unsigned Count,
2429 LLVMBool Packed);
2430
2431/**
2432 * Create a ConstantStruct in the global Context.
2433 *
2434 * This is the same as LLVMConstStructInContext except it operates on the
2435 * global Context.
2436 *
2437 * @see LLVMConstStructInContext()
2438 */
2440 unsigned Count, LLVMBool Packed);
2441
2442/**
2443 * Create a ConstantArray from values.
2444 *
2445 * @deprecated LLVMConstArray is deprecated in favor of the API accurate
2446 * LLVMConstArray2
2447 * @see llvm::ConstantArray::get()
2448 */
2450 LLVMValueRef *ConstantVals,
2451 unsigned Length);
2452
2453/**
2454 * Create a ConstantArray from values.
2455 *
2456 * @see llvm::ConstantArray::get()
2457 */
2459 LLVMValueRef *ConstantVals,
2460 uint64_t Length);
2461
2462/**
2463 * Create a ConstantDataArray from raw values.
2464 *
2465 * ElementTy must be one of i8, i16, i32, i64, half, bfloat, float, or double.
2466 * Data points to a contiguous buffer of raw values in the host endianness. The
2467 * element count is inferred from the element type and the data size in bytes.
2468 *
2469 * @see llvm::ConstantDataArray::getRaw()
2470 */
2472 const char *Data,
2473 size_t SizeInBytes);
2474
2475/**
2476 * Create a non-anonymous ConstantStruct from values.
2477 *
2478 * @see llvm::ConstantStruct::get()
2479 */
2481 LLVMValueRef *ConstantVals,
2482 unsigned Count);
2483
2484/**
2485 * Get element of a constant aggregate (struct, array or vector) at the
2486 * specified index. Returns null if the index is out of range, or it's not
2487 * possible to determine the element (e.g., because the constant is a
2488 * constant expression.)
2489 *
2490 * @see llvm::Constant::getAggregateElement()
2491 */
2493
2494/**
2495 * Get an element at specified index as a constant.
2496 *
2497 * @see ConstantDataSequential::getElementAsConstant()
2498 */
2501 "Use LLVMGetAggregateElement instead");
2502
2503/**
2504 * Create a ConstantVector from values.
2505 *
2506 * @see llvm::ConstantVector::get()
2507 */
2509 unsigned Size);
2510
2511/**
2512 * Create a ConstantPtrAuth constant with the given values.
2513 *
2514 * @see llvm::ConstantPtrAuth::get()
2515 */
2517 LLVMValueRef Disc,
2518 LLVMValueRef AddrDisc);
2519
2520/**
2521 * @}
2522 */
2523
2524/**
2525 * @defgroup LLVMCCoreValueConstantExpressions Constant Expressions
2526 *
2527 * Functions in this group correspond to APIs on llvm::ConstantExpr.
2528 *
2529 * @see llvm::ConstantExpr.
2530 *
2531 * @{
2532 */
2540 "Use LLVMConstNull instead.");
2543 LLVMValueRef RHSConstant);
2545 LLVMValueRef RHSConstant);
2547 LLVMValueRef RHSConstant);
2549 LLVMValueRef RHSConstant);
2551 LLVMValueRef RHSConstant);
2553 LLVMValueRef RHSConstant);
2555 LLVMValueRef RHSConstant);
2557 LLVMValueRef *ConstantIndices,
2558 unsigned NumIndices);
2560 LLVMValueRef ConstantVal,
2561 LLVMValueRef *ConstantIndices,
2562 unsigned NumIndices);
2563/**
2564 * Creates a constant GetElementPtr expression. Similar to LLVMConstGEP2, but
2565 * allows specifying the no-wrap flags.
2566 *
2567 * @see llvm::ConstantExpr::getGetElementPtr()
2568 */
2570 LLVMTypeRef Ty, LLVMValueRef ConstantVal, LLVMValueRef *ConstantIndices,
2571 unsigned NumIndices, LLVMGEPNoWrapFlags NoWrapFlags);
2573 LLVMTypeRef ToType);
2575 LLVMTypeRef ToType);
2577 LLVMTypeRef ToType);
2579 LLVMTypeRef ToType);
2581 LLVMTypeRef ToType);
2583 LLVMTypeRef ToType);
2585 LLVMTypeRef ToType);
2587 LLVMValueRef IndexConstant);
2589 LLVMValueRef VectorConstant, LLVMValueRef ElementValueConstant,
2590 LLVMValueRef IndexConstant);
2592 LLVMValueRef VectorBConstant,
2593 LLVMValueRef MaskConstant);
2595
2596/**
2597 * Gets the function associated with a given BlockAddress constant value.
2598 */
2600
2601/**
2602 * Gets the basic block associated with a given BlockAddress constant value.
2603 */
2606
2607/** Deprecated: Use LLVMGetInlineAsm instead. */
2609 const char *AsmString,
2610 const char *Constraints,
2611 LLVMBool HasSideEffects,
2612 LLVMBool IsAlignStack);
2613
2614/**
2615 * @}
2616 */
2617
2618/**
2619 * @defgroup LLVMCCoreValueConstantGlobals Global Values
2620 *
2621 * This group contains functions that operate on global values. Functions in
2622 * this group relate to functions in the llvm::GlobalValue class tree.
2623 *
2624 * @see llvm::GlobalValue
2625 *
2626 * @{
2627 */
2628
2633LLVM_C_ABI const char *LLVMGetSection(LLVMValueRef Global);
2634LLVM_C_ABI void LLVMSetSection(LLVMValueRef Global, const char *Section);
2639 LLVMDLLStorageClass Class);
2642 LLVMUnnamedAddr UnnamedAddr);
2643
2644/**
2645 * Returns the "value type" of a global value. This differs from the formal
2646 * type of a global value which is always a pointer type.
2647 *
2648 * @see llvm::GlobalValue::getValueType()
2649 * @see llvm::Function::getFunctionType()
2650 */
2652
2653/** Deprecated: Use LLVMGetUnnamedAddress instead. */
2655/** Deprecated: Use LLVMSetUnnamedAddress instead. */
2657 LLVMBool HasUnnamedAddr);
2658
2659/**
2660 * @defgroup LLVMCCoreValueWithAlignment Values with alignment
2661 *
2662 * Functions in this group only apply to values with alignment, i.e.
2663 * global variables, load and store instructions.
2664 */
2665
2666/**
2667 * Obtain the preferred alignment of the value.
2668 * @see llvm::AllocaInst::getAlignment()
2669 * @see llvm::LoadInst::getAlignment()
2670 * @see llvm::StoreInst::getAlignment()
2671 * @see llvm::AtomicRMWInst::setAlignment()
2672 * @see llvm::AtomicCmpXchgInst::setAlignment()
2673 * @see llvm::GlobalValue::getAlignment()
2674 */
2676
2677/**
2678 * Set the preferred alignment of the value.
2679 * @see llvm::AllocaInst::setAlignment()
2680 * @see llvm::LoadInst::setAlignment()
2681 * @see llvm::StoreInst::setAlignment()
2682 * @see llvm::AtomicRMWInst::setAlignment()
2683 * @see llvm::AtomicCmpXchgInst::setAlignment()
2684 * @see llvm::GlobalValue::setAlignment()
2685 */
2686LLVM_C_ABI void LLVMSetAlignment(LLVMValueRef V, unsigned Bytes);
2687
2688/**
2689 * Sets a metadata attachment, erasing the existing metadata attachment if
2690 * it already exists for the given kind.
2691 *
2692 * @see llvm::GlobalObject::setMetadata()
2693 */
2694LLVM_C_ABI void LLVMGlobalSetMetadata(LLVMValueRef Global, unsigned Kind,
2695 LLVMMetadataRef MD);
2696
2697/**
2698 * Adds a metadata attachment.
2699 *
2700 * @see llvm::GlobalObject::addMetadata()
2701 */
2702LLVM_C_ABI void LLVMGlobalAddMetadata(LLVMValueRef Global, unsigned Kind,
2703 LLVMMetadataRef MD);
2704
2705/**
2706 * Erases a metadata attachment of the given kind if it exists.
2707 *
2708 * @see llvm::GlobalObject::eraseMetadata()
2709 */
2710LLVM_C_ABI void LLVMGlobalEraseMetadata(LLVMValueRef Global, unsigned Kind);
2711
2712/**
2713 * Removes all metadata attachments from this value.
2714 *
2715 * @see llvm::GlobalObject::clearMetadata()
2716 */
2718
2719/**
2720 * Add debuginfo metadata to this global.
2721 *
2722 * @see llvm::GlobalVariable::addDebugInfo()
2723 */
2725 LLVMMetadataRef GVE);
2726
2727/**
2728 * Retrieves an array of metadata entries representing the metadata attached to
2729 * this value. The caller is responsible for freeing this array by calling
2730 * \c LLVMDisposeValueMetadataEntries.
2731 *
2732 * @see llvm::GlobalObject::getAllMetadata()
2733 */
2735LLVMGlobalCopyAllMetadata(LLVMValueRef Value, size_t *NumEntries);
2736
2737/**
2738 * Destroys value metadata entries.
2739 */
2740LLVM_C_ABI void
2742
2743/**
2744 * Returns the kind of a value metadata entry at a specific index.
2745 */
2746LLVM_C_ABI unsigned
2748 unsigned Index);
2749
2750/**
2751 * Returns the underlying metadata node of a value metadata entry at a
2752 * specific index.
2753 */
2755 LLVMValueMetadataEntry *Entries, unsigned Index);
2756
2757/**
2758 * @}
2759 */
2760
2761/**
2762 * @defgroup LLVMCoreValueConstantGlobalVariable Global Variables
2763 *
2764 * This group contains functions that operate on global variable values.
2765 *
2766 * @see llvm::GlobalVariable
2767 *
2768 * @{
2769 */
2771 const char *Name);
2773 LLVMTypeRef Ty,
2774 const char *Name,
2775 unsigned AddressSpace);
2778 const char *Name,
2779 size_t Length);
2787 LLVMValueRef ConstantVal);
2790 LLVMBool IsThreadLocal);
2793 LLVMBool IsConstant);
2799 LLVMBool IsExtInit);
2800
2801/**
2802 * @}
2803 */
2804
2805/**
2806 * @defgroup LLVMCoreValueConstantGlobalAlias Global Aliases
2807 *
2808 * This group contains function that operate on global alias values.
2809 *
2810 * @see llvm::GlobalAlias
2811 *
2812 * @{
2813 */
2814
2815/**
2816 * Add a GlobalAlias with the given value type, address space and aliasee.
2817 *
2818 * @see llvm::GlobalAlias::create()
2819 */
2821 unsigned AddrSpace, LLVMValueRef Aliasee,
2822 const char *Name);
2823
2824/**
2825 * Obtain a GlobalAlias value from a Module by its name.
2826 *
2827 * The returned value corresponds to a llvm::GlobalAlias value.
2828 *
2829 * @see llvm::Module::getNamedAlias()
2830 */
2832 const char *Name,
2833 size_t NameLen);
2834
2835/**
2836 * Obtain an iterator to the first GlobalAlias in a Module.
2837 *
2838 * @see llvm::Module::alias_begin()
2839 */
2841
2842/**
2843 * Obtain an iterator to the last GlobalAlias in a Module.
2844 *
2845 * @see llvm::Module::alias_end()
2846 */
2848
2849/**
2850 * Advance a GlobalAlias iterator to the next GlobalAlias.
2851 *
2852 * Returns NULL if the iterator was already at the end and there are no more
2853 * global aliases.
2854 */
2856
2857/**
2858 * Decrement a GlobalAlias iterator to the previous GlobalAlias.
2859 *
2860 * Returns NULL if the iterator was already at the beginning and there are
2861 * no previous global aliases.
2862 */
2864
2865/**
2866 * Retrieve the target value of an alias.
2867 */
2869
2870/**
2871 * Set the target value of an alias.
2872 */
2874
2875/**
2876 * @}
2877 */
2878
2879/**
2880 * @defgroup LLVMCCoreValueFunction Function values
2881 *
2882 * Functions in this group operate on LLVMValueRef instances that
2883 * correspond to llvm::Function instances.
2884 *
2885 * @see llvm::Function
2886 *
2887 * @{
2888 */
2889
2890/**
2891 * Remove a function from its containing module and deletes it.
2892 *
2893 * @see llvm::Function::eraseFromParent()
2894 */
2896
2897/**
2898 * Check whether the given function has a personality function.
2899 *
2900 * @see llvm::Function::hasPersonalityFn()
2901 */
2903
2904/**
2905 * Obtain the personality function attached to the function.
2906 *
2907 * @see llvm::Function::getPersonalityFn()
2908 */
2910
2911/**
2912 * Set the personality function attached to the function.
2913 *
2914 * @see llvm::Function::setPersonalityFn()
2915 */
2917 LLVMValueRef PersonalityFn);
2918
2919/**
2920 * Obtain the intrinsic ID number which matches the given function name.
2921 *
2922 * @see llvm::Intrinsic::lookupIntrinsicID()
2923 */
2924LLVM_C_ABI unsigned LLVMLookupIntrinsicID(const char *Name, size_t NameLen);
2925
2926/**
2927 * Obtain the ID number from a function instance.
2928 *
2929 * @see llvm::Function::getIntrinsicID()
2930 */
2932
2933/**
2934 * Get or insert the declaration of an intrinsic. For overloaded intrinsics,
2935 * parameter types must be provided to uniquely identify an overload.
2936 *
2937 * @see llvm::Intrinsic::getOrInsertDeclaration()
2938 */
2940 unsigned ID,
2941 LLVMTypeRef *ParamTypes,
2942 size_t ParamCount);
2943
2944/**
2945 * Retrieves the type of an intrinsic. For overloaded intrinsics, parameter
2946 * types must be provided to uniquely identify an overload.
2947 *
2948 * @see llvm::Intrinsic::getType()
2949 */
2951 LLVMTypeRef *ParamTypes,
2952 size_t ParamCount);
2953
2954/**
2955 * Retrieves the name of an intrinsic.
2956 *
2957 * @see llvm::Intrinsic::getName()
2958 */
2959LLVM_C_ABI const char *LLVMIntrinsicGetName(unsigned ID, size_t *NameLength);
2960
2961/** Deprecated: Use LLVMIntrinsicCopyOverloadedName2 instead. */
2963 LLVMTypeRef *ParamTypes,
2964 size_t ParamCount,
2965 size_t *NameLength);
2966
2967/**
2968 * Copies the name of an overloaded intrinsic identified by a given list of
2969 * parameter types.
2970 *
2971 * Unlike LLVMIntrinsicGetName, the caller is responsible for freeing the
2972 * returned string.
2973 *
2974 * This version also supports unnamed types.
2975 *
2976 * @see llvm::Intrinsic::getName()
2977 */
2979 unsigned ID,
2980 LLVMTypeRef *ParamTypes,
2981 size_t ParamCount,
2982 size_t *NameLength);
2983
2984/**
2985 * Obtain if the intrinsic identified by the given ID is overloaded.
2986 *
2987 * @see llvm::Intrinsic::isOverloaded()
2988 */
2990
2991/**
2992 * Obtain the calling function of a function.
2993 *
2994 * The returned value corresponds to the LLVMCallConv enumeration.
2995 *
2996 * @see llvm::Function::getCallingConv()
2997 */
2999
3000/**
3001 * Set the calling convention of a function.
3002 *
3003 * @see llvm::Function::setCallingConv()
3004 *
3005 * @param Fn Function to operate on
3006 * @param CC LLVMCallConv to set calling convention to
3007 */
3008LLVM_C_ABI void LLVMSetFunctionCallConv(LLVMValueRef Fn, unsigned CC);
3009
3010/**
3011 * Obtain the name of the garbage collector to use during code
3012 * generation.
3013 *
3014 * @see llvm::Function::getGC()
3015 */
3016LLVM_C_ABI const char *LLVMGetGC(LLVMValueRef Fn);
3017
3018/**
3019 * Define the garbage collector to use during code generation.
3020 *
3021 * @see llvm::Function::setGC()
3022 */
3023LLVM_C_ABI void LLVMSetGC(LLVMValueRef Fn, const char *Name);
3024
3025/**
3026 * Gets the prefix data associated with a function. Only valid on functions, and
3027 * only if LLVMHasPrefixData returns true.
3028 * See https://llvm.org/docs/LangRef.html#prefix-data
3029 */
3031
3032/**
3033 * Check if a given function has prefix data. Only valid on functions.
3034 * See https://llvm.org/docs/LangRef.html#prefix-data
3035 */
3037
3038/**
3039 * Sets the prefix data for the function. Only valid on functions.
3040 * See https://llvm.org/docs/LangRef.html#prefix-data
3041 */
3043
3044/**
3045 * Gets the prologue data associated with a function. Only valid on functions,
3046 * and only if LLVMHasPrologueData returns true.
3047 * See https://llvm.org/docs/LangRef.html#prologue-data
3048 */
3050
3051/**
3052 * Check if a given function has prologue data. Only valid on functions.
3053 * See https://llvm.org/docs/LangRef.html#prologue-data
3054 */
3056
3057/**
3058 * Sets the prologue data for the function. Only valid on functions.
3059 * See https://llvm.org/docs/LangRef.html#prologue-data
3060 */
3062
3063/**
3064 * Add an attribute to a function.
3065 *
3066 * @see llvm::Function::addAttribute()
3067 */
3071 LLVMAttributeIndex Idx);
3073 LLVMAttributeRef *Attrs);
3076 unsigned KindID);
3078 LLVMValueRef F, LLVMAttributeIndex Idx, const char *K, unsigned KLen);
3081 unsigned KindID);
3084 const char *K, unsigned KLen);
3085
3086/**
3087 * Add a target-dependent attribute to a function
3088 * @see llvm::AttrBuilder::addAttribute()
3089 */
3091 const char *A,
3092 const char *V);
3093
3094/**
3095 * @defgroup LLVMCCoreValueFunctionParameters Function Parameters
3096 *
3097 * Functions in this group relate to arguments/parameters on functions.
3098 *
3099 * Functions in this group expect LLVMValueRef instances that correspond
3100 * to llvm::Function instances.
3101 *
3102 * @{
3103 */
3104
3105/**
3106 * Obtain the number of parameters in a function.
3107 *
3108 * @see llvm::Function::arg_size()
3109 */
3111
3112/**
3113 * Obtain the parameters in a function.
3114 *
3115 * The takes a pointer to a pre-allocated array of LLVMValueRef that is
3116 * at least LLVMCountParams() long. This array will be filled with
3117 * LLVMValueRef instances which correspond to the parameters the
3118 * function receives. Each LLVMValueRef corresponds to a llvm::Argument
3119 * instance.
3120 *
3121 * @see llvm::Function::arg_begin()
3122 */
3124
3125/**
3126 * Obtain the parameter at the specified index.
3127 *
3128 * Parameters are indexed from 0.
3129 *
3130 * @see llvm::Function::arg_begin()
3131 */
3133
3134/**
3135 * Obtain the function to which this argument belongs.
3136 *
3137 * Unlike other functions in this group, this one takes an LLVMValueRef
3138 * that corresponds to a llvm::Attribute.
3139 *
3140 * The returned LLVMValueRef is the llvm::Function to which this
3141 * argument belongs.
3142 */
3144
3145/**
3146 * Obtain the first parameter to a function.
3147 *
3148 * @see llvm::Function::arg_begin()
3149 */
3151
3152/**
3153 * Obtain the last parameter to a function.
3154 *
3155 * @see llvm::Function::arg_end()
3156 */
3158
3159/**
3160 * Obtain the next parameter to a function.
3161 *
3162 * This takes an LLVMValueRef obtained from LLVMGetFirstParam() (which is
3163 * actually a wrapped iterator) and obtains the next parameter from the
3164 * underlying iterator.
3165 */
3167
3168/**
3169 * Obtain the previous parameter to a function.
3170 *
3171 * This is the opposite of LLVMGetNextParam().
3172 */
3174
3175/**
3176 * Set the alignment for a function parameter.
3177 *
3178 * @see llvm::Argument::addAttr()
3179 * @see llvm::AttrBuilder::addAlignmentAttr()
3180 */
3181LLVM_C_ABI void LLVMSetParamAlignment(LLVMValueRef Arg, unsigned Align);
3182
3183/**
3184 * @}
3185 */
3186
3187/**
3188 * @defgroup LLVMCCoreValueGlobalIFunc IFuncs
3189 *
3190 * Functions in this group relate to indirect functions.
3191 *
3192 * Functions in this group expect LLVMValueRef instances that correspond
3193 * to llvm::GlobalIFunc instances.
3194 *
3195 * @{
3196 */
3197
3198/**
3199 * Add a global indirect function to a module under a specified name.
3200 *
3201 * @see llvm::GlobalIFunc::create()
3202 */
3204 size_t NameLen, LLVMTypeRef Ty,
3205 unsigned AddrSpace,
3206 LLVMValueRef Resolver);
3207
3208/**
3209 * Obtain a GlobalIFunc value from a Module by its name.
3210 *
3211 * The returned value corresponds to a llvm::GlobalIFunc value.
3212 *
3213 * @see llvm::Module::getNamedIFunc()
3214 */
3216 const char *Name,
3217 size_t NameLen);
3218
3219/**
3220 * Obtain an iterator to the first GlobalIFunc in a Module.
3221 *
3222 * @see llvm::Module::ifunc_begin()
3223 */
3225
3226/**
3227 * Obtain an iterator to the last GlobalIFunc in a Module.
3228 *
3229 * @see llvm::Module::ifunc_end()
3230 */
3232
3233/**
3234 * Advance a GlobalIFunc iterator to the next GlobalIFunc.
3235 *
3236 * Returns NULL if the iterator was already at the end and there are no more
3237 * global aliases.
3238 */
3240
3241/**
3242 * Decrement a GlobalIFunc iterator to the previous GlobalIFunc.
3243 *
3244 * Returns NULL if the iterator was already at the beginning and there are
3245 * no previous global aliases.
3246 */
3248
3249/**
3250 * Retrieves the resolver function associated with this indirect function, or
3251 * NULL if it doesn't not exist.
3252 *
3253 * @see llvm::GlobalIFunc::getResolver()
3254 */
3256
3257/**
3258 * Sets the resolver function associated with this indirect function.
3259 *
3260 * @see llvm::GlobalIFunc::setResolver()
3261 */
3263 LLVMValueRef Resolver);
3264
3265/**
3266 * Remove a global indirect function from its parent module and delete it.
3267 *
3268 * @see llvm::GlobalIFunc::eraseFromParent()
3269 */
3271
3272/**
3273 * Remove a global indirect function from its parent module.
3274 *
3275 * This unlinks the global indirect function from its containing module but
3276 * keeps it alive.
3277 *
3278 * @see llvm::GlobalIFunc::removeFromParent()
3279 */
3281
3282/**
3283 * @}
3284 */
3285
3286/**
3287 * @}
3288 */
3289
3290/**
3291 * @}
3292 */
3293
3294/**
3295 * @}
3296 */
3297
3298/**
3299 * @defgroup LLVMCCoreValueMetadata Metadata
3300 *
3301 * @{
3302 */
3303
3304/**
3305 * Create an MDString value from a given string value.
3306 *
3307 * The MDString value does not take ownership of the given string, it remains
3308 * the responsibility of the caller to free it.
3309 *
3310 * @see llvm::MDString::get()
3311 */
3313 const char *Str, size_t SLen);
3314
3315/**
3316 * Create an MDNode value with the given array of operands.
3317 *
3318 * @see llvm::MDNode::get()
3319 */
3321 LLVMMetadataRef *MDs,
3322 size_t Count);
3323
3324/**
3325 * Obtain a Metadata as a Value.
3326 */
3328 LLVMMetadataRef MD);
3329
3330/**
3331 * Obtain a Value as a Metadata.
3332 */
3334
3335/**
3336 * Obtain the underlying string from a MDString value.
3337 *
3338 * @param V Instance to obtain string from.
3339 * @param Length Memory address which will hold length of returned string.
3340 * @return String data in MDString.
3341 */
3342LLVM_C_ABI const char *LLVMGetMDString(LLVMValueRef V, unsigned *Length);
3343
3344/**
3345 * Obtain the number of operands from an MDNode value.
3346 *
3347 * @param V MDNode to get number of operands from.
3348 * @return Number of operands of the MDNode.
3349 */
3351
3352/**
3353 * Obtain the given MDNode's operands.
3354 *
3355 * The passed LLVMValueRef pointer should point to enough memory to hold all of
3356 * the operands of the given MDNode (see LLVMGetMDNodeNumOperands) as
3357 * LLVMValueRefs. This memory will be populated with the LLVMValueRefs of the
3358 * MDNode's operands.
3359 *
3360 * @param V MDNode to get the operands from.
3361 * @param Dest Destination array for operands.
3362 */
3364
3365/**
3366 * Replace an operand at a specific index in a llvm::MDNode value.
3367 *
3368 * @see llvm::MDNode::replaceOperandWith()
3369 */
3371 LLVMMetadataRef Replacement);
3372
3373/** Deprecated: Use LLVMMDStringInContext2 instead. */
3375 unsigned SLen);
3376/** Deprecated: Use LLVMMDStringInContext2 instead. */
3377LLVM_C_ABI LLVMValueRef LLVMMDString(const char *Str, unsigned SLen);
3378/** Deprecated: Use LLVMMDNodeInContext2 instead. */
3380 LLVMValueRef *Vals, unsigned Count);
3381/** Deprecated: Use LLVMMDNodeInContext2 instead. */
3382LLVM_C_ABI LLVMValueRef LLVMMDNode(LLVMValueRef *Vals, unsigned Count);
3383
3384/**
3385 * @}
3386 */
3387
3388/**
3389 * @defgroup LLVMCCoreOperandBundle Operand Bundles
3390 *
3391 * Functions in this group operate on LLVMOperandBundleRef instances that
3392 * correspond to llvm::OperandBundleDef instances.
3393 *
3394 * @see llvm::OperandBundleDef
3395 *
3396 * @{
3397 */
3398
3399/**
3400 * Create a new operand bundle.
3401 *
3402 * Every invocation should be paired with LLVMDisposeOperandBundle() or memory
3403 * will be leaked.
3404 *
3405 * @param Tag Tag name of the operand bundle
3406 * @param TagLen Length of Tag
3407 * @param Args Memory address of an array of bundle operands
3408 * @param NumArgs Length of Args
3409 */
3411 size_t TagLen,
3412 LLVMValueRef *Args,
3413 unsigned NumArgs);
3414
3415/**
3416 * Destroy an operand bundle.
3417 *
3418 * This must be called for every created operand bundle or memory will be
3419 * leaked.
3420 */
3422
3423/**
3424 * Obtain the tag of an operand bundle as a string.
3425 *
3426 * @param Bundle Operand bundle to obtain tag of.
3427 * @param Len Out parameter which holds the length of the returned string.
3428 * @return The tag name of Bundle.
3429 * @see OperandBundleDef::getTag()
3430 */
3432 size_t *Len);
3433
3434/**
3435 * Obtain the number of operands for an operand bundle.
3436 *
3437 * @param Bundle Operand bundle to obtain operand count of.
3438 * @return The number of operands.
3439 * @see OperandBundleDef::input_size()
3440 */
3442
3443/**
3444 * Obtain the operand for an operand bundle at the given index.
3445 *
3446 * @param Bundle Operand bundle to obtain operand of.
3447 * @param Index An operand index, must be less than
3448 * LLVMGetNumOperandBundleArgs().
3449 * @return The operand.
3450 */
3453
3454/**
3455 * @}
3456 */
3457
3458/**
3459 * @defgroup LLVMCCoreValueBasicBlock Basic Block
3460 *
3461 * A basic block represents a single entry single exit section of code.
3462 * Basic blocks contain a list of instructions which form the body of
3463 * the block.
3464 *
3465 * Basic blocks belong to functions. They have the type of label.
3466 *
3467 * Basic blocks are themselves values. However, the C API models them as
3468 * LLVMBasicBlockRef.
3469 *
3470 * @see llvm::BasicBlock
3471 *
3472 * @{
3473 */
3474
3475/**
3476 * Convert a basic block instance to a value type.
3477 */
3479
3480/**
3481 * Determine whether an LLVMValueRef is itself a basic block.
3482 */
3484
3485/**
3486 * Convert an LLVMValueRef to an LLVMBasicBlockRef instance.
3487 */
3489
3490/**
3491 * Obtain the string name of a basic block.
3492 */
3494
3495/**
3496 * Obtain the function to which a basic block belongs.
3497 *
3498 * @see llvm::BasicBlock::getParent()
3499 */
3501
3502/**
3503 * Obtain the terminator instruction for a basic block.
3504 *
3505 * If the basic block does not have a terminator (it is not well-formed
3506 * if it doesn't), then NULL is returned.
3507 *
3508 * The returned LLVMValueRef corresponds to an llvm::Instruction.
3509 *
3510 * @see llvm::BasicBlock::getTerminator()
3511 */
3513
3514/**
3515 * Obtain the number of basic blocks in a function.
3516 *
3517 * @param Fn Function value to operate on.
3518 */
3520
3521/**
3522 * Obtain all of the basic blocks in a function.
3523 *
3524 * This operates on a function value. The BasicBlocks parameter is a
3525 * pointer to a pre-allocated array of LLVMBasicBlockRef of at least
3526 * LLVMCountBasicBlocks() in length. This array is populated with
3527 * LLVMBasicBlockRef instances.
3528 */
3530 LLVMBasicBlockRef *BasicBlocks);
3531
3532/**
3533 * Obtain the first basic block in a function.
3534 *
3535 * The returned basic block can be used as an iterator. You will likely
3536 * eventually call into LLVMGetNextBasicBlock() with it.
3537 *
3538 * @see llvm::Function::begin()
3539 */
3541
3542/**
3543 * Obtain the last basic block in a function.
3544 *
3545 * @see llvm::Function::end()
3546 */
3548
3549/**
3550 * Advance a basic block iterator.
3551 */
3553
3554/**
3555 * Go backwards in a basic block iterator.
3556 */
3558
3559/**
3560 * Obtain the basic block that corresponds to the entry point of a
3561 * function.
3562 *
3563 * @see llvm::Function::getEntryBlock()
3564 */
3566
3567/**
3568 * Insert the given basic block after the insertion point of the given builder.
3569 *
3570 * The insertion point must be valid.
3571 *
3572 * @see llvm::Function::BasicBlockListType::insertAfter()
3573 */
3574LLVM_C_ABI void
3577
3578/**
3579 * Append the given basic block to the basic block list of the given function.
3580 *
3581 * @see llvm::Function::BasicBlockListType::push_back()
3582 */
3585
3586/**
3587 * Create a new basic block without inserting it into a function.
3588 *
3589 * @see llvm::BasicBlock::Create()
3590 */
3592 const char *Name);
3593
3594/**
3595 * Append a basic block to the end of a function.
3596 *
3597 * @see llvm::BasicBlock::Create()
3598 */
3600 LLVMValueRef Fn,
3601 const char *Name);
3602
3603/**
3604 * Append a basic block to the end of a function using the global
3605 * context.
3606 *
3607 * @see llvm::BasicBlock::Create()
3608 */
3610 const char *Name);
3611
3612/**
3613 * Insert a basic block in a function before another basic block.
3614 *
3615 * The function to add to is determined by the function of the
3616 * passed basic block.
3617 *
3618 * @see llvm::BasicBlock::Create()
3619 */
3622 const char *Name);
3623
3624/**
3625 * Insert a basic block in a function using the global context.
3626 *
3627 * @see llvm::BasicBlock::Create()
3628 */
3630LLVMInsertBasicBlock(LLVMBasicBlockRef InsertBeforeBB, const char *Name);
3631
3632/**
3633 * Remove a basic block from a function and delete it.
3634 *
3635 * This deletes the basic block from its containing function and deletes
3636 * the basic block itself.
3637 *
3638 * @see llvm::BasicBlock::eraseFromParent()
3639 */
3641
3642/**
3643 * Remove a basic block from a function.
3644 *
3645 * This deletes the basic block from its containing function but keep
3646 * the basic block alive.
3647 *
3648 * @see llvm::BasicBlock::removeFromParent()
3649 */
3651
3652/**
3653 * Move a basic block to before another one.
3654 *
3655 * @see llvm::BasicBlock::moveBefore()
3656 */
3658 LLVMBasicBlockRef MovePos);
3659
3660/**
3661 * Move a basic block to after another one.
3662 *
3663 * @see llvm::BasicBlock::moveAfter()
3664 */
3666 LLVMBasicBlockRef MovePos);
3667
3668/**
3669 * Obtain the first instruction in a basic block.
3670 *
3671 * The returned LLVMValueRef corresponds to a llvm::Instruction
3672 * instance.
3673 */
3675
3676/**
3677 * Obtain the last instruction in a basic block.
3678 *
3679 * The returned LLVMValueRef corresponds to an LLVM:Instruction.
3680 */
3682
3683/**
3684 * @}
3685 */
3686
3687/**
3688 * @defgroup LLVMCCoreValueInstruction Instructions
3689 *
3690 * Functions in this group relate to the inspection and manipulation of
3691 * individual instructions.
3692 *
3693 * In the C++ API, an instruction is modeled by llvm::Instruction. This
3694 * class has a large number of descendents. llvm::Instruction is a
3695 * llvm::Value and in the C API, instructions are modeled by
3696 * LLVMValueRef.
3697 *
3698 * This group also contains sub-groups which operate on specific
3699 * llvm::Instruction types, e.g. llvm::CallInst.
3700 *
3701 * @{
3702 */
3703
3704/**
3705 * Determine whether an instruction has any metadata attached.
3706 */
3708
3709/**
3710 * Return metadata associated with an instruction value.
3711 */
3713
3714/**
3715 * Set metadata associated with an instruction value.
3716 */
3717LLVM_C_ABI void LLVMSetMetadata(LLVMValueRef Val, unsigned KindID,
3719
3720/**
3721 * Returns the metadata associated with an instruction value, but filters out
3722 * all the debug locations.
3723 *
3724 * @see llvm::Instruction::getAllMetadataOtherThanDebugLoc()
3725 */
3728 size_t *NumEntries);
3729
3730/**
3731 * Obtain the basic block to which an instruction belongs.
3732 *
3733 * @see llvm::Instruction::getParent()
3734 */
3736
3737/**
3738 * Obtain the instruction that occurs after the one specified.
3739 *
3740 * The next instruction will be from the same basic block.
3741 *
3742 * If this is the last instruction in a basic block, NULL will be
3743 * returned.
3744 */
3746
3747/**
3748 * Obtain the instruction that occurred before this one.
3749 *
3750 * If the instruction is the first instruction in a basic block, NULL
3751 * will be returned.
3752 */
3754
3755/**
3756 * Remove an instruction.
3757 *
3758 * The instruction specified is removed from its containing building
3759 * block but is kept alive.
3760 *
3761 * @see llvm::Instruction::removeFromParent()
3762 */
3764
3765/**
3766 * Remove and delete an instruction.
3767 *
3768 * The instruction specified is removed from its containing building
3769 * block and then deleted.
3770 *
3771 * @see llvm::Instruction::eraseFromParent()
3772 */
3774
3775/**
3776 * Delete an instruction.
3777 *
3778 * The instruction specified is deleted. It must have previously been
3779 * removed from its containing building block.
3780 *
3781 * @see llvm::Value::deleteValue()
3782 */
3784
3785/**
3786 * Obtain the code opcode for an individual instruction.
3787 *
3788 * @see llvm::Instruction::getOpCode()
3789 */
3791
3792/**
3793 * Obtain the predicate of an instruction.
3794 *
3795 * This is only valid for instructions that correspond to llvm::ICmpInst.
3796 *
3797 * @see llvm::ICmpInst::getPredicate()
3798 */
3800
3801/**
3802 * Get whether or not an icmp instruction has the samesign flag.
3803 *
3804 * This is only valid for instructions that correspond to llvm::ICmpInst.
3805 *
3806 * @see llvm::ICmpInst::hasSameSign()
3807 */
3809
3810/**
3811 * Set the samesign flag on an icmp instruction.
3812 *
3813 * This is only valid for instructions that correspond to llvm::ICmpInst.
3814 *
3815 * @see llvm::ICmpInst::setSameSign()
3816 */
3818
3819/**
3820 * Obtain the float predicate of an instruction.
3821 *
3822 * This is only valid for instructions that correspond to llvm::FCmpInst.
3823 *
3824 * @see llvm::FCmpInst::getPredicate()
3825 */
3827
3828/**
3829 * Create a copy of 'this' instruction that is identical in all ways
3830 * except the following:
3831 * * The instruction has no parent
3832 * * The instruction has no name
3833 *
3834 * @see llvm::Instruction::clone()
3835 */
3837
3838/**
3839 * Determine whether an instruction is a terminator. This routine is named to
3840 * be compatible with historical functions that did this by querying the
3841 * underlying C++ type.
3842 *
3843 * @see llvm::Instruction::isTerminator()
3844 */
3846
3847/**
3848 * Obtain the first debug record attached to an instruction.
3849 *
3850 * Use LLVMGetNextDbgRecord() and LLVMGetPreviousDbgRecord() to traverse the
3851 * sequence of DbgRecords.
3852 *
3853 * Return the first DbgRecord attached to Inst or NULL if there are none.
3854 *
3855 * @see llvm::Instruction::getDbgRecordRange()
3856 */
3858
3859/**
3860 * Obtain the last debug record attached to an instruction.
3861 *
3862 * Return the last DbgRecord attached to Inst or NULL if there are none.
3863 *
3864 * @see llvm::Instruction::getDbgRecordRange()
3865 */
3867
3868/**
3869 * Obtain the next DbgRecord in the sequence or NULL if there are no more.
3870 *
3871 * @see llvm::Instruction::getDbgRecordRange()
3872 */
3874
3875/**
3876 * Obtain the previous DbgRecord in the sequence or NULL if there are no more.
3877 *
3878 * @see llvm::Instruction::getDbgRecordRange()
3879 */
3882
3883/**
3884 * @defgroup LLVMCCoreValueInstructionCall Call Sites and Invocations
3885 *
3886 * Functions in this group apply to instructions that refer to call
3887 * sites and invocations. These correspond to C++ types in the
3888 * llvm::CallInst class tree.
3889 *
3890 * @{
3891 */
3892
3893/**
3894 * Obtain the argument count for a call instruction.
3895 *
3896 * This expects an LLVMValueRef that corresponds to a llvm::CallInst,
3897 * llvm::InvokeInst, or llvm:FuncletPadInst.
3898 *
3899 * @see llvm::CallInst::getNumArgOperands()
3900 * @see llvm::InvokeInst::getNumArgOperands()
3901 * @see llvm::FuncletPadInst::getNumArgOperands()
3902 */
3904
3905/**
3906 * Set the calling convention for a call instruction.
3907 *
3908 * This expects an LLVMValueRef that corresponds to a llvm::CallInst or
3909 * llvm::InvokeInst.
3910 *
3911 * @see llvm::CallInst::setCallingConv()
3912 * @see llvm::InvokeInst::setCallingConv()
3913 */
3914LLVM_C_ABI void LLVMSetInstructionCallConv(LLVMValueRef Instr, unsigned CC);
3915
3916/**
3917 * Obtain the calling convention for a call instruction.
3918 *
3919 * This is the opposite of LLVMSetInstructionCallConv(). Reads its
3920 * usage.
3921 *
3922 * @see LLVMSetInstructionCallConv()
3923 */
3925
3928 unsigned Align);
3929
3933 LLVMAttributeIndex Idx);
3936 LLVMAttributeRef *Attrs);
3939 unsigned KindID);
3941 LLVMValueRef C, LLVMAttributeIndex Idx, const char *K, unsigned KLen);
3944 unsigned KindID);
3947 const char *K, unsigned KLen);
3948
3949/**
3950 * Obtain the function type called by this instruction.
3951 *
3952 * @see llvm::CallBase::getFunctionType()
3953 */
3955
3956/**
3957 * Obtain the pointer to the function invoked by this instruction.
3958 *
3959 * This expects an LLVMValueRef that corresponds to a llvm::CallInst or
3960 * llvm::InvokeInst.
3961 *
3962 * @see llvm::CallInst::getCalledOperand()
3963 * @see llvm::InvokeInst::getCalledOperand()
3964 */
3966
3967/**
3968 * Obtain the number of operand bundles attached to this instruction.
3969 *
3970 * This only works on llvm::CallInst and llvm::InvokeInst instructions.
3971 *
3972 * @see llvm::CallBase::getNumOperandBundles()
3973 */
3975
3976/**
3977 * Obtain the operand bundle attached to this instruction at the given index.
3978 * Use LLVMDisposeOperandBundle to free the operand bundle.
3979 *
3980 * This only works on llvm::CallInst and llvm::InvokeInst instructions.
3981 */
3983 unsigned Index);
3984
3985/**
3986 * Obtain whether a call instruction is a tail call.
3987 *
3988 * This only works on llvm::CallInst instructions.
3989 *
3990 * @see llvm::CallInst::isTailCall()
3991 */
3993
3994/**
3995 * Set whether a call instruction is a tail call.
3996 *
3997 * This only works on llvm::CallInst instructions.
3998 *
3999 * @see llvm::CallInst::setTailCall()
4000 */
4001LLVM_C_ABI void LLVMSetTailCall(LLVMValueRef CallInst, LLVMBool IsTailCall);
4002
4003/**
4004 * Obtain a tail call kind of the call instruction.
4005 *
4006 * @see llvm::CallInst::setTailCallKind()
4007 */
4009
4010/**
4011 * Set the call kind of the call instruction.
4012 *
4013 * @see llvm::CallInst::getTailCallKind()
4014 */
4016 LLVMTailCallKind kind);
4017
4018/**
4019 * Return the normal destination basic block.
4020 *
4021 * This only works on llvm::InvokeInst instructions.
4022 *
4023 * @see llvm::InvokeInst::getNormalDest()
4024 */
4026
4027/**
4028 * Return the unwind destination basic block.
4029 *
4030 * Works on llvm::InvokeInst, llvm::CleanupReturnInst, and
4031 * llvm::CatchSwitchInst instructions.
4032 *
4033 * @see llvm::InvokeInst::getUnwindDest()
4034 * @see llvm::CleanupReturnInst::getUnwindDest()
4035 * @see llvm::CatchSwitchInst::getUnwindDest()
4036 */
4038
4039/**
4040 * Set the normal destination basic block.
4041 *
4042 * This only works on llvm::InvokeInst instructions.
4043 *
4044 * @see llvm::InvokeInst::setNormalDest()
4045 */
4047
4048/**
4049 * Set the unwind destination basic block.
4050 *
4051 * Works on llvm::InvokeInst, llvm::CleanupReturnInst, and
4052 * llvm::CatchSwitchInst instructions.
4053 *
4054 * @see llvm::InvokeInst::setUnwindDest()
4055 * @see llvm::CleanupReturnInst::setUnwindDest()
4056 * @see llvm::CatchSwitchInst::setUnwindDest()
4057 */
4059
4060/**
4061 * Get the default destination of a CallBr instruction.
4062 *
4063 * @see llvm::CallBrInst::getDefaultDest()
4064 */
4066
4067/**
4068 * Get the number of indirect destinations of a CallBr instruction.
4069 *
4070 * @see llvm::CallBrInst::getNumIndirectDests()
4071
4072 */
4074
4075/**
4076 * Get the indirect destination of a CallBr instruction at the given index.
4077 *
4078 * @see llvm::CallBrInst::getIndirectDest()
4079 */
4081 unsigned Idx);
4082
4083/**
4084 * @}
4085 */
4086
4087/**
4088 * @defgroup LLVMCCoreValueInstructionTerminator Terminators
4089 *
4090 * Functions in this group only apply to instructions for which
4091 * LLVMIsATerminatorInst returns true.
4092 *
4093 * @{
4094 */
4095
4096/**
4097 * Return the number of successors that this terminator has.
4098 *
4099 * @see llvm::Instruction::getNumSuccessors
4100 */
4102
4103/**
4104 * Return the specified successor.
4105 *
4106 * @see llvm::Instruction::getSuccessor
4107 */
4109
4110/**
4111 * Update the specified successor to point at the provided block.
4112 *
4113 * @see llvm::Instruction::setSuccessor
4114 */
4115LLVM_C_ABI void LLVMSetSuccessor(LLVMValueRef Term, unsigned i,
4117
4118/**
4119 * Return if a branch is conditional.
4120 *
4121 * This only works on llvm::BranchInst instructions.
4122 *
4123 * @see llvm::BranchInst::isConditional
4124 */
4126
4127/**
4128 * Return the condition of a branch instruction.
4129 *
4130 * This only works on llvm::BranchInst instructions.
4131 *
4132 * @see llvm::BranchInst::getCondition
4133 */
4135
4136/**
4137 * Set the condition of a branch instruction.
4138 *
4139 * This only works on llvm::BranchInst instructions.
4140 *
4141 * @see llvm::BranchInst::setCondition
4142 */
4144
4145/**
4146 * Obtain the default destination basic block of a switch instruction.
4147 *
4148 * This only works on llvm::SwitchInst instructions.
4149 *
4150 * @see llvm::SwitchInst::getDefaultDest()
4151 */
4153
4154/**
4155 * @}
4156 */
4157
4158/**
4159 * @defgroup LLVMCCoreValueInstructionAlloca Allocas
4160 *
4161 * Functions in this group only apply to instructions that map to
4162 * llvm::AllocaInst instances.
4163 *
4164 * @{
4165 */
4166
4167/**
4168 * Obtain the type that is being allocated by the alloca instruction.
4169 */
4171
4172/**
4173 * @}
4174 */
4175
4176/**
4177 * @defgroup LLVMCCoreValueInstructionGetElementPointer GEPs
4178 *
4179 * Functions in this group only apply to instructions that map to
4180 * llvm::GetElementPtrInst instances.
4181 *
4182 * @{
4183 */
4184
4185/**
4186 * Check whether the given GEP operator is inbounds.
4187 */
4189
4190/**
4191 * Set the given GEP instruction to be inbounds or not.
4192 */
4194
4195/**
4196 * Get the source element type of the given GEP operator.
4197 */
4199
4200/**
4201 * Get the no-wrap related flags for the given GEP instruction.
4202 *
4203 * @see llvm::GetElementPtrInst::getNoWrapFlags
4204 */
4206
4207/**
4208 * Set the no-wrap related flags for the given GEP instruction.
4209 *
4210 * @see llvm::GetElementPtrInst::setNoWrapFlags
4211 */
4213 LLVMGEPNoWrapFlags NoWrapFlags);
4214
4215/**
4216 * @}
4217 */
4218
4219/**
4220 * @defgroup LLVMCCoreValueInstructionPHINode PHI Nodes
4221 *
4222 * Functions in this group only apply to instructions that map to
4223 * llvm::PHINode instances.
4224 *
4225 * @{
4226 */
4227
4228/**
4229 * Add an incoming value to the end of a PHI list.
4230 */
4232 LLVMValueRef *IncomingValues,
4233 LLVMBasicBlockRef *IncomingBlocks,
4234 unsigned Count);
4235
4236/**
4237 * Obtain the number of incoming basic blocks to a PHI node.
4238 */
4239LLVM_C_ABI unsigned LLVMCountIncoming(LLVMValueRef PhiNode);
4240
4241/**
4242 * Obtain an incoming value to a PHI node as an LLVMValueRef.
4243 */
4245 unsigned Index);
4246
4247/**
4248 * Obtain an incoming value to a PHI node as an LLVMBasicBlockRef.
4249 */
4251 unsigned Index);
4252
4253/**
4254 * @}
4255 */
4256
4257/**
4258 * @defgroup LLVMCCoreValueInstructionExtractValue ExtractValue
4259 * @defgroup LLVMCCoreValueInstructionInsertValue InsertValue
4260 *
4261 * Functions in this group only apply to instructions that map to
4262 * llvm::ExtractValue and llvm::InsertValue instances.
4263 *
4264 * @{
4265 */
4266
4267/**
4268 * Obtain the number of indices.
4269 * NB: This also works on GEP operators.
4270 */
4272
4273/**
4274 * Obtain the indices as an array.
4275 */
4276LLVM_C_ABI const unsigned *LLVMGetIndices(LLVMValueRef Inst);
4277
4278/**
4279 * @}
4280 */
4281
4282/**
4283 * @}
4284 */
4285
4286/**
4287 * @}
4288 */
4289
4290/**
4291 * @defgroup LLVMCCoreInstructionBuilder Instruction Builders
4292 *
4293 * An instruction builder represents a point within a basic block and is
4294 * the exclusive means of building instructions using the C interface.
4295 *
4296 * @{
4297 */
4298
4301/**
4302 * Set the builder position before Instr but after any attached debug records,
4303 * or if Instr is null set the position to the end of Block.
4304 */
4306 LLVMBasicBlockRef Block,
4307 LLVMValueRef Instr);
4308/**
4309 * Set the builder position before Instr and any attached debug records,
4310 * or if Instr is null set the position to the end of Block.
4311 */
4313 LLVMBasicBlockRef Block,
4314 LLVMValueRef Inst);
4315/**
4316 * Set the builder position before Instr but after any attached debug records.
4317 */
4319 LLVMValueRef Instr);
4320/**
4321 * Set the builder position before Instr and any attached debug records.
4322 */
4323LLVM_C_ABI void
4325 LLVMValueRef Instr);
4327 LLVMBasicBlockRef Block);
4331 LLVMValueRef Instr);
4333 LLVMValueRef Instr,
4334 const char *Name);
4336
4337/* Metadata */
4338
4339/**
4340 * Get location information used by debugging information.
4341 *
4342 * @see llvm::IRBuilder::getCurrentDebugLocation()
4343 */
4345
4346/**
4347 * Set location information used by debugging information.
4348 *
4349 * To clear the location metadata of the given instruction, pass NULL to \p Loc.
4350 *
4351 * @see llvm::IRBuilder::SetCurrentDebugLocation()
4352 */
4354 LLVMMetadataRef Loc);
4355
4356/**
4357 * Attempts to set the debug location for the given instruction using the
4358 * current debug location for the given builder. If the builder has no current
4359 * debug location, this function is a no-op.
4360 *
4361 * @deprecated LLVMSetInstDebugLocation is deprecated in favor of the more general
4362 * LLVMAddMetadataToInst.
4363 *
4364 * @see llvm::IRBuilder::SetInstDebugLocation()
4365 */
4367 LLVMValueRef Inst);
4368
4369/**
4370 * Adds the metadata registered with the given builder to the given instruction.
4371 *
4372 * @see llvm::IRBuilder::AddMetadataToInst()
4373 */
4375 LLVMValueRef Inst);
4376
4377/**
4378 * Get the dafult floating-point math metadata for a given builder.
4379 *
4380 * @see llvm::IRBuilder::getDefaultFPMathTag()
4381 */
4384
4385/**
4386 * Set the default floating-point math metadata for the given builder.
4387 *
4388 * To clear the metadata, pass NULL to \p FPMathTag.
4389 *
4390 * @see llvm::IRBuilder::setDefaultFPMathTag()
4391 */
4393 LLVMMetadataRef FPMathTag);
4394
4395/**
4396 * Obtain the context to which this builder is associated.
4397 *
4398 * @see llvm::IRBuilder::getContext()
4399 */
4401
4402/**
4403 * Deprecated: Passing the NULL location will crash.
4404 * Use LLVMGetCurrentDebugLocation2 instead.
4405 */
4407 LLVMValueRef L);
4408/**
4409 * Deprecated: Returning the NULL location will crash.
4410 * Use LLVMGetCurrentDebugLocation2 instead.
4411 */
4413
4414/* Terminators */
4418 LLVMValueRef *RetVals,
4419 unsigned N);
4422 LLVMBasicBlockRef Then,
4423 LLVMBasicBlockRef Else);
4425 LLVMBasicBlockRef Else,
4426 unsigned NumCases);
4428 unsigned NumDests);
4431 LLVMBasicBlockRef DefaultDest, LLVMBasicBlockRef *IndirectDests,
4432 unsigned NumIndirectDests, LLVMValueRef *Args, unsigned NumArgs,
4433 LLVMOperandBundleRef *Bundles, unsigned NumBundles, const char *Name);
4435 LLVMValueRef Fn, LLVMValueRef *Args,
4436 unsigned NumArgs,
4437 LLVMBasicBlockRef Then,
4438 LLVMBasicBlockRef Catch,
4439 const char *Name);
4442 unsigned NumArgs, LLVMBasicBlockRef Then, LLVMBasicBlockRef Catch,
4443 LLVMOperandBundleRef *Bundles, unsigned NumBundles, const char *Name);
4445
4446/* Exception Handling */
4449 LLVMValueRef PersFn,
4450 unsigned NumClauses,
4451 const char *Name);
4453 LLVMValueRef CatchPad,
4456 LLVMValueRef CatchPad,
4459 LLVMValueRef ParentPad,
4460 LLVMValueRef *Args, unsigned NumArgs,
4461 const char *Name);
4463 LLVMValueRef ParentPad,
4464 LLVMValueRef *Args,
4465 unsigned NumArgs, const char *Name);
4467 LLVMValueRef ParentPad,
4468 LLVMBasicBlockRef UnwindBB,
4469 unsigned NumHandlers,
4470 const char *Name);
4471
4472/* Add a case to the switch instruction */
4474 LLVMBasicBlockRef Dest);
4475
4476/* Add a destination to the indirectbr instruction */
4478 LLVMBasicBlockRef Dest);
4479
4480/* Get the number of clauses on the landingpad instruction */
4481LLVM_C_ABI unsigned LLVMGetNumClauses(LLVMValueRef LandingPad);
4482
4483/* Get the value of the clause at index Idx on the landingpad instruction */
4484LLVM_C_ABI LLVMValueRef LLVMGetClause(LLVMValueRef LandingPad, unsigned Idx);
4485
4486/* Add a catch or filter clause to the landingpad instruction */
4487LLVM_C_ABI void LLVMAddClause(LLVMValueRef LandingPad, LLVMValueRef ClauseVal);
4488
4489/* Get the 'cleanup' flag in the landingpad instruction */
4491
4492/* Set the 'cleanup' flag in the landingpad instruction */
4493LLVM_C_ABI void LLVMSetCleanup(LLVMValueRef LandingPad, LLVMBool Val);
4494
4495/* Add a destination to the catchswitch instruction */
4496LLVM_C_ABI void LLVMAddHandler(LLVMValueRef CatchSwitch,
4497 LLVMBasicBlockRef Dest);
4498
4499/* Get the number of handlers on the catchswitch instruction */
4500LLVM_C_ABI unsigned LLVMGetNumHandlers(LLVMValueRef CatchSwitch);
4501
4502/**
4503 * Obtain the basic blocks acting as handlers for a catchswitch instruction.
4504 *
4505 * The Handlers parameter should point to a pre-allocated array of
4506 * LLVMBasicBlockRefs at least LLVMGetNumHandlers() large. On return, the
4507 * first LLVMGetNumHandlers() entries in the array will be populated
4508 * with LLVMBasicBlockRef instances.
4509 *
4510 * @param CatchSwitch The catchswitch instruction to operate on.
4511 * @param Handlers Memory address of an array to be filled with basic blocks.
4512 */
4513LLVM_C_ABI void LLVMGetHandlers(LLVMValueRef CatchSwitch,
4514 LLVMBasicBlockRef *Handlers);
4515
4516/* Funclets */
4517
4518/* Get the number of funcletpad arguments. */
4520
4521/* Set a funcletpad argument at the given index. */
4522LLVM_C_ABI void LLVMSetArgOperand(LLVMValueRef Funclet, unsigned i,
4523 LLVMValueRef value);
4524
4525/**
4526 * Get the parent catchswitch instruction of a catchpad instruction.
4527 *
4528 * This only works on llvm::CatchPadInst instructions.
4529 *
4530 * @see llvm::CatchPadInst::getCatchSwitch()
4531 */
4533
4534/**
4535 * Set the parent catchswitch instruction of a catchpad instruction.
4536 *
4537 * This only works on llvm::CatchPadInst instructions.
4538 *
4539 * @see llvm::CatchPadInst::setCatchSwitch()
4540 */
4542 LLVMValueRef CatchSwitch);
4543
4544/* Arithmetic */
4546 LLVMValueRef RHS, const char *Name);
4548 LLVMValueRef RHS, const char *Name);
4550 LLVMValueRef RHS, const char *Name);
4552 LLVMValueRef RHS, const char *Name);
4554 LLVMValueRef RHS, const char *Name);
4556 LLVMValueRef RHS, const char *Name);
4558 LLVMValueRef RHS, const char *Name);
4560 LLVMValueRef RHS, const char *Name);
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);
4599 const char *Name);
4601 const char *Name);
4603 const char *Name);
4606 const char *Name),
4607 "Use LLVMBuildNeg + LLVMSetNUW instead.");
4609 const char *Name);
4611 const char *Name);
4612
4614LLVM_C_ABI void LLVMSetNUW(LLVMValueRef ArithInst, LLVMBool HasNUW);
4616LLVM_C_ABI void LLVMSetNSW(LLVMValueRef ArithInst, LLVMBool HasNSW);
4618LLVM_C_ABI void LLVMSetExact(LLVMValueRef DivOrShrInst, LLVMBool IsExact);
4619
4620/**
4621 * Gets if the instruction has the non-negative flag set.
4622 * Only valid for zext instructions.
4623 */
4625/**
4626 * Sets the non-negative flag for the instruction.
4627 * Only valid for zext instructions.
4628 */
4629LLVM_C_ABI void LLVMSetNNeg(LLVMValueRef NonNegInst, LLVMBool IsNonNeg);
4630
4631/**
4632 * Get the flags for which fast-math-style optimizations are allowed for this
4633 * value.
4634 *
4635 * Only valid on floating point instructions.
4636 * @see LLVMCanValueUseFastMathFlags
4637 */
4639
4640/**
4641 * Sets the flags for which fast-math-style optimizations are allowed for this
4642 * value.
4643 *
4644 * Only valid on floating point instructions.
4645 * @see LLVMCanValueUseFastMathFlags
4646 */
4648 LLVMFastMathFlags FMF);
4649
4650/**
4651 * Check if a given value can potentially have fast math flags.
4652 *
4653 * Will return true for floating point arithmetic instructions, and for select,
4654 * phi, and call instructions whose type is a floating point type, or a vector
4655 * or array thereof. See https://llvm.org/docs/LangRef.html#fast-math-flags
4656 */
4658
4659/**
4660 * Gets whether the instruction has the disjoint flag set.
4661 * Only valid for or instructions.
4662 */
4664/**
4665 * Sets the disjoint flag for the instruction.
4666 * Only valid for or instructions.
4667 */
4668LLVM_C_ABI void LLVMSetIsDisjoint(LLVMValueRef Inst, LLVMBool IsDisjoint);
4669
4670/* Memory */
4672 const char *Name);
4674 LLVMValueRef Val,
4675 const char *Name);
4676
4677/**
4678 * Creates and inserts a memset to the specified pointer and the
4679 * specified value.
4680 *
4681 * @see llvm::IRRBuilder::CreateMemSet()
4682 */
4684 LLVMValueRef Val, LLVMValueRef Len,
4685 unsigned Align);
4686/**
4687 * Creates and inserts a memcpy between the specified pointers.
4688 *
4689 * @see llvm::IRRBuilder::CreateMemCpy()
4690 */
4692 unsigned DstAlign, LLVMValueRef Src,
4693 unsigned SrcAlign, LLVMValueRef Size);
4694/**
4695 * Creates and inserts a memmove between the specified pointers.
4696 *
4697 * @see llvm::IRRBuilder::CreateMemMove()
4698 */
4700 unsigned DstAlign, LLVMValueRef Src,
4701 unsigned SrcAlign, LLVMValueRef Size);
4702
4704 const char *Name);
4706 LLVMValueRef Val,
4707 const char *Name);
4710 LLVMValueRef PointerVal,
4711 const char *Name);
4715 LLVMValueRef Pointer,
4716 LLVMValueRef *Indices,
4717 unsigned NumIndices, const char *Name);
4719 LLVMValueRef Pointer,
4720 LLVMValueRef *Indices,
4721 unsigned NumIndices,
4722 const char *Name);
4723/**
4724 * Creates a GetElementPtr instruction. Similar to LLVMBuildGEP2, but allows
4725 * specifying the no-wrap flags.
4726 *
4727 * @see llvm::IRBuilder::CreateGEP()
4728 */
4731 LLVMValueRef *Indices, unsigned NumIndices, const char *Name,
4732 LLVMGEPNoWrapFlags NoWrapFlags);
4734 LLVMValueRef Pointer, unsigned Idx,
4735 const char *Name);
4737 const char *Name);
4738/**
4739 * Deprecated: Use LLVMBuildGlobalString instead, which has identical behavior.
4740 */
4742 const char *Str,
4743 const char *Name);
4745LLVM_C_ABI void LLVMSetVolatile(LLVMValueRef MemoryAccessInst,
4746 LLVMBool IsVolatile);
4748LLVM_C_ABI void LLVMSetWeak(LLVMValueRef CmpXchgInst, LLVMBool IsWeak);
4750LLVM_C_ABI void LLVMSetOrdering(LLVMValueRef MemoryAccessInst,
4751 LLVMAtomicOrdering Ordering);
4754 LLVMAtomicRMWBinOp BinOp);
4755
4756/* Casts */
4758 LLVMTypeRef DestTy, const char *Name);
4760 LLVMTypeRef DestTy, const char *Name);
4762 LLVMTypeRef DestTy, const char *Name);
4764 LLVMTypeRef DestTy, const char *Name);
4766 LLVMTypeRef DestTy, const char *Name);
4768 LLVMTypeRef DestTy, const char *Name);
4770 LLVMTypeRef DestTy, const char *Name);
4772 LLVMTypeRef DestTy, const char *Name);
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,
4783 const char *Name);
4785 LLVMTypeRef DestTy,
4786 const char *Name);
4788 LLVMTypeRef DestTy,
4789 const char *Name);
4791 LLVMValueRef Val,
4792 LLVMTypeRef DestTy,
4793 const char *Name);
4795 LLVMValueRef Val, LLVMTypeRef DestTy,
4796 const char *Name);
4798 LLVMTypeRef DestTy,
4799 const char *Name);
4801 LLVMTypeRef DestTy, LLVMBool IsSigned,
4802 const char *Name);
4804 LLVMTypeRef DestTy, const char *Name);
4805
4806/** Deprecated: This cast is always signed. Use LLVMBuildIntCast2 instead. */
4808 LLVMValueRef Val, /*Signed cast!*/
4809 LLVMTypeRef DestTy, const char *Name);
4810
4812 LLVMTypeRef DestTy,
4813 LLVMBool DestIsSigned);
4814
4815/* Comparisons */
4818 const char *Name);
4821 const char *Name);
4822
4823/* Miscellaneous instructions */
4825 const char *Name);
4827 LLVMValueRef Fn, LLVMValueRef *Args,
4828 unsigned NumArgs, const char *Name);
4831 unsigned NumArgs, LLVMOperandBundleRef *Bundles, unsigned NumBundles,
4832 const char *Name);
4834 LLVMValueRef Then, LLVMValueRef Else,
4835 const char *Name);
4837 LLVMTypeRef Ty, const char *Name);
4839 LLVMValueRef VecVal,
4840 LLVMValueRef Index,
4841 const char *Name);
4843 LLVMValueRef VecVal,
4844 LLVMValueRef EltVal,
4845 LLVMValueRef Index,
4846 const char *Name);
4848 LLVMValueRef V2,
4849 LLVMValueRef Mask,
4850 const char *Name);
4852 LLVMValueRef AggVal,
4853 unsigned Index, const char *Name);
4855 LLVMValueRef AggVal,
4856 LLVMValueRef EltVal,
4857 unsigned Index, const char *Name);
4859 const char *Name);
4860
4862 const char *Name);
4864 const char *Name);
4867 const char *Name);
4869 LLVMAtomicOrdering ordering,
4870 LLVMBool singleThread, const char *Name);
4872 LLVMAtomicOrdering ordering,
4873 unsigned SSID,
4874 const char *Name);
4877 LLVMValueRef PTR, LLVMValueRef Val,
4878 LLVMAtomicOrdering ordering,
4879 LLVMBool singleThread);
4882 LLVMAtomicOrdering ordering, unsigned SSID);
4885 LLVMAtomicOrdering SuccessOrdering, LLVMAtomicOrdering FailureOrdering,
4889 LLVMAtomicOrdering SuccessOrdering, LLVMAtomicOrdering FailureOrdering,
4890 unsigned SSID);
4891
4892/**
4893 * Get the number of elements in the mask of a ShuffleVector instruction.
4894 */
4895LLVM_C_ABI unsigned LLVMGetNumMaskElements(LLVMValueRef ShuffleVectorInst);
4896
4897/**
4898 * \returns a constant that specifies that the result of a \c ShuffleVectorInst
4899 * is undefined.
4900 */
4902
4903/**
4904 * Get the mask value at position Elt in the mask of a ShuffleVector
4905 * instruction.
4906 *
4907 * \Returns the result of \c LLVMGetUndefMaskElem() if the mask value is
4908 * poison at that position.
4909 */
4910LLVM_C_ABI int LLVMGetMaskValue(LLVMValueRef ShuffleVectorInst, unsigned Elt);
4911
4915
4916/**
4917 * Returns whether an instruction is an atomic instruction, e.g., atomicrmw,
4918 * cmpxchg, fence, or loads and stores with atomic ordering.
4919 */
4921
4922/**
4923 * Returns the synchronization scope ID of an atomic instruction.
4924 */
4926
4927/**
4928 * Sets the synchronization scope ID of an atomic instruction.
4929 */
4931 unsigned SSID);
4932
4936 LLVMAtomicOrdering Ordering);
4940 LLVMAtomicOrdering Ordering);
4941
4942/**
4943 * @}
4944 */
4945
4946/**
4947 * @defgroup LLVMCCoreModuleProvider Module Providers
4948 *
4949 * @{
4950 */
4951
4952/**
4953 * Changes the type of M so it can be passed to FunctionPassManagers and the
4954 * JIT. They take ModuleProviders for historical reasons.
4955 */
4958
4959/**
4960 * Destroys the module M.
4961 */
4963
4964/**
4965 * @}
4966 */
4967
4968/**
4969 * @defgroup LLVMCCoreMemoryBuffers Memory Buffers
4970 *
4971 * @{
4972 */
4973
4975 const char *Path, LLVMMemoryBufferRef *OutMemBuf, char **OutMessage);
4977 LLVMMemoryBufferRef *OutMemBuf, char **OutMessage);
4979 const char *InputData, size_t InputDataLength, const char *BufferName,
4980 LLVMBool RequiresNullTerminator);
4982 const char *InputData, size_t InputDataLength, const char *BufferName);
4986
4987/**
4988 * @}
4989 */
4990
4991/**
4992 * @defgroup LLVMCCorePassManagers Pass Managers
4993 * @ingroup LLVMCCore
4994 *
4995 * @{
4996 */
4997
4998/** Constructs a new whole-module pass pipeline. This type of pipeline is
4999 suitable for link-time optimization and whole-module transformations.
5000 @see llvm::PassManager::PassManager */
5002
5003/** Constructs a new function-by-function pass pipeline over the module
5004 provider. It does not take ownership of the module provider. This type of
5005 pipeline is suitable for code generation and JIT compilation tasks.
5006 @see llvm::FunctionPassManager::FunctionPassManager */
5009
5010/** Deprecated: Use LLVMCreateFunctionPassManagerForModule instead. */
5013
5014/** Initializes, executes on the provided module, and finalizes all of the
5015 passes scheduled in the pass manager. Returns 1 if any of the passes
5016 modified the module, 0 otherwise.
5017 @see llvm::PassManager::run(Module&) */
5019
5020/** Initializes all of the function passes scheduled in the function pass
5021 manager. Returns 1 if any of the passes modified the module, 0 otherwise.
5022 @see llvm::FunctionPassManager::doInitialization */
5024
5025/** Executes all of the function passes scheduled in the function pass manager
5026 on the provided function. Returns 1 if any of the passes modified the
5027 function, false otherwise.
5028 @see llvm::FunctionPassManager::run(Function&) */
5030 LLVMValueRef F);
5031
5032/** Finalizes all of the function passes scheduled in the function pass
5033 manager. Returns 1 if any of the passes modified the module, 0 otherwise.
5034 @see llvm::FunctionPassManager::doFinalization */
5036
5037/** Frees the memory of a pass pipeline. For function pipelines, does not free
5038 the module provider.
5039 @see llvm::PassManagerBase::~PassManagerBase. */
5041
5042/**
5043 * @}
5044 */
5045
5046/**
5047 * @defgroup LLVMCCoreThreading Threading
5048 *
5049 * Handle the structures needed to make LLVM safe for multithreading.
5050 *
5051 * @{
5052 */
5053
5054/** Deprecated: Multi-threading can only be enabled/disabled with the compile
5055 time define LLVM_ENABLE_THREADS. This function always returns
5056 LLVMIsMultithreaded(). */
5058
5059/** Deprecated: Multi-threading can only be enabled/disabled with the compile
5060 time define LLVM_ENABLE_THREADS. */
5062
5063/** Check whether LLVM is executing in thread-safe mode or not.
5064 @see llvm::llvm_is_multithreaded */
5066
5067/**
5068 * @}
5069 */
5070
5071/**
5072 * @}
5073 */
5074
5075/**
5076 * @}
5077 */
5078
5080
5081#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:3779
LLVMValueRef LLVMConstNUWNeg(LLVMValueRef ConstantVal)
Definition Core.cpp:1775
static cl::opt< bool > SingleThread("licm-force-thread-model-single", cl::Hidden, cl::init(false), cl::desc("Force thread model single in LICM pass"))
#define F(x, y, z)
Definition MD5.cpp: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:3409
LLVM_C_ABI LLVMValueRef LLVMBuildMul(LLVMBuilderRef, LLVMValueRef LHS, LLVMValueRef RHS, const char *Name)
Definition Core.cpp:3673
LLVM_C_ABI LLVMValueRef LLVMBuildRetVoid(LLVMBuilderRef)
Definition Core.cpp:3401
LLVM_C_ABI LLVMValueRef LLVMBuildSub(LLVMBuilderRef, LLVMValueRef LHS, LLVMValueRef RHS, const char *Name)
Definition Core.cpp:3653
LLVM_C_ABI LLVMValueRef LLVMBuildNUWMul(LLVMBuilderRef, LLVMValueRef LHS, LLVMValueRef RHS, const char *Name)
Definition Core.cpp:3683
LLVM_C_ABI LLVMBool LLVMGetWeak(LLVMValueRef CmpXchgInst)
Definition Core.cpp:4111
LLVM_C_ABI LLVMValueRef LLVMBuildCast(LLVMBuilderRef B, LLVMOpcode Op, LLVMValueRef Val, LLVMTypeRef DestTy, const char *Name)
Definition Core.cpp:4239
LLVM_C_ABI LLVMValueRef LLVMBuildIsNull(LLVMBuilderRef, LLVMValueRef Val, const char *Name)
Definition Core.cpp:4368
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:4062
LLVM_C_ABI LLVMValueRef LLVMBuildAdd(LLVMBuilderRef, LLVMValueRef LHS, LLVMValueRef RHS, const char *Name)
Definition Core.cpp:3633
LLVM_C_ABI LLVMBuilderRef LLVMCreateBuilder(void)
Definition Core.cpp:3289
LLVM_C_ABI void LLVMSetWeak(LLVMValueRef CmpXchgInst, LLVMBool IsWeak)
Definition Core.cpp:4115
LLVM_C_ABI LLVMValueRef LLVMBuildOr(LLVMBuilderRef, LLVMValueRef LHS, LLVMValueRef RHS, const char *Name)
Definition Core.cpp:3753
LLVM_C_ABI LLVMValueRef LLVMBuildBitCast(LLVMBuilderRef, LLVMValueRef Val, LLVMTypeRef DestTy, const char *Name)
Definition Core.cpp:4211
LLVM_C_ABI LLVMValueRef LLVMBuildExactUDiv(LLVMBuilderRef, LLVMValueRef LHS, LLVMValueRef RHS, const char *Name)
Definition Core.cpp:3698
LLVM_C_ABI LLVMValueRef LLVMBuildGEP2(LLVMBuilderRef B, LLVMTypeRef Ty, LLVMValueRef Pointer, LLVMValueRef *Indices, unsigned NumIndices, const char *Name)
Definition Core.cpp:4047
LLVM_C_ABI LLVMValueRef LLVMBuildNSWSub(LLVMBuilderRef, LLVMValueRef LHS, LLVMValueRef RHS, const char *Name)
Definition Core.cpp:3658
LLVM_C_ABI void LLVMPositionBuilderBeforeInstrAndDbgRecords(LLVMBuilderRef Builder, LLVMValueRef Instr)
Set the builder position before Instr and any attached debug records.
Definition Core.cpp:3318
LLVM_C_ABI LLVMValueRef LLVMBuildIsNotNull(LLVMBuilderRef, LLVMValueRef Val, const char *Name)
Definition Core.cpp:4373
LLVM_C_ABI void LLVMDisposeBuilder(LLVMBuilderRef Builder)
Definition Core.cpp:3346
LLVM_C_ABI void LLVMClearInsertionPosition(LLVMBuilderRef Builder)
Definition Core.cpp:3333
LLVM_C_ABI LLVMValueRef LLVMBuildLandingPad(LLVMBuilderRef B, LLVMTypeRef Ty, LLVMValueRef PersFn, unsigned NumClauses, const char *Name)
Definition Core.cpp:3475
LLVM_C_ABI void LLVMSetIsDisjoint(LLVMValueRef Inst, LLVMBool IsDisjoint)
Sets the disjoint flag for the instruction.
Definition Core.cpp:3856
LLVM_C_ABI LLVMBool LLVMIsAtomicSingleThread(LLVMValueRef AtomicInst)
Definition Core.cpp:4449
LLVM_C_ABI LLVMValueRef LLVMBuildResume(LLVMBuilderRef B, LLVMValueRef Exn)
Definition Core.cpp:3505
LLVM_C_ABI void LLVMSetAtomicRMWBinOp(LLVMValueRef AtomicRMWInst, LLVMAtomicRMWBinOp BinOp)
Definition Core.cpp:4150
LLVM_C_ABI LLVMValueRef LLVMBuildFDiv(LLVMBuilderRef, LLVMValueRef LHS, LLVMValueRef RHS, const char *Name)
Definition Core.cpp:3713
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:3461
LLVM_C_ABI LLVMValueRef LLVMBuildXor(LLVMBuilderRef, LLVMValueRef LHS, LLVMValueRef RHS, const char *Name)
Definition Core.cpp:3758
LLVM_C_ABI LLVMBool LLVMGetExact(LLVMValueRef DivOrShrInst)
Definition Core.cpp:3815
LLVM_C_ABI LLVMValueRef LLVMBuildAddrSpaceCast(LLVMBuilderRef, LLVMValueRef Val, LLVMTypeRef DestTy, const char *Name)
Definition Core.cpp:4216
LLVM_C_ABI unsigned LLVMGetNumMaskElements(LLVMValueRef ShuffleVectorInst)
Get the number of elements in the mask of a ShuffleVector instruction.
Definition Core.cpp:4431
LLVM_C_ABI void LLVMInsertIntoBuilder(LLVMBuilderRef Builder, LLVMValueRef Instr)
Definition Core.cpp:3337
LLVM_C_ABI LLVMValueRef LLVMBuildCleanupRet(LLVMBuilderRef B, LLVMValueRef CatchPad, LLVMBasicBlockRef BB)
Definition Core.cpp:3526
LLVM_C_ABI LLVMValueRef LLVMBuildFPToSI(LLVMBuilderRef, LLVMValueRef Val, LLVMTypeRef DestTy, const char *Name)
Definition Core.cpp:4176
LLVM_C_ABI void LLVMGetHandlers(LLVMValueRef CatchSwitch, LLVMBasicBlockRef *Handlers)
Obtain the basic blocks acting as handlers for a catchswitch instruction.
Definition Core.cpp:3573
LLVM_C_ABI LLVMValueRef LLVMBuildTrunc(LLVMBuilderRef, LLVMValueRef Val, LLVMTypeRef DestTy, const char *Name)
Definition Core.cpp:4156
LLVM_C_ABI LLVMValueRef LLVMGetArgOperand(LLVMValueRef Funclet, unsigned i)
Definition Core.cpp:3590
LLVM_C_ABI LLVMValueRef LLVMBuildAnd(LLVMBuilderRef, LLVMValueRef LHS, LLVMValueRef RHS, const char *Name)
Definition Core.cpp:3748
LLVM_C_ABI unsigned LLVMGetNumHandlers(LLVMValueRef CatchSwitch)
Definition Core.cpp:3569
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:3433
LLVM_C_ABI LLVMBasicBlockRef LLVMGetInsertBlock(LLVMBuilderRef Builder)
Definition Core.cpp:3329
LLVM_C_ABI LLVMValueRef LLVMBuildSDiv(LLVMBuilderRef, LLVMValueRef LHS, LLVMValueRef RHS, const char *Name)
Definition Core.cpp:3703
LLVM_C_ABI LLVMValueRef LLVMBuildSExtOrBitCast(LLVMBuilderRef, LLVMValueRef Val, LLVMTypeRef DestTy, const char *Name)
Definition Core.cpp:4227
LLVM_C_ABI LLVMValueRef LLVMBuildCall2(LLVMBuilderRef, LLVMTypeRef, LLVMValueRef Fn, LLVMValueRef *Args, unsigned NumArgs, const char *Name)
Definition Core.cpp:4296
LLVM_C_ABI void LLVMSetNSW(LLVMValueRef ArithInst, LLVMBool HasNSW)
Definition Core.cpp:3810
LLVM_C_ABI LLVMMetadataRef LLVMGetCurrentDebugLocation2(LLVMBuilderRef Builder)
Get location information used by debugging information.
Definition Core.cpp:3352
LLVM_C_ABI LLVMValueRef LLVMBuildUDiv(LLVMBuilderRef, LLVMValueRef LHS, LLVMValueRef RHS, const char *Name)
Definition Core.cpp:3693
LLVM_C_ABI LLVMValueRef LLVMBuildSelect(LLVMBuilderRef, LLVMValueRef If, LLVMValueRef Then, LLVMValueRef Else, const char *Name)
Definition Core.cpp:4319
LLVM_C_ABI void LLVMPositionBuilderBefore(LLVMBuilderRef Builder, LLVMValueRef Instr)
Set the builder position before Instr but after any attached debug records.
Definition Core.cpp:3313
LLVM_C_ABI LLVMBool LLVMCanValueUseFastMathFlags(LLVMValueRef Inst)
Check if a given value can potentially have fast math flags.
Definition Core.cpp:3846
LLVM_C_ABI void LLVMSetArgOperand(LLVMValueRef Funclet, unsigned i, LLVMValueRef value)
Definition Core.cpp:3594
LLVM_C_ABI LLVMValueRef LLVMBuildCondBr(LLVMBuilderRef, LLVMValueRef If, LLVMBasicBlockRef Then, LLVMBasicBlockRef Else)
Definition Core.cpp:3418
LLVM_C_ABI LLVMBool LLVMGetNUW(LLVMValueRef ArithInst)
Definition Core.cpp:3795
LLVM_C_ABI LLVMOpcode LLVMGetCastOpcode(LLVMValueRef Src, LLVMBool SrcIsSigned, LLVMTypeRef DestTy, LLVMBool DestIsSigned)
Definition Core.cpp:4268
LLVM_C_ABI void LLVMInsertIntoBuilderWithName(LLVMBuilderRef Builder, LLVMValueRef Instr, const char *Name)
Definition Core.cpp:3341
LLVM_C_ABI LLVMValueRef LLVMBuildSRem(LLVMBuilderRef, LLVMValueRef LHS, LLVMValueRef RHS, const char *Name)
Definition Core.cpp:3723
LLVM_C_ABI LLVMValueRef LLVMBuildCleanupPad(LLVMBuilderRef B, LLVMValueRef ParentPad, LLVMValueRef *Args, unsigned NumArgs, const char *Name)
Definition Core.cpp:3494
LLVM_C_ABI LLVMValueRef LLVMBuildIntCast(LLVMBuilderRef, LLVMValueRef Val, LLVMTypeRef DestTy, const char *Name)
Deprecated: This cast is always signed.
Definition Core.cpp:4257
LLVM_C_ABI LLVMValueRef LLVMGetCurrentDebugLocation(LLVMBuilderRef Builder)
Deprecated: Returning the NULL location will crash.
Definition Core.cpp:3369
LLVM_C_ABI LLVMValueRef LLVMBuildExtractElement(LLVMBuilderRef, LLVMValueRef VecVal, LLVMValueRef Index, const char *Name)
Definition Core.cpp:4331
LLVM_C_ABI LLVMValueRef LLVMBuildShl(LLVMBuilderRef, LLVMValueRef LHS, LLVMValueRef RHS, const char *Name)
Definition Core.cpp:3733
LLVM_C_ABI LLVMBuilderRef LLVMCreateBuilderInContext(LLVMContextRef C)
Definition Core.cpp:3285
LLVM_C_ABI LLVMValueRef LLVMBuildCatchRet(LLVMBuilderRef B, LLVMValueRef CatchPad, LLVMBasicBlockRef BB)
Definition Core.cpp:3520
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:3897
LLVM_C_ABI LLVMAtomicOrdering LLVMGetOrdering(LLVMValueRef MemoryAccessInst)
Definition Core.cpp:4119
LLVM_C_ABI LLVMValueRef LLVMBuildStructGEP2(LLVMBuilderRef B, LLVMTypeRef Ty, LLVMValueRef Pointer, unsigned Idx, const char *Name)
Definition Core.cpp:4072
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:4437
LLVM_C_ABI void LLVMAddCase(LLVMValueRef Switch, LLVMValueRef OnVal, LLVMBasicBlockRef Dest)
Definition Core.cpp:3536
LLVM_C_ABI LLVMValueRef LLVMBuildBr(LLVMBuilderRef, LLVMBasicBlockRef Dest)
Definition Core.cpp:3414
LLVM_C_ABI LLVMValueRef LLVMBuildInsertElement(LLVMBuilderRef, LLVMValueRef VecVal, LLVMValueRef EltVal, LLVMValueRef Index, const char *Name)
Definition Core.cpp:4337
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:3306
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:3841
LLVM_C_ABI LLVMValueRef LLVMBuildIntCast2(LLVMBuilderRef, LLVMValueRef Val, LLVMTypeRef DestTy, LLVMBool IsSigned, const char *Name)
Definition Core.cpp:4250
LLVM_C_ABI LLVMValueRef LLVMBuildNUWSub(LLVMBuilderRef, LLVMValueRef LHS, LLVMValueRef RHS, const char *Name)
Definition Core.cpp:3663
LLVM_C_ABI LLVMValueRef LLVMBuildFAdd(LLVMBuilderRef, LLVMValueRef LHS, LLVMValueRef RHS, const char *Name)
Definition Core.cpp:3648
LLVM_C_ABI LLVMValueRef LLVMBuildCatchPad(LLVMBuilderRef B, LLVMValueRef ParentPad, LLVMValueRef *Args, unsigned NumArgs, const char *Name)
Definition Core.cpp:3487
LLVM_C_ABI LLVMValueRef LLVMBuildCallWithOperandBundles(LLVMBuilderRef, LLVMTypeRef, LLVMValueRef Fn, LLVMValueRef *Args, unsigned NumArgs, LLVMOperandBundleRef *Bundles, unsigned NumBundles, const char *Name)
Definition Core.cpp:4305
LLVM_C_ABI LLVMBool LLVMIsCleanup(LLVMValueRef LandingPad)
Definition Core.cpp:3557
LLVM_C_ABI LLVMValueRef LLVMBuildZExtOrBitCast(LLVMBuilderRef, LLVMValueRef Val, LLVMTypeRef DestTy, const char *Name)
Definition Core.cpp:4221
LLVM_C_ABI LLVMValueRef LLVMBuildFPCast(LLVMBuilderRef, LLVMValueRef Val, LLVMTypeRef DestTy, const char *Name)
Definition Core.cpp:4263
LLVM_C_ABI LLVMValueRef LLVMBuildPtrToInt(LLVMBuilderRef, LLVMValueRef Val, LLVMTypeRef DestTy, const char *Name)
Definition Core.cpp:4201
LLVM_C_ABI LLVMValueRef LLVMBuildPtrDiff2(LLVMBuilderRef, LLVMTypeRef ElemTy, LLVMValueRef LHS, LLVMValueRef RHS, const char *Name)
Definition Core.cpp:4378
LLVM_C_ABI LLVMValueRef LLVMBuildTruncOrBitCast(LLVMBuilderRef, LLVMValueRef Val, LLVMTypeRef DestTy, const char *Name)
Definition Core.cpp:4233
LLVM_C_ABI LLVMValueRef LLVMBuildArrayAlloca(LLVMBuilderRef, LLVMTypeRef Ty, LLVMValueRef Val, const char *Name)
Definition Core.cpp:3911
LLVM_C_ABI LLVMValueRef LLVMGetClause(LLVMValueRef LandingPad, unsigned Idx)
Definition Core.cpp:3549
LLVM_C_ABI unsigned LLVMGetAtomicSyncScopeID(LLVMValueRef AtomicInst)
Returns the synchronization scope ID of an atomic instruction.
Definition Core.cpp:4468
LLVM_C_ABI LLVMValueRef LLVMBuildVAArg(LLVMBuilderRef, LLVMValueRef List, LLVMTypeRef Ty, const char *Name)
Definition Core.cpp:4326
LLVM_C_ABI LLVMValueRef LLVMBuildAtomicCmpXchgSyncScope(LLVMBuilderRef B, LLVMValueRef Ptr, LLVMValueRef Cmp, LLVMValueRef New, LLVMAtomicOrdering SuccessOrdering, LLVMAtomicOrdering FailureOrdering, unsigned SSID)
Definition Core.cpp:4420
LLVM_C_ABI LLVMValueRef LLVMBuildBinOp(LLVMBuilderRef B, LLVMOpcode Op, LLVMValueRef LHS, LLVMValueRef RHS, const char *Name)
Definition Core.cpp:3763
LLVM_C_ABI LLVMBool LLVMIsAtomic(LLVMValueRef Inst)
Returns whether an instruction is an atomic instruction, e.g., atomicrmw, cmpxchg,...
Definition Core.cpp:4445
LLVM_C_ABI void LLVMSetVolatile(LLVMValueRef MemoryAccessInst, LLVMBool IsVolatile)
Definition Core.cpp:4100
LLVM_C_ABI void LLVMSetAtomicSingleThread(LLVMValueRef AtomicInst, LLVMBool SingleThread)
Definition Core.cpp:4458
LLVM_C_ABI LLVMValueRef LLVMBuildFRem(LLVMBuilderRef, LLVMValueRef LHS, LLVMValueRef RHS, const char *Name)
Definition Core.cpp:3728
LLVM_C_ABI LLVMValueRef LLVMBuildURem(LLVMBuilderRef, LLVMValueRef LHS, LLVMValueRef RHS, const char *Name)
Definition Core.cpp:3718
LLVM_C_ABI LLVMValueRef LLVMBuildIntToPtr(LLVMBuilderRef, LLVMValueRef Val, LLVMTypeRef DestTy, const char *Name)
Definition Core.cpp:4206
LLVM_C_ABI LLVMBool LLVMGetNSW(LLVMValueRef ArithInst)
Definition Core.cpp:3805
LLVM_C_ABI LLVMValueRef LLVMBuildNSWMul(LLVMBuilderRef, LLVMValueRef LHS, LLVMValueRef RHS, const char *Name)
Definition Core.cpp:3678
LLVM_C_ABI LLVMValueRef LLVMBuildFree(LLVMBuilderRef, LLVMValueRef PointerVal)
Definition Core.cpp:3916
LLVM_C_ABI LLVMValueRef LLVMBuildNeg(LLVMBuilderRef, LLVMValueRef V, const char *Name)
Definition Core.cpp:3770
LLVM_C_ABI LLVMValueRef LLVMBuildFSub(LLVMBuilderRef, LLVMValueRef LHS, LLVMValueRef RHS, const char *Name)
Definition Core.cpp:3668
LLVM_C_ABI LLVMValueRef LLVMBuildCatchSwitch(LLVMBuilderRef B, LLVMValueRef ParentPad, LLVMBasicBlockRef UnwindBB, unsigned NumHandlers, const char *Name)
Definition Core.cpp:3509
LLVM_C_ABI LLVMValueRef LLVMBuildLoad2(LLVMBuilderRef, LLVMTypeRef Ty, LLVMValueRef PointerVal, const char *Name)
Definition Core.cpp:3920
LLVM_C_ABI LLVMValueRef LLVMBuildInBoundsGEP2(LLVMBuilderRef B, LLVMTypeRef Ty, LLVMValueRef Pointer, LLVMValueRef *Indices, unsigned NumIndices, const char *Name)
Definition Core.cpp:4054
LLVM_C_ABI LLVMValueRef LLVMBuildArrayMalloc(LLVMBuilderRef, LLVMTypeRef Ty, LLVMValueRef Val, const char *Name)
Definition Core.cpp:3872
LLVM_C_ABI LLVMValueRef LLVMBuildAtomicCmpXchg(LLVMBuilderRef B, LLVMValueRef Ptr, LLVMValueRef Cmp, LLVMValueRef New, LLVMAtomicOrdering SuccessOrdering, LLVMAtomicOrdering FailureOrdering, LLVMBool SingleThread)
Definition Core.cpp:4407
LLVM_C_ABI LLVMValueRef LLVMBuildIndirectBr(LLVMBuilderRef B, LLVMValueRef Addr, unsigned NumDests)
Definition Core.cpp:3428
LLVM_C_ABI LLVMValueRef LLVMBuildUnreachable(LLVMBuilderRef)
Definition Core.cpp:3532
LLVM_C_ABI LLVMValueRef LLVMBuildSIToFP(LLVMBuilderRef, LLVMValueRef Val, LLVMTypeRef DestTy, const char *Name)
Definition Core.cpp:4186
LLVM_C_ABI LLVMValueRef LLVMBuildSExt(LLVMBuilderRef, LLVMValueRef Val, LLVMTypeRef DestTy, const char *Name)
Definition Core.cpp:4166
LLVM_C_ABI LLVMValueRef LLVMBuildFPToUI(LLVMBuilderRef, LLVMValueRef Val, LLVMTypeRef DestTy, const char *Name)
Definition Core.cpp:4171
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:3375
LLVM_C_ABI void LLVMSetCurrentDebugLocation2(LLVMBuilderRef Builder, LLVMMetadataRef Loc)
Set location information used by debugging information.
Definition Core.cpp:3356
LLVM_C_ABI LLVMValueRef LLVMBuildAlloca(LLVMBuilderRef, LLVMTypeRef Ty, const char *Name)
Definition Core.cpp:3906
LLVM_C_ABI LLVMBool LLVMGetVolatile(LLVMValueRef MemoryAccessInst)
Definition Core.cpp:4089
LLVM_C_ABI void LLVMSetCurrentDebugLocation(LLVMBuilderRef Builder, LLVMValueRef L)
Deprecated: Passing the NULL location will crash.
Definition Core.cpp:3363
LLVM_C_ABI LLVMValueRef LLVMBuildPhi(LLVMBuilderRef, LLVMTypeRef Ty, const char *Name)
Definition Core.cpp:4292
LLVM_C_ABI void LLVMAddDestination(LLVMValueRef IndirectBr, LLVMBasicBlockRef Dest)
Definition Core.cpp:3541
LLVM_C_ABI LLVMBool LLVMGetNNeg(LLVMValueRef NonNegInst)
Gets if the instruction has the non-negative flag set.
Definition Core.cpp:3825
LLVM_C_ABI LLVMValueRef LLVMBuildAtomicRMWSyncScope(LLVMBuilderRef B, LLVMAtomicRMWBinOp op, LLVMValueRef PTR, LLVMValueRef Val, LLVMAtomicOrdering ordering, unsigned SSID)
Definition Core.cpp:4396
LLVM_C_ABI LLVMValueRef LLVMBuildRet(LLVMBuilderRef, LLVMValueRef V)
Definition Core.cpp:3405
LLVM_C_ABI LLVMMetadataRef LLVMBuilderGetDefaultFPMathTag(LLVMBuilderRef Builder)
Get the dafult floating-point math metadata for a given builder.
Definition Core.cpp:3395
LLVM_C_ABI LLVMValueRef LLVMBuildExtractValue(LLVMBuilderRef, LLVMValueRef AggVal, unsigned Index, const char *Name)
Definition Core.cpp:4351
LLVM_C_ABI LLVMValueRef LLVMBuildGlobalStringPtr(LLVMBuilderRef B, const char *Str, const char *Name)
Deprecated: Use LLVMBuildGlobalString instead, which has identical behavior.
Definition Core.cpp:4084
LLVM_C_ABI LLVMValueRef LLVMBuildNSWAdd(LLVMBuilderRef, LLVMValueRef LHS, LLVMValueRef RHS, const char *Name)
Definition Core.cpp:3638
LLVM_C_ABI void LLVMPositionBuilderAtEnd(LLVMBuilderRef Builder, LLVMBasicBlockRef Block)
Definition Core.cpp:3324
LLVM_C_ABI LLVMValueRef LLVMBuildFMul(LLVMBuilderRef, LLVMValueRef LHS, LLVMValueRef RHS, const char *Name)
Definition Core.cpp:3688
LLVM_C_ABI LLVMValueRef LLVMBuildLShr(LLVMBuilderRef, LLVMValueRef LHS, LLVMValueRef RHS, const char *Name)
Definition Core.cpp:3738
LLVM_C_ABI LLVMAtomicRMWBinOp LLVMGetAtomicRMWBinOp(LLVMValueRef AtomicRMWInst)
Definition Core.cpp:4146
LLVM_C_ABI LLVMValueRef LLVMBuildFNeg(LLVMBuilderRef, LLVMValueRef V, const char *Name)
Definition Core.cpp:3787
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:3881
LLVM_C_ABI void LLVMSetAtomicSyncScopeID(LLVMValueRef AtomicInst, unsigned SSID)
Sets the synchronization scope ID of an atomic instruction.
Definition Core.cpp:4474
LLVM_C_ABI LLVMContextRef LLVMGetBuilderContext(LLVMBuilderRef Builder)
Obtain the context to which this builder is associated.
Definition Core.cpp:3391
LLVM_C_ABI LLVMValueRef LLVMBuildMalloc(LLVMBuilderRef, LLVMTypeRef Ty, const char *Name)
Definition Core.cpp:3863
LLVM_C_ABI LLVMValueRef LLVMBuildFreeze(LLVMBuilderRef, LLVMValueRef Val, const char *Name)
Definition Core.cpp:4363
LLVM_C_ABI LLVMValueRef LLVMBuildGlobalString(LLVMBuilderRef B, const char *Str, const char *Name)
Definition Core.cpp:4079
LLVM_C_ABI void LLVMSetNUW(LLVMValueRef ArithInst, LLVMBool HasNUW)
Definition Core.cpp:3800
LLVM_C_ABI LLVMAtomicOrdering LLVMGetCmpXchgSuccessOrdering(LLVMValueRef CmpXchgInst)
Definition Core.cpp:4480
LLVM_C_ABI LLVMValueRef LLVMBuildFCmp(LLVMBuilderRef, LLVMRealPredicate Op, LLVMValueRef LHS, LLVMValueRef RHS, const char *Name)
Definition Core.cpp:4283
LLVM_C_ABI LLVMValueRef LLVMBuildPointerCast(LLVMBuilderRef, LLVMValueRef Val, LLVMTypeRef DestTy, const char *Name)
Definition Core.cpp:4245
LLVM_C_ABI LLVMValueRef LLVMBuildExactSDiv(LLVMBuilderRef, LLVMValueRef LHS, LLVMValueRef RHS, const char *Name)
Definition Core.cpp:3708
LLVM_C_ABI LLVMValueRef LLVMBuildShuffleVector(LLVMBuilderRef, LLVMValueRef V1, LLVMValueRef V2, LLVMValueRef Mask, const char *Name)
Definition Core.cpp:4344
LLVM_C_ABI LLVMValueRef LLVMBuildFPExt(LLVMBuilderRef, LLVMValueRef Val, LLVMTypeRef DestTy, const char *Name)
Definition Core.cpp:4196
LLVM_C_ABI void LLVMSetCleanup(LLVMValueRef LandingPad, LLVMBool Val)
Definition Core.cpp:3561
LLVM_C_ABI LLVMValueRef LLVMBuildICmp(LLVMBuilderRef, LLVMIntPredicate Op, LLVMValueRef LHS, LLVMValueRef RHS, const char *Name)
Definition Core.cpp:4276
LLVM_C_ABI void LLVMSetCmpXchgFailureOrdering(LLVMValueRef CmpXchgInst, LLVMAtomicOrdering Ordering)
Definition Core.cpp:4498
LLVM_C_ABI void LLVMAddClause(LLVMValueRef LandingPad, LLVMValueRef ClauseVal)
Definition Core.cpp:3553
LLVM_C_ABI LLVMValueRef LLVMBuildFence(LLVMBuilderRef B, LLVMAtomicOrdering ordering, LLVMBool singleThread, const char *Name)
Definition Core.cpp:4031
LLVM_C_ABI void LLVMSetParentCatchSwitch(LLVMValueRef CatchPad, LLVMValueRef CatchSwitch)
Set the parent catchswitch instruction of a catchpad instruction.
Definition Core.cpp:3583
LLVM_C_ABI LLVMValueRef LLVMBuildFenceSyncScope(LLVMBuilderRef B, LLVMAtomicOrdering ordering, unsigned SSID, const char *Name)
Definition Core.cpp:4040
LLVM_C_ABI LLVMValueRef LLVMBuildUIToFP(LLVMBuilderRef, LLVMValueRef Val, LLVMTypeRef DestTy, const char *Name)
Definition Core.cpp:4181
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:3300
LLVM_C_ABI unsigned LLVMGetNumClauses(LLVMValueRef LandingPad)
Definition Core.cpp:3545
LLVM_C_ABI int LLVMGetUndefMaskElem(void)
Definition Core.cpp:4443
LLVM_C_ABI void LLVMSetCmpXchgSuccessOrdering(LLVMValueRef CmpXchgInst, LLVMAtomicOrdering Ordering)
Definition Core.cpp:4485
LLVM_C_ABI LLVMValueRef LLVMGetParentCatchSwitch(LLVMValueRef CatchPad)
Get the parent catchswitch instruction of a catchpad instruction.
Definition Core.cpp:3579
LLVM_C_ABI LLVMFastMathFlags LLVMGetFastMathFlags(LLVMValueRef FPMathInst)
Get the flags for which fast-math-style optimizations are allowed for this value.
Definition Core.cpp:3835
LLVM_C_ABI LLVMBool LLVMGetIsDisjoint(LLVMValueRef Inst)
Gets whether the instruction has the disjoint flag set.
Definition Core.cpp:3851
LLVM_C_ABI LLVMValueRef LLVMBuildSwitch(LLVMBuilderRef, LLVMValueRef V, LLVMBasicBlockRef Else, unsigned NumCases)
Definition Core.cpp:3423
LLVM_C_ABI void LLVMSetNNeg(LLVMValueRef NonNegInst, LLVMBool IsNonNeg)
Sets the non-negative flag for the instruction.
Definition Core.cpp:3830
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:3888
LLVM_C_ABI void LLVMAddHandler(LLVMValueRef CatchSwitch, LLVMBasicBlockRef Dest)
Definition Core.cpp:3565
LLVM_C_ABI void LLVMSetExact(LLVMValueRef DivOrShrInst, LLVMBool IsExact)
Definition Core.cpp:3820
LLVM_C_ABI LLVMValueRef LLVMBuildNSWNeg(LLVMBuilderRef B, LLVMValueRef V, const char *Name)
Definition Core.cpp:3774
LLVM_C_ABI LLVMValueRef LLVMBuildAShr(LLVMBuilderRef, LLVMValueRef LHS, LLVMValueRef RHS, const char *Name)
Definition Core.cpp:3743
LLVM_C_ABI LLVMValueRef LLVMBuildInvoke2(LLVMBuilderRef, LLVMTypeRef Ty, LLVMValueRef Fn, LLVMValueRef *Args, unsigned NumArgs, LLVMBasicBlockRef Then, LLVMBasicBlockRef Catch, const char *Name)
Definition Core.cpp:3452
LLVM_C_ABI void LLVMSetOrdering(LLVMValueRef MemoryAccessInst, LLVMAtomicOrdering Ordering)
Definition Core.cpp:4133
LLVM_C_ABI LLVMValueRef LLVMBuildFPTrunc(LLVMBuilderRef, LLVMValueRef Val, LLVMTypeRef DestTy, const char *Name)
Definition Core.cpp:4191
LLVM_C_ABI LLVMValueRef LLVMBuildStore(LLVMBuilderRef, LLVMValueRef Val, LLVMValueRef Ptr)
Definition Core.cpp:3925
LLVM_C_ABI void LLVMAddMetadataToInst(LLVMBuilderRef Builder, LLVMValueRef Inst)
Adds the metadata registered with the given builder to the given instruction.
Definition Core.cpp:3379
LLVM_C_ABI LLVMAtomicOrdering LLVMGetCmpXchgFailureOrdering(LLVMValueRef CmpXchgInst)
Definition Core.cpp:4493
LLVM_C_ABI LLVMValueRef LLVMBuildNUWAdd(LLVMBuilderRef, LLVMValueRef LHS, LLVMValueRef RHS, const char *Name)
Definition Core.cpp:3643
LLVM_C_ABI LLVMValueRef LLVMBuildInsertValue(LLVMBuilderRef, LLVMValueRef AggVal, LLVMValueRef EltVal, unsigned Index, const char *Name)
Definition Core.cpp:4356
LLVM_C_ABI void LLVMBuilderSetDefaultFPMathTag(LLVMBuilderRef Builder, LLVMMetadataRef FPMathTag)
Set the default floating-point math metadata for the given builder.
Definition Core.cpp:3383
LLVM_C_ABI LLVMValueRef LLVMBuildZExt(LLVMBuilderRef, LLVMValueRef Val, LLVMTypeRef DestTy, const char *Name)
Definition Core.cpp:4161
LLVM_C_ABI LLVMValueRef LLVMBuildNot(LLVMBuilderRef, LLVMValueRef V, const char *Name)
Definition Core.cpp:3791
LLVM_C_ABI LLVMValueRef LLVMBuildAtomicRMW(LLVMBuilderRef B, LLVMAtomicRMWBinOp op, LLVMValueRef PTR, LLVMValueRef Val, LLVMAtomicOrdering ordering, LLVMBool singleThread)
Definition Core.cpp:4385
LLVM_C_ABI LLVMMemoryBufferRef LLVMCreateMemoryBufferWithMemoryRange(const char *InputData, size_t InputDataLength, const char *BufferName, LLVMBool RequiresNullTerminator)
Definition Core.cpp:4545
LLVM_C_ABI size_t LLVMGetBufferSize(LLVMMemoryBufferRef MemBuf)
Definition Core.cpp:4570
LLVM_C_ABI LLVMMemoryBufferRef LLVMCreateMemoryBufferWithMemoryRangeCopy(const char *InputData, size_t InputDataLength, const char *BufferName)
Definition Core.cpp:4556
LLVM_C_ABI const char * LLVMGetBufferStart(LLVMMemoryBufferRef MemBuf)
Definition Core.cpp:4566
LLVM_C_ABI LLVMBool LLVMCreateMemoryBufferWithContentsOfFile(const char *Path, LLVMMemoryBufferRef *OutMemBuf, char **OutMessage)
Definition Core.cpp:4520
LLVM_C_ABI LLVMBool LLVMCreateMemoryBufferWithSTDIN(LLVMMemoryBufferRef *OutMemBuf, char **OutMessage)
Definition Core.cpp:4534
LLVM_C_ABI void LLVMDisposeMemoryBuffer(LLVMMemoryBufferRef MemBuf)
Definition Core.cpp:4574
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:4509
LLVM_C_ABI void LLVMDisposeModuleProvider(LLVMModuleProviderRef M)
Destroys the module M.
Definition Core.cpp:4513
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:2410
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:2431
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 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:2439
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:2423
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:2406
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:2415
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:2754
LLVM_C_ABI unsigned LLVMGetNumOperandBundleArgs(LLVMOperandBundleRef Bundle)
Obtain the number of operands for an operand bundle.
Definition Core.cpp:2771
LLVM_C_ABI const char * LLVMGetOperandBundleTag(LLVMOperandBundleRef Bundle, size_t *Len)
Obtain the tag of an operand bundle as a string.
Definition Core.cpp:2765
LLVM_C_ABI void LLVMDisposeOperandBundle(LLVMOperandBundleRef Bundle)
Destroy an operand bundle.
Definition Core.cpp:2761
LLVM_C_ABI LLVMValueRef LLVMGetOperandBundleArgAtIndex(LLVMOperandBundleRef Bundle, unsigned Index)
Obtain the operand for an operand bundle at the given index.
Definition Core.cpp:2775
LLVM_C_ABI LLVMPassManagerRef LLVMCreateFunctionPassManager(LLVMModuleProviderRef MP)
Deprecated: Use LLVMCreateFunctionPassManagerForModule instead.
Definition Core.cpp:4588
LLVM_C_ABI LLVMPassManagerRef LLVMCreateFunctionPassManagerForModule(LLVMModuleRef M)
Constructs a new function-by-function pass pipeline over the module provider.
Definition Core.cpp:4584
LLVM_C_ABI LLVMBool LLVMFinalizeFunctionPassManager(LLVMPassManagerRef FPM)
Finalizes all of the function passes scheduled in the function pass manager.
Definition Core.cpp:4605
LLVM_C_ABI void LLVMDisposePassManager(LLVMPassManagerRef PM)
Frees the memory of a pass pipeline.
Definition Core.cpp:4609
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:4601
LLVM_C_ABI LLVMBool LLVMInitializeFunctionPassManager(LLVMPassManagerRef FPM)
Initializes all of the function passes scheduled in the function pass manager.
Definition Core.cpp:4597
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:4593
LLVM_C_ABI LLVMPassManagerRef LLVMCreatePassManager(void)
Constructs a new whole-module pass pipeline.
Definition Core.cpp:4580
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:4619
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:4615
LLVM_C_ABI LLVMBool LLVMIsMultithreaded(void)
Check whether LLVM is executing in thread-safe mode or not.
Definition Core.cpp:4622
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:2922
LLVM_C_ABI void LLVMMoveBasicBlockAfter(LLVMBasicBlockRef BB, LLVMBasicBlockRef MovePos)
Move a basic block to after another one.
Definition Core.cpp:2904
LLVM_C_ABI LLVMBasicBlockRef LLVMGetFirstBasicBlock(LLVMValueRef Fn)
Obtain the first basic block in a function.
Definition Core.cpp:2820
LLVM_C_ABI LLVMBasicBlockRef LLVMCreateBasicBlockInContext(LLVMContextRef C, const char *Name)
Create a new basic block without inserting it into a function.
Definition Core.cpp:2852
LLVM_C_ABI LLVMBasicBlockRef LLVMGetPreviousBasicBlock(LLVMBasicBlockRef BB)
Go backwards in a basic block iterator.
Definition Core.cpp:2844
LLVM_C_ABI LLVMBasicBlockRef LLVMGetLastBasicBlock(LLVMValueRef Fn)
Obtain the last basic block in a function.
Definition Core.cpp:2828
LLVM_C_ABI LLVMBasicBlockRef LLVMInsertBasicBlock(LLVMBasicBlockRef InsertBeforeBB, const char *Name)
Insert a basic block in a function using the global context.
Definition Core.cpp:2887
LLVM_C_ABI LLVMValueRef LLVMGetBasicBlockTerminator(LLVMBasicBlockRef BB)
Obtain the terminator instruction for a basic block.
Definition Core.cpp:2802
LLVM_C_ABI const char * LLVMGetBasicBlockName(LLVMBasicBlockRef BB)
Obtain the string name of a basic block.
Definition Core.cpp:2794
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:2865
LLVM_C_ABI void LLVMDeleteBasicBlock(LLVMBasicBlockRef BB)
Remove a basic block from a function and delete it.
Definition Core.cpp:2892
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:2880
LLVM_C_ABI void LLVMGetBasicBlocks(LLVMValueRef Fn, LLVMBasicBlockRef *BasicBlocks)
Obtain all of the basic blocks in a function.
Definition Core.cpp:2810
LLVM_C_ABI void LLVMMoveBasicBlockBefore(LLVMBasicBlockRef BB, LLVMBasicBlockRef MovePos)
Move a basic block to before another one.
Definition Core.cpp:2900
LLVM_C_ABI LLVMValueRef LLVMGetBasicBlockParent(LLVMBasicBlockRef BB)
Obtain the function to which a basic block belongs.
Definition Core.cpp:2798
LLVM_C_ABI LLVMBasicBlockRef LLVMGetEntryBasicBlock(LLVMValueRef Fn)
Obtain the basic block that corresponds to the entry point of a function.
Definition Core.cpp:2816
LLVM_C_ABI LLVMValueRef LLVMGetFirstInstruction(LLVMBasicBlockRef BB)
Obtain the first instruction in a basic block.
Definition Core.cpp:2914
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:2857
LLVM_C_ABI LLVMValueRef LLVMBasicBlockAsValue(LLVMBasicBlockRef BB)
Convert a basic block instance to a value type.
Definition Core.cpp:2782
LLVM_C_ABI LLVMBasicBlockRef LLVMValueAsBasicBlock(LLVMValueRef Val)
Convert an LLVMValueRef to an LLVMBasicBlockRef instance.
Definition Core.cpp:2790
LLVM_C_ABI void LLVMRemoveBasicBlockFromParent(LLVMBasicBlockRef BB)
Remove a basic block from a function.
Definition Core.cpp:2896
LLVM_C_ABI LLVMBasicBlockRef LLVMGetNextBasicBlock(LLVMBasicBlockRef BB)
Advance a basic block iterator.
Definition Core.cpp:2836
LLVM_C_ABI unsigned LLVMCountBasicBlocks(LLVMValueRef Fn)
Obtain the number of basic blocks in a function.
Definition Core.cpp:2806
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:2876
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:2870
LLVM_C_ABI LLVMBool LLVMValueIsBasicBlock(LLVMValueRef Val)
Determine whether an LLVMValueRef is itself a basic block.
Definition Core.cpp:2786
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:2675
LLVM_C_ABI void LLVMSetParamAlignment(LLVMValueRef Arg, unsigned Align)
Set the alignment for a function parameter.
Definition Core.cpp:2682
LLVM_C_ABI unsigned LLVMCountParams(LLVMValueRef Fn)
Obtain the number of parameters in a function.
Definition Core.cpp:2630
LLVM_C_ABI void LLVMGetParams(LLVMValueRef Fn, LLVMValueRef *Params)
Obtain the parameters in a function.
Definition Core.cpp:2636
LLVM_C_ABI LLVMValueRef LLVMGetFirstParam(LLVMValueRef Fn)
Obtain the first parameter to a function.
Definition Core.cpp:2651
LLVM_C_ABI LLVMValueRef LLVMGetLastParam(LLVMValueRef Fn)
Obtain the last parameter to a function.
Definition Core.cpp:2659
LLVM_C_ABI LLVMValueRef LLVMGetParam(LLVMValueRef Fn, unsigned Index)
Obtain the parameter at the specified index.
Definition Core.cpp:2642
LLVM_C_ABI LLVMValueRef LLVMGetNextParam(LLVMValueRef Arg)
Obtain the next parameter to a function.
Definition Core.cpp:2667
LLVM_C_ABI LLVMValueRef LLVMGetParamParent(LLVMValueRef Inst)
Obtain the function to which this argument belongs.
Definition Core.cpp:2647
LLVM_C_ABI void LLVMAddAttributeAtIndex(LLVMValueRef F, LLVMAttributeIndex Idx, LLVMAttributeRef A)
Add an attribute to a function.
Definition Core.cpp:2580
LLVM_C_ABI LLVMValueRef LLVMGetPrefixData(LLVMValueRef Fn)
Gets the prefix data associated with a function.
Definition Core.cpp:2548
LLVM_C_ABI LLVMValueRef LLVMGetPrologueData(LLVMValueRef Fn)
Gets the prologue data associated with a function.
Definition Core.cpp:2564
LLVM_C_ABI LLVMTypeRef LLVMIntrinsicGetType(LLVMContextRef Ctx, unsigned ID, LLVMTypeRef *ParamTypes, size_t ParamCount)
Retrieves the type of an intrinsic.
Definition Core.cpp:2491
LLVM_C_ABI unsigned LLVMGetIntrinsicID(LLVMValueRef Fn)
Obtain the ID number from a function instance.
Definition Core.cpp:2464
LLVM_C_ABI LLVMValueRef LLVMGetPersonalityFn(LLVMValueRef Fn)
Obtain the personality function attached to the function.
Definition Core.cpp:2455
LLVM_C_ABI unsigned LLVMGetAttributeCountAtIndex(LLVMValueRef F, LLVMAttributeIndex Idx)
Definition Core.cpp:2585
LLVM_C_ABI LLVMBool LLVMHasPersonalityFn(LLVMValueRef Fn)
Check whether the given function has a personality function.
Definition Core.cpp:2451
LLVM_C_ABI void LLVMRemoveStringAttributeAtIndex(LLVMValueRef F, LLVMAttributeIndex Idx, const char *K, unsigned KLen)
Definition Core.cpp:2616
LLVM_C_ABI void LLVMSetPrefixData(LLVMValueRef Fn, LLVMValueRef prefixData)
Sets the prefix data for the function.
Definition Core.cpp:2558
LLVM_C_ABI char * LLVMIntrinsicCopyOverloadedName(unsigned ID, LLVMTypeRef *ParamTypes, size_t ParamCount, size_t *NameLength)
Deprecated: Use LLVMIntrinsicCopyOverloadedName2 instead.
Definition Core.cpp:2498
LLVM_C_ABI const char * LLVMGetGC(LLVMValueRef Fn)
Obtain the name of the garbage collector to use during code generation.
Definition Core.cpp:2535
LLVM_C_ABI void LLVMSetGC(LLVMValueRef Fn, const char *Name)
Define the garbage collector to use during code generation.
Definition Core.cpp:2540
LLVM_C_ABI void LLVMSetPrologueData(LLVMValueRef Fn, LLVMValueRef prologueData)
Sets the prologue data for the function.
Definition Core.cpp:2574
LLVM_C_ABI void LLVMSetPersonalityFn(LLVMValueRef Fn, LLVMValueRef PersonalityFn)
Set the personality function attached to the function.
Definition Core.cpp:2459
LLVM_C_ABI void LLVMGetAttributesAtIndex(LLVMValueRef F, LLVMAttributeIndex Idx, LLVMAttributeRef *Attrs)
Definition Core.cpp:2590
LLVM_C_ABI unsigned LLVMGetFunctionCallConv(LLVMValueRef Fn)
Obtain the calling function of a function.
Definition Core.cpp:2526
LLVM_C_ABI LLVMBool LLVMIntrinsicIsOverloaded(unsigned ID)
Obtain if the intrinsic identified by the given ID is overloaded.
Definition Core.cpp:2521
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:2507
LLVM_C_ABI void LLVMDeleteFunction(LLVMValueRef Fn)
Remove a function from its containing module and deletes it.
Definition Core.cpp:2447
LLVM_C_ABI void LLVMRemoveEnumAttributeAtIndex(LLVMValueRef F, LLVMAttributeIndex Idx, unsigned KindID)
Definition Core.cpp:2611
LLVM_C_ABI LLVMAttributeRef LLVMGetEnumAttributeAtIndex(LLVMValueRef F, LLVMAttributeIndex Idx, unsigned KindID)
Definition Core.cpp:2597
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:2517
LLVM_C_ABI const char * LLVMIntrinsicGetName(unsigned ID, size_t *NameLength)
Retrieves the name of an intrinsic.
Definition Core.cpp:2484
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:2475
LLVM_C_ABI LLVMBool LLVMHasPrologueData(LLVMValueRef Fn)
Check if a given function has prologue data.
Definition Core.cpp:2569
LLVM_C_ABI LLVMBool LLVMHasPrefixData(LLVMValueRef Fn)
Check if a given function has prefix data.
Definition Core.cpp:2553
LLVM_C_ABI void LLVMSetFunctionCallConv(LLVMValueRef Fn, unsigned CC)
Set the calling convention of a function.
Definition Core.cpp:2530
LLVM_C_ABI void LLVMAddTargetDependentFunctionAttr(LLVMValueRef Fn, const char *A, const char *V)
Add a target-dependent attribute to a function.
Definition Core.cpp:2621
LLVM_C_ABI LLVMAttributeRef LLVMGetStringAttributeAtIndex(LLVMValueRef F, LLVMAttributeIndex Idx, const char *K, unsigned KLen)
Definition Core.cpp:2604
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:2075
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:2704
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:2699
LLVM_C_ABI void LLVMRemoveGlobalIFunc(LLVMValueRef IFunc)
Remove a global indirect function from its parent module.
Definition Core.cpp:2748
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:2689
LLVM_C_ABI LLVMValueRef LLVMGetNextGlobalIFunc(LLVMValueRef IFunc)
Advance a GlobalIFunc iterator to the next GlobalIFunc.
Definition Core.cpp:2720
LLVM_C_ABI LLVMValueRef LLVMGetPreviousGlobalIFunc(LLVMValueRef IFunc)
Decrement a GlobalIFunc iterator to the previous GlobalIFunc.
Definition Core.cpp:2728
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:2736
LLVM_C_ABI void LLVMSetGlobalIFuncResolver(LLVMValueRef IFunc, LLVMValueRef Resolver)
Sets the resolver function associated with this indirect function.
Definition Core.cpp:2740
LLVM_C_ABI LLVMValueRef LLVMGetLastGlobalIFunc(LLVMModuleRef M)
Obtain an iterator to the last GlobalIFunc in a Module.
Definition Core.cpp:2712
LLVM_C_ABI void LLVMEraseGlobalIFunc(LLVMValueRef IFunc)
Remove a global indirect function from its parent module and delete it.
Definition Core.cpp:2744
LLVM_C_ABI LLVMTypeRef LLVMGetAllocatedType(LLVMValueRef Alloca)
Obtain the type that is being allocated by the alloca instruction.
Definition Core.cpp:3209
LLVM_C_ABI void LLVMSetTailCall(LLVMValueRef CallInst, LLVMBool IsTailCall)
Set whether a call instruction is a tail call.
Definition Core.cpp:3121
LLVM_C_ABI void LLVMAddCallSiteAttribute(LLVMValueRef C, LLVMAttributeIndex Idx, LLVMAttributeRef A)
Definition Core.cpp:3053
LLVM_C_ABI unsigned LLVMGetNumOperandBundles(LLVMValueRef C)
Obtain the number of operand bundles attached to this instruction.
Definition Core.cpp:3105
LLVM_C_ABI void LLVMRemoveCallSiteEnumAttribute(LLVMValueRef C, LLVMAttributeIndex Idx, unsigned KindID)
Definition Core.cpp:3087
LLVM_C_ABI void LLVMRemoveCallSiteStringAttribute(LLVMValueRef C, LLVMAttributeIndex Idx, const char *K, unsigned KLen)
Definition Core.cpp:3092
LLVM_C_ABI LLVMAttributeRef LLVMGetCallSiteEnumAttribute(LLVMValueRef C, LLVMAttributeIndex Idx, unsigned KindID)
Definition Core.cpp:3073
LLVM_C_ABI unsigned LLVMGetInstructionCallConv(LLVMValueRef Instr)
Obtain the calling convention for a call instruction.
Definition Core.cpp:3036
LLVM_C_ABI LLVMBasicBlockRef LLVMGetCallBrDefaultDest(LLVMValueRef CallBr)
Get the default destination of a CallBr instruction.
Definition Core.cpp:3161
LLVM_C_ABI LLVMValueRef LLVMGetCalledValue(LLVMValueRef Instr)
Obtain the pointer to the function invoked by this instruction.
Definition Core.cpp:3097
LLVM_C_ABI void LLVMSetNormalDest(LLVMValueRef InvokeInst, LLVMBasicBlockRef B)
Set the normal destination basic block.
Definition Core.cpp:3148
LLVM_C_ABI LLVMBool LLVMIsTailCall(LLVMValueRef CallInst)
Obtain whether a call instruction is a tail call.
Definition Core.cpp:3117
LLVM_C_ABI LLVMAttributeRef LLVMGetCallSiteStringAttribute(LLVMValueRef C, LLVMAttributeIndex Idx, const char *K, unsigned KLen)
Definition Core.cpp:3080
LLVM_C_ABI unsigned LLVMGetCallBrNumIndirectDests(LLVMValueRef CallBr)
Get the number of indirect destinations of a CallBr instruction.
Definition Core.cpp:3165
LLVM_C_ABI void LLVMGetCallSiteAttributes(LLVMValueRef C, LLVMAttributeIndex Idx, LLVMAttributeRef *Attrs)
Definition Core.cpp:3065
LLVM_C_ABI LLVMBasicBlockRef LLVMGetNormalDest(LLVMValueRef InvokeInst)
Return the normal destination basic block.
Definition Core.cpp:3135
LLVM_C_ABI unsigned LLVMGetNumArgOperands(LLVMValueRef Instr)
Obtain the argument count for a call instruction.
Definition Core.cpp:3027
LLVM_C_ABI void LLVMSetTailCallKind(LLVMValueRef CallInst, LLVMTailCallKind kind)
Set the call kind of the call instruction.
Definition Core.cpp:3129
LLVM_C_ABI LLVMOperandBundleRef LLVMGetOperandBundleAtIndex(LLVMValueRef C, unsigned Index)
Obtain the operand bundle attached to this instruction at the given index.
Definition Core.cpp:3109
LLVM_C_ABI LLVMBasicBlockRef LLVMGetCallBrIndirectDest(LLVMValueRef CallBr, unsigned Idx)
Get the indirect destination of a CallBr instruction at the given index.
Definition Core.cpp:3169
LLVM_C_ABI LLVMTailCallKind LLVMGetTailCallKind(LLVMValueRef CallInst)
Obtain a tail call kind of the call instruction.
Definition Core.cpp:3125
LLVM_C_ABI void LLVMSetUnwindDest(LLVMValueRef InvokeInst, LLVMBasicBlockRef B)
Set the unwind destination basic block.
Definition Core.cpp:3152
LLVM_C_ABI LLVMTypeRef LLVMGetCalledFunctionType(LLVMValueRef C)
Obtain the function type called by this instruction.
Definition Core.cpp:3101
LLVM_C_ABI LLVMBasicBlockRef LLVMGetUnwindDest(LLVMValueRef InvokeInst)
Return the unwind destination basic block.
Definition Core.cpp:3139
LLVM_C_ABI void LLVMSetInstrParamAlignment(LLVMValueRef Instr, LLVMAttributeIndex Idx, unsigned Align)
Definition Core.cpp:3045
LLVM_C_ABI unsigned LLVMGetCallSiteAttributeCount(LLVMValueRef C, LLVMAttributeIndex Idx)
Definition Core.cpp:3058
LLVM_C_ABI void LLVMSetInstructionCallConv(LLVMValueRef Instr, unsigned CC)
Set the calling convention for a call instruction.
Definition Core.cpp:3040
LLVM_C_ABI LLVMGEPNoWrapFlags LLVMGEPGetNoWrapFlags(LLVMValueRef GEP)
Get the no-wrap related flags for the given GEP instruction.
Definition Core.cpp:3227
LLVM_C_ABI LLVMBool LLVMIsInBounds(LLVMValueRef GEP)
Check whether the given GEP operator is inbounds.
Definition Core.cpp:3215
LLVM_C_ABI void LLVMSetIsInBounds(LLVMValueRef GEP, LLVMBool InBounds)
Set the given GEP instruction to be inbounds or not.
Definition Core.cpp:3219
LLVM_C_ABI LLVMTypeRef LLVMGetGEPSourceElementType(LLVMValueRef GEP)
Get the source element type of the given GEP operator.
Definition Core.cpp:3223
LLVM_C_ABI void LLVMGEPSetNoWrapFlags(LLVMValueRef GEP, LLVMGEPNoWrapFlags NoWrapFlags)
Set the no-wrap related flags for the given GEP instruction.
Definition Core.cpp:3232
LLVM_C_ABI unsigned LLVMGetNumIndices(LLVMValueRef Inst)
Obtain the number of indices.
Definition Core.cpp:3260
LLVM_C_ABI const unsigned * LLVMGetIndices(LLVMValueRef Inst)
Obtain the indices as an array.
Definition Core.cpp:3272
LLVM_C_ABI LLVMBasicBlockRef LLVMGetIncomingBlock(LLVMValueRef PhiNode, unsigned Index)
Obtain an incoming value to a PHI node as an LLVMBasicBlockRef.
Definition Core.cpp:3254
LLVM_C_ABI LLVMValueRef LLVMGetIncomingValue(LLVMValueRef PhiNode, unsigned Index)
Obtain an incoming value to a PHI node as an LLVMValueRef.
Definition Core.cpp:3250
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:3239
LLVM_C_ABI unsigned LLVMCountIncoming(LLVMValueRef PhiNode)
Obtain the number of incoming basic blocks to a PHI node.
Definition Core.cpp:3246
LLVM_C_ABI LLVMValueRef LLVMGetCondition(LLVMValueRef Branch)
Return the condition of a branch instruction.
Definition Core.cpp:3193
LLVM_C_ABI LLVMBasicBlockRef LLVMGetSuccessor(LLVMValueRef Term, unsigned i)
Return the specified successor.
Definition Core.cpp:3179
LLVM_C_ABI void LLVMSetCondition(LLVMValueRef Branch, LLVMValueRef Cond)
Set the condition of a branch instruction.
Definition Core.cpp:3197
LLVM_C_ABI void LLVMSetSuccessor(LLVMValueRef Term, unsigned i, LLVMBasicBlockRef block)
Update the specified successor to point at the provided block.
Definition Core.cpp:3183
LLVM_C_ABI LLVMBool LLVMIsConditional(LLVMValueRef Branch)
Return if a branch is conditional.
Definition Core.cpp:3189
LLVM_C_ABI LLVMBasicBlockRef LLVMGetSwitchDefaultDest(LLVMValueRef SwitchInstr)
Obtain the default destination basic block of a switch instruction.
Definition Core.cpp:3203
LLVM_C_ABI unsigned LLVMGetNumSuccessors(LLVMValueRef Term)
Return the number of successors that this terminator has.
Definition Core.cpp:3175
LLVM_C_ABI LLVMRealPredicate LLVMGetFCmpPredicate(LLVMValueRef Inst)
Obtain the float predicate of an instruction.
Definition Core.cpp:2972
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:2946
LLVM_C_ABI LLVMValueRef LLVMGetPreviousInstruction(LLVMValueRef Inst)
Obtain the instruction that occurred before this one.
Definition Core.cpp:2938
LLVM_C_ABI LLVMDbgRecordRef LLVMGetPreviousDbgRecord(LLVMDbgRecordRef DbgRecord)
Obtain the previous DbgRecord in the sequence or NULL if there are no more.
Definition Core.cpp:3019
LLVM_C_ABI LLVMDbgRecordRef LLVMGetFirstDbgRecord(LLVMValueRef Inst)
Obtain the first debug record attached to an instruction.
Definition Core.cpp:2995
LLVM_C_ABI LLVMOpcode LLVMGetInstructionOpcode(LLVMValueRef Inst)
Obtain the code opcode for an individual instruction.
Definition Core.cpp:2978
LLVM_C_ABI LLVMDbgRecordRef LLVMGetNextDbgRecord(LLVMDbgRecordRef DbgRecord)
Obtain the next DbgRecord in the sequence or NULL if there are no more.
Definition Core.cpp:3011
LLVM_C_ABI LLVMDbgRecordRef LLVMGetLastDbgRecord(LLVMValueRef Inst)
Obtain the last debug record attached to an instruction.
Definition Core.cpp:3003
LLVM_C_ABI LLVMValueRef LLVMIsATerminatorInst(LLVMValueRef Inst)
Determine whether an instruction is a terminator.
Definition Core.cpp:2990
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:2954
LLVM_C_ABI LLVMBasicBlockRef LLVMGetInstructionParent(LLVMValueRef Inst)
Obtain the basic block to which an instruction belongs.
Definition Core.cpp:2910
LLVM_C_ABI LLVMBool LLVMGetICmpSameSign(LLVMValueRef Inst)
Get whether or not an icmp instruction has the samesign flag.
Definition Core.cpp:2964
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:2984
LLVM_C_ABI void LLVMInstructionEraseFromParent(LLVMValueRef Inst)
Remove and delete an instruction.
Definition Core.cpp:2950
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:2958
LLVM_C_ABI LLVMValueRef LLVMGetNextInstruction(LLVMValueRef Inst)
Obtain the instruction that occurs after the one specified.
Definition Core.cpp:2930
LLVM_C_ABI void LLVMSetICmpSameSign(LLVMValueRef Inst, LLVMBool SameSign)
Set the samesign flag on an icmp instruction.
Definition Core.cpp:2968
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:1879
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