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