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 = 0, /**< type with no size */
150 LLVMHalfTypeKind = 1, /**< 16 bit floating point type */
151 LLVMFloatTypeKind = 2, /**< 32 bit floating point type */
152 LLVMDoubleTypeKind = 3, /**< 64 bit floating point type */
153 LLVMX86_FP80TypeKind = 4, /**< 80 bit floating point type (X87) */
154 LLVMFP128TypeKind = 5, /**< 128 bit floating point type (112-bit mantissa)*/
155 LLVMPPC_FP128TypeKind = 6, /**< 128 bit floating point type (two 64-bits) */
156 LLVMLabelTypeKind = 7, /**< Labels */
157 LLVMIntegerTypeKind = 8, /**< Arbitrary bit width integers */
158 LLVMFunctionTypeKind = 9, /**< Functions */
159 LLVMStructTypeKind = 10, /**< Structures */
160 LLVMArrayTypeKind = 11, /**< Arrays */
161 LLVMPointerTypeKind = 12, /**< Pointers */
162 LLVMVectorTypeKind = 13, /**< Fixed width SIMD vector type */
163 LLVMMetadataTypeKind = 14, /**< Metadata */
164 /* 15 previously used by LLVMX86_MMXTypeKind */
165 LLVMTokenTypeKind = 16, /**< Tokens */
166 LLVMScalableVectorTypeKind = 17, /**< Scalable SIMD vector type */
167 LLVMBFloatTypeKind = 18, /**< 16 bit brain floating point type */
168 LLVMX86_AMXTypeKind = 19, /**< X86 AMX */
169 LLVMTargetExtTypeKind = 20, /**< 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 * Maps a synchronization scope name to a ID unique within this context.
651 */
652unsigned LLVMGetSyncScopeID(LLVMContextRef C, const char *Name, size_t SLen);
653
654/**
655 * Return an unique id given the name of a enum attribute,
656 * or 0 if no attribute by that name exists.
657 *
658 * See http://llvm.org/docs/LangRef.html#parameter-attributes
659 * and http://llvm.org/docs/LangRef.html#function-attributes
660 * for the list of available attributes.
661 *
662 * NB: Attribute names and/or id are subject to change without
663 * going through the C API deprecation cycle.
664 */
665unsigned LLVMGetEnumAttributeKindForName(const char *Name, size_t SLen);
666unsigned LLVMGetLastEnumAttributeKind(void);
667
668/**
669 * Create an enum attribute.
670 */
672 uint64_t Val);
673
674/**
675 * Get the unique id corresponding to the enum attribute
676 * passed as argument.
677 */
679
680/**
681 * Get the enum attribute's value. 0 is returned if none exists.
682 */
684
685/**
686 * Create a type attribute
687 */
689 LLVMTypeRef type_ref);
690
691/**
692 * Get the type attribute's value.
693 */
695
696/**
697 * Create a ConstantRange attribute.
698 *
699 * LowerWords and UpperWords need to be NumBits divided by 64 rounded up
700 * elements long.
701 */
703 unsigned KindID,
704 unsigned NumBits,
705 const uint64_t LowerWords[],
706 const uint64_t UpperWords[]);
707
708/**
709 * Create a string attribute.
710 */
712 const char *K, unsigned KLength,
713 const char *V, unsigned VLength);
714
715/**
716 * Get the string attribute's kind.
717 */
718const char *LLVMGetStringAttributeKind(LLVMAttributeRef A, unsigned *Length);
719
720/**
721 * Get the string attribute's value.
722 */
723const char *LLVMGetStringAttributeValue(LLVMAttributeRef A, unsigned *Length);
724
725/**
726 * Check for the different types of attributes.
727 */
731
732/**
733 * Obtain a Type from a context by its registered name.
734 */
736
737/**
738 * @}
739 */
740
741/**
742 * @defgroup LLVMCCoreModule Modules
743 *
744 * Modules represent the top-level structure in an LLVM program. An LLVM
745 * module is effectively a translation unit or a collection of
746 * translation units merged together.
747 *
748 * @{
749 */
750
751/**
752 * Create a new, empty module in the global context.
753 *
754 * This is equivalent to calling LLVMModuleCreateWithNameInContext with
755 * LLVMGetGlobalContext() as the context parameter.
756 *
757 * Every invocation should be paired with LLVMDisposeModule() or memory
758 * will be leaked.
759 */
760LLVMModuleRef LLVMModuleCreateWithName(const char *ModuleID);
761
762/**
763 * Create a new, empty module in a specific context.
764 *
765 * Every invocation should be paired with LLVMDisposeModule() or memory
766 * will be leaked.
767 */
770/**
771 * Return an exact copy of the specified module.
772 */
774
775/**
776 * Destroy a module instance.
777 *
778 * This must be called for every created module or memory will be
779 * leaked.
780 */
782
783/**
784 * Soon to be deprecated.
785 * See https://llvm.org/docs/RemoveDIsDebugInfo.html#c-api-changes
786 *
787 * Returns true if the module is in the new debug info mode which uses
788 * non-instruction debug records instead of debug intrinsics for variable
789 * location tracking.
790 */
792
793/**
794 * Soon to be deprecated.
795 * See https://llvm.org/docs/RemoveDIsDebugInfo.html#c-api-changes
796 *
797 * Convert module into desired debug info format.
798 */
800
801/**
802 * Obtain the identifier of a module.
803 *
804 * @param M Module to obtain identifier of
805 * @param Len Out parameter which holds the length of the returned string.
806 * @return The identifier of M.
807 * @see Module::getModuleIdentifier()
808 */
809const char *LLVMGetModuleIdentifier(LLVMModuleRef M, size_t *Len);
810
811/**
812 * Set the identifier of a module to a string Ident with length Len.
813 *
814 * @param M The module to set identifier
815 * @param Ident The string to set M's identifier to
816 * @param Len Length of Ident
817 * @see Module::setModuleIdentifier()
818 */
819void LLVMSetModuleIdentifier(LLVMModuleRef M, const char *Ident, size_t Len);
820
821/**
822 * Obtain the module's original source file name.
823 *
824 * @param M Module to obtain the name of
825 * @param Len Out parameter which holds the length of the returned string
826 * @return The original source file name of M
827 * @see Module::getSourceFileName()
828 */
829const char *LLVMGetSourceFileName(LLVMModuleRef M, size_t *Len);
830
831/**
832 * Set the original source file name of a module to a string Name with length
833 * Len.
834 *
835 * @param M The module to set the source file name of
836 * @param Name The string to set M's source file name to
837 * @param Len Length of Name
838 * @see Module::setSourceFileName()
839 */
840void LLVMSetSourceFileName(LLVMModuleRef M, const char *Name, size_t Len);
841
842/**
843 * Obtain the data layout for a module.
844 *
845 * @see Module::getDataLayoutStr()
846 *
847 * LLVMGetDataLayout is DEPRECATED, as the name is not only incorrect,
848 * but match the name of another method on the module. Prefer the use
849 * of LLVMGetDataLayoutStr, which is not ambiguous.
850 */
852const char *LLVMGetDataLayout(LLVMModuleRef M);
853
854/**
855 * Set the data layout for a module.
856 *
857 * @see Module::setDataLayout()
858 */
859void LLVMSetDataLayout(LLVMModuleRef M, const char *DataLayoutStr);
860
861/**
862 * Obtain the target triple for a module.
863 *
864 * @see Module::getTargetTriple()
865 */
866const char *LLVMGetTarget(LLVMModuleRef M);
867
868/**
869 * Set the target triple for a module.
870 *
871 * @see Module::setTargetTriple()
872 */
873void LLVMSetTarget(LLVMModuleRef M, const char *Triple);
874
875/**
876 * Returns the module flags as an array of flag-key-value triples. The caller
877 * is responsible for freeing this array by calling
878 * \c LLVMDisposeModuleFlagsMetadata.
879 *
880 * @see Module::getModuleFlagsMetadata()
881 */
883
884/**
885 * Destroys module flags metadata entries.
886 */
888
889/**
890 * Returns the flag behavior for a module flag entry at a specific index.
891 *
892 * @see Module::ModuleFlagEntry::Behavior
893 */
896 unsigned Index);
897
898/**
899 * Returns the key for a module flag entry at a specific index.
900 *
901 * @see Module::ModuleFlagEntry::Key
902 */
904 unsigned Index, size_t *Len);
905
906/**
907 * Returns the metadata for a module flag entry at a specific index.
908 *
909 * @see Module::ModuleFlagEntry::Val
910 */
912 unsigned Index);
913
914/**
915 * Add a module-level flag to the module-level flags metadata if it doesn't
916 * already exist.
917 *
918 * @see Module::getModuleFlag()
919 */
921 const char *Key, size_t KeyLen);
922
923/**
924 * Add a module-level flag to the module-level flags metadata if it doesn't
925 * already exist.
926 *
927 * @see Module::addModuleFlag()
928 */
930 const char *Key, size_t KeyLen,
931 LLVMMetadataRef Val);
932
933/**
934 * Dump a representation of a module to stderr.
935 *
936 * @see Module::dump()
937 */
939
940/**
941 * Print a representation of a module to a file. The ErrorMessage needs to be
942 * disposed with LLVMDisposeMessage. Returns 0 on success, 1 otherwise.
943 *
944 * @see Module::print()
945 */
946LLVMBool LLVMPrintModuleToFile(LLVMModuleRef M, const char *Filename,
947 char **ErrorMessage);
948
949/**
950 * Return a string representation of the module. Use
951 * LLVMDisposeMessage to free the string.
952 *
953 * @see Module::print()
954 */
956
957/**
958 * Get inline assembly for a module.
959 *
960 * @see Module::getModuleInlineAsm()
961 */
962const char *LLVMGetModuleInlineAsm(LLVMModuleRef M, size_t *Len);
963
964/**
965 * Set inline assembly for a module.
966 *
967 * @see Module::setModuleInlineAsm()
968 */
969void LLVMSetModuleInlineAsm2(LLVMModuleRef M, const char *Asm, size_t Len);
970
971/**
972 * Append inline assembly to a module.
973 *
974 * @see Module::appendModuleInlineAsm()
975 */
976void LLVMAppendModuleInlineAsm(LLVMModuleRef M, const char *Asm, size_t Len);
977
978/**
979 * Create the specified uniqued inline asm string.
980 *
981 * @see InlineAsm::get()
982 */
983LLVMValueRef LLVMGetInlineAsm(LLVMTypeRef Ty, const char *AsmString,
984 size_t AsmStringSize, const char *Constraints,
985 size_t ConstraintsSize, LLVMBool HasSideEffects,
986 LLVMBool IsAlignStack,
987 LLVMInlineAsmDialect Dialect, LLVMBool CanThrow);
988
989/**
990 * Get the template string used for an inline assembly snippet
991 *
992 */
993const char *LLVMGetInlineAsmAsmString(LLVMValueRef InlineAsmVal, size_t *Len);
994
995/**
996 * Get the raw constraint string for an inline assembly snippet
997 *
998 */
999const char *LLVMGetInlineAsmConstraintString(LLVMValueRef InlineAsmVal,
1000 size_t *Len);
1001
1002/**
1003 * Get the dialect used by the inline asm snippet
1004 *
1005 */
1007
1008/**
1009 * Get the function type of the inline assembly snippet. The same type that
1010 * was passed into LLVMGetInlineAsm originally
1011 *
1012 * @see LLVMGetInlineAsm
1013 *
1014 */
1016
1017/**
1018 * Get if the inline asm snippet has side effects
1019 *
1020 */
1022
1023/**
1024 * Get if the inline asm snippet needs an aligned stack
1025 *
1026 */
1028
1029/**
1030 * Get if the inline asm snippet may unwind the stack
1031 *
1032 */
1034
1035/**
1036 * Obtain the context to which this module is associated.
1037 *
1038 * @see Module::getContext()
1039 */
1041
1042/** Deprecated: Use LLVMGetTypeByName2 instead. */
1044
1045/**
1046 * Obtain an iterator to the first NamedMDNode in a Module.
1047 *
1048 * @see llvm::Module::named_metadata_begin()
1049 */
1051
1052/**
1053 * Obtain an iterator to the last NamedMDNode in a Module.
1054 *
1055 * @see llvm::Module::named_metadata_end()
1056 */
1058
1059/**
1060 * Advance a NamedMDNode iterator to the next NamedMDNode.
1061 *
1062 * Returns NULL if the iterator was already at the end and there are no more
1063 * named metadata nodes.
1064 */
1066
1067/**
1068 * Decrement a NamedMDNode iterator to the previous NamedMDNode.
1069 *
1070 * Returns NULL if the iterator was already at the beginning and there are
1071 * no previous named metadata nodes.
1072 */
1074
1075/**
1076 * Retrieve a NamedMDNode with the given name, returning NULL if no such
1077 * node exists.
1078 *
1079 * @see llvm::Module::getNamedMetadata()
1080 */
1082 const char *Name, size_t NameLen);
1083
1084/**
1085 * Retrieve a NamedMDNode with the given name, creating a new node if no such
1086 * node exists.
1087 *
1088 * @see llvm::Module::getOrInsertNamedMetadata()
1089 */
1091 const char *Name,
1092 size_t NameLen);
1093
1094/**
1095 * Retrieve the name of a NamedMDNode.
1096 *
1097 * @see llvm::NamedMDNode::getName()
1098 */
1100 size_t *NameLen);
1101
1102/**
1103 * Obtain the number of operands for named metadata in a module.
1104 *
1105 * @see llvm::Module::getNamedMetadata()
1106 */
1107unsigned LLVMGetNamedMetadataNumOperands(LLVMModuleRef M, const char *Name);
1108
1109/**
1110 * Obtain the named metadata operands for a module.
1111 *
1112 * The passed LLVMValueRef pointer should refer to an array of
1113 * LLVMValueRef at least LLVMGetNamedMetadataNumOperands long. This
1114 * array will be populated with the LLVMValueRef instances. Each
1115 * instance corresponds to a llvm::MDNode.
1116 *
1117 * @see llvm::Module::getNamedMetadata()
1118 * @see llvm::MDNode::getOperand()
1119 */
1121 LLVMValueRef *Dest);
1122
1123/**
1124 * Add an operand to named metadata.
1125 *
1126 * @see llvm::Module::getNamedMetadata()
1127 * @see llvm::MDNode::addOperand()
1128 */
1130 LLVMValueRef Val);
1131
1132/**
1133 * Return the directory of the debug location for this value, which must be
1134 * an llvm::Instruction, llvm::GlobalVariable, or llvm::Function.
1135 *
1136 * @see llvm::Instruction::getDebugLoc()
1137 * @see llvm::GlobalVariable::getDebugInfo()
1138 * @see llvm::Function::getSubprogram()
1139 */
1140const char *LLVMGetDebugLocDirectory(LLVMValueRef Val, unsigned *Length);
1141
1142/**
1143 * Return the filename of the debug location for this value, which must be
1144 * an llvm::Instruction, llvm::GlobalVariable, or llvm::Function.
1145 *
1146 * @see llvm::Instruction::getDebugLoc()
1147 * @see llvm::GlobalVariable::getDebugInfo()
1148 * @see llvm::Function::getSubprogram()
1149 */
1150const char *LLVMGetDebugLocFilename(LLVMValueRef Val, unsigned *Length);
1151
1152/**
1153 * Return the line number of the debug location for this value, which must be
1154 * an llvm::Instruction, llvm::GlobalVariable, or llvm::Function.
1155 *
1156 * @see llvm::Instruction::getDebugLoc()
1157 * @see llvm::GlobalVariable::getDebugInfo()
1158 * @see llvm::Function::getSubprogram()
1159 */
1160unsigned LLVMGetDebugLocLine(LLVMValueRef Val);
1161
1162/**
1163 * Return the column number of the debug location for this value, which must be
1164 * an llvm::Instruction.
1165 *
1166 * @see llvm::Instruction::getDebugLoc()
1167 */
1169
1170/**
1171 * Add a function to a module under a specified name.
1172 *
1173 * @see llvm::Function::Create()
1174 */
1176 LLVMTypeRef FunctionTy);
1177
1178/**
1179 * Obtain a Function value from a Module by its name.
1180 *
1181 * The returned value corresponds to a llvm::Function value.
1182 *
1183 * @see llvm::Module::getFunction()
1184 */
1186
1187/**
1188 * Obtain a Function value from a Module by its name.
1189 *
1190 * The returned value corresponds to a llvm::Function value.
1191 *
1192 * @see llvm::Module::getFunction()
1193 */
1195 size_t Length);
1196
1197/**
1198 * Obtain an iterator to the first Function in a Module.
1199 *
1200 * @see llvm::Module::begin()
1201 */
1203
1204/**
1205 * Obtain an iterator to the last Function in a Module.
1206 *
1207 * @see llvm::Module::end()
1208 */
1210
1211/**
1212 * Advance a Function iterator to the next Function.
1213 *
1214 * Returns NULL if the iterator was already at the end and there are no more
1215 * functions.
1216 */
1218
1219/**
1220 * Decrement a Function iterator to the previous Function.
1221 *
1222 * Returns NULL if the iterator was already at the beginning and there are
1223 * no previous functions.
1224 */
1226
1227/** Deprecated: Use LLVMSetModuleInlineAsm2 instead. */
1228void LLVMSetModuleInlineAsm(LLVMModuleRef M, const char *Asm);
1229
1230/**
1231 * @}
1232 */
1233
1234/**
1235 * @defgroup LLVMCCoreType Types
1236 *
1237 * Types represent the type of a value.
1238 *
1239 * Types are associated with a context instance. The context internally
1240 * deduplicates types so there is only 1 instance of a specific type
1241 * alive at a time. In other words, a unique type is shared among all
1242 * consumers within a context.
1243 *
1244 * A Type in the C API corresponds to llvm::Type.
1245 *
1246 * Types have the following hierarchy:
1247 *
1248 * types:
1249 * integer type
1250 * real type
1251 * function type
1252 * sequence types:
1253 * array type
1254 * pointer type
1255 * vector type
1256 * void type
1257 * label type
1258 * opaque type
1259 *
1260 * @{
1261 */
1262
1263/**
1264 * Obtain the enumerated type of a Type instance.
1265 *
1266 * @see llvm::Type:getTypeID()
1267 */
1269
1270/**
1271 * Whether the type has a known size.
1272 *
1273 * Things that don't have a size are abstract types, labels, and void.a
1274 *
1275 * @see llvm::Type::isSized()
1276 */
1278
1279/**
1280 * Obtain the context to which this type instance is associated.
1281 *
1282 * @see llvm::Type::getContext()
1283 */
1285
1286/**
1287 * Dump a representation of a type to stderr.
1288 *
1289 * @see llvm::Type::dump()
1290 */
1291void LLVMDumpType(LLVMTypeRef Val);
1292
1293/**
1294 * Return a string representation of the type. Use
1295 * LLVMDisposeMessage to free the string.
1296 *
1297 * @see llvm::Type::print()
1298 */
1300
1301/**
1302 * @defgroup LLVMCCoreTypeInt Integer Types
1303 *
1304 * Functions in this section operate on integer types.
1305 *
1306 * @{
1307 */
1308
1309/**
1310 * Obtain an integer type from a context with specified bit width.
1311 */
1319
1320/**
1321 * Obtain an integer type from the global context with a specified bit
1322 * width.
1323 */
1330LLVMTypeRef LLVMIntType(unsigned NumBits);
1331unsigned LLVMGetIntTypeWidth(LLVMTypeRef IntegerTy);
1332
1333/**
1334 * @}
1335 */
1336
1337/**
1338 * @defgroup LLVMCCoreTypeFloat Floating Point Types
1339 *
1340 * @{
1341 */
1342
1343/**
1344 * Obtain a 16-bit floating point type from a context.
1345 */
1347
1348/**
1349 * Obtain a 16-bit brain floating point type from a context.
1350 */
1352
1353/**
1354 * Obtain a 32-bit floating point type from a context.
1355 */
1357
1358/**
1359 * Obtain a 64-bit floating point type from a context.
1360 */
1362
1363/**
1364 * Obtain a 80-bit floating point type (X87) from a context.
1365 */
1367
1368/**
1369 * Obtain a 128-bit floating point type (112-bit mantissa) from a
1370 * context.
1371 */
1373
1374/**
1375 * Obtain a 128-bit floating point type (two 64-bits) from a context.
1376 */
1378
1379/**
1380 * Obtain a floating point type from the global context.
1381 *
1382 * These map to the functions in this group of the same name.
1383 */
1391
1392/**
1393 * @}
1394 */
1395
1396/**
1397 * @defgroup LLVMCCoreTypeFunction Function Types
1398 *
1399 * @{
1400 */
1401
1402/**
1403 * Obtain a function type consisting of a specified signature.
1404 *
1405 * The function is defined as a tuple of a return Type, a list of
1406 * parameter types, and whether the function is variadic.
1407 */
1409 LLVMTypeRef *ParamTypes, unsigned ParamCount,
1410 LLVMBool IsVarArg);
1411
1412/**
1413 * Returns whether a function type is variadic.
1414 */
1416
1417/**
1418 * Obtain the Type this function Type returns.
1419 */
1421
1422/**
1423 * Obtain the number of parameters this function accepts.
1424 */
1425unsigned LLVMCountParamTypes(LLVMTypeRef FunctionTy);
1426
1427/**
1428 * Obtain the types of a function's parameters.
1429 *
1430 * The Dest parameter should point to a pre-allocated array of
1431 * LLVMTypeRef at least LLVMCountParamTypes() large. On return, the
1432 * first LLVMCountParamTypes() entries in the array will be populated
1433 * with LLVMTypeRef instances.
1434 *
1435 * @param FunctionTy The function type to operate on.
1436 * @param Dest Memory address of an array to be filled with result.
1437 */
1438void LLVMGetParamTypes(LLVMTypeRef FunctionTy, LLVMTypeRef *Dest);
1439
1440/**
1441 * @}
1442 */
1443
1444/**
1445 * @defgroup LLVMCCoreTypeStruct Structure Types
1446 *
1447 * These functions relate to LLVMTypeRef instances.
1448 *
1449 * @see llvm::StructType
1450 *
1451 * @{
1452 */
1453
1454/**
1455 * Create a new structure type in a context.
1456 *
1457 * A structure is specified by a list of inner elements/types and
1458 * whether these can be packed together.
1459 *
1460 * @see llvm::StructType::create()
1461 */
1463 unsigned ElementCount, LLVMBool Packed);
1464
1465/**
1466 * Create a new structure type in the global context.
1467 *
1468 * @see llvm::StructType::create()
1469 */
1470LLVMTypeRef LLVMStructType(LLVMTypeRef *ElementTypes, unsigned ElementCount,
1471 LLVMBool Packed);
1472
1473/**
1474 * Create an empty structure in a context having a specified name.
1475 *
1476 * @see llvm::StructType::create()
1477 */
1479
1480/**
1481 * Obtain the name of a structure.
1482 *
1483 * @see llvm::StructType::getName()
1484 */
1485const char *LLVMGetStructName(LLVMTypeRef Ty);
1486
1487/**
1488 * Set the contents of a structure type.
1489 *
1490 * @see llvm::StructType::setBody()
1491 */
1492void LLVMStructSetBody(LLVMTypeRef StructTy, LLVMTypeRef *ElementTypes,
1493 unsigned ElementCount, LLVMBool Packed);
1494
1495/**
1496 * Get the number of elements defined inside the structure.
1497 *
1498 * @see llvm::StructType::getNumElements()
1499 */
1500unsigned LLVMCountStructElementTypes(LLVMTypeRef StructTy);
1501
1502/**
1503 * Get the elements within a structure.
1504 *
1505 * The function is passed the address of a pre-allocated array of
1506 * LLVMTypeRef at least LLVMCountStructElementTypes() long. After
1507 * invocation, this array will be populated with the structure's
1508 * elements. The objects in the destination array will have a lifetime
1509 * of the structure type itself, which is the lifetime of the context it
1510 * is contained in.
1511 */
1513
1514/**
1515 * Get the type of the element at a given index in the structure.
1516 *
1517 * @see llvm::StructType::getTypeAtIndex()
1518 */
1520
1521/**
1522 * Determine whether a structure is packed.
1523 *
1524 * @see llvm::StructType::isPacked()
1525 */
1527
1528/**
1529 * Determine whether a structure is opaque.
1530 *
1531 * @see llvm::StructType::isOpaque()
1532 */
1534
1535/**
1536 * Determine whether a structure is literal.
1537 *
1538 * @see llvm::StructType::isLiteral()
1539 */
1541
1542/**
1543 * @}
1544 */
1545
1546/**
1547 * @defgroup LLVMCCoreTypeSequential Sequential Types
1548 *
1549 * Sequential types represents "arrays" of types. This is a super class
1550 * for array, vector, and pointer types.
1551 *
1552 * @{
1553 */
1554
1555/**
1556 * Obtain the element type of an array or vector type.
1557 *
1558 * @see llvm::SequentialType::getElementType()
1559 */
1561
1562/**
1563 * Returns type's subtypes
1564 *
1565 * @see llvm::Type::subtypes()
1566 */
1568
1569/**
1570 * Return the number of types in the derived type.
1571 *
1572 * @see llvm::Type::getNumContainedTypes()
1573 */
1575
1576/**
1577 * Create a fixed size array type that refers to a specific type.
1578 *
1579 * The created type will exist in the context that its element type
1580 * exists in.
1581 *
1582 * @deprecated LLVMArrayType is deprecated in favor of the API accurate
1583 * LLVMArrayType2
1584 * @see llvm::ArrayType::get()
1585 */
1586LLVMTypeRef LLVMArrayType(LLVMTypeRef ElementType, unsigned ElementCount);
1587
1588/**
1589 * Create a fixed size array type that refers to a specific type.
1590 *
1591 * The created type will exist in the context that its element type
1592 * exists in.
1593 *
1594 * @see llvm::ArrayType::get()
1595 */
1596LLVMTypeRef LLVMArrayType2(LLVMTypeRef ElementType, uint64_t ElementCount);
1597
1598/**
1599 * Obtain the length of an array type.
1600 *
1601 * This only works on types that represent arrays.
1602 *
1603 * @deprecated LLVMGetArrayLength is deprecated in favor of the API accurate
1604 * LLVMGetArrayLength2
1605 * @see llvm::ArrayType::getNumElements()
1606 */
1607unsigned LLVMGetArrayLength(LLVMTypeRef ArrayTy);
1608
1609/**
1610 * Obtain the length of an array type.
1611 *
1612 * This only works on types that represent arrays.
1613 *
1614 * @see llvm::ArrayType::getNumElements()
1615 */
1617
1618/**
1619 * Create a pointer type that points to a defined type.
1620 *
1621 * The created type will exist in the context that its pointee type
1622 * exists in.
1623 *
1624 * @see llvm::PointerType::get()
1625 */
1626LLVMTypeRef LLVMPointerType(LLVMTypeRef ElementType, unsigned AddressSpace);
1627
1628/**
1629 * Determine whether a pointer is opaque.
1630 *
1631 * True if this is an instance of an opaque PointerType.
1632 *
1633 * @see llvm::Type::isOpaquePointerTy()
1634 */
1636
1637/**
1638 * Create an opaque pointer type in a context.
1639 *
1640 * @see llvm::PointerType::get()
1641 */
1643
1644/**
1645 * Obtain the address space of a pointer type.
1646 *
1647 * This only works on types that represent pointers.
1648 *
1649 * @see llvm::PointerType::getAddressSpace()
1650 */
1651unsigned LLVMGetPointerAddressSpace(LLVMTypeRef PointerTy);
1652
1653/**
1654 * Create a vector type that contains a defined type and has a specific
1655 * number of elements.
1656 *
1657 * The created type will exist in the context thats its element type
1658 * exists in.
1659 *
1660 * @see llvm::VectorType::get()
1661 */
1662LLVMTypeRef LLVMVectorType(LLVMTypeRef ElementType, unsigned ElementCount);
1663
1664/**
1665 * Create a vector type that contains a defined type and has a scalable
1666 * number of elements.
1667 *
1668 * The created type will exist in the context thats its element type
1669 * exists in.
1670 *
1671 * @see llvm::ScalableVectorType::get()
1672 */
1674 unsigned ElementCount);
1675
1676/**
1677 * Obtain the (possibly scalable) number of elements in a vector type.
1678 *
1679 * This only works on types that represent vectors (fixed or scalable).
1680 *
1681 * @see llvm::VectorType::getNumElements()
1682 */
1683unsigned LLVMGetVectorSize(LLVMTypeRef VectorTy);
1684
1685/**
1686 * Get the pointer value for the associated ConstantPtrAuth constant.
1687 *
1688 * @see llvm::ConstantPtrAuth::getPointer
1689 */
1691
1692/**
1693 * Get the key value for the associated ConstantPtrAuth constant.
1694 *
1695 * @see llvm::ConstantPtrAuth::getKey
1696 */
1698
1699/**
1700 * Get the discriminator value for the associated ConstantPtrAuth constant.
1701 *
1702 * @see llvm::ConstantPtrAuth::getDiscriminator
1703 */
1705
1706/**
1707 * Get the address discriminator value for the associated ConstantPtrAuth
1708 * constant.
1709 *
1710 * @see llvm::ConstantPtrAuth::getAddrDiscriminator
1711 */
1713
1714/**
1715 * @}
1716 */
1717
1718/**
1719 * @defgroup LLVMCCoreTypeOther Other Types
1720 *
1721 * @{
1722 */
1723
1724/**
1725 * Create a void type in a context.
1726 */
1728
1729/**
1730 * Create a label type in a context.
1731 */
1733
1734/**
1735 * Create a X86 AMX type in a context.
1736 */
1738
1739/**
1740 * Create a token type in a context.
1741 */
1743
1744/**
1745 * Create a metadata type in a context.
1746 */
1748
1749/**
1750 * These are similar to the above functions except they operate on the
1751 * global context.
1752 */
1756
1757/**
1758 * Create a target extension type in LLVM context.
1759 */
1761 LLVMTypeRef *TypeParams,
1762 unsigned TypeParamCount,
1763 unsigned *IntParams,
1764 unsigned IntParamCount);
1765
1766/**
1767 * Obtain the name for this target extension type.
1768 *
1769 * @see llvm::TargetExtType::getName()
1770 */
1771const char *LLVMGetTargetExtTypeName(LLVMTypeRef TargetExtTy);
1772
1773/**
1774 * Obtain the number of type parameters for this target extension type.
1775 *
1776 * @see llvm::TargetExtType::getNumTypeParameters()
1777 */
1779
1780/**
1781 * Get the type parameter at the given index for the target extension type.
1782 *
1783 * @see llvm::TargetExtType::getTypeParameter()
1784 */
1786 unsigned Idx);
1787
1788/**
1789 * Obtain the number of int parameters for this target extension type.
1790 *
1791 * @see llvm::TargetExtType::getNumIntParameters()
1792 */
1793unsigned LLVMGetTargetExtTypeNumIntParams(LLVMTypeRef TargetExtTy);
1794
1795/**
1796 * Get the int parameter at the given index for the target extension type.
1797 *
1798 * @see llvm::TargetExtType::getIntParameter()
1799 */
1800unsigned LLVMGetTargetExtTypeIntParam(LLVMTypeRef TargetExtTy, unsigned Idx);
1801
1802/**
1803 * @}
1804 */
1805
1806/**
1807 * @}
1808 */
1809
1810/**
1811 * @defgroup LLVMCCoreValues Values
1812 *
1813 * The bulk of LLVM's object model consists of values, which comprise a very
1814 * rich type hierarchy.
1815 *
1816 * LLVMValueRef essentially represents llvm::Value. There is a rich
1817 * hierarchy of classes within this type. Depending on the instance
1818 * obtained, not all APIs are available.
1819 *
1820 * Callers can determine the type of an LLVMValueRef by calling the
1821 * LLVMIsA* family of functions (e.g. LLVMIsAArgument()). These
1822 * functions are defined by a macro, so it isn't obvious which are
1823 * available by looking at the Doxygen source code. Instead, look at the
1824 * source definition of LLVM_FOR_EACH_VALUE_SUBCLASS and note the list
1825 * of value names given. These value names also correspond to classes in
1826 * the llvm::Value hierarchy.
1827 *
1828 * @{
1829 */
1830
1831// Currently, clang-format tries to format the LLVM_FOR_EACH_VALUE_SUBCLASS
1832// macro in a progressively-indented fashion, which is not desired
1833// clang-format off
1834
1835#define LLVM_FOR_EACH_VALUE_SUBCLASS(macro) \
1836 macro(Argument) \
1837 macro(BasicBlock) \
1838 macro(InlineAsm) \
1839 macro(User) \
1840 macro(Constant) \
1841 macro(BlockAddress) \
1842 macro(ConstantAggregateZero) \
1843 macro(ConstantArray) \
1844 macro(ConstantDataSequential) \
1845 macro(ConstantDataArray) \
1846 macro(ConstantDataVector) \
1847 macro(ConstantExpr) \
1848 macro(ConstantFP) \
1849 macro(ConstantInt) \
1850 macro(ConstantPointerNull) \
1851 macro(ConstantStruct) \
1852 macro(ConstantTokenNone) \
1853 macro(ConstantVector) \
1854 macro(ConstantPtrAuth) \
1855 macro(GlobalValue) \
1856 macro(GlobalAlias) \
1857 macro(GlobalObject) \
1858 macro(Function) \
1859 macro(GlobalVariable) \
1860 macro(GlobalIFunc) \
1861 macro(UndefValue) \
1862 macro(PoisonValue) \
1863 macro(Instruction) \
1864 macro(UnaryOperator) \
1865 macro(BinaryOperator) \
1866 macro(CallInst) \
1867 macro(IntrinsicInst) \
1868 macro(DbgInfoIntrinsic) \
1869 macro(DbgVariableIntrinsic) \
1870 macro(DbgDeclareInst) \
1871 macro(DbgLabelInst) \
1872 macro(MemIntrinsic) \
1873 macro(MemCpyInst) \
1874 macro(MemMoveInst) \
1875 macro(MemSetInst) \
1876 macro(CmpInst) \
1877 macro(FCmpInst) \
1878 macro(ICmpInst) \
1879 macro(ExtractElementInst) \
1880 macro(GetElementPtrInst) \
1881 macro(InsertElementInst) \
1882 macro(InsertValueInst) \
1883 macro(LandingPadInst) \
1884 macro(PHINode) \
1885 macro(SelectInst) \
1886 macro(ShuffleVectorInst) \
1887 macro(StoreInst) \
1888 macro(BranchInst) \
1889 macro(IndirectBrInst) \
1890 macro(InvokeInst) \
1891 macro(ReturnInst) \
1892 macro(SwitchInst) \
1893 macro(UnreachableInst) \
1894 macro(ResumeInst) \
1895 macro(CleanupReturnInst) \
1896 macro(CatchReturnInst) \
1897 macro(CatchSwitchInst) \
1898 macro(CallBrInst) \
1899 macro(FuncletPadInst) \
1900 macro(CatchPadInst) \
1901 macro(CleanupPadInst) \
1902 macro(UnaryInstruction) \
1903 macro(AllocaInst) \
1904 macro(CastInst) \
1905 macro(AddrSpaceCastInst) \
1906 macro(BitCastInst) \
1907 macro(FPExtInst) \
1908 macro(FPToSIInst) \
1909 macro(FPToUIInst) \
1910 macro(FPTruncInst) \
1911 macro(IntToPtrInst) \
1912 macro(PtrToIntInst) \
1913 macro(SExtInst) \
1914 macro(SIToFPInst) \
1915 macro(TruncInst) \
1916 macro(UIToFPInst) \
1917 macro(ZExtInst) \
1918 macro(ExtractValueInst) \
1919 macro(LoadInst) \
1920 macro(VAArgInst) \
1921 macro(FreezeInst) \
1922 macro(AtomicCmpXchgInst) \
1923 macro(AtomicRMWInst) \
1924 macro(FenceInst)
1925
1926// clang-format on
1927
1928/**
1929 * @defgroup LLVMCCoreValueGeneral General APIs
1930 *
1931 * Functions in this section work on all LLVMValueRef instances,
1932 * regardless of their sub-type. They correspond to functions available
1933 * on llvm::Value.
1934 *
1935 * @{
1936 */
1937
1938/**
1939 * Obtain the type of a value.
1940 *
1941 * @see llvm::Value::getType()
1942 */
1944
1945/**
1946 * Obtain the enumerated type of a Value instance.
1947 *
1948 * @see llvm::Value::getValueID()
1949 */
1951
1952/**
1953 * Obtain the string name of a value.
1954 *
1955 * @see llvm::Value::getName()
1956 */
1957const char *LLVMGetValueName2(LLVMValueRef Val, size_t *Length);
1958
1959/**
1960 * Set the string name of a value.
1961 *
1962 * @see llvm::Value::setName()
1963 */
1964void LLVMSetValueName2(LLVMValueRef Val, const char *Name, size_t NameLen);
1965
1966/**
1967 * Dump a representation of a value to stderr.
1968 *
1969 * @see llvm::Value::dump()
1970 */
1971void LLVMDumpValue(LLVMValueRef Val);
1972
1973/**
1974 * Return a string representation of the value. Use
1975 * LLVMDisposeMessage to free the string.
1976 *
1977 * @see llvm::Value::print()
1978 */
1980
1981/**
1982 * Obtain the context to which this value is associated.
1983 *
1984 * @see llvm::Value::getContext()
1985 */
1987
1988/**
1989 * Return a string representation of the DbgRecord. Use
1990 * LLVMDisposeMessage to free the string.
1991 *
1992 * @see llvm::DbgRecord::print()
1993 */
1995
1996/**
1997 * Replace all uses of a value with another one.
1998 *
1999 * @see llvm::Value::replaceAllUsesWith()
2000 */
2002
2003/**
2004 * Determine whether the specified value instance is constant.
2005 */
2007
2008/**
2009 * Determine whether a value instance is undefined.
2010 */
2012
2013/**
2014 * Determine whether a value instance is poisonous.
2015 */
2017
2018/**
2019 * Convert value instances between types.
2020 *
2021 * Internally, an LLVMValueRef is "pinned" to a specific type. This
2022 * series of functions allows you to cast an instance to a specific
2023 * type.
2024 *
2025 * If the cast is not valid for the specified type, NULL is returned.
2026 *
2027 * @see llvm::dyn_cast_or_null<>
2028 */
2029#define LLVM_DECLARE_VALUE_CAST(name) \
2030 LLVMValueRef LLVMIsA##name(LLVMValueRef Val);
2032
2036
2037/** Deprecated: Use LLVMGetValueName2 instead. */
2038const char *LLVMGetValueName(LLVMValueRef Val);
2039/** Deprecated: Use LLVMSetValueName2 instead. */
2040void LLVMSetValueName(LLVMValueRef Val, const char *Name);
2041
2042/**
2043 * @}
2044 */
2045
2046/**
2047 * @defgroup LLVMCCoreValueUses Usage
2048 *
2049 * This module defines functions that allow you to inspect the uses of a
2050 * LLVMValueRef.
2051 *
2052 * It is possible to obtain an LLVMUseRef for any LLVMValueRef instance.
2053 * Each LLVMUseRef (which corresponds to a llvm::Use instance) holds a
2054 * llvm::User and llvm::Value.
2055 *
2056 * @{
2057 */
2058
2059/**
2060 * Obtain the first use of a value.
2061 *
2062 * Uses are obtained in an iterator fashion. First, call this function
2063 * to obtain a reference to the first use. Then, call LLVMGetNextUse()
2064 * on that instance and all subsequently obtained instances until
2065 * LLVMGetNextUse() returns NULL.
2066 *
2067 * @see llvm::Value::use_begin()
2068 */
2070
2071/**
2072 * Obtain the next use of a value.
2073 *
2074 * This effectively advances the iterator. It returns NULL if you are on
2075 * the final use and no more are available.
2076 */
2078
2079/**
2080 * Obtain the user value for a user.
2081 *
2082 * The returned value corresponds to a llvm::User type.
2083 *
2084 * @see llvm::Use::getUser()
2085 */
2087
2088/**
2089 * Obtain the value this use corresponds to.
2090 *
2091 * @see llvm::Use::get().
2092 */
2094
2095/**
2096 * @}
2097 */
2098
2099/**
2100 * @defgroup LLVMCCoreValueUser User value
2101 *
2102 * Function in this group pertain to LLVMValueRef instances that descent
2103 * from llvm::User. This includes constants, instructions, and
2104 * operators.
2105 *
2106 * @{
2107 */
2108
2109/**
2110 * Obtain an operand at a specific index in a llvm::User value.
2111 *
2112 * @see llvm::User::getOperand()
2113 */
2115
2116/**
2117 * Obtain the use of an operand at a specific index in a llvm::User value.
2118 *
2119 * @see llvm::User::getOperandUse()
2120 */
2122
2123/**
2124 * Set an operand at a specific index in a llvm::User value.
2125 *
2126 * @see llvm::User::setOperand()
2127 */
2128void LLVMSetOperand(LLVMValueRef User, unsigned Index, LLVMValueRef Val);
2129
2130/**
2131 * Obtain the number of operands in a llvm::User value.
2132 *
2133 * @see llvm::User::getNumOperands()
2134 */
2136
2137/**
2138 * @}
2139 */
2140
2141/**
2142 * @defgroup LLVMCCoreValueConstant Constants
2143 *
2144 * This section contains APIs for interacting with LLVMValueRef that
2145 * correspond to llvm::Constant instances.
2146 *
2147 * These functions will work for any LLVMValueRef in the llvm::Constant
2148 * class hierarchy.
2149 *
2150 * @{
2151 */
2152
2153/**
2154 * Obtain a constant value referring to the null instance of a type.
2155 *
2156 * @see llvm::Constant::getNullValue()
2157 */
2158LLVMValueRef LLVMConstNull(LLVMTypeRef Ty); /* all zeroes */
2159
2160/**
2161 * Obtain a constant value referring to the instance of a type
2162 * consisting of all ones.
2163 *
2164 * This is only valid for integer types.
2165 *
2166 * @see llvm::Constant::getAllOnesValue()
2167 */
2169
2170/**
2171 * Obtain a constant value referring to an undefined value of a type.
2172 *
2173 * @see llvm::UndefValue::get()
2174 */
2176
2177/**
2178 * Obtain a constant value referring to a poison value of a type.
2179 *
2180 * @see llvm::PoisonValue::get()
2181 */
2183
2184/**
2185 * Determine whether a value instance is null.
2186 *
2187 * @see llvm::Constant::isNullValue()
2188 */
2190
2191/**
2192 * Obtain a constant that is a constant pointer pointing to NULL for a
2193 * specified type.
2194 */
2196
2197/**
2198 * @defgroup LLVMCCoreValueConstantScalar Scalar constants
2199 *
2200 * Functions in this group model LLVMValueRef instances that correspond
2201 * to constants referring to scalar types.
2202 *
2203 * For integer types, the LLVMTypeRef parameter should correspond to a
2204 * llvm::IntegerType instance and the returned LLVMValueRef will
2205 * correspond to a llvm::ConstantInt.
2206 *
2207 * For floating point types, the LLVMTypeRef returned corresponds to a
2208 * llvm::ConstantFP.
2209 *
2210 * @{
2211 */
2212
2213/**
2214 * Obtain a constant value for an integer type.
2215 *
2216 * The returned value corresponds to a llvm::ConstantInt.
2217 *
2218 * @see llvm::ConstantInt::get()
2219 *
2220 * @param IntTy Integer type to obtain value of.
2221 * @param N The value the returned instance should refer to.
2222 * @param SignExtend Whether to sign extend the produced value.
2223 */
2224LLVMValueRef LLVMConstInt(LLVMTypeRef IntTy, unsigned long long N,
2225 LLVMBool SignExtend);
2226
2227/**
2228 * Obtain a constant value for an integer of arbitrary precision.
2229 *
2230 * @see llvm::ConstantInt::get()
2231 */
2233 unsigned NumWords,
2234 const uint64_t Words[]);
2235
2236/**
2237 * Obtain a constant value for an integer parsed from a string.
2238 *
2239 * A similar API, LLVMConstIntOfStringAndSize is also available. If the
2240 * string's length is available, it is preferred to call that function
2241 * instead.
2242 *
2243 * @see llvm::ConstantInt::get()
2244 */
2246 uint8_t Radix);
2247
2248/**
2249 * Obtain a constant value for an integer parsed from a string with
2250 * specified length.
2251 *
2252 * @see llvm::ConstantInt::get()
2253 */
2255 unsigned SLen, uint8_t Radix);
2256
2257/**
2258 * Obtain a constant value referring to a double floating point value.
2259 */
2260LLVMValueRef LLVMConstReal(LLVMTypeRef RealTy, double N);
2261
2262/**
2263 * Obtain a constant for a floating point value parsed from a string.
2264 *
2265 * A similar API, LLVMConstRealOfStringAndSize is also available. It
2266 * should be used if the input string's length is known.
2267 */
2268LLVMValueRef LLVMConstRealOfString(LLVMTypeRef RealTy, const char *Text);
2269
2270/**
2271 * Obtain a constant for a floating point value parsed from a string.
2272 */
2274 unsigned SLen);
2275
2276/**
2277 * Obtain the zero extended value for an integer constant value.
2278 *
2279 * @see llvm::ConstantInt::getZExtValue()
2280 */
2281unsigned long long LLVMConstIntGetZExtValue(LLVMValueRef ConstantVal);
2282
2283/**
2284 * Obtain the sign extended value for an integer constant value.
2285 *
2286 * @see llvm::ConstantInt::getSExtValue()
2287 */
2288long long LLVMConstIntGetSExtValue(LLVMValueRef ConstantVal);
2289
2290/**
2291 * Obtain the double value for an floating point constant value.
2292 * losesInfo indicates if some precision was lost in the conversion.
2293 *
2294 * @see llvm::ConstantFP::getDoubleValue
2295 */
2296double LLVMConstRealGetDouble(LLVMValueRef ConstantVal, LLVMBool *losesInfo);
2297
2298/**
2299 * @}
2300 */
2301
2302/**
2303 * @defgroup LLVMCCoreValueConstantComposite Composite Constants
2304 *
2305 * Functions in this group operate on composite constants.
2306 *
2307 * @{
2308 */
2309
2310/**
2311 * Create a ConstantDataSequential and initialize it with a string.
2312 *
2313 * @deprecated LLVMConstStringInContext is deprecated in favor of the API
2314 * accurate LLVMConstStringInContext2
2315 * @see llvm::ConstantDataArray::getString()
2316 */
2318 unsigned Length, LLVMBool DontNullTerminate);
2319
2320/**
2321 * Create a ConstantDataSequential and initialize it with a string.
2322 *
2323 * @see llvm::ConstantDataArray::getString()
2324 */
2326 size_t Length,
2327 LLVMBool DontNullTerminate);
2328
2329/**
2330 * Create a ConstantDataSequential with string content in the global context.
2331 *
2332 * This is the same as LLVMConstStringInContext except it operates on the
2333 * global context.
2334 *
2335 * @see LLVMConstStringInContext()
2336 * @see llvm::ConstantDataArray::getString()
2337 */
2338LLVMValueRef LLVMConstString(const char *Str, unsigned Length,
2339 LLVMBool DontNullTerminate);
2340
2341/**
2342 * Returns true if the specified constant is an array of i8.
2343 *
2344 * @see ConstantDataSequential::getAsString()
2345 */
2347
2348/**
2349 * Get the given constant data sequential as a string.
2350 *
2351 * @see ConstantDataSequential::getAsString()
2352 */
2353const char *LLVMGetAsString(LLVMValueRef c, size_t *Length);
2354
2355/**
2356 * Create an anonymous ConstantStruct with the specified values.
2357 *
2358 * @see llvm::ConstantStruct::getAnon()
2359 */
2361 LLVMValueRef *ConstantVals,
2362 unsigned Count, LLVMBool Packed);
2363
2364/**
2365 * Create a ConstantStruct in the global Context.
2366 *
2367 * This is the same as LLVMConstStructInContext except it operates on the
2368 * global Context.
2369 *
2370 * @see LLVMConstStructInContext()
2371 */
2372LLVMValueRef LLVMConstStruct(LLVMValueRef *ConstantVals, unsigned Count,
2373 LLVMBool Packed);
2374
2375/**
2376 * Create a ConstantArray from values.
2377 *
2378 * @deprecated LLVMConstArray is deprecated in favor of the API accurate
2379 * LLVMConstArray2
2380 * @see llvm::ConstantArray::get()
2381 */
2383 LLVMValueRef *ConstantVals, unsigned Length);
2384
2385/**
2386 * Create a ConstantArray from values.
2387 *
2388 * @see llvm::ConstantArray::get()
2389 */
2390LLVMValueRef LLVMConstArray2(LLVMTypeRef ElementTy, LLVMValueRef *ConstantVals,
2391 uint64_t Length);
2392
2393/**
2394 * Create a non-anonymous ConstantStruct from values.
2395 *
2396 * @see llvm::ConstantStruct::get()
2397 */
2399 LLVMValueRef *ConstantVals,
2400 unsigned Count);
2401
2402/**
2403 * Get element of a constant aggregate (struct, array or vector) at the
2404 * specified index. Returns null if the index is out of range, or it's not
2405 * possible to determine the element (e.g., because the constant is a
2406 * constant expression.)
2407 *
2408 * @see llvm::Constant::getAggregateElement()
2409 */
2411
2412/**
2413 * Get an element at specified index as a constant.
2414 *
2415 * @see ConstantDataSequential::getElementAsConstant()
2416 */
2419 "Use LLVMGetAggregateElement instead");
2420
2421/**
2422 * Create a ConstantVector from values.
2423 *
2424 * @see llvm::ConstantVector::get()
2425 */
2426LLVMValueRef LLVMConstVector(LLVMValueRef *ScalarConstantVals, unsigned Size);
2427
2428/**
2429 * Create a ConstantPtrAuth constant with the given values.
2430 *
2431 * @see llvm::ConstantPtrAuth::get()
2432 */
2434 LLVMValueRef Disc, LLVMValueRef AddrDisc);
2435
2436/**
2437 * @}
2438 */
2439
2440/**
2441 * @defgroup LLVMCCoreValueConstantExpressions Constant Expressions
2442 *
2443 * Functions in this group correspond to APIs on llvm::ConstantExpr.
2444 *
2445 * @see llvm::ConstantExpr.
2446 *
2447 * @{
2448 */
2456 "Use LLVMConstNull instead.");
2458LLVMValueRef LLVMConstAdd(LLVMValueRef LHSConstant, LLVMValueRef RHSConstant);
2459LLVMValueRef LLVMConstNSWAdd(LLVMValueRef LHSConstant, LLVMValueRef RHSConstant);
2460LLVMValueRef LLVMConstNUWAdd(LLVMValueRef LHSConstant, LLVMValueRef RHSConstant);
2461LLVMValueRef LLVMConstSub(LLVMValueRef LHSConstant, LLVMValueRef RHSConstant);
2462LLVMValueRef LLVMConstNSWSub(LLVMValueRef LHSConstant, LLVMValueRef RHSConstant);
2463LLVMValueRef LLVMConstNUWSub(LLVMValueRef LHSConstant, LLVMValueRef RHSConstant);
2464LLVMValueRef LLVMConstMul(LLVMValueRef LHSConstant, LLVMValueRef RHSConstant);
2465LLVMValueRef LLVMConstNSWMul(LLVMValueRef LHSConstant, LLVMValueRef RHSConstant);
2466LLVMValueRef LLVMConstNUWMul(LLVMValueRef LHSConstant, LLVMValueRef RHSConstant);
2467LLVMValueRef LLVMConstXor(LLVMValueRef LHSConstant, LLVMValueRef RHSConstant);
2469 LLVMValueRef *ConstantIndices, unsigned NumIndices);
2471 LLVMValueRef *ConstantIndices,
2472 unsigned NumIndices);
2473/**
2474 * Creates a constant GetElementPtr expression. Similar to LLVMConstGEP2, but
2475 * allows specifying the no-wrap flags.
2476 *
2477 * @see llvm::ConstantExpr::getGetElementPtr()
2478 */
2480 LLVMValueRef ConstantVal,
2481 LLVMValueRef *ConstantIndices,
2482 unsigned NumIndices,
2483 LLVMGEPNoWrapFlags NoWrapFlags);
2490 LLVMTypeRef ToType);
2492 LLVMTypeRef ToType);
2494 LLVMValueRef IndexConstant);
2496 LLVMValueRef ElementValueConstant,
2497 LLVMValueRef IndexConstant);
2499 LLVMValueRef VectorBConstant,
2500 LLVMValueRef MaskConstant);
2502
2503/**
2504 * Gets the function associated with a given BlockAddress constant value.
2505 */
2507
2508/**
2509 * Gets the basic block associated with a given BlockAddress constant value.
2510 */
2512
2513/** Deprecated: Use LLVMGetInlineAsm instead. */
2515 const char *AsmString, const char *Constraints,
2516 LLVMBool HasSideEffects, LLVMBool IsAlignStack);
2517
2518/**
2519 * @}
2520 */
2521
2522/**
2523 * @defgroup LLVMCCoreValueConstantGlobals Global Values
2524 *
2525 * This group contains functions that operate on global values. Functions in
2526 * this group relate to functions in the llvm::GlobalValue class tree.
2527 *
2528 * @see llvm::GlobalValue
2529 *
2530 * @{
2531 */
2532
2537const char *LLVMGetSection(LLVMValueRef Global);
2538void LLVMSetSection(LLVMValueRef Global, const char *Section);
2544void LLVMSetUnnamedAddress(LLVMValueRef Global, LLVMUnnamedAddr UnnamedAddr);
2545
2546/**
2547 * Returns the "value type" of a global value. This differs from the formal
2548 * type of a global value which is always a pointer type.
2549 *
2550 * @see llvm::GlobalValue::getValueType()
2551 */
2553
2554/** Deprecated: Use LLVMGetUnnamedAddress instead. */
2556/** Deprecated: Use LLVMSetUnnamedAddress instead. */
2557void LLVMSetUnnamedAddr(LLVMValueRef Global, LLVMBool HasUnnamedAddr);
2558
2559/**
2560 * @defgroup LLVMCCoreValueWithAlignment Values with alignment
2561 *
2562 * Functions in this group only apply to values with alignment, i.e.
2563 * global variables, load and store instructions.
2564 */
2565
2566/**
2567 * Obtain the preferred alignment of the value.
2568 * @see llvm::AllocaInst::getAlignment()
2569 * @see llvm::LoadInst::getAlignment()
2570 * @see llvm::StoreInst::getAlignment()
2571 * @see llvm::AtomicRMWInst::setAlignment()
2572 * @see llvm::AtomicCmpXchgInst::setAlignment()
2573 * @see llvm::GlobalValue::getAlignment()
2574 */
2575unsigned LLVMGetAlignment(LLVMValueRef V);
2576
2577/**
2578 * Set the preferred alignment of the value.
2579 * @see llvm::AllocaInst::setAlignment()
2580 * @see llvm::LoadInst::setAlignment()
2581 * @see llvm::StoreInst::setAlignment()
2582 * @see llvm::AtomicRMWInst::setAlignment()
2583 * @see llvm::AtomicCmpXchgInst::setAlignment()
2584 * @see llvm::GlobalValue::setAlignment()
2585 */
2586void LLVMSetAlignment(LLVMValueRef V, unsigned Bytes);
2587
2588/**
2589 * Sets a metadata attachment, erasing the existing metadata attachment if
2590 * it already exists for the given kind.
2591 *
2592 * @see llvm::GlobalObject::setMetadata()
2593 */
2594void LLVMGlobalSetMetadata(LLVMValueRef Global, unsigned Kind,
2595 LLVMMetadataRef MD);
2596
2597/**
2598 * Erases a metadata attachment of the given kind if it exists.
2599 *
2600 * @see llvm::GlobalObject::eraseMetadata()
2601 */
2602void LLVMGlobalEraseMetadata(LLVMValueRef Global, unsigned Kind);
2603
2604/**
2605 * Removes all metadata attachments from this value.
2606 *
2607 * @see llvm::GlobalObject::clearMetadata()
2608 */
2610
2611/**
2612 * Retrieves an array of metadata entries representing the metadata attached to
2613 * this value. The caller is responsible for freeing this array by calling
2614 * \c LLVMDisposeValueMetadataEntries.
2615 *
2616 * @see llvm::GlobalObject::getAllMetadata()
2617 */
2619 size_t *NumEntries);
2620
2621/**
2622 * Destroys value metadata entries.
2623 */
2625
2626/**
2627 * Returns the kind of a value metadata entry at a specific index.
2628 */
2630 unsigned Index);
2631
2632/**
2633 * Returns the underlying metadata node of a value metadata entry at a
2634 * specific index.
2635 */
2638 unsigned Index);
2639
2640/**
2641 * @}
2642 */
2643
2644/**
2645 * @defgroup LLVMCoreValueConstantGlobalVariable Global Variables
2646 *
2647 * This group contains functions that operate on global variable values.
2648 *
2649 * @see llvm::GlobalVariable
2650 *
2651 * @{
2652 */
2655 const char *Name,
2656 unsigned AddressSpace);
2659 size_t Length);
2664void LLVMDeleteGlobal(LLVMValueRef GlobalVar);
2666void LLVMSetInitializer(LLVMValueRef GlobalVar, LLVMValueRef ConstantVal);
2668void LLVMSetThreadLocal(LLVMValueRef GlobalVar, LLVMBool IsThreadLocal);
2670void LLVMSetGlobalConstant(LLVMValueRef GlobalVar, LLVMBool IsConstant);
2674void LLVMSetExternallyInitialized(LLVMValueRef GlobalVar, LLVMBool IsExtInit);
2675
2676/**
2677 * @}
2678 */
2679
2680/**
2681 * @defgroup LLVMCoreValueConstantGlobalAlias Global Aliases
2682 *
2683 * This group contains function that operate on global alias values.
2684 *
2685 * @see llvm::GlobalAlias
2686 *
2687 * @{
2688 */
2689
2690/**
2691 * Add a GlobalAlias with the given value type, address space and aliasee.
2692 *
2693 * @see llvm::GlobalAlias::create()
2694 */
2696 unsigned AddrSpace, LLVMValueRef Aliasee,
2697 const char *Name);
2698
2699/**
2700 * Obtain a GlobalAlias value from a Module by its name.
2701 *
2702 * The returned value corresponds to a llvm::GlobalAlias value.
2703 *
2704 * @see llvm::Module::getNamedAlias()
2705 */
2707 const char *Name, size_t NameLen);
2708
2709/**
2710 * Obtain an iterator to the first GlobalAlias in a Module.
2711 *
2712 * @see llvm::Module::alias_begin()
2713 */
2715
2716/**
2717 * Obtain an iterator to the last GlobalAlias in a Module.
2718 *
2719 * @see llvm::Module::alias_end()
2720 */
2722
2723/**
2724 * Advance a GlobalAlias iterator to the next GlobalAlias.
2725 *
2726 * Returns NULL if the iterator was already at the end and there are no more
2727 * global aliases.
2728 */
2730
2731/**
2732 * Decrement a GlobalAlias iterator to the previous GlobalAlias.
2733 *
2734 * Returns NULL if the iterator was already at the beginning and there are
2735 * no previous global aliases.
2736 */
2738
2739/**
2740 * Retrieve the target value of an alias.
2741 */
2743
2744/**
2745 * Set the target value of an alias.
2746 */
2747void LLVMAliasSetAliasee(LLVMValueRef Alias, LLVMValueRef Aliasee);
2748
2749/**
2750 * @}
2751 */
2752
2753/**
2754 * @defgroup LLVMCCoreValueFunction Function values
2755 *
2756 * Functions in this group operate on LLVMValueRef instances that
2757 * correspond to llvm::Function instances.
2758 *
2759 * @see llvm::Function
2760 *
2761 * @{
2762 */
2763
2764/**
2765 * Remove a function from its containing module and deletes it.
2766 *
2767 * @see llvm::Function::eraseFromParent()
2768 */
2770
2771/**
2772 * Check whether the given function has a personality function.
2773 *
2774 * @see llvm::Function::hasPersonalityFn()
2775 */
2777
2778/**
2779 * Obtain the personality function attached to the function.
2780 *
2781 * @see llvm::Function::getPersonalityFn()
2782 */
2784
2785/**
2786 * Set the personality function attached to the function.
2787 *
2788 * @see llvm::Function::setPersonalityFn()
2789 */
2790void LLVMSetPersonalityFn(LLVMValueRef Fn, LLVMValueRef PersonalityFn);
2791
2792/**
2793 * Obtain the intrinsic ID number which matches the given function name.
2794 *
2795 * @see llvm::Function::lookupIntrinsicID()
2796 */
2797unsigned LLVMLookupIntrinsicID(const char *Name, size_t NameLen);
2798
2799/**
2800 * Obtain the ID number from a function instance.
2801 *
2802 * @see llvm::Function::getIntrinsicID()
2803 */
2804unsigned LLVMGetIntrinsicID(LLVMValueRef Fn);
2805
2806/**
2807 * Create or insert the declaration of an intrinsic. For overloaded intrinsics,
2808 * parameter types must be provided to uniquely identify an overload.
2809 *
2810 * @see llvm::Intrinsic::getDeclaration()
2811 */
2813 unsigned ID,
2814 LLVMTypeRef *ParamTypes,
2815 size_t ParamCount);
2816
2817/**
2818 * Retrieves the type of an intrinsic. For overloaded intrinsics, parameter
2819 * types must be provided to uniquely identify an overload.
2820 *
2821 * @see llvm::Intrinsic::getType()
2822 */
2824 LLVMTypeRef *ParamTypes, size_t ParamCount);
2825
2826/**
2827 * Retrieves the name of an intrinsic.
2828 *
2829 * @see llvm::Intrinsic::getName()
2830 */
2831const char *LLVMIntrinsicGetName(unsigned ID, size_t *NameLength);
2832
2833/** Deprecated: Use LLVMIntrinsicCopyOverloadedName2 instead. */
2834const char *LLVMIntrinsicCopyOverloadedName(unsigned ID,
2835 LLVMTypeRef *ParamTypes,
2836 size_t ParamCount,
2837 size_t *NameLength);
2838
2839/**
2840 * Copies the name of an overloaded intrinsic identified by a given list of
2841 * parameter types.
2842 *
2843 * Unlike LLVMIntrinsicGetName, the caller is responsible for freeing the
2844 * returned string.
2845 *
2846 * This version also supports unnamed types.
2847 *
2848 * @see llvm::Intrinsic::getName()
2849 */
2850const char *LLVMIntrinsicCopyOverloadedName2(LLVMModuleRef Mod, unsigned ID,
2851 LLVMTypeRef *ParamTypes,
2852 size_t ParamCount,
2853 size_t *NameLength);
2854
2855/**
2856 * Obtain if the intrinsic identified by the given ID is overloaded.
2857 *
2858 * @see llvm::Intrinsic::isOverloaded()
2859 */
2861
2862/**
2863 * Obtain the calling function of a function.
2864 *
2865 * The returned value corresponds to the LLVMCallConv enumeration.
2866 *
2867 * @see llvm::Function::getCallingConv()
2868 */
2870
2871/**
2872 * Set the calling convention of a function.
2873 *
2874 * @see llvm::Function::setCallingConv()
2875 *
2876 * @param Fn Function to operate on
2877 * @param CC LLVMCallConv to set calling convention to
2878 */
2879void LLVMSetFunctionCallConv(LLVMValueRef Fn, unsigned CC);
2880
2881/**
2882 * Obtain the name of the garbage collector to use during code
2883 * generation.
2884 *
2885 * @see llvm::Function::getGC()
2886 */
2887const char *LLVMGetGC(LLVMValueRef Fn);
2888
2889/**
2890 * Define the garbage collector to use during code generation.
2891 *
2892 * @see llvm::Function::setGC()
2893 */
2894void LLVMSetGC(LLVMValueRef Fn, const char *Name);
2895
2896/**
2897 * Gets the prefix data associated with a function. Only valid on functions, and
2898 * only if LLVMHasPrefixData returns true.
2899 * See https://llvm.org/docs/LangRef.html#prefix-data
2900 */
2902
2903/**
2904 * Check if a given function has prefix data. Only valid on functions.
2905 * See https://llvm.org/docs/LangRef.html#prefix-data
2906 */
2908
2909/**
2910 * Sets the prefix data for the function. Only valid on functions.
2911 * See https://llvm.org/docs/LangRef.html#prefix-data
2912 */
2913void LLVMSetPrefixData(LLVMValueRef Fn, LLVMValueRef prefixData);
2914
2915/**
2916 * Gets the prologue data associated with a function. Only valid on functions,
2917 * and only if LLVMHasPrologueData returns true.
2918 * See https://llvm.org/docs/LangRef.html#prologue-data
2919 */
2921
2922/**
2923 * Check if a given function has prologue data. Only valid on functions.
2924 * See https://llvm.org/docs/LangRef.html#prologue-data
2925 */
2927
2928/**
2929 * Sets the prologue data for the function. Only valid on functions.
2930 * See https://llvm.org/docs/LangRef.html#prologue-data
2931 */
2932void LLVMSetPrologueData(LLVMValueRef Fn, LLVMValueRef prologueData);
2933
2934/**
2935 * Add an attribute to a function.
2936 *
2937 * @see llvm::Function::addAttribute()
2938 */
2943 LLVMAttributeRef *Attrs);
2946 unsigned KindID);
2949 const char *K, unsigned KLen);
2951 unsigned KindID);
2953 const char *K, unsigned KLen);
2954
2955/**
2956 * Add a target-dependent attribute to a function
2957 * @see llvm::AttrBuilder::addAttribute()
2958 */
2960 const char *V);
2961
2962/**
2963 * @defgroup LLVMCCoreValueFunctionParameters Function Parameters
2964 *
2965 * Functions in this group relate to arguments/parameters on functions.
2966 *
2967 * Functions in this group expect LLVMValueRef instances that correspond
2968 * to llvm::Function instances.
2969 *
2970 * @{
2971 */
2972
2973/**
2974 * Obtain the number of parameters in a function.
2975 *
2976 * @see llvm::Function::arg_size()
2977 */
2978unsigned LLVMCountParams(LLVMValueRef Fn);
2979
2980/**
2981 * Obtain the parameters in a function.
2982 *
2983 * The takes a pointer to a pre-allocated array of LLVMValueRef that is
2984 * at least LLVMCountParams() long. This array will be filled with
2985 * LLVMValueRef instances which correspond to the parameters the
2986 * function receives. Each LLVMValueRef corresponds to a llvm::Argument
2987 * instance.
2988 *
2989 * @see llvm::Function::arg_begin()
2990 */
2991void LLVMGetParams(LLVMValueRef Fn, LLVMValueRef *Params);
2992
2993/**
2994 * Obtain the parameter at the specified index.
2995 *
2996 * Parameters are indexed from 0.
2997 *
2998 * @see llvm::Function::arg_begin()
2999 */
3001
3002/**
3003 * Obtain the function to which this argument belongs.
3004 *
3005 * Unlike other functions in this group, this one takes an LLVMValueRef
3006 * that corresponds to a llvm::Attribute.
3007 *
3008 * The returned LLVMValueRef is the llvm::Function to which this
3009 * argument belongs.
3010 */
3012
3013/**
3014 * Obtain the first parameter to a function.
3015 *
3016 * @see llvm::Function::arg_begin()
3017 */
3019
3020/**
3021 * Obtain the last parameter to a function.
3022 *
3023 * @see llvm::Function::arg_end()
3024 */
3026
3027/**
3028 * Obtain the next parameter to a function.
3029 *
3030 * This takes an LLVMValueRef obtained from LLVMGetFirstParam() (which is
3031 * actually a wrapped iterator) and obtains the next parameter from the
3032 * underlying iterator.
3033 */
3035
3036/**
3037 * Obtain the previous parameter to a function.
3038 *
3039 * This is the opposite of LLVMGetNextParam().
3040 */
3042
3043/**
3044 * Set the alignment for a function parameter.
3045 *
3046 * @see llvm::Argument::addAttr()
3047 * @see llvm::AttrBuilder::addAlignmentAttr()
3048 */
3049void LLVMSetParamAlignment(LLVMValueRef Arg, unsigned Align);
3050
3051/**
3052 * @}
3053 */
3054
3055/**
3056 * @defgroup LLVMCCoreValueGlobalIFunc IFuncs
3057 *
3058 * Functions in this group relate to indirect functions.
3059 *
3060 * Functions in this group expect LLVMValueRef instances that correspond
3061 * to llvm::GlobalIFunc instances.
3062 *
3063 * @{
3064 */
3065
3066/**
3067 * Add a global indirect function to a module under a specified name.
3068 *
3069 * @see llvm::GlobalIFunc::create()
3070 */
3072 const char *Name, size_t NameLen,
3073 LLVMTypeRef Ty, unsigned AddrSpace,
3074 LLVMValueRef Resolver);
3075
3076/**
3077 * Obtain a GlobalIFunc value from a Module by its name.
3078 *
3079 * The returned value corresponds to a llvm::GlobalIFunc value.
3080 *
3081 * @see llvm::Module::getNamedIFunc()
3082 */
3084 const char *Name, size_t NameLen);
3085
3086/**
3087 * Obtain an iterator to the first GlobalIFunc in a Module.
3088 *
3089 * @see llvm::Module::ifunc_begin()
3090 */
3092
3093/**
3094 * Obtain an iterator to the last GlobalIFunc in a Module.
3095 *
3096 * @see llvm::Module::ifunc_end()
3097 */
3099
3100/**
3101 * Advance a GlobalIFunc iterator to the next GlobalIFunc.
3102 *
3103 * Returns NULL if the iterator was already at the end and there are no more
3104 * global aliases.
3105 */
3107
3108/**
3109 * Decrement a GlobalIFunc iterator to the previous GlobalIFunc.
3110 *
3111 * Returns NULL if the iterator was already at the beginning and there are
3112 * no previous global aliases.
3113 */
3115
3116/**
3117 * Retrieves the resolver function associated with this indirect function, or
3118 * NULL if it doesn't not exist.
3119 *
3120 * @see llvm::GlobalIFunc::getResolver()
3121 */
3123
3124/**
3125 * Sets the resolver function associated with this indirect function.
3126 *
3127 * @see llvm::GlobalIFunc::setResolver()
3128 */
3130
3131/**
3132 * Remove a global indirect function from its parent module and delete it.
3133 *
3134 * @see llvm::GlobalIFunc::eraseFromParent()
3135 */
3137
3138/**
3139 * Remove a global indirect function from its parent module.
3140 *
3141 * This unlinks the global indirect function from its containing module but
3142 * keeps it alive.
3143 *
3144 * @see llvm::GlobalIFunc::removeFromParent()
3145 */
3147
3148/**
3149 * @}
3150 */
3151
3152/**
3153 * @}
3154 */
3155
3156/**
3157 * @}
3158 */
3159
3160/**
3161 * @}
3162 */
3163
3164/**
3165 * @defgroup LLVMCCoreValueMetadata Metadata
3166 *
3167 * @{
3168 */
3169
3170/**
3171 * Create an MDString value from a given string value.
3172 *
3173 * The MDString value does not take ownership of the given string, it remains
3174 * the responsibility of the caller to free it.
3175 *
3176 * @see llvm::MDString::get()
3177 */
3179 size_t SLen);
3180
3181/**
3182 * Create an MDNode value with the given array of operands.
3183 *
3184 * @see llvm::MDNode::get()
3185 */
3187 size_t Count);
3188
3189/**
3190 * Obtain a Metadata as a Value.
3191 */
3193
3194/**
3195 * Obtain a Value as a Metadata.
3196 */
3198
3199/**
3200 * Obtain the underlying string from a MDString value.
3201 *
3202 * @param V Instance to obtain string from.
3203 * @param Length Memory address which will hold length of returned string.
3204 * @return String data in MDString.
3205 */
3206const char *LLVMGetMDString(LLVMValueRef V, unsigned *Length);
3207
3208/**
3209 * Obtain the number of operands from an MDNode value.
3210 *
3211 * @param V MDNode to get number of operands from.
3212 * @return Number of operands of the MDNode.
3213 */
3215
3216/**
3217 * Obtain the given MDNode's operands.
3218 *
3219 * The passed LLVMValueRef pointer should point to enough memory to hold all of
3220 * the operands of the given MDNode (see LLVMGetMDNodeNumOperands) as
3221 * LLVMValueRefs. This memory will be populated with the LLVMValueRefs of the
3222 * MDNode's operands.
3223 *
3224 * @param V MDNode to get the operands from.
3225 * @param Dest Destination array for operands.
3226 */
3228
3229/**
3230 * Replace an operand at a specific index in a llvm::MDNode value.
3231 *
3232 * @see llvm::MDNode::replaceOperandWith()
3233 */
3235 LLVMMetadataRef Replacement);
3236
3237/** Deprecated: Use LLVMMDStringInContext2 instead. */
3239 unsigned SLen);
3240/** Deprecated: Use LLVMMDStringInContext2 instead. */
3241LLVMValueRef LLVMMDString(const char *Str, unsigned SLen);
3242/** Deprecated: Use LLVMMDNodeInContext2 instead. */
3244 unsigned Count);
3245/** Deprecated: Use LLVMMDNodeInContext2 instead. */
3246LLVMValueRef LLVMMDNode(LLVMValueRef *Vals, unsigned Count);
3247
3248/**
3249 * @}
3250 */
3251
3252/**
3253 * @defgroup LLVMCCoreOperandBundle Operand Bundles
3254 *
3255 * Functions in this group operate on LLVMOperandBundleRef instances that
3256 * correspond to llvm::OperandBundleDef instances.
3257 *
3258 * @see llvm::OperandBundleDef
3259 *
3260 * @{
3261 */
3262
3263/**
3264 * Create a new operand bundle.
3265 *
3266 * Every invocation should be paired with LLVMDisposeOperandBundle() or memory
3267 * will be leaked.
3268 *
3269 * @param Tag Tag name of the operand bundle
3270 * @param TagLen Length of Tag
3271 * @param Args Memory address of an array of bundle operands
3272 * @param NumArgs Length of Args
3273 */
3274LLVMOperandBundleRef LLVMCreateOperandBundle(const char *Tag, size_t TagLen,
3275 LLVMValueRef *Args,
3276 unsigned NumArgs);
3277
3278/**
3279 * Destroy an operand bundle.
3280 *
3281 * This must be called for every created operand bundle or memory will be
3282 * leaked.
3283 */
3285
3286/**
3287 * Obtain the tag of an operand bundle as a string.
3288 *
3289 * @param Bundle Operand bundle to obtain tag of.
3290 * @param Len Out parameter which holds the length of the returned string.
3291 * @return The tag name of Bundle.
3292 * @see OperandBundleDef::getTag()
3293 */
3294const char *LLVMGetOperandBundleTag(LLVMOperandBundleRef Bundle, size_t *Len);
3295
3296/**
3297 * Obtain the number of operands for an operand bundle.
3298 *
3299 * @param Bundle Operand bundle to obtain operand count of.
3300 * @return The number of operands.
3301 * @see OperandBundleDef::input_size()
3302 */
3304
3305/**
3306 * Obtain the operand for an operand bundle at the given index.
3307 *
3308 * @param Bundle Operand bundle to obtain operand of.
3309 * @param Index An operand index, must be less than
3310 * LLVMGetNumOperandBundleArgs().
3311 * @return The operand.
3312 */
3314 unsigned Index);
3315
3316/**
3317 * @}
3318 */
3319
3320/**
3321 * @defgroup LLVMCCoreValueBasicBlock Basic Block
3322 *
3323 * A basic block represents a single entry single exit section of code.
3324 * Basic blocks contain a list of instructions which form the body of
3325 * the block.
3326 *
3327 * Basic blocks belong to functions. They have the type of label.
3328 *
3329 * Basic blocks are themselves values. However, the C API models them as
3330 * LLVMBasicBlockRef.
3331 *
3332 * @see llvm::BasicBlock
3333 *
3334 * @{
3335 */
3336
3337/**
3338 * Convert a basic block instance to a value type.
3339 */
3341
3342/**
3343 * Determine whether an LLVMValueRef is itself a basic block.
3344 */
3346
3347/**
3348 * Convert an LLVMValueRef to an LLVMBasicBlockRef instance.
3349 */
3351
3352/**
3353 * Obtain the string name of a basic block.
3354 */
3356
3357/**
3358 * Obtain the function to which a basic block belongs.
3359 *
3360 * @see llvm::BasicBlock::getParent()
3361 */
3363
3364/**
3365 * Obtain the terminator instruction for a basic block.
3366 *
3367 * If the basic block does not have a terminator (it is not well-formed
3368 * if it doesn't), then NULL is returned.
3369 *
3370 * The returned LLVMValueRef corresponds to an llvm::Instruction.
3371 *
3372 * @see llvm::BasicBlock::getTerminator()
3373 */
3375
3376/**
3377 * Obtain the number of basic blocks in a function.
3378 *
3379 * @param Fn Function value to operate on.
3380 */
3382
3383/**
3384 * Obtain all of the basic blocks in a function.
3385 *
3386 * This operates on a function value. The BasicBlocks parameter is a
3387 * pointer to a pre-allocated array of LLVMBasicBlockRef of at least
3388 * LLVMCountBasicBlocks() in length. This array is populated with
3389 * LLVMBasicBlockRef instances.
3390 */
3392
3393/**
3394 * Obtain the first basic block in a function.
3395 *
3396 * The returned basic block can be used as an iterator. You will likely
3397 * eventually call into LLVMGetNextBasicBlock() with it.
3398 *
3399 * @see llvm::Function::begin()
3400 */
3402
3403/**
3404 * Obtain the last basic block in a function.
3405 *
3406 * @see llvm::Function::end()
3407 */
3409
3410/**
3411 * Advance a basic block iterator.
3412 */
3414
3415/**
3416 * Go backwards in a basic block iterator.
3417 */
3419
3420/**
3421 * Obtain the basic block that corresponds to the entry point of a
3422 * function.
3423 *
3424 * @see llvm::Function::getEntryBlock()
3425 */
3427
3428/**
3429 * Insert the given basic block after the insertion point of the given builder.
3430 *
3431 * The insertion point must be valid.
3432 *
3433 * @see llvm::Function::BasicBlockListType::insertAfter()
3434 */
3437
3438/**
3439 * Append the given basic block to the basic block list of the given function.
3440 *
3441 * @see llvm::Function::BasicBlockListType::push_back()
3442 */
3445
3446/**
3447 * Create a new basic block without inserting it into a function.
3448 *
3449 * @see llvm::BasicBlock::Create()
3450 */
3452 const char *Name);
3453
3454/**
3455 * Append a basic block to the end of a function.
3456 *
3457 * @see llvm::BasicBlock::Create()
3458 */
3460 LLVMValueRef Fn,
3461 const char *Name);
3462
3463/**
3464 * Append a basic block to the end of a function using the global
3465 * context.
3466 *
3467 * @see llvm::BasicBlock::Create()
3468 */
3470
3471/**
3472 * Insert a basic block in a function before another basic block.
3473 *
3474 * The function to add to is determined by the function of the
3475 * passed basic block.
3476 *
3477 * @see llvm::BasicBlock::Create()
3478 */
3481 const char *Name);
3482
3483/**
3484 * Insert a basic block in a function using the global context.
3485 *
3486 * @see llvm::BasicBlock::Create()
3487 */
3489 const char *Name);
3490
3491/**
3492 * Remove a basic block from a function and delete it.
3493 *
3494 * This deletes the basic block from its containing function and deletes
3495 * the basic block itself.
3496 *
3497 * @see llvm::BasicBlock::eraseFromParent()
3498 */
3500
3501/**
3502 * Remove a basic block from a function.
3503 *
3504 * This deletes the basic block from its containing function but keep
3505 * the basic block alive.
3506 *
3507 * @see llvm::BasicBlock::removeFromParent()
3508 */
3510
3511/**
3512 * Move a basic block to before another one.
3513 *
3514 * @see llvm::BasicBlock::moveBefore()
3515 */
3517
3518/**
3519 * Move a basic block to after another one.
3520 *
3521 * @see llvm::BasicBlock::moveAfter()
3522 */
3524
3525/**
3526 * Obtain the first instruction in a basic block.
3527 *
3528 * The returned LLVMValueRef corresponds to a llvm::Instruction
3529 * instance.
3530 */
3532
3533/**
3534 * Obtain the last instruction in a basic block.
3535 *
3536 * The returned LLVMValueRef corresponds to an LLVM:Instruction.
3537 */
3539
3540/**
3541 * @}
3542 */
3543
3544/**
3545 * @defgroup LLVMCCoreValueInstruction Instructions
3546 *
3547 * Functions in this group relate to the inspection and manipulation of
3548 * individual instructions.
3549 *
3550 * In the C++ API, an instruction is modeled by llvm::Instruction. This
3551 * class has a large number of descendents. llvm::Instruction is a
3552 * llvm::Value and in the C API, instructions are modeled by
3553 * LLVMValueRef.
3554 *
3555 * This group also contains sub-groups which operate on specific
3556 * llvm::Instruction types, e.g. llvm::CallInst.
3557 *
3558 * @{
3559 */
3560
3561/**
3562 * Determine whether an instruction has any metadata attached.
3563 */
3565
3566/**
3567 * Return metadata associated with an instruction value.
3568 */
3569LLVMValueRef LLVMGetMetadata(LLVMValueRef Val, unsigned KindID);
3570
3571/**
3572 * Set metadata associated with an instruction value.
3573 */
3574void LLVMSetMetadata(LLVMValueRef Val, unsigned KindID, LLVMValueRef Node);
3575
3576/**
3577 * Returns the metadata associated with an instruction value, but filters out
3578 * all the debug locations.
3579 *
3580 * @see llvm::Instruction::getAllMetadataOtherThanDebugLoc()
3581 */
3584 size_t *NumEntries);
3585
3586/**
3587 * Obtain the basic block to which an instruction belongs.
3588 *
3589 * @see llvm::Instruction::getParent()
3590 */
3592
3593/**
3594 * Obtain the instruction that occurs after the one specified.
3595 *
3596 * The next instruction will be from the same basic block.
3597 *
3598 * If this is the last instruction in a basic block, NULL will be
3599 * returned.
3600 */
3602
3603/**
3604 * Obtain the instruction that occurred before this one.
3605 *
3606 * If the instruction is the first instruction in a basic block, NULL
3607 * will be returned.
3608 */
3610
3611/**
3612 * Remove an instruction.
3613 *
3614 * The instruction specified is removed from its containing building
3615 * block but is kept alive.
3616 *
3617 * @see llvm::Instruction::removeFromParent()
3618 */
3620
3621/**
3622 * Remove and delete an instruction.
3623 *
3624 * The instruction specified is removed from its containing building
3625 * block and then deleted.
3626 *
3627 * @see llvm::Instruction::eraseFromParent()
3628 */
3630
3631/**
3632 * Delete an instruction.
3633 *
3634 * The instruction specified is deleted. It must have previously been
3635 * removed from its containing building block.
3636 *
3637 * @see llvm::Value::deleteValue()
3638 */
3640
3641/**
3642 * Obtain the code opcode for an individual instruction.
3643 *
3644 * @see llvm::Instruction::getOpCode()
3645 */
3647
3648/**
3649 * Obtain the predicate of an instruction.
3650 *
3651 * This is only valid for instructions that correspond to llvm::ICmpInst.
3652 *
3653 * @see llvm::ICmpInst::getPredicate()
3654 */
3656
3657/**
3658 * Obtain the float predicate of an instruction.
3659 *
3660 * This is only valid for instructions that correspond to llvm::FCmpInst.
3661 *
3662 * @see llvm::FCmpInst::getPredicate()
3663 */
3665
3666/**
3667 * Create a copy of 'this' instruction that is identical in all ways
3668 * except the following:
3669 * * The instruction has no parent
3670 * * The instruction has no name
3671 *
3672 * @see llvm::Instruction::clone()
3673 */
3675
3676/**
3677 * Determine whether an instruction is a terminator. This routine is named to
3678 * be compatible with historical functions that did this by querying the
3679 * underlying C++ type.
3680 *
3681 * @see llvm::Instruction::isTerminator()
3682 */
3684
3685/**
3686 * @defgroup LLVMCCoreValueInstructionCall Call Sites and Invocations
3687 *
3688 * Functions in this group apply to instructions that refer to call
3689 * sites and invocations. These correspond to C++ types in the
3690 * llvm::CallInst class tree.
3691 *
3692 * @{
3693 */
3694
3695/**
3696 * Obtain the argument count for a call instruction.
3697 *
3698 * This expects an LLVMValueRef that corresponds to a llvm::CallInst,
3699 * llvm::InvokeInst, or llvm:FuncletPadInst.
3700 *
3701 * @see llvm::CallInst::getNumArgOperands()
3702 * @see llvm::InvokeInst::getNumArgOperands()
3703 * @see llvm::FuncletPadInst::getNumArgOperands()
3704 */
3705unsigned LLVMGetNumArgOperands(LLVMValueRef Instr);
3706
3707/**
3708 * Set the calling convention for a call instruction.
3709 *
3710 * This expects an LLVMValueRef that corresponds to a llvm::CallInst or
3711 * llvm::InvokeInst.
3712 *
3713 * @see llvm::CallInst::setCallingConv()
3714 * @see llvm::InvokeInst::setCallingConv()
3715 */
3716void LLVMSetInstructionCallConv(LLVMValueRef Instr, unsigned CC);
3717
3718/**
3719 * Obtain the calling convention for a call instruction.
3720 *
3721 * This is the opposite of LLVMSetInstructionCallConv(). Reads its
3722 * usage.
3723 *
3724 * @see LLVMSetInstructionCallConv()
3725 */
3727
3729 unsigned Align);
3730
3735 LLVMAttributeRef *Attrs);
3738 unsigned KindID);
3741 const char *K, unsigned KLen);
3743 unsigned KindID);
3745 const char *K, unsigned KLen);
3746
3747/**
3748 * Obtain the function type called by this instruction.
3749 *
3750 * @see llvm::CallBase::getFunctionType()
3751 */
3753
3754/**
3755 * Obtain the pointer to the function invoked by this instruction.
3756 *
3757 * This expects an LLVMValueRef that corresponds to a llvm::CallInst or
3758 * llvm::InvokeInst.
3759 *
3760 * @see llvm::CallInst::getCalledOperand()
3761 * @see llvm::InvokeInst::getCalledOperand()
3762 */
3764
3765/**
3766 * Obtain the number of operand bundles attached to this instruction.
3767 *
3768 * This only works on llvm::CallInst and llvm::InvokeInst instructions.
3769 *
3770 * @see llvm::CallBase::getNumOperandBundles()
3771 */
3773
3774/**
3775 * Obtain the operand bundle attached to this instruction at the given index.
3776 * Use LLVMDisposeOperandBundle to free the operand bundle.
3777 *
3778 * This only works on llvm::CallInst and llvm::InvokeInst instructions.
3779 */
3781 unsigned Index);
3782
3783/**
3784 * Obtain whether a call instruction is a tail call.
3785 *
3786 * This only works on llvm::CallInst instructions.
3787 *
3788 * @see llvm::CallInst::isTailCall()
3789 */
3791
3792/**
3793 * Set whether a call instruction is a tail call.
3794 *
3795 * This only works on llvm::CallInst instructions.
3796 *
3797 * @see llvm::CallInst::setTailCall()
3798 */
3799void LLVMSetTailCall(LLVMValueRef CallInst, LLVMBool IsTailCall);
3800
3801/**
3802 * Obtain a tail call kind of the call instruction.
3803 *
3804 * @see llvm::CallInst::setTailCallKind()
3805 */
3807
3808/**
3809 * Set the call kind of the call instruction.
3810 *
3811 * @see llvm::CallInst::getTailCallKind()
3812 */
3814
3815/**
3816 * Return the normal destination basic block.
3817 *
3818 * This only works on llvm::InvokeInst instructions.
3819 *
3820 * @see llvm::InvokeInst::getNormalDest()
3821 */
3823
3824/**
3825 * Return the unwind destination basic block.
3826 *
3827 * Works on llvm::InvokeInst, llvm::CleanupReturnInst, and
3828 * llvm::CatchSwitchInst instructions.
3829 *
3830 * @see llvm::InvokeInst::getUnwindDest()
3831 * @see llvm::CleanupReturnInst::getUnwindDest()
3832 * @see llvm::CatchSwitchInst::getUnwindDest()
3833 */
3835
3836/**
3837 * Set the normal destination basic block.
3838 *
3839 * This only works on llvm::InvokeInst instructions.
3840 *
3841 * @see llvm::InvokeInst::setNormalDest()
3842 */
3844
3845/**
3846 * Set the unwind destination basic block.
3847 *
3848 * Works on llvm::InvokeInst, llvm::CleanupReturnInst, and
3849 * llvm::CatchSwitchInst instructions.
3850 *
3851 * @see llvm::InvokeInst::setUnwindDest()
3852 * @see llvm::CleanupReturnInst::setUnwindDest()
3853 * @see llvm::CatchSwitchInst::setUnwindDest()
3854 */
3856
3857/**
3858 * Get the default destination of a CallBr instruction.
3859 *
3860 * @see llvm::CallBrInst::getDefaultDest()
3861 */
3863
3864/**
3865 * Get the number of indirect destinations of a CallBr instruction.
3866 *
3867 * @see llvm::CallBrInst::getNumIndirectDests()
3868
3869 */
3871
3872/**
3873 * Get the indirect destination of a CallBr instruction at the given index.
3874 *
3875 * @see llvm::CallBrInst::getIndirectDest()
3876 */
3878
3879/**
3880 * @}
3881 */
3882
3883/**
3884 * @defgroup LLVMCCoreValueInstructionTerminator Terminators
3885 *
3886 * Functions in this group only apply to instructions for which
3887 * LLVMIsATerminatorInst returns true.
3888 *
3889 * @{
3890 */
3891
3892/**
3893 * Return the number of successors that this terminator has.
3894 *
3895 * @see llvm::Instruction::getNumSuccessors
3896 */
3897unsigned LLVMGetNumSuccessors(LLVMValueRef Term);
3898
3899/**
3900 * Return the specified successor.
3901 *
3902 * @see llvm::Instruction::getSuccessor
3903 */
3905
3906/**
3907 * Update the specified successor to point at the provided block.
3908 *
3909 * @see llvm::Instruction::setSuccessor
3910 */
3912
3913/**
3914 * Return if a branch is conditional.
3915 *
3916 * This only works on llvm::BranchInst instructions.
3917 *
3918 * @see llvm::BranchInst::isConditional
3919 */
3921
3922/**
3923 * Return the condition of a branch instruction.
3924 *
3925 * This only works on llvm::BranchInst instructions.
3926 *
3927 * @see llvm::BranchInst::getCondition
3928 */
3930
3931/**
3932 * Set the condition of a branch instruction.
3933 *
3934 * This only works on llvm::BranchInst instructions.
3935 *
3936 * @see llvm::BranchInst::setCondition
3937 */
3939
3940/**
3941 * Obtain the default destination basic block of a switch instruction.
3942 *
3943 * This only works on llvm::SwitchInst instructions.
3944 *
3945 * @see llvm::SwitchInst::getDefaultDest()
3946 */
3948
3949/**
3950 * @}
3951 */
3952
3953/**
3954 * @defgroup LLVMCCoreValueInstructionAlloca Allocas
3955 *
3956 * Functions in this group only apply to instructions that map to
3957 * llvm::AllocaInst instances.
3958 *
3959 * @{
3960 */
3961
3962/**
3963 * Obtain the type that is being allocated by the alloca instruction.
3964 */
3966
3967/**
3968 * @}
3969 */
3970
3971/**
3972 * @defgroup LLVMCCoreValueInstructionGetElementPointer GEPs
3973 *
3974 * Functions in this group only apply to instructions that map to
3975 * llvm::GetElementPtrInst instances.
3976 *
3977 * @{
3978 */
3979
3980/**
3981 * Check whether the given GEP operator is inbounds.
3982 */
3984
3985/**
3986 * Set the given GEP instruction to be inbounds or not.
3987 */
3989
3990/**
3991 * Get the source element type of the given GEP operator.
3992 */
3994
3995/**
3996 * Get the no-wrap related flags for the given GEP instruction.
3997 *
3998 * @see llvm::GetElementPtrInst::getNoWrapFlags
3999 */
4001
4002/**
4003 * Set the no-wrap related flags for the given GEP instruction.
4004 *
4005 * @see llvm::GetElementPtrInst::setNoWrapFlags
4006 */
4008
4009/**
4010 * @}
4011 */
4012
4013/**
4014 * @defgroup LLVMCCoreValueInstructionPHINode PHI Nodes
4015 *
4016 * Functions in this group only apply to instructions that map to
4017 * llvm::PHINode instances.
4018 *
4019 * @{
4020 */
4021
4022/**
4023 * Add an incoming value to the end of a PHI list.
4024 */
4025void LLVMAddIncoming(LLVMValueRef PhiNode, LLVMValueRef *IncomingValues,
4026 LLVMBasicBlockRef *IncomingBlocks, unsigned Count);
4027
4028/**
4029 * Obtain the number of incoming basic blocks to a PHI node.
4030 */
4031unsigned LLVMCountIncoming(LLVMValueRef PhiNode);
4032
4033/**
4034 * Obtain an incoming value to a PHI node as an LLVMValueRef.
4035 */
4037
4038/**
4039 * Obtain an incoming value to a PHI node as an LLVMBasicBlockRef.
4040 */
4042
4043/**
4044 * @}
4045 */
4046
4047/**
4048 * @defgroup LLVMCCoreValueInstructionExtractValue ExtractValue
4049 * @defgroup LLVMCCoreValueInstructionInsertValue InsertValue
4050 *
4051 * Functions in this group only apply to instructions that map to
4052 * llvm::ExtractValue and llvm::InsertValue instances.
4053 *
4054 * @{
4055 */
4056
4057/**
4058 * Obtain the number of indices.
4059 * NB: This also works on GEP operators.
4060 */
4061unsigned LLVMGetNumIndices(LLVMValueRef Inst);
4062
4063/**
4064 * Obtain the indices as an array.
4065 */
4066const unsigned *LLVMGetIndices(LLVMValueRef Inst);
4067
4068/**
4069 * @}
4070 */
4071
4072/**
4073 * @}
4074 */
4075
4076/**
4077 * @}
4078 */
4079
4080/**
4081 * @defgroup LLVMCCoreInstructionBuilder Instruction Builders
4082 *
4083 * An instruction builder represents a point within a basic block and is
4084 * the exclusive means of building instructions using the C interface.
4085 *
4086 * @{
4087 */
4088
4091/**
4092 * Set the builder position before Instr but after any attached debug records,
4093 * or if Instr is null set the position to the end of Block.
4094 */
4096 LLVMValueRef Instr);
4097/**
4098 * Set the builder position before Instr and any attached debug records,
4099 * or if Instr is null set the position to the end of Block.
4100 */
4102 LLVMBasicBlockRef Block,
4103 LLVMValueRef Inst);
4104/**
4105 * Set the builder position before Instr but after any attached debug records.
4106 */
4108/**
4109 * Set the builder position before Instr and any attached debug records.
4110 */
4112 LLVMValueRef Instr);
4118 const char *Name);
4120
4121/* Metadata */
4122
4123/**
4124 * Get location information used by debugging information.
4125 *
4126 * @see llvm::IRBuilder::getCurrentDebugLocation()
4127 */
4129
4130/**
4131 * Set location information used by debugging information.
4132 *
4133 * To clear the location metadata of the given instruction, pass NULL to \p Loc.
4134 *
4135 * @see llvm::IRBuilder::SetCurrentDebugLocation()
4136 */
4138
4139/**
4140 * Attempts to set the debug location for the given instruction using the
4141 * current debug location for the given builder. If the builder has no current
4142 * debug location, this function is a no-op.
4143 *
4144 * @deprecated LLVMSetInstDebugLocation is deprecated in favor of the more general
4145 * LLVMAddMetadataToInst.
4146 *
4147 * @see llvm::IRBuilder::SetInstDebugLocation()
4148 */
4150
4151/**
4152 * Adds the metadata registered with the given builder to the given instruction.
4153 *
4154 * @see llvm::IRBuilder::AddMetadataToInst()
4155 */
4157
4158/**
4159 * Get the dafult floating-point math metadata for a given builder.
4160 *
4161 * @see llvm::IRBuilder::getDefaultFPMathTag()
4162 */
4164
4165/**
4166 * Set the default floating-point math metadata for the given builder.
4167 *
4168 * To clear the metadata, pass NULL to \p FPMathTag.
4169 *
4170 * @see llvm::IRBuilder::setDefaultFPMathTag()
4171 */
4173 LLVMMetadataRef FPMathTag);
4174
4175/**
4176 * Obtain the context to which this builder is associated.
4177 *
4178 * @see llvm::IRBuilder::getContext()
4179 */
4181
4182/**
4183 * Deprecated: Passing the NULL location will crash.
4184 * Use LLVMGetCurrentDebugLocation2 instead.
4185 */
4187/**
4188 * Deprecated: Returning the NULL location will crash.
4189 * Use LLVMGetCurrentDebugLocation2 instead.
4190 */
4192
4193/* Terminators */
4197 unsigned N);
4202 LLVMBasicBlockRef Else, unsigned NumCases);
4204 unsigned NumDests);
4206 LLVMBasicBlockRef DefaultDest,
4207 LLVMBasicBlockRef *IndirectDests,
4208 unsigned NumIndirectDests, LLVMValueRef *Args,
4209 unsigned NumArgs, LLVMOperandBundleRef *Bundles,
4210 unsigned NumBundles, const char *Name);
4212 LLVMValueRef *Args, unsigned NumArgs,
4214 const char *Name);
4217 unsigned NumArgs, LLVMBasicBlockRef Then, LLVMBasicBlockRef Catch,
4218 LLVMOperandBundleRef *Bundles, unsigned NumBundles, const char *Name);
4220
4221/* Exception Handling */
4224 LLVMValueRef PersFn, unsigned NumClauses,
4225 const char *Name);
4231 LLVMValueRef *Args, unsigned NumArgs,
4232 const char *Name);
4234 LLVMValueRef *Args, unsigned NumArgs,
4235 const char *Name);
4237 LLVMBasicBlockRef UnwindBB,
4238 unsigned NumHandlers, const char *Name);
4239
4240/* Add a case to the switch instruction */
4241void LLVMAddCase(LLVMValueRef Switch, LLVMValueRef OnVal,
4242 LLVMBasicBlockRef Dest);
4243
4244/* Add a destination to the indirectbr instruction */
4246
4247/* Get the number of clauses on the landingpad instruction */
4248unsigned LLVMGetNumClauses(LLVMValueRef LandingPad);
4249
4250/* Get the value of the clause at index Idx on the landingpad instruction */
4251LLVMValueRef LLVMGetClause(LLVMValueRef LandingPad, unsigned Idx);
4252
4253/* Add a catch or filter clause to the landingpad instruction */
4254void LLVMAddClause(LLVMValueRef LandingPad, LLVMValueRef ClauseVal);
4255
4256/* Get the 'cleanup' flag in the landingpad instruction */
4258
4259/* Set the 'cleanup' flag in the landingpad instruction */
4260void LLVMSetCleanup(LLVMValueRef LandingPad, LLVMBool Val);
4261
4262/* Add a destination to the catchswitch instruction */
4263void LLVMAddHandler(LLVMValueRef CatchSwitch, LLVMBasicBlockRef Dest);
4264
4265/* Get the number of handlers on the catchswitch instruction */
4266unsigned LLVMGetNumHandlers(LLVMValueRef CatchSwitch);
4267
4268/**
4269 * Obtain the basic blocks acting as handlers for a catchswitch instruction.
4270 *
4271 * The Handlers parameter should point to a pre-allocated array of
4272 * LLVMBasicBlockRefs at least LLVMGetNumHandlers() large. On return, the
4273 * first LLVMGetNumHandlers() entries in the array will be populated
4274 * with LLVMBasicBlockRef instances.
4275 *
4276 * @param CatchSwitch The catchswitch instruction to operate on.
4277 * @param Handlers Memory address of an array to be filled with basic blocks.
4278 */
4279void LLVMGetHandlers(LLVMValueRef CatchSwitch, LLVMBasicBlockRef *Handlers);
4280
4281/* Funclets */
4282
4283/* Get the number of funcletpad arguments. */
4284LLVMValueRef LLVMGetArgOperand(LLVMValueRef Funclet, unsigned i);
4285
4286/* Set a funcletpad argument at the given index. */
4287void LLVMSetArgOperand(LLVMValueRef Funclet, unsigned i, LLVMValueRef value);
4288
4289/**
4290 * Get the parent catchswitch instruction of a catchpad instruction.
4291 *
4292 * This only works on llvm::CatchPadInst instructions.
4293 *
4294 * @see llvm::CatchPadInst::getCatchSwitch()
4295 */
4297
4298/**
4299 * Set the parent catchswitch instruction of a catchpad instruction.
4300 *
4301 * This only works on llvm::CatchPadInst instructions.
4302 *
4303 * @see llvm::CatchPadInst::setCatchSwitch()
4304 */
4305void LLVMSetParentCatchSwitch(LLVMValueRef CatchPad, LLVMValueRef CatchSwitch);
4306
4307/* Arithmetic */
4309 const char *Name);
4311 const char *Name);
4313 const char *Name);
4315 const char *Name);
4317 const char *Name);
4319 const char *Name);
4321 const char *Name);
4323 const char *Name);
4325 const char *Name);
4327 const char *Name);
4329 const char *Name);
4331 const char *Name);
4333 const char *Name);
4335 const char *Name);
4337 const char *Name);
4339 const char *Name);
4341 const char *Name);
4343 const char *Name);
4345 const char *Name);
4347 const char *Name);
4349 const char *Name);
4351 const char *Name);
4353 const char *Name);
4355 const char *Name);
4357 const char *Name);
4359 const char *Name);
4362 const char *Name);
4365 const char *Name);
4367 LLVMValueRef V,
4368 const char *Name),
4369 "Use LLVMBuildNeg + LLVMSetNUW instead.");
4372
4374void LLVMSetNUW(LLVMValueRef ArithInst, LLVMBool HasNUW);
4376void LLVMSetNSW(LLVMValueRef ArithInst, LLVMBool HasNSW);
4377LLVMBool LLVMGetExact(LLVMValueRef DivOrShrInst);
4378void LLVMSetExact(LLVMValueRef DivOrShrInst, LLVMBool IsExact);
4379
4380/**
4381 * Gets if the instruction has the non-negative flag set.
4382 * Only valid for zext instructions.
4383 */
4385/**
4386 * Sets the non-negative flag for the instruction.
4387 * Only valid for zext instructions.
4388 */
4389void LLVMSetNNeg(LLVMValueRef NonNegInst, LLVMBool IsNonNeg);
4390
4391/**
4392 * Get the flags for which fast-math-style optimizations are allowed for this
4393 * value.
4394 *
4395 * Only valid on floating point instructions.
4396 * @see LLVMCanValueUseFastMathFlags
4397 */
4399
4400/**
4401 * Sets the flags for which fast-math-style optimizations are allowed for this
4402 * value.
4403 *
4404 * Only valid on floating point instructions.
4405 * @see LLVMCanValueUseFastMathFlags
4406 */
4408
4409/**
4410 * Check if a given value can potentially have fast math flags.
4411 *
4412 * Will return true for floating point arithmetic instructions, and for select,
4413 * phi, and call instructions whose type is a floating point type, or a vector
4414 * or array thereof. See https://llvm.org/docs/LangRef.html#fast-math-flags
4415 */
4417
4418/**
4419 * Gets whether the instruction has the disjoint flag set.
4420 * Only valid for or instructions.
4421 */
4423/**
4424 * Sets the disjoint flag for the instruction.
4425 * Only valid for or instructions.
4426 */
4427void LLVMSetIsDisjoint(LLVMValueRef Inst, LLVMBool IsDisjoint);
4428
4429/* Memory */
4432 LLVMValueRef Val, const char *Name);
4433
4434/**
4435 * Creates and inserts a memset to the specified pointer and the
4436 * specified value.
4437 *
4438 * @see llvm::IRRBuilder::CreateMemSet()
4439 */
4441 LLVMValueRef Val, LLVMValueRef Len,
4442 unsigned Align);
4443/**
4444 * Creates and inserts a memcpy between the specified pointers.
4445 *
4446 * @see llvm::IRRBuilder::CreateMemCpy()
4447 */
4449 LLVMValueRef Dst, unsigned DstAlign,
4450 LLVMValueRef Src, unsigned SrcAlign,
4452/**
4453 * Creates and inserts a memmove between the specified pointers.
4454 *
4455 * @see llvm::IRRBuilder::CreateMemMove()
4456 */
4458 LLVMValueRef Dst, unsigned DstAlign,
4459 LLVMValueRef Src, unsigned SrcAlign,
4461
4464 LLVMValueRef Val, const char *Name);
4467 LLVMValueRef PointerVal, const char *Name);
4470 LLVMValueRef Pointer, LLVMValueRef *Indices,
4471 unsigned NumIndices, const char *Name);
4473 LLVMValueRef Pointer, LLVMValueRef *Indices,
4474 unsigned NumIndices, const char *Name);
4475/**
4476 * Creates a GetElementPtr instruction. Similar to LLVMBuildGEP2, but allows
4477 * specifying the no-wrap flags.
4478 *
4479 * @see llvm::IRBuilder::CreateGEP()
4480 */
4482 LLVMValueRef Pointer,
4483 LLVMValueRef *Indices,
4484 unsigned NumIndices, const char *Name,
4485 LLVMGEPNoWrapFlags NoWrapFlags);
4487 LLVMValueRef Pointer, unsigned Idx,
4488 const char *Name);
4490 const char *Name);
4492 const char *Name);
4493LLVMBool LLVMGetVolatile(LLVMValueRef MemoryAccessInst);
4494void LLVMSetVolatile(LLVMValueRef MemoryAccessInst, LLVMBool IsVolatile);
4495LLVMBool LLVMGetWeak(LLVMValueRef CmpXchgInst);
4496void LLVMSetWeak(LLVMValueRef CmpXchgInst, LLVMBool IsWeak);
4498void LLVMSetOrdering(LLVMValueRef MemoryAccessInst, LLVMAtomicOrdering Ordering);
4500void LLVMSetAtomicRMWBinOp(LLVMValueRef AtomicRMWInst, LLVMAtomicRMWBinOp BinOp);
4501
4502/* Casts */
4504 LLVMTypeRef DestTy, const char *Name);
4506 LLVMTypeRef DestTy, const char *Name);
4508 LLVMTypeRef DestTy, const char *Name);
4510 LLVMTypeRef DestTy, const char *Name);
4512 LLVMTypeRef DestTy, const char *Name);
4514 LLVMTypeRef DestTy, const char *Name);
4516 LLVMTypeRef DestTy, const char *Name);
4518 LLVMTypeRef DestTy, const char *Name);
4520 LLVMTypeRef DestTy, const char *Name);
4522 LLVMTypeRef DestTy, const char *Name);
4524 LLVMTypeRef DestTy, const char *Name);
4526 LLVMTypeRef DestTy, const char *Name);
4528 LLVMTypeRef DestTy, const char *Name);
4530 LLVMTypeRef DestTy, const char *Name);
4532 LLVMTypeRef DestTy, const char *Name);
4534 LLVMTypeRef DestTy, const char *Name);
4536 LLVMTypeRef DestTy, const char *Name);
4538 LLVMTypeRef DestTy, const char *Name);
4540 LLVMTypeRef DestTy, LLVMBool IsSigned,
4541 const char *Name);
4543 LLVMTypeRef DestTy, const char *Name);
4544
4545/** Deprecated: This cast is always signed. Use LLVMBuildIntCast2 instead. */
4547 LLVMTypeRef DestTy, const char *Name);
4548
4550 LLVMTypeRef DestTy, LLVMBool DestIsSigned);
4551
4552/* Comparisons */
4555 const char *Name);
4558 const char *Name);
4559
4560/* Miscellaneous instructions */
4563 LLVMValueRef *Args, unsigned NumArgs,
4564 const char *Name);
4567 LLVMValueRef *Args, unsigned NumArgs,
4568 LLVMOperandBundleRef *Bundles,
4569 unsigned NumBundles, const char *Name);
4571 LLVMValueRef Then, LLVMValueRef Else,
4572 const char *Name);
4574 const char *Name);
4576 LLVMValueRef Index, const char *Name);
4579 const char *Name);
4581 LLVMValueRef V2, LLVMValueRef Mask,
4582 const char *Name);
4584 unsigned Index, const char *Name);
4586 LLVMValueRef EltVal, unsigned Index,
4587 const char *Name);
4589 const char *Name);
4590
4592 const char *Name);
4594 const char *Name);
4597 const char *Name);
4599 LLVMBool singleThread, const char *Name);
4601 LLVMAtomicOrdering ordering, unsigned SSID,
4602 const char *Name);
4604 LLVMValueRef PTR, LLVMValueRef Val,
4605 LLVMAtomicOrdering ordering,
4606 LLVMBool singleThread);
4609 LLVMValueRef PTR, LLVMValueRef Val,
4610 LLVMAtomicOrdering ordering,
4611 unsigned SSID);
4613 LLVMValueRef Cmp, LLVMValueRef New,
4614 LLVMAtomicOrdering SuccessOrdering,
4615 LLVMAtomicOrdering FailureOrdering,
4618 LLVMValueRef Cmp, LLVMValueRef New,
4619 LLVMAtomicOrdering SuccessOrdering,
4620 LLVMAtomicOrdering FailureOrdering,
4621 unsigned SSID);
4622
4623/**
4624 * Get the number of elements in the mask of a ShuffleVector instruction.
4625 */
4626unsigned LLVMGetNumMaskElements(LLVMValueRef ShuffleVectorInst);
4627
4628/**
4629 * \returns a constant that specifies that the result of a \c ShuffleVectorInst
4630 * is undefined.
4631 */
4632int LLVMGetUndefMaskElem(void);
4633
4634/**
4635 * Get the mask value at position Elt in the mask of a ShuffleVector
4636 * instruction.
4637 *
4638 * \Returns the result of \c LLVMGetUndefMaskElem() if the mask value is
4639 * poison at that position.
4640 */
4641int LLVMGetMaskValue(LLVMValueRef ShuffleVectorInst, unsigned Elt);
4642
4645
4646/**
4647 * Returns whether an instruction is an atomic instruction, e.g., atomicrmw,
4648 * cmpxchg, fence, or loads and stores with atomic ordering.
4649 */
4651
4652/**
4653 * Returns the synchronization scope ID of an atomic instruction.
4654 */
4655unsigned LLVMGetAtomicSyncScopeID(LLVMValueRef AtomicInst);
4656
4657/**
4658 * Sets the synchronization scope ID of an atomic instruction.
4659 */
4660void LLVMSetAtomicSyncScopeID(LLVMValueRef AtomicInst, unsigned SSID);
4661
4664 LLVMAtomicOrdering Ordering);
4667 LLVMAtomicOrdering Ordering);
4668
4669/**
4670 * @}
4671 */
4672
4673/**
4674 * @defgroup LLVMCCoreModuleProvider Module Providers
4675 *
4676 * @{
4677 */
4678
4679/**
4680 * Changes the type of M so it can be passed to FunctionPassManagers and the
4681 * JIT. They take ModuleProviders for historical reasons.
4682 */
4685
4686/**
4687 * Destroys the module M.
4688 */
4690
4691/**
4692 * @}
4693 */
4694
4695/**
4696 * @defgroup LLVMCCoreMemoryBuffers Memory Buffers
4697 *
4698 * @{
4699 */
4700
4702 LLVMMemoryBufferRef *OutMemBuf,
4703 char **OutMessage);
4705 char **OutMessage);
4707 size_t InputDataLength,
4708 const char *BufferName,
4709 LLVMBool RequiresNullTerminator);
4711 size_t InputDataLength,
4712 const char *BufferName);
4713const char *LLVMGetBufferStart(LLVMMemoryBufferRef MemBuf);
4716
4717/**
4718 * @}
4719 */
4720
4721/**
4722 * @defgroup LLVMCCorePassManagers Pass Managers
4723 * @ingroup LLVMCCore
4724 *
4725 * @{
4726 */
4727
4728/** Constructs a new whole-module pass pipeline. This type of pipeline is
4729 suitable for link-time optimization and whole-module transformations.
4730 @see llvm::PassManager::PassManager */
4732
4733/** Constructs a new function-by-function pass pipeline over the module
4734 provider. It does not take ownership of the module provider. This type of
4735 pipeline is suitable for code generation and JIT compilation tasks.
4736 @see llvm::FunctionPassManager::FunctionPassManager */
4738
4739/** Deprecated: Use LLVMCreateFunctionPassManagerForModule instead. */
4741
4742/** Initializes, executes on the provided module, and finalizes all of the
4743 passes scheduled in the pass manager. Returns 1 if any of the passes
4744 modified the module, 0 otherwise.
4745 @see llvm::PassManager::run(Module&) */
4747
4748/** Initializes all of the function passes scheduled in the function pass
4749 manager. Returns 1 if any of the passes modified the module, 0 otherwise.
4750 @see llvm::FunctionPassManager::doInitialization */
4752
4753/** Executes all of the function passes scheduled in the function pass manager
4754 on the provided function. Returns 1 if any of the passes modified the
4755 function, false otherwise.
4756 @see llvm::FunctionPassManager::run(Function&) */
4758
4759/** Finalizes all of the function passes scheduled in the function pass
4760 manager. Returns 1 if any of the passes modified the module, 0 otherwise.
4761 @see llvm::FunctionPassManager::doFinalization */
4763
4764/** Frees the memory of a pass pipeline. For function pipelines, does not free
4765 the module provider.
4766 @see llvm::PassManagerBase::~PassManagerBase. */
4768
4769/**
4770 * @}
4771 */
4772
4773/**
4774 * @defgroup LLVMCCoreThreading Threading
4775 *
4776 * Handle the structures needed to make LLVM safe for multithreading.
4777 *
4778 * @{
4779 */
4780
4781/** Deprecated: Multi-threading can only be enabled/disabled with the compile
4782 time define LLVM_ENABLE_THREADS. This function always returns
4783 LLVMIsMultithreaded(). */
4785
4786/** Deprecated: Multi-threading can only be enabled/disabled with the compile
4787 time define LLVM_ENABLE_THREADS. */
4788void LLVMStopMultithreaded(void);
4789
4790/** Check whether LLVM is executing in thread-safe mode or not.
4791 @see llvm::llvm_is_multithreaded */
4793
4794/**
4795 * @}
4796 */
4797
4798/**
4799 * @}
4800 */
4801
4802/**
4803 * @}
4804 */
4805
4807
4808#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")
DXIL Finalize Linkage
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:1629
LLVMValueRef LLVMBuildNUWNeg(LLVMBuilderRef B, LLVMValueRef V, const char *Name)
Definition: Core.cpp:3729
LLVMValueRef LLVMConstNUWNeg(LLVMValueRef ConstantVal)
Definition: Core.cpp:1760
static cl::opt< bool > SingleThread("licm-force-thread-model-single", cl::Hidden, cl::init(false), cl::desc("Force thread model single in LICM pass"))
#define F(x, y, z)
Definition: MD5.cpp:55
if(auto Err=PB.parsePassPipeline(MPM, Passes)) return wrap(std MPM run * Mod
const SmallVectorImpl< MachineOperand > & Cond
static cl::opt< 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:102
unsigned LLVMGetEnumAttributeKind(LLVMAttributeRef A)
Get the unique id corresponding to the enum attribute passed as argument.
Definition: Core.cpp:169
void LLVMContextSetDiscardValueNames(LLVMContextRef C, LLVMBool Discard)
Set whether the given context discards all value names.
Definition: Core.cpp:133
uint64_t LLVMGetEnumAttributeValue(LLVMAttributeRef A)
Get the enum attribute's value.
Definition: Core.cpp:173
LLVMTypeRef LLVMGetTypeAttributeValue(LLVMAttributeRef A)
Get the type attribute's value.
Definition: Core.cpp:187
unsigned LLVMGetMDKindIDInContext(LLVMContextRef C, const char *Name, unsigned SLen)
Definition: Core.cpp:141
LLVMDiagnosticSeverity LLVMGetDiagInfoSeverity(LLVMDiagnosticInfoRef DI)
Return an enum LLVMDiagnosticSeverity.
Definition: Core.cpp:251
char * LLVMGetDiagInfoDescription(LLVMDiagnosticInfoRef DI)
Return a string representation of the DiagnosticInfo.
Definition: Core.cpp:240
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:154
unsigned LLVMGetSyncScopeID(LLVMContextRef C, const char *Name, size_t SLen)
Maps a synchronization scope name to a ID unique within this context.
Definition: Core.cpp:150
LLVMDiagnosticHandler LLVMContextGetDiagnosticHandler(LLVMContextRef C)
Get the diagnostic handler of this context.
Definition: Core.cpp:113
LLVMBool LLVMContextShouldDiscardValueNames(LLVMContextRef C)
Retrieve whether the given context is set to discard all value names.
Definition: Core.cpp:129
LLVMAttributeRef LLVMCreateTypeAttribute(LLVMContextRef C, unsigned KindID, LLVMTypeRef type_ref)
Create a type attribute.
Definition: Core.cpp:180
LLVMAttributeRef LLVMCreateStringAttribute(LLVMContextRef C, const char *K, unsigned KLength, const char *V, unsigned VLength)
Create a string attribute.
Definition: Core.cpp:206
LLVMAttributeRef LLVMCreateConstantRangeAttribute(LLVMContextRef C, unsigned KindID, unsigned NumBits, const uint64_t LowerWords[], const uint64_t UpperWords[])
Create a ConstantRange attribute.
Definition: Core.cpp:192
void LLVMContextDispose(LLVMContextRef C)
Destroy a context instance.
Definition: Core.cpp:137
LLVMAttributeRef LLVMCreateEnumAttribute(LLVMContextRef C, unsigned KindID, uint64_t Val)
Create an enum attribute.
Definition: Core.cpp:162
const char * LLVMGetStringAttributeKind(LLVMAttributeRef A, unsigned *Length)
Get the string attribute's kind.
Definition: Core.cpp:213
LLVMTypeRef LLVMGetTypeByName2(LLVMContextRef C, const char *Name)
Obtain a Type from a context by its registered name.
Definition: Core.cpp:851
LLVMContextRef LLVMContextCreate(void)
Create a new context.
Definition: Core.cpp:98
void(* LLVMYieldCallback)(LLVMContextRef, void *)
Definition: Core.h:565
unsigned LLVMGetLastEnumAttributeKind(void)
Definition: Core.cpp:158
LLVMBool LLVMIsStringAttribute(LLVMAttributeRef A)
Definition: Core.cpp:232
LLVMBool LLVMIsTypeAttribute(LLVMAttributeRef A)
Definition: Core.cpp:236
const char * LLVMGetStringAttributeValue(LLVMAttributeRef A, unsigned *Length)
Get the string attribute's value.
Definition: Core.cpp:220
void LLVMContextSetYieldCallback(LLVMContextRef C, LLVMYieldCallback Callback, void *OpaqueHandle)
Set the yield callback function for this context.
Definition: Core.cpp:122
unsigned LLVMGetMDKindID(const char *Name, unsigned SLen)
Definition: Core.cpp:146
void LLVMContextSetDiagnosticHandler(LLVMContextRef C, LLVMDiagnosticHandler Handler, void *DiagnosticContext)
Set the diagnostic handler for this context.
Definition: Core.cpp:104
void(* LLVMDiagnosticHandler)(LLVMDiagnosticInfoRef, void *)
Definition: Core.h:564
void * LLVMContextGetDiagnosticContext(LLVMContextRef C)
Get the diagnostic context of this context.
Definition: Core.cpp:118
LLVMBool LLVMIsEnumAttribute(LLVMAttributeRef A)
Check for the different types of attributes.
Definition: Core.cpp:227
LLVMValueRef LLVMBuildLoad2(LLVMBuilderRef, LLVMTypeRef Ty, LLVMValueRef PointerVal, const char *Name)
Definition: Core.cpp:3870
LLVMValueRef LLVMBuildGlobalStringPtr(LLVMBuilderRef B, const char *Str, const char *Name)
Definition: Core.cpp:4018
LLVMValueRef LLVMBuildFence(LLVMBuilderRef B, LLVMAtomicOrdering ordering, LLVMBool singleThread, const char *Name)
Definition: Core.cpp:3965
LLVMValueRef LLVMBuildAtomicRMW(LLVMBuilderRef B, LLVMAtomicRMWBinOp op, LLVMValueRef PTR, LLVMValueRef Val, LLVMAtomicOrdering ordering, LLVMBool singleThread)
Definition: Core.cpp:4319
LLVMBool LLVMGetIsDisjoint(LLVMValueRef Inst)
Gets whether the instruction has the disjoint flag set.
Definition: Core.cpp:3801
LLVMValueRef LLVMBuildNot(LLVMBuilderRef, LLVMValueRef V, const char *Name)
Definition: Core.cpp:3741
void LLVMSetAtomicSyncScopeID(LLVMValueRef AtomicInst, unsigned SSID)
Sets the synchronization scope ID of an atomic instruction.
Definition: Core.cpp:4408
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:3411
LLVMValueRef LLVMBuildNSWSub(LLVMBuilderRef, LLVMValueRef LHS, LLVMValueRef RHS, const char *Name)
Definition: Core.cpp:3608
LLVMValueRef LLVMBuildAnd(LLVMBuilderRef, LLVMValueRef LHS, LLVMValueRef RHS, const char *Name)
Definition: Core.cpp:3698
LLVMValueRef LLVMBuildFPExt(LLVMBuilderRef, LLVMValueRef Val, LLVMTypeRef DestTy, const char *Name)
Definition: Core.cpp:4130
void LLVMClearInsertionPosition(LLVMBuilderRef Builder)
Definition: Core.cpp:3283
LLVMValueRef LLVMBuildFDiv(LLVMBuilderRef, LLVMValueRef LHS, LLVMValueRef RHS, const char *Name)
Definition: Core.cpp:3663
void LLVMSetWeak(LLVMValueRef CmpXchgInst, LLVMBool IsWeak)
Definition: Core.cpp:4049
void LLVMSetNSW(LLVMValueRef ArithInst, LLVMBool HasNSW)
Definition: Core.cpp:3760
LLVMValueRef LLVMBuildFreeze(LLVMBuilderRef, LLVMValueRef Val, const char *Name)
Definition: Core.cpp:4297
LLVMValueRef LLVMBuildFAdd(LLVMBuilderRef, LLVMValueRef LHS, LLVMValueRef RHS, const char *Name)
Definition: Core.cpp:3598
LLVMValueRef LLVMBuildFMul(LLVMBuilderRef, LLVMValueRef LHS, LLVMValueRef RHS, const char *Name)
Definition: Core.cpp:3638
LLVMValueRef LLVMBuildZExt(LLVMBuilderRef, LLVMValueRef Val, LLVMTypeRef DestTy, const char *Name)
Definition: Core.cpp:4095
LLVMValueRef LLVMBuildSExt(LLVMBuilderRef, LLVMValueRef Val, LLVMTypeRef DestTy, const char *Name)
Definition: Core.cpp:4100
LLVMValueRef LLVMBuildTruncOrBitCast(LLVMBuilderRef, LLVMValueRef Val, LLVMTypeRef DestTy, const char *Name)
Definition: Core.cpp:4167
LLVMValueRef LLVMBuildSExtOrBitCast(LLVMBuilderRef, LLVMValueRef Val, LLVMTypeRef DestTy, const char *Name)
Definition: Core.cpp:4161
LLVMValueRef LLVMBuildBitCast(LLVMBuilderRef, LLVMValueRef Val, LLVMTypeRef DestTy, const char *Name)
Definition: Core.cpp:4145
void LLVMBuilderSetDefaultFPMathTag(LLVMBuilderRef Builder, LLVMMetadataRef FPMathTag)
Set the default floating-point math metadata for the given builder.
Definition: Core.cpp:3333
LLVMValueRef LLVMBuildExtractValue(LLVMBuilderRef, LLVMValueRef AggVal, unsigned Index, const char *Name)
Definition: Core.cpp:4285
LLVMValueRef LLVMBuildFCmp(LLVMBuilderRef, LLVMRealPredicate Op, LLVMValueRef LHS, LLVMValueRef RHS, const char *Name)
Definition: Core.cpp:4217
void LLVMSetCmpXchgFailureOrdering(LLVMValueRef CmpXchgInst, LLVMAtomicOrdering Ordering)
Definition: Core.cpp:4432
LLVMValueRef LLVMBuildAtomicCmpXchgSyncScope(LLVMBuilderRef B, LLVMValueRef Ptr, LLVMValueRef Cmp, LLVMValueRef New, LLVMAtomicOrdering SuccessOrdering, LLVMAtomicOrdering FailureOrdering, unsigned SSID)
Definition: Core.cpp:4354
LLVMValueRef LLVMBuildFPTrunc(LLVMBuilderRef, LLVMValueRef Val, LLVMTypeRef DestTy, const char *Name)
Definition: Core.cpp:4125
LLVMAtomicOrdering LLVMGetCmpXchgFailureOrdering(LLVMValueRef CmpXchgInst)
Definition: Core.cpp:4427
LLVMOpcode LLVMGetCastOpcode(LLVMValueRef Src, LLVMBool SrcIsSigned, LLVMTypeRef DestTy, LLVMBool DestIsSigned)
Definition: Core.cpp:4202
LLVMAtomicRMWBinOp LLVMGetAtomicRMWBinOp(LLVMValueRef AtomicRMWInst)
Definition: Core.cpp:4080
void LLVMSetNUW(LLVMValueRef ArithInst, LLVMBool HasNUW)
Definition: Core.cpp:3750
LLVMValueRef LLVMBuildSIToFP(LLVMBuilderRef, LLVMValueRef Val, LLVMTypeRef DestTy, const char *Name)
Definition: Core.cpp:4120
LLVMValueRef LLVMBuildShl(LLVMBuilderRef, LLVMValueRef LHS, LLVMValueRef RHS, const char *Name)
Definition: Core.cpp:3683
void LLVMSetCurrentDebugLocation2(LLVMBuilderRef Builder, LLVMMetadataRef Loc)
Set location information used by debugging information.
Definition: Core.cpp:3306
int LLVMGetUndefMaskElem(void)
Definition: Core.cpp:4377
LLVMBool LLVMGetWeak(LLVMValueRef CmpXchgInst)
Definition: Core.cpp:4045
LLVMValueRef LLVMBuildFRem(LLVMBuilderRef, LLVMValueRef LHS, LLVMValueRef RHS, const char *Name)
Definition: Core.cpp:3678
LLVMValueRef LLVMBuildAlloca(LLVMBuilderRef, LLVMTypeRef Ty, const char *Name)
Definition: Core.cpp:3856
LLVMValueRef LLVMBuildSelect(LLVMBuilderRef, LLVMValueRef If, LLVMValueRef Then, LLVMValueRef Else, const char *Name)
Definition: Core.cpp:4253
LLVMValueRef LLVMBuildCatchPad(LLVMBuilderRef B, LLVMValueRef ParentPad, LLVMValueRef *Args, unsigned NumArgs, const char *Name)
Definition: Core.cpp:3437
void LLVMSetIsDisjoint(LLVMValueRef Inst, LLVMBool IsDisjoint)
Sets the disjoint flag for the instruction.
Definition: Core.cpp:3806
LLVMValueRef LLVMBuildMul(LLVMBuilderRef, LLVMValueRef LHS, LLVMValueRef RHS, const char *Name)
Definition: Core.cpp:3623
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:3256
LLVMValueRef LLVMBuildExactSDiv(LLVMBuilderRef, LLVMValueRef LHS, LLVMValueRef RHS, const char *Name)
Definition: Core.cpp:3658
LLVMValueRef LLVMBuildNUWSub(LLVMBuilderRef, LLVMValueRef LHS, LLVMValueRef RHS, const char *Name)
Definition: Core.cpp:3613
LLVMValueRef LLVMBuildMalloc(LLVMBuilderRef, LLVMTypeRef Ty, const char *Name)
Definition: Core.cpp:3813
LLVMValueRef LLVMBuildIsNull(LLVMBuilderRef, LLVMValueRef Val, const char *Name)
Definition: Core.cpp:4302
LLVMValueRef LLVMBuildLandingPad(LLVMBuilderRef B, LLVMTypeRef Ty, LLVMValueRef PersFn, unsigned NumClauses, const char *Name)
Definition: Core.cpp:3425
LLVMValueRef LLVMBuildAggregateRet(LLVMBuilderRef, LLVMValueRef *RetVals, unsigned N)
Definition: Core.cpp:3359
LLVMValueRef LLVMBuildAShr(LLVMBuilderRef, LLVMValueRef LHS, LLVMValueRef RHS, const char *Name)
Definition: Core.cpp:3693
LLVMValueRef LLVMBuildInvoke2(LLVMBuilderRef, LLVMTypeRef Ty, LLVMValueRef Fn, LLVMValueRef *Args, unsigned NumArgs, LLVMBasicBlockRef Then, LLVMBasicBlockRef Catch, const char *Name)
Definition: Core.cpp:3402
LLVMValueRef LLVMBuildCallWithOperandBundles(LLVMBuilderRef, LLVMTypeRef, LLVMValueRef Fn, LLVMValueRef *Args, unsigned NumArgs, LLVMOperandBundleRef *Bundles, unsigned NumBundles, const char *Name)
Definition: Core.cpp:4239
LLVMValueRef LLVMBuildExactUDiv(LLVMBuilderRef, LLVMValueRef LHS, LLVMValueRef RHS, const char *Name)
Definition: Core.cpp:3648
void LLVMSetOrdering(LLVMValueRef MemoryAccessInst, LLVMAtomicOrdering Ordering)
Definition: Core.cpp:4067
void LLVMSetCleanup(LLVMValueRef LandingPad, LLVMBool Val)
Definition: Core.cpp:3511
LLVMValueRef LLVMGetArgOperand(LLVMValueRef Funclet, unsigned i)
Definition: Core.cpp:3540
unsigned LLVMGetAtomicSyncScopeID(LLVMValueRef AtomicInst)
Returns the synchronization scope ID of an atomic instruction.
Definition: Core.cpp:4402
LLVMValueRef LLVMBuildInsertValue(LLVMBuilderRef, LLVMValueRef AggVal, LLVMValueRef EltVal, unsigned Index, const char *Name)
Definition: Core.cpp:4290
LLVMValueRef LLVMBuildAdd(LLVMBuilderRef, LLVMValueRef LHS, LLVMValueRef RHS, const char *Name)
Definition: Core.cpp:3583
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:3831
LLVMValueRef LLVMBuildBr(LLVMBuilderRef, LLVMBasicBlockRef Dest)
Definition: Core.cpp:3364
LLVMValueRef LLVMBuildNSWMul(LLVMBuilderRef, LLVMValueRef LHS, LLVMValueRef RHS, const char *Name)
Definition: Core.cpp:3628
LLVMValueRef LLVMBuildBinOp(LLVMBuilderRef B, LLVMOpcode Op, LLVMValueRef LHS, LLVMValueRef RHS, const char *Name)
Definition: Core.cpp:3713
LLVMValueRef LLVMBuildSRem(LLVMBuilderRef, LLVMValueRef LHS, LLVMValueRef RHS, const char *Name)
Definition: Core.cpp:3673
void LLVMDisposeBuilder(LLVMBuilderRef Builder)
Definition: Core.cpp:3296
int LLVMGetMaskValue(LLVMValueRef ShuffleVectorInst, unsigned Elt)
Get the mask value at position Elt in the mask of a ShuffleVector instruction.
Definition: Core.cpp:4371
LLVMValueRef LLVMBuildFSub(LLVMBuilderRef, LLVMValueRef LHS, LLVMValueRef RHS, const char *Name)
Definition: Core.cpp:3618
LLVMValueRef LLVMGetClause(LLVMValueRef LandingPad, unsigned Idx)
Definition: Core.cpp:3499
LLVMMetadataRef LLVMGetCurrentDebugLocation2(LLVMBuilderRef Builder)
Get location information used by debugging information.
Definition: Core.cpp:3302
LLVMValueRef LLVMBuildArrayAlloca(LLVMBuilderRef, LLVMTypeRef Ty, LLVMValueRef Val, const char *Name)
Definition: Core.cpp:3861
LLVMValueRef LLVMBuildVAArg(LLVMBuilderRef, LLVMValueRef List, LLVMTypeRef Ty, const char *Name)
Definition: Core.cpp:4260
LLVMBuilderRef LLVMCreateBuilderInContext(LLVMContextRef C)
Definition: Core.cpp:3235
LLVMValueRef LLVMBuildAtomicCmpXchg(LLVMBuilderRef B, LLVMValueRef Ptr, LLVMValueRef Cmp, LLVMValueRef New, LLVMAtomicOrdering SuccessOrdering, LLVMAtomicOrdering FailureOrdering, LLVMBool SingleThread)
Definition: Core.cpp:4341
LLVMValueRef LLVMBuildICmp(LLVMBuilderRef, LLVMIntPredicate Op, LLVMValueRef LHS, LLVMValueRef RHS, const char *Name)
Definition: Core.cpp:4210
LLVMValueRef LLVMBuildPointerCast(LLVMBuilderRef, LLVMValueRef Val, LLVMTypeRef DestTy, const char *Name)
Definition: Core.cpp:4179
LLVMValueRef LLVMGetParentCatchSwitch(LLVMValueRef CatchPad)
Get the parent catchswitch instruction of a catchpad instruction.
Definition: Core.cpp:3529
void LLVMSetAtomicSingleThread(LLVMValueRef AtomicInst, LLVMBool SingleThread)
Definition: Core.cpp:4392
LLVMValueRef LLVMBuildCast(LLVMBuilderRef B, LLVMOpcode Op, LLVMValueRef Val, LLVMTypeRef DestTy, const char *Name)
Definition: Core.cpp:4173
LLVMValueRef LLVMBuildTrunc(LLVMBuilderRef, LLVMValueRef Val, LLVMTypeRef DestTy, const char *Name)
Definition: Core.cpp:4090
LLVMValueRef LLVMBuildURem(LLVMBuilderRef, LLVMValueRef LHS, LLVMValueRef RHS, const char *Name)
Definition: Core.cpp:3668
void LLVMSetAtomicRMWBinOp(LLVMValueRef AtomicRMWInst, LLVMAtomicRMWBinOp BinOp)
Definition: Core.cpp:4084
LLVMValueRef LLVMBuildCall2(LLVMBuilderRef, LLVMTypeRef, LLVMValueRef Fn, LLVMValueRef *Args, unsigned NumArgs, const char *Name)
Definition: Core.cpp:4230
void LLVMAddClause(LLVMValueRef LandingPad, LLVMValueRef ClauseVal)
Definition: Core.cpp:3503
LLVMValueRef LLVMBuildOr(LLVMBuilderRef, LLVMValueRef LHS, LLVMValueRef RHS, const char *Name)
Definition: Core.cpp:3703
LLVMBool LLVMGetNUW(LLVMValueRef ArithInst)
Definition: Core.cpp:3745
LLVMValueRef LLVMBuildAddrSpaceCast(LLVMBuilderRef, LLVMValueRef Val, LLVMTypeRef DestTy, const char *Name)
Definition: Core.cpp:4150
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:3383
LLVMValueRef LLVMBuildFPToUI(LLVMBuilderRef, LLVMValueRef Val, LLVMTypeRef DestTy, const char *Name)
Definition: Core.cpp:4105
void LLVMSetCurrentDebugLocation(LLVMBuilderRef Builder, LLVMValueRef L)
Deprecated: Passing the NULL location will crash.
Definition: Core.cpp:3313
LLVMValueRef LLVMBuildFPToSI(LLVMBuilderRef, LLVMValueRef Val, LLVMTypeRef DestTy, const char *Name)
Definition: Core.cpp:4110
LLVMBool LLVMIsAtomic(LLVMValueRef Inst)
Returns whether an instruction is an atomic instruction, e.g., atomicrmw, cmpxchg,...
Definition: Core.cpp:4379
LLVMValueRef LLVMBuildIntCast2(LLVMBuilderRef, LLVMValueRef Val, LLVMTypeRef DestTy, LLVMBool IsSigned, const char *Name)
Definition: Core.cpp:4184
LLVMValueRef LLVMBuildNSWAdd(LLVMBuilderRef, LLVMValueRef LHS, LLVMValueRef RHS, const char *Name)
Definition: Core.cpp:3588
LLVMValueRef LLVMBuildFNeg(LLVMBuilderRef, LLVMValueRef V, const char *Name)
Definition: Core.cpp:3737
LLVMMetadataRef LLVMBuilderGetDefaultFPMathTag(LLVMBuilderRef Builder)
Get the dafult floating-point math metadata for a given builder.
Definition: Core.cpp:3345
LLVMValueRef LLVMBuildAtomicRMWSyncScope(LLVMBuilderRef B, LLVMAtomicRMWBinOp op, LLVMValueRef PTR, LLVMValueRef Val, LLVMAtomicOrdering ordering, unsigned SSID)
Definition: Core.cpp:4330
LLVMValueRef LLVMBuildUDiv(LLVMBuilderRef, LLVMValueRef LHS, LLVMValueRef RHS, const char *Name)
Definition: Core.cpp:3643
void LLVMSetParentCatchSwitch(LLVMValueRef CatchPad, LLVMValueRef CatchSwitch)
Set the parent catchswitch instruction of a catchpad instruction.
Definition: Core.cpp:3533
LLVMValueRef LLVMBuildCatchRet(LLVMBuilderRef B, LLVMValueRef CatchPad, LLVMBasicBlockRef BB)
Definition: Core.cpp:3470
LLVMValueRef LLVMBuildStructGEP2(LLVMBuilderRef B, LLVMTypeRef Ty, LLVMValueRef Pointer, unsigned Idx, const char *Name)
Definition: Core.cpp:4006
unsigned LLVMGetNumClauses(LLVMValueRef LandingPad)
Definition: Core.cpp:3495
LLVMBool LLVMGetNNeg(LLVMValueRef NonNegInst)
Gets if the instruction has the non-negative flag set.
Definition: Core.cpp:3775
LLVMValueRef LLVMBuildSDiv(LLVMBuilderRef, LLVMValueRef LHS, LLVMValueRef RHS, const char *Name)
Definition: Core.cpp:3653
LLVMValueRef LLVMBuildStore(LLVMBuilderRef, LLVMValueRef Val, LLVMValueRef Ptr)
Definition: Core.cpp:3875
LLVMValueRef LLVMBuildCatchSwitch(LLVMBuilderRef B, LLVMValueRef ParentPad, LLVMBasicBlockRef UnwindBB, unsigned NumHandlers, const char *Name)
Definition: Core.cpp:3459
LLVMValueRef LLVMBuildFenceSyncScope(LLVMBuilderRef B, LLVMAtomicOrdering ordering, unsigned SSID, const char *Name)
Definition: Core.cpp:3974
LLVMValueRef LLVMBuildIntCast(LLVMBuilderRef, LLVMValueRef Val, LLVMTypeRef DestTy, const char *Name)
Deprecated: This cast is always signed.
Definition: Core.cpp:4191
LLVMValueRef LLVMBuildArrayMalloc(LLVMBuilderRef, LLVMTypeRef Ty, LLVMValueRef Val, const char *Name)
Definition: Core.cpp:3822
LLVMValueRef LLVMBuildZExtOrBitCast(LLVMBuilderRef, LLVMValueRef Val, LLVMTypeRef DestTy, const char *Name)
Definition: Core.cpp:4155
LLVMValueRef LLVMBuildInBoundsGEP2(LLVMBuilderRef B, LLVMTypeRef Ty, LLVMValueRef Pointer, LLVMValueRef *Indices, unsigned NumIndices, const char *Name)
Definition: Core.cpp:3988
void LLVMGetHandlers(LLVMValueRef CatchSwitch, LLVMBasicBlockRef *Handlers)
Obtain the basic blocks acting as handlers for a catchswitch instruction.
Definition: Core.cpp:3523
LLVMAtomicOrdering LLVMGetOrdering(LLVMValueRef MemoryAccessInst)
Definition: Core.cpp:4053
LLVMValueRef LLVMBuildUIToFP(LLVMBuilderRef, LLVMValueRef Val, LLVMTypeRef DestTy, const char *Name)
Definition: Core.cpp:4115
LLVMValueRef LLVMBuildIntToPtr(LLVMBuilderRef, LLVMValueRef Val, LLVMTypeRef DestTy, const char *Name)
Definition: Core.cpp:4140
LLVMValueRef LLVMBuildCondBr(LLVMBuilderRef, LLVMValueRef If, LLVMBasicBlockRef Then, LLVMBasicBlockRef Else)
Definition: Core.cpp:3368
LLVMValueRef LLVMBuildIndirectBr(LLVMBuilderRef B, LLVMValueRef Addr, unsigned NumDests)
Definition: Core.cpp:3378
void LLVMAddDestination(LLVMValueRef IndirectBr, LLVMBasicBlockRef Dest)
Definition: Core.cpp:3491
LLVMValueRef LLVMBuildNSWNeg(LLVMBuilderRef B, LLVMValueRef V, const char *Name)
Definition: Core.cpp:3724
LLVMValueRef LLVMBuildXor(LLVMBuilderRef, LLVMValueRef LHS, LLVMValueRef RHS, const char *Name)
Definition: Core.cpp:3708
LLVMValueRef LLVMBuildGlobalString(LLVMBuilderRef B, const char *Str, const char *Name)
Definition: Core.cpp:4013
LLVMBool LLVMGetExact(LLVMValueRef DivOrShrInst)
Definition: Core.cpp:3765
LLVMValueRef LLVMBuildIsNotNull(LLVMBuilderRef, LLVMValueRef Val, const char *Name)
Definition: Core.cpp:4307
void LLVMSetArgOperand(LLVMValueRef Funclet, unsigned i, LLVMValueRef value)
Definition: Core.cpp:3544
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:3838
LLVMValueRef LLVMBuildPtrDiff2(LLVMBuilderRef, LLVMTypeRef ElemTy, LLVMValueRef LHS, LLVMValueRef RHS, const char *Name)
Definition: Core.cpp:4312
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:3325
void LLVMAddMetadataToInst(LLVMBuilderRef Builder, LLVMValueRef Inst)
Adds the metadata registered with the given builder to the given instruction.
Definition: Core.cpp:3329
LLVMValueRef LLVMBuildSub(LLVMBuilderRef, LLVMValueRef LHS, LLVMValueRef RHS, const char *Name)
Definition: Core.cpp:3603
LLVMValueRef LLVMBuildNUWAdd(LLVMBuilderRef, LLVMValueRef LHS, LLVMValueRef RHS, const char *Name)
Definition: Core.cpp:3593
LLVMValueRef LLVMBuildUnreachable(LLVMBuilderRef)
Definition: Core.cpp:3482
LLVMValueRef LLVMBuildShuffleVector(LLVMBuilderRef, LLVMValueRef V1, LLVMValueRef V2, LLVMValueRef Mask, const char *Name)
Definition: Core.cpp:4278
void LLVMSetVolatile(LLVMValueRef MemoryAccessInst, LLVMBool IsVolatile)
Definition: Core.cpp:4034
LLVMValueRef LLVMBuildFree(LLVMBuilderRef, LLVMValueRef PointerVal)
Definition: Core.cpp:3866
LLVMValueRef LLVMBuildGEP2(LLVMBuilderRef B, LLVMTypeRef Ty, LLVMValueRef Pointer, LLVMValueRef *Indices, unsigned NumIndices, const char *Name)
Definition: Core.cpp:3981
unsigned LLVMGetNumHandlers(LLVMValueRef CatchSwitch)
Definition: Core.cpp:3519
LLVMValueRef LLVMBuildFPCast(LLVMBuilderRef, LLVMValueRef Val, LLVMTypeRef DestTy, const char *Name)
Definition: Core.cpp:4197
LLVMBuilderRef LLVMCreateBuilder(void)
Definition: Core.cpp:3239
void LLVMSetCmpXchgSuccessOrdering(LLVMValueRef CmpXchgInst, LLVMAtomicOrdering Ordering)
Definition: Core.cpp:4419
LLVMValueRef LLVMBuildPhi(LLVMBuilderRef, LLVMTypeRef Ty, const char *Name)
Definition: Core.cpp:4226
LLVMBool LLVMCanValueUseFastMathFlags(LLVMValueRef Inst)
Check if a given value can potentially have fast math flags.
Definition: Core.cpp:3796
void LLVMAddCase(LLVMValueRef Switch, LLVMValueRef OnVal, LLVMBasicBlockRef Dest)
Definition: Core.cpp:3486
LLVMBool LLVMIsAtomicSingleThread(LLVMValueRef AtomicInst)
Definition: Core.cpp:4383
LLVMValueRef LLVMBuildResume(LLVMBuilderRef B, LLVMValueRef Exn)
Definition: Core.cpp:3455
LLVMValueRef LLVMBuildSwitch(LLVMBuilderRef, LLVMValueRef V, LLVMBasicBlockRef Else, unsigned NumCases)
Definition: Core.cpp:3373
void LLVMInsertIntoBuilder(LLVMBuilderRef Builder, LLVMValueRef Instr)
Definition: Core.cpp:3287
LLVMValueRef LLVMBuildPtrToInt(LLVMBuilderRef, LLVMValueRef Val, LLVMTypeRef DestTy, const char *Name)
Definition: Core.cpp:4135
LLVMBool LLVMIsCleanup(LLVMValueRef LandingPad)
Definition: Core.cpp:3507
LLVMBool LLVMGetNSW(LLVMValueRef ArithInst)
Definition: Core.cpp:3755
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:3847
LLVMValueRef LLVMBuildLShr(LLVMBuilderRef, LLVMValueRef LHS, LLVMValueRef RHS, const char *Name)
Definition: Core.cpp:3688
unsigned LLVMGetNumMaskElements(LLVMValueRef ShuffleVectorInst)
Get the number of elements in the mask of a ShuffleVector instruction.
Definition: Core.cpp:4365
LLVMValueRef LLVMBuildRetVoid(LLVMBuilderRef)
Definition: Core.cpp:3351
LLVMValueRef LLVMBuildRet(LLVMBuilderRef, LLVMValueRef V)
Definition: Core.cpp:3355
void LLVMAddHandler(LLVMValueRef CatchSwitch, LLVMBasicBlockRef Dest)
Definition: Core.cpp:3515
void LLVMPositionBuilderBeforeInstrAndDbgRecords(LLVMBuilderRef Builder, LLVMValueRef Instr)
Set the builder position before Instr and any attached debug records.
Definition: Core.cpp:3268
LLVMValueRef LLVMBuildExtractElement(LLVMBuilderRef, LLVMValueRef VecVal, LLVMValueRef Index, const char *Name)
Definition: Core.cpp:4265
void LLVMPositionBuilderBefore(LLVMBuilderRef Builder, LLVMValueRef Instr)
Set the builder position before Instr but after any attached debug records.
Definition: Core.cpp:3263
LLVMValueRef LLVMGetCurrentDebugLocation(LLVMBuilderRef Builder)
Deprecated: Returning the NULL location will crash.
Definition: Core.cpp:3319
LLVMAtomicOrdering LLVMGetCmpXchgSuccessOrdering(LLVMValueRef CmpXchgInst)
Definition: Core.cpp:4414
void LLVMSetNNeg(LLVMValueRef NonNegInst, LLVMBool IsNonNeg)
Sets the non-negative flag for the instruction.
Definition: Core.cpp:3780
LLVMContextRef LLVMGetBuilderContext(LLVMBuilderRef Builder)
Obtain the context to which this builder is associated.
Definition: Core.cpp:3341
void LLVMSetExact(LLVMValueRef DivOrShrInst, LLVMBool IsExact)
Definition: Core.cpp:3770
LLVMBasicBlockRef LLVMGetInsertBlock(LLVMBuilderRef Builder)
Definition: Core.cpp:3279
LLVMValueRef LLVMBuildCleanupPad(LLVMBuilderRef B, LLVMValueRef ParentPad, LLVMValueRef *Args, unsigned NumArgs, const char *Name)
Definition: Core.cpp:3444
void LLVMInsertIntoBuilderWithName(LLVMBuilderRef Builder, LLVMValueRef Instr, const char *Name)
Definition: Core.cpp:3291
void LLVMSetFastMathFlags(LLVMValueRef FPMathInst, LLVMFastMathFlags FMF)
Sets the flags for which fast-math-style optimizations are allowed for this value.
Definition: Core.cpp:3791
LLVMValueRef LLVMBuildGEPWithNoWrapFlags(LLVMBuilderRef B, LLVMTypeRef Ty, LLVMValueRef Pointer, LLVMValueRef *Indices, unsigned NumIndices, const char *Name, LLVMGEPNoWrapFlags NoWrapFlags)
Creates a GetElementPtr instruction.
Definition: Core.cpp:3996
LLVMFastMathFlags LLVMGetFastMathFlags(LLVMValueRef FPMathInst)
Get the flags for which fast-math-style optimizations are allowed for this value.
Definition: Core.cpp:3785
LLVMValueRef LLVMBuildNeg(LLVMBuilderRef, LLVMValueRef V, const char *Name)
Definition: Core.cpp:3720
LLVMBool LLVMGetVolatile(LLVMValueRef MemoryAccessInst)
Definition: Core.cpp:4023
LLVMValueRef LLVMBuildNUWMul(LLVMBuilderRef, LLVMValueRef LHS, LLVMValueRef RHS, const char *Name)
Definition: Core.cpp:3633
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:3250
void LLVMPositionBuilderAtEnd(LLVMBuilderRef Builder, LLVMBasicBlockRef Block)
Definition: Core.cpp:3274
LLVMValueRef LLVMBuildInsertElement(LLVMBuilderRef, LLVMValueRef VecVal, LLVMValueRef EltVal, LLVMValueRef Index, const char *Name)
Definition: Core.cpp:4271
LLVMValueRef LLVMBuildCleanupRet(LLVMBuilderRef B, LLVMValueRef CatchPad, LLVMBasicBlockRef BB)
Definition: Core.cpp:3476
void LLVMDisposeMemoryBuffer(LLVMMemoryBufferRef MemBuf)
Definition: Core.cpp:4508
size_t LLVMGetBufferSize(LLVMMemoryBufferRef MemBuf)
Definition: Core.cpp:4504
LLVMBool LLVMCreateMemoryBufferWithSTDIN(LLVMMemoryBufferRef *OutMemBuf, char **OutMessage)
Definition: Core.cpp:4468
LLVMMemoryBufferRef LLVMCreateMemoryBufferWithMemoryRange(const char *InputData, size_t InputDataLength, const char *BufferName, LLVMBool RequiresNullTerminator)
Definition: Core.cpp:4479
LLVMBool LLVMCreateMemoryBufferWithContentsOfFile(const char *Path, LLVMMemoryBufferRef *OutMemBuf, char **OutMessage)
Definition: Core.cpp:4454
const char * LLVMGetBufferStart(LLVMMemoryBufferRef MemBuf)
Definition: Core.cpp:4500
LLVMMemoryBufferRef LLVMCreateMemoryBufferWithMemoryRangeCopy(const char *InputData, size_t InputDataLength, const char *BufferName)
Definition: Core.cpp:4490
LLVMModuleProviderRef LLVMCreateModuleProviderForExistingModule(LLVMModuleRef M)
Changes the type of M so it can be passed to FunctionPassManagers and the JIT.
Definition: Core.cpp:4443
void LLVMDisposeModuleProvider(LLVMModuleProviderRef M)
Destroys the module M.
Definition: Core.cpp:4447
const char * LLVMGetModuleIdentifier(LLVMModuleRef M, size_t *Len)
Obtain the identifier of a module.
Definition: Core.cpp:287
void LLVMSetDataLayout(LLVMModuleRef M, const char *DataLayoutStr)
Set the data layout for a module.
Definition: Core.cpp:316
LLVMValueRef LLVMAddFunction(LLVMModuleRef M, const char *Name, LLVMTypeRef FunctionTy)
Add a function to a module under a specified name.
Definition: Core.cpp:2388
LLVMBool LLVMIsNewDbgInfoFormat(LLVMModuleRef M)
Soon to be deprecated.
Definition: Core.cpp:432
LLVMNamedMDNodeRef LLVMGetPreviousNamedMetadata(LLVMNamedMDNodeRef NamedMDNode)
Decrement a NamedMDNode iterator to the previous NamedMDNode.
Definition: Core.cpp:1385
LLVMValueRef LLVMGetNamedFunctionWithLength(LLVMModuleRef M, const char *Name, size_t Length)
Obtain a Function value from a Module by its name.
Definition: Core.cpp:2398
LLVMTypeRef LLVMGetTypeByName(LLVMModuleRef M, const char *Name)
Deprecated: Use LLVMGetTypeByName2 instead.
Definition: Core.cpp:847
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:303
void LLVMDumpModule(LLVMModuleRef M)
Dump a representation of a module to stderr.
Definition: Core.cpp:442
void LLVMAppendModuleInlineAsm(LLVMModuleRef M, const char *Asm, size_t Len)
Append inline assembly to a module.
Definition: Core.cpp:488
LLVMValueRef LLVMGetFirstFunction(LLVMModuleRef M)
Obtain an iterator to the first Function in a Module.
Definition: Core.cpp:2403
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:1480
LLVMBool LLVMPrintModuleToFile(LLVMModuleRef M, const char *Filename, char **ErrorMessage)
Print a representation of a module to a file.
Definition: Core.cpp:447
void LLVMDisposeModule(LLVMModuleRef M)
Destroy a module instance.
Definition: Core.cpp:283
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:498
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:1456
const char * LLVMGetModuleInlineAsm(LLVMModuleRef M, size_t *Len)
Get inline assembly for a module.
Definition: Core.cpp:492
const char * LLVMGetSourceFileName(LLVMModuleRef M, size_t *Len)
Obtain the module's original source file name.
Definition: Core.cpp:297
const char * LLVMGetNamedMetadataName(LLVMNamedMDNodeRef NamedMD, size_t *NameLen)
Retrieve the name of a NamedMDNode.
Definition: Core.cpp:1403
LLVMContextRef LLVMGetModuleContext(LLVMModuleRef M)
Obtain the context to which this module is associated.
Definition: Core.cpp:574
const char * LLVMGetInlineAsmConstraintString(LLVMValueRef InlineAsmVal, size_t *Len)
Get the raw constraint string for an inline assembly snippet.
Definition: Core.cpp:527
LLVMModuleRef LLVMModuleCreateWithNameInContext(const char *ModuleID, LLVMContextRef C)
Create a new, empty module in a specific context.
Definition: Core.cpp:278
LLVMMetadataRef LLVMModuleFlagEntriesGetMetadata(LLVMModuleFlagEntry *Entries, unsigned Index)
Returns the metadata for a module flag entry at a specific index.
Definition: Core.cpp:413
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:405
LLVMValueRef LLVMGetLastFunction(LLVMModuleRef M)
Obtain an iterator to the last Function in a Module.
Definition: Core.cpp:2411
void LLVMSetTarget(LLVMModuleRef M, const char *Triple)
Set the target triple for a module.
Definition: Core.cpp:325
const char * LLVMGetDataLayoutStr(LLVMModuleRef M)
Obtain the data layout for a module.
Definition: Core.cpp:308
const char * LLVMGetInlineAsmAsmString(LLVMValueRef InlineAsmVal, size_t *Len)
Get the template string used for an inline assembly snippet.
Definition: Core.cpp:518
LLVMModuleFlagBehavior LLVMModuleFlagEntriesGetFlagBehavior(LLVMModuleFlagEntry *Entries, unsigned Index)
Returns the flag behavior for a module flag entry at a specific index.
Definition: Core.cpp:398
unsigned LLVMGetDebugLocColumn(LLVMValueRef Val)
Return the column number of the debug location for this value, which must be an llvm::Instruction.
Definition: Core.cpp:1526
unsigned LLVMGetDebugLocLine(LLVMValueRef Val)
Return the line number of the debug location for this value, which must be an llvm::Instruction,...
Definition: Core.cpp:1504
LLVMBool LLVMGetInlineAsmNeedsAlignedStack(LLVMValueRef InlineAsmVal)
Get if the inline asm snippet needs an aligned stack.
Definition: Core.cpp:563
LLVMModuleRef LLVMModuleCreateWithName(const char *ModuleID)
Create a new, empty module in the global context.
Definition: Core.cpp:274
LLVMModuleFlagEntry * LLVMCopyModuleFlagsMetadata(LLVMModuleRef M, size_t *Len)
Returns the module flags as an array of flag-key-value triples.
Definition: Core.cpp:376
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:425
void LLVMSetModuleInlineAsm(LLVMModuleRef M, const char *Asm)
Deprecated: Use LLVMSetModuleInlineAsm2 instead.
Definition: Core.cpp:484
LLVMBool LLVMGetInlineAsmHasSideEffects(LLVMValueRef InlineAsmVal)
Get if the inline asm snippet has side effects.
Definition: Core.cpp:558
void LLVMDisposeModuleFlagsMetadata(LLVMModuleFlagEntry *Entries)
Destroys module flags metadata entries.
Definition: Core.cpp:393
LLVMInlineAsmDialect LLVMGetInlineAsmDialect(LLVMValueRef InlineAsmVal)
Get the dialect used by the inline asm snippet.
Definition: Core.cpp:537
unsigned LLVMGetNamedMetadataNumOperands(LLVMModuleRef M, const char *Name)
Obtain the number of operands for named metadata in a module.
Definition: Core.cpp:1429
const char * LLVMGetTarget(LLVMModuleRef M)
Obtain the target triple for a module.
Definition: Core.cpp:321
LLVMNamedMDNodeRef LLVMGetNextNamedMetadata(LLVMNamedMDNodeRef NamedMDNode)
Advance a NamedMDNode iterator to the next NamedMDNode.
Definition: Core.cpp:1377
void LLVMSetModuleInlineAsm2(LLVMModuleRef M, const char *Asm, size_t Len)
Set inline assembly for a module.
Definition: Core.cpp:480
LLVMNamedMDNodeRef LLVMGetLastNamedMetadata(LLVMModuleRef M)
Obtain an iterator to the last NamedMDNode in a Module.
Definition: Core.cpp:1369
LLVMBool LLVMGetInlineAsmCanUnwind(LLVMValueRef InlineAsmVal)
Get if the inline asm snippet may unwind the stack.
Definition: Core.cpp:568
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:420
LLVMModuleRef LLVMCloneModule(LLVMModuleRef M)
Return an exact copy of the specified module.
const char * LLVMGetDataLayout(LLVMModuleRef M)
Definition: Core.cpp:312
LLVMValueRef LLVMGetNamedFunction(LLVMModuleRef M, const char *Name)
Obtain a Function value from a Module by its name.
Definition: Core.cpp:2394
void LLVMSetIsNewDbgInfoFormat(LLVMModuleRef M, LLVMBool UseNewFormat)
Soon to be deprecated.
Definition: Core.cpp:436
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:1393
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:1398
LLVMValueRef LLVMGetPreviousFunction(LLVMValueRef Fn)
Decrement a Function iterator to the previous Function.
Definition: Core.cpp:2427
char * LLVMPrintModuleToString(LLVMModuleRef M)
Return a string representation of the module.
Definition: Core.cpp:469
void LLVMGetNamedMetadataOperands(LLVMModuleRef M, const char *Name, LLVMValueRef *Dest)
Obtain the named metadata operands for a module.
Definition: Core.cpp:1436
LLVMValueRef LLVMGetNextFunction(LLVMValueRef Fn)
Advance a Function iterator to the next Function.
Definition: Core.cpp:2419
LLVMTypeRef LLVMGetInlineAsmFunctionType(LLVMValueRef InlineAsmVal)
Get the function type of the inline assembly snippet.
Definition: Core.cpp:553
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:293
void LLVMAddNamedMetadataOperand(LLVMModuleRef M, const char *Name, LLVMValueRef Val)
Add an operand to named metadata.
Definition: Core.cpp:1446
LLVMNamedMDNodeRef LLVMGetFirstNamedMetadata(LLVMModuleRef M)
Obtain an iterator to the first NamedMDNode in a Module.
Definition: Core.cpp:1361
LLVMValueRef LLVMGetOperandBundleArgAtIndex(LLVMOperandBundleRef Bundle, unsigned Index)
Obtain the operand for an operand bundle at the given index.
Definition: Core.cpp:2765
unsigned LLVMGetNumOperandBundleArgs(LLVMOperandBundleRef Bundle)
Obtain the number of operands for an operand bundle.
Definition: Core.cpp:2761
LLVMOperandBundleRef LLVMCreateOperandBundle(const char *Tag, size_t TagLen, LLVMValueRef *Args, unsigned NumArgs)
Create a new operand bundle.
Definition: Core.cpp:2744
void LLVMDisposeOperandBundle(LLVMOperandBundleRef Bundle)
Destroy an operand bundle.
Definition: Core.cpp:2751
const char * LLVMGetOperandBundleTag(LLVMOperandBundleRef Bundle, size_t *Len)
Obtain the tag of an operand bundle as a string.
Definition: Core.cpp:2755
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:4527
LLVMPassManagerRef LLVMCreateFunctionPassManager(LLVMModuleProviderRef MP)
Deprecated: Use LLVMCreateFunctionPassManagerForModule instead.
Definition: Core.cpp:4522
LLVMPassManagerRef LLVMCreatePassManager(void)
Constructs a new whole-module pass pipeline.
Definition: Core.cpp:4514
void LLVMDisposePassManager(LLVMPassManagerRef PM)
Frees the memory of a pass pipeline.
Definition: Core.cpp:4543
LLVMBool LLVMFinalizeFunctionPassManager(LLVMPassManagerRef FPM)
Finalizes all of the function passes scheduled in the function pass manager.
Definition: Core.cpp:4539
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:4535
LLVMBool LLVMInitializeFunctionPassManager(LLVMPassManagerRef FPM)
Initializes all of the function passes scheduled in the function pass manager.
Definition: Core.cpp:4531
LLVMPassManagerRef LLVMCreateFunctionPassManagerForModule(LLVMModuleRef M)
Constructs a new function-by-function pass pipeline over the module provider.
Definition: Core.cpp:4518
LLVMBool LLVMIsMultithreaded(void)
Check whether LLVM is executing in thread-safe mode or not.
Definition: Core.cpp:4556
LLVMBool LLVMStartMultithreaded(void)
Deprecated: Multi-threading can only be enabled/disabled with the compile time define LLVM_ENABLE_THR...
Definition: Core.cpp:4549
void LLVMStopMultithreaded(void)
Deprecated: Multi-threading can only be enabled/disabled with the compile time define LLVM_ENABLE_THR...
Definition: Core.cpp:4553
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:725
LLVMTypeRef LLVMDoubleTypeInContext(LLVMContextRef C)
Obtain a 64-bit floating point type from a context.
Definition: Core.cpp:719
LLVMTypeRef LLVMX86FP80TypeInContext(LLVMContextRef C)
Obtain a 80-bit floating point type (X87) from a context.
Definition: Core.cpp:722
LLVMTypeRef LLVMHalfTypeInContext(LLVMContextRef C)
Obtain a 16-bit floating point type from a context.
Definition: Core.cpp:710
LLVMTypeRef LLVMBFloatTypeInContext(LLVMContextRef C)
Obtain a 16-bit brain floating point type from a context.
Definition: Core.cpp:713
LLVMTypeRef LLVMBFloatType(void)
Definition: Core.cpp:738
LLVMTypeRef LLVMFloatTypeInContext(LLVMContextRef C)
Obtain a 32-bit floating point type from a context.
Definition: Core.cpp:716
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:728
LLVMBool LLVMIsFunctionVarArg(LLVMTypeRef FunctionTy)
Returns whether a function type is variadic.
Definition: Core.cpp:769
unsigned LLVMCountParamTypes(LLVMTypeRef FunctionTy)
Obtain the number of parameters this function accepts.
Definition: Core.cpp:777
void LLVMGetParamTypes(LLVMTypeRef FunctionTy, LLVMTypeRef *Dest)
Obtain the types of a function's parameters.
Definition: Core.cpp:781
LLVMTypeRef LLVMFunctionType(LLVMTypeRef ReturnType, LLVMTypeRef *ParamTypes, unsigned ParamCount, LLVMBool IsVarArg)
Obtain a function type consisting of a specified signature.
Definition: Core.cpp:762
LLVMTypeRef LLVMGetReturnType(LLVMTypeRef FunctionTy)
Obtain the Type this function Type returns.
Definition: Core.cpp:773
LLVMTypeRef LLVMInt64Type(void)
Definition: Core.cpp:694
LLVMTypeRef LLVMInt64TypeInContext(LLVMContextRef C)
Definition: Core.cpp:672
LLVMTypeRef LLVMInt16TypeInContext(LLVMContextRef C)
Definition: Core.cpp:666
LLVMTypeRef LLVMIntTypeInContext(LLVMContextRef C, unsigned NumBits)
Definition: Core.cpp:678
LLVMTypeRef LLVMInt1TypeInContext(LLVMContextRef C)
Obtain an integer type from a context with specified bit width.
Definition: Core.cpp:660
LLVMTypeRef LLVMInt32Type(void)
Definition: Core.cpp:691
LLVMTypeRef LLVMInt32TypeInContext(LLVMContextRef C)
Definition: Core.cpp:669
LLVMTypeRef LLVMInt128TypeInContext(LLVMContextRef C)
Definition: Core.cpp:675
LLVMTypeRef LLVMIntType(unsigned NumBits)
Definition: Core.cpp:700
LLVMTypeRef LLVMInt8TypeInContext(LLVMContextRef C)
Definition: Core.cpp:663
LLVMTypeRef LLVMInt8Type(void)
Definition: Core.cpp:685
LLVMTypeRef LLVMInt1Type(void)
Obtain an integer type from the global context with a specified bit width.
Definition: Core.cpp:682
LLVMTypeRef LLVMInt128Type(void)
Definition: Core.cpp:697
unsigned LLVMGetIntTypeWidth(LLVMTypeRef IntegerTy)
Definition: Core.cpp:704
LLVMTypeRef LLVMInt16Type(void)
Definition: Core.cpp:688
LLVMTypeRef LLVMVoidType(void)
These are similar to the above functions except they operate on the global context.
Definition: Core.cpp:952
const char * LLVMGetTargetExtTypeName(LLVMTypeRef TargetExtTy)
Obtain the name for this target extension type.
Definition: Core.cpp:970
LLVMTypeRef LLVMGetTargetExtTypeTypeParam(LLVMTypeRef TargetExtTy, unsigned Idx)
Get the type parameter at the given index for the target extension type.
Definition: Core.cpp:980
unsigned LLVMGetTargetExtTypeNumTypeParams(LLVMTypeRef TargetExtTy)
Obtain the number of type parameters for this target extension type.
Definition: Core.cpp:975
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:948
LLVMTypeRef LLVMTokenTypeInContext(LLVMContextRef C)
Create a token type in a context.
Definition: Core.cpp:945
LLVMTypeRef LLVMX86AMXType(void)
Definition: Core.cpp:756
LLVMTypeRef LLVMLabelTypeInContext(LLVMContextRef C)
Create a label type in a context.
Definition: Core.cpp:942
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:959
unsigned LLVMGetTargetExtTypeNumIntParams(LLVMTypeRef TargetExtTy)
Obtain the number of int parameters for this target extension type.
Definition: Core.cpp:986
unsigned LLVMGetTargetExtTypeIntParam(LLVMTypeRef TargetExtTy, unsigned Idx)
Get the int parameter at the given index for the target extension type.
Definition: Core.cpp:991
LLVMTypeRef LLVMLabelType(void)
Definition: Core.cpp:955
LLVMTypeRef LLVMVoidTypeInContext(LLVMContextRef C)
Create a void type in a context.
Definition: Core.cpp:939
unsigned LLVMGetArrayLength(LLVMTypeRef ArrayTy)
Obtain the length of an array type.
Definition: Core.cpp:901
LLVMTypeRef LLVMGetElementType(LLVMTypeRef Ty)
Obtain the element type of an array or vector type.
Definition: Core.cpp:890
unsigned LLVMGetPointerAddressSpace(LLVMTypeRef PointerTy)
Obtain the address space of a pointer type.
Definition: Core.cpp:909
uint64_t LLVMGetArrayLength2(LLVMTypeRef ArrayTy)
Obtain the length of an array type.
Definition: Core.cpp:905
LLVMValueRef LLVMGetConstantPtrAuthPointer(LLVMValueRef PtrAuth)
Get the pointer value for the associated ConstantPtrAuth constant.
Definition: Core.cpp:917
LLVMTypeRef LLVMPointerType(LLVMTypeRef ElementType, unsigned AddressSpace)
Create a pointer type that points to a defined type.
Definition: Core.cpp:873
unsigned LLVMGetNumContainedTypes(LLVMTypeRef Tp)
Return the number of types in the derived type.
Definition: Core.cpp:897
LLVMValueRef LLVMGetConstantPtrAuthDiscriminator(LLVMValueRef PtrAuth)
Get the discriminator value for the associated ConstantPtrAuth constant.
Definition: Core.cpp:925
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:881
LLVMBool LLVMPointerTypeIsOpaque(LLVMTypeRef Ty)
Determine whether a pointer is opaque.
Definition: Core.cpp:877
LLVMTypeRef LLVMPointerTypeInContext(LLVMContextRef C, unsigned AddressSpace)
Create an opaque pointer type in a context.
Definition: Core.cpp:935
LLVMValueRef LLVMGetConstantPtrAuthKey(LLVMValueRef PtrAuth)
Get the key value for the associated ConstantPtrAuth constant.
Definition: Core.cpp:921
LLVMTypeRef LLVMArrayType(LLVMTypeRef ElementType, unsigned ElementCount)
Create a fixed size array type that refers to a specific type.
Definition: Core.cpp:865
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:885
LLVMTypeRef LLVMArrayType2(LLVMTypeRef ElementType, uint64_t ElementCount)
Create a fixed size array type that refers to a specific type.
Definition: Core.cpp:869
void LLVMGetSubtypes(LLVMTypeRef Tp, LLVMTypeRef *Arr)
Returns type's subtypes.
Definition: Core.cpp:857
LLVMValueRef LLVMGetConstantPtrAuthAddrDiscriminator(LLVMValueRef PtrAuth)
Get the address discriminator value for the associated ConstantPtrAuth constant.
Definition: Core.cpp:929
unsigned LLVMGetVectorSize(LLVMTypeRef VectorTy)
Obtain the (possibly scalable) number of elements in a vector type.
Definition: Core.cpp:913
void LLVMStructSetBody(LLVMTypeRef StructTy, LLVMTypeRef *ElementTypes, unsigned ElementCount, LLVMBool Packed)
Set the contents of a structure type.
Definition: Core.cpp:814
LLVMBool LLVMIsPackedStruct(LLVMTypeRef StructTy)
Determine whether a structure is packed.
Definition: Core.cpp:835
LLVMTypeRef LLVMStructGetTypeAtIndex(LLVMTypeRef StructTy, unsigned i)
Get the type of the element at a given index in the structure.
Definition: Core.cpp:830
LLVMTypeRef LLVMStructType(LLVMTypeRef *ElementTypes, unsigned ElementCount, LLVMBool Packed)
Create a new structure type in the global context.
Definition: Core.cpp:795
const char * LLVMGetStructName(LLVMTypeRef Ty)
Obtain the name of a structure.
Definition: Core.cpp:806
void LLVMGetStructElementTypes(LLVMTypeRef StructTy, LLVMTypeRef *Dest)
Get the elements within a structure.
Definition: Core.cpp:824
LLVMBool LLVMIsOpaqueStruct(LLVMTypeRef StructTy)
Determine whether a structure is opaque.
Definition: Core.cpp:839
unsigned LLVMCountStructElementTypes(LLVMTypeRef StructTy)
Get the number of elements defined inside the structure.
Definition: Core.cpp:820
LLVMTypeRef LLVMStructCreateNamed(LLVMContextRef C, const char *Name)
Create an empty structure in a context having a specified name.
Definition: Core.cpp:801
LLVMBool LLVMIsLiteralStruct(LLVMTypeRef StructTy)
Determine whether a structure is literal.
Definition: Core.cpp:843
LLVMTypeRef LLVMStructTypeInContext(LLVMContextRef C, LLVMTypeRef *ElementTypes, unsigned ElementCount, LLVMBool Packed)
Create a new structure type in a context.
Definition: Core.cpp:789
LLVMBool LLVMTypeIsSized(LLVMTypeRef Ty)
Whether the type has a known size.
Definition: Core.cpp:631
LLVMTypeKind LLVMGetTypeKind(LLVMTypeRef Ty)
Obtain the enumerated type of a Type instance.
Definition: Core.cpp:583
char * LLVMPrintTypeToString(LLVMTypeRef Val)
Return a string representation of the type.
Definition: Core.cpp:644
void LLVMDumpType(LLVMTypeRef Val)
Dump a representation of a type to stderr.
Definition: Core.cpp:640
LLVMContextRef LLVMGetTypeContext(LLVMTypeRef Ty)
Obtain the context to which this type instance is associated.
Definition: Core.cpp:636
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
@ 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:2826
void LLVMAppendExistingBasicBlock(LLVMValueRef Fn, LLVMBasicBlockRef BB)
Append the given basic block to the basic block list of the given function.
Definition: Core.cpp:2855
void LLVMDeleteBasicBlock(LLVMBasicBlockRef BB)
Remove a basic block from a function and delete it.
Definition: Core.cpp:2882
LLVMBasicBlockRef LLVMGetFirstBasicBlock(LLVMValueRef Fn)
Obtain the first basic block in a function.
Definition: Core.cpp:2810
LLVMBasicBlockRef LLVMValueAsBasicBlock(LLVMValueRef Val)
Convert an LLVMValueRef to an LLVMBasicBlockRef instance.
Definition: Core.cpp:2780
LLVMBasicBlockRef LLVMCreateBasicBlockInContext(LLVMContextRef C, const char *Name)
Create a new basic block without inserting it into a function.
Definition: Core.cpp:2842
void LLVMRemoveBasicBlockFromParent(LLVMBasicBlockRef BB)
Remove a basic block from a function.
Definition: Core.cpp:2886
void LLVMMoveBasicBlockBefore(LLVMBasicBlockRef BB, LLVMBasicBlockRef MovePos)
Move a basic block to before another one.
Definition: Core.cpp:2890
LLVMValueRef LLVMBasicBlockAsValue(LLVMBasicBlockRef BB)
Convert a basic block instance to a value type.
Definition: Core.cpp:2772
void LLVMInsertExistingBasicBlockAfterInsertBlock(LLVMBuilderRef Builder, LLVMBasicBlockRef BB)
Insert the given basic block after the insertion point of the given builder.
Definition: Core.cpp:2847
void LLVMGetBasicBlocks(LLVMValueRef Fn, LLVMBasicBlockRef *BasicBlocks)
Obtain all of the basic blocks in a function.
Definition: Core.cpp:2800
LLVMBasicBlockRef LLVMAppendBasicBlock(LLVMValueRef Fn, const char *Name)
Append a basic block to the end of a function using the global context.
Definition: Core.cpp:2866
LLVMValueRef LLVMGetBasicBlockTerminator(LLVMBasicBlockRef BB)
Obtain the terminator instruction for a basic block.
Definition: Core.cpp:2792
unsigned LLVMCountBasicBlocks(LLVMValueRef Fn)
Obtain the number of basic blocks in a function.
Definition: Core.cpp:2796
void LLVMMoveBasicBlockAfter(LLVMBasicBlockRef BB, LLVMBasicBlockRef MovePos)
Move a basic block to after another one.
Definition: Core.cpp:2894
LLVMBasicBlockRef LLVMGetLastBasicBlock(LLVMValueRef Fn)
Obtain the last basic block in a function.
Definition: Core.cpp:2818
LLVMBasicBlockRef LLVMAppendBasicBlockInContext(LLVMContextRef C, LLVMValueRef Fn, const char *Name)
Append a basic block to the end of a function.
Definition: Core.cpp:2860
LLVMValueRef LLVMGetBasicBlockParent(LLVMBasicBlockRef BB)
Obtain the function to which a basic block belongs.
Definition: Core.cpp:2788
LLVMValueRef LLVMGetFirstInstruction(LLVMBasicBlockRef BB)
Obtain the first instruction in a basic block.
Definition: Core.cpp:2904
LLVMValueRef LLVMGetLastInstruction(LLVMBasicBlockRef BB)
Obtain the last instruction in a basic block.
Definition: Core.cpp:2912
LLVMBasicBlockRef LLVMInsertBasicBlockInContext(LLVMContextRef C, LLVMBasicBlockRef BB, const char *Name)
Insert a basic block in a function before another basic block.
Definition: Core.cpp:2870
LLVMBasicBlockRef LLVMInsertBasicBlock(LLVMBasicBlockRef InsertBeforeBB, const char *Name)
Insert a basic block in a function using the global context.
Definition: Core.cpp:2877
LLVMBasicBlockRef LLVMGetEntryBasicBlock(LLVMValueRef Fn)
Obtain the basic block that corresponds to the entry point of a function.
Definition: Core.cpp:2806
LLVMBool LLVMValueIsBasicBlock(LLVMValueRef Val)
Determine whether an LLVMValueRef is itself a basic block.
Definition: Core.cpp:2776
const char * LLVMGetBasicBlockName(LLVMBasicBlockRef BB)
Obtain the string name of a basic block.
Definition: Core.cpp:2784
LLVMBasicBlockRef LLVMGetPreviousBasicBlock(LLVMBasicBlockRef BB)
Go backwards in a basic block iterator.
Definition: Core.cpp:2834
LLVMValueRef LLVMConstStruct(LLVMValueRef *ConstantVals, unsigned Count, LLVMBool Packed)
Create a ConstantStruct in the global Context.
Definition: Core.cpp:1663
LLVMValueRef LLVMConstArray(LLVMTypeRef ElementTy, LLVMValueRef *ConstantVals, unsigned Length)
Create a ConstantArray from values.
Definition: Core.cpp:1643
LLVMValueRef LLVMConstArray2(LLVMTypeRef ElementTy, LLVMValueRef *ConstantVals, uint64_t Length)
Create a ConstantArray from values.
Definition: Core.cpp:1649
LLVMValueRef LLVMConstVector(LLVMValueRef *ScalarConstantVals, unsigned Size)
Create a ConstantVector from values.
Definition: Core.cpp:1678
LLVMValueRef LLVMConstStringInContext(LLVMContextRef C, const char *Str, unsigned Length, LLVMBool DontNullTerminate)
Create a ConstantDataSequential and initialize it with a string.
Definition: Core.cpp:1601
LLVMValueRef LLVMConstNamedStruct(LLVMTypeRef StructTy, LLVMValueRef *ConstantVals, unsigned Count)
Create a non-anonymous ConstantStruct from values.
Definition: Core.cpp:1669
LLVMBool LLVMIsConstantString(LLVMValueRef c)
Returns true if the specified constant is an array of i8.
Definition: Core.cpp:1633
LLVMValueRef LLVMConstantPtrAuth(LLVMValueRef Ptr, LLVMValueRef Key, LLVMValueRef Disc, LLVMValueRef AddrDisc)
Create a ConstantPtrAuth constant with the given values.
Definition: Core.cpp:1683
LLVMValueRef LLVMGetAggregateElement(LLVMValueRef C, unsigned Idx)
Get element of a constant aggregate (struct, array or vector) at the specified index.
Definition: Core.cpp:1625
LLVMValueRef LLVMConstString(const char *Str, unsigned Length, LLVMBool DontNullTerminate)
Create a ConstantDataSequential with string content in the global context.
Definition: Core.cpp:1619
const char * LLVMGetAsString(LLVMValueRef c, size_t *Length)
Get the given constant data sequential as a string.
Definition: Core.cpp:1637
LLVMValueRef LLVMConstStringInContext2(LLVMContextRef C, const char *Str, size_t Length, LLVMBool DontNullTerminate)
Create a ConstantDataSequential and initialize it with a string.
Definition: Core.cpp:1610
LLVMValueRef LLVMConstStructInContext(LLVMContextRef C, LLVMValueRef *ConstantVals, unsigned Count, LLVMBool Packed)
Create an anonymous ConstantStruct with the specified values.
Definition: Core.cpp:1655
LLVMValueRef LLVMConstPointerCast(LLVMValueRef ConstantVal, LLVMTypeRef ToType)
Definition: Core.cpp:1886
LLVMValueRef LLVMConstMul(LLVMValueRef LHSConstant, LLVMValueRef RHSConstant)
Definition: Core.cpp:1803
LLVMValueRef LLVMConstTruncOrBitCast(LLVMValueRef ConstantVal, LLVMTypeRef ToType)
Definition: Core.cpp:1880
LLVMValueRef LLVMSizeOf(LLVMTypeRef Ty)
Definition: Core.cpp:1748
LLVMValueRef LLVMConstPtrToInt(LLVMValueRef ConstantVal, LLVMTypeRef ToType)
Definition: Core.cpp:1859
LLVMValueRef LLVMConstNUWSub(LLVMValueRef LHSConstant, LLVMValueRef RHSConstant)
Definition: Core.cpp:1797
LLVMValueRef LLVMConstNUWAdd(LLVMValueRef LHSConstant, LLVMValueRef RHSConstant)
Definition: Core.cpp:1780
LLVMValueRef LLVMConstIntToPtr(LLVMValueRef ConstantVal, LLVMTypeRef ToType)
Definition: Core.cpp:1864
LLVMValueRef LLVMConstTrunc(LLVMValueRef ConstantVal, LLVMTypeRef ToType)
Definition: Core.cpp:1854
LLVMValueRef LLVMConstNot(LLVMValueRef ConstantVal)
Definition: Core.cpp:1765
LLVMValueRef LLVMGetBlockAddressFunction(LLVMValueRef BlockAddr)
Gets the function associated with a given BlockAddress constant value.
Definition: Core.cpp:1928
LLVMValueRef LLVMConstNSWMul(LLVMValueRef LHSConstant, LLVMValueRef RHSConstant)
Definition: Core.cpp:1808
LLVMValueRef LLVMConstExtractElement(LLVMValueRef VectorConstant, LLVMValueRef IndexConstant)
Definition: Core.cpp:1892
LLVMValueRef LLVMConstInsertElement(LLVMValueRef VectorConstant, LLVMValueRef ElementValueConstant, LLVMValueRef IndexConstant)
Definition: Core.cpp:1898
LLVMValueRef LLVMConstInBoundsGEP2(LLVMTypeRef Ty, LLVMValueRef ConstantVal, LLVMValueRef *ConstantIndices, unsigned NumIndices)
Definition: Core.cpp:1833
LLVMValueRef LLVMConstAddrSpaceCast(LLVMValueRef ConstantVal, LLVMTypeRef ToType)
Definition: Core.cpp:1874
LLVMBasicBlockRef LLVMGetBlockAddressBasicBlock(LLVMValueRef BlockAddr)
Gets the basic block associated with a given BlockAddress constant value.
Definition: Core.cpp:1932
LLVMValueRef LLVMConstNSWAdd(LLVMValueRef LHSConstant, LLVMValueRef RHSConstant)
Definition: Core.cpp:1774
LLVMValueRef LLVMAlignOf(LLVMTypeRef Ty)
Definition: Core.cpp:1744
LLVMValueRef LLVMConstInlineAsm(LLVMTypeRef Ty, const char *AsmString, const char *Constraints, LLVMBool HasSideEffects, LLVMBool IsAlignStack)
Deprecated: Use LLVMGetInlineAsm instead.
Definition: Core.cpp:1916
LLVMValueRef LLVMConstXor(LLVMValueRef LHSConstant, LLVMValueRef RHSConstant)
Definition: Core.cpp:1820
LLVMValueRef LLVMConstBitCast(LLVMValueRef ConstantVal, LLVMTypeRef ToType)
Definition: Core.cpp:1869
LLVMValueRef LLVMConstNSWNeg(LLVMValueRef ConstantVal)
Definition: Core.cpp:1756
LLVMValueRef LLVMConstNUWMul(LLVMValueRef LHSConstant, LLVMValueRef RHSConstant)
Definition: Core.cpp:1814
LLVMValueRef LLVMConstGEPWithNoWrapFlags(LLVMTypeRef Ty, LLVMValueRef ConstantVal, LLVMValueRef *ConstantIndices, unsigned NumIndices, LLVMGEPNoWrapFlags NoWrapFlags)
Creates a constant GetElementPtr expression.
Definition: Core.cpp:1842
LLVMValueRef LLVMConstGEP2(LLVMTypeRef Ty, LLVMValueRef ConstantVal, LLVMValueRef *ConstantIndices, unsigned NumIndices)
Definition: Core.cpp:1825
LLVMValueRef LLVMConstSub(LLVMValueRef LHSConstant, LLVMValueRef RHSConstant)
Definition: Core.cpp:1786
LLVMValueRef LLVMConstAdd(LLVMValueRef LHSConstant, LLVMValueRef RHSConstant)
Definition: Core.cpp:1769
LLVMValueRef LLVMConstShuffleVector(LLVMValueRef VectorAConstant, LLVMValueRef VectorBConstant, LLVMValueRef MaskConstant)
Definition: Core.cpp:1906
LLVMValueRef LLVMConstNeg(LLVMValueRef ConstantVal)
Definition: Core.cpp:1752
LLVMValueRef LLVMBlockAddress(LLVMValueRef F, LLVMBasicBlockRef BB)
Definition: Core.cpp:1924
LLVMOpcode LLVMGetConstOpcode(LLVMValueRef ConstantVal)
Definition: Core.cpp:1740
LLVMValueRef LLVMConstNSWSub(LLVMValueRef LHSConstant, LLVMValueRef RHSConstant)
Definition: Core.cpp:1791
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:2182
unsigned LLVMValueMetadataEntriesGetKind(LLVMValueMetadataEntry *Entries, unsigned Index)
Returns the kind of a value metadata entry at a specific index.
Definition: Core.cpp:2163
void LLVMDisposeValueMetadataEntries(LLVMValueMetadataEntry *Entries)
Destroys value metadata entries.
Definition: Core.cpp:2178
void LLVMSetVisibility(LLVMValueRef Global, LLVMVisibility Viz)
Definition: Core.cpp:2055
LLVMDLLStorageClass LLVMGetDLLStorageClass(LLVMValueRef Global)
Definition: Core.cpp:2060
void LLVMSetAlignment(LLVMValueRef V, unsigned Bytes)
Set the preferred alignment of the value.
Definition: Core.cpp:2131
LLVMModuleRef LLVMGetGlobalParent(LLVMValueRef Global)
Definition: Core.cpp:1938
const char * LLVMGetSection(LLVMValueRef Global)
Definition: Core.cpp:2040
LLVMTypeRef LLVMGlobalGetValueType(LLVMValueRef Global)
Returns the "value type" of a global value.
Definition: Core.cpp:2105
LLVMBool LLVMIsDeclaration(LLVMValueRef Global)
Definition: Core.cpp:1942
LLVMVisibility LLVMGetVisibility(LLVMValueRef Global)
Definition: Core.cpp:2050
void LLVMSetDLLStorageClass(LLVMValueRef Global, LLVMDLLStorageClass Class)
Definition: Core.cpp:2065
LLVMBool LLVMHasUnnamedAddr(LLVMValueRef Global)
Deprecated: Use LLVMGetUnnamedAddress instead.
Definition: Core.cpp:2095
LLVMLinkage LLVMGetLinkage(LLVMValueRef Global)
Definition: Core.cpp:1946
LLVMUnnamedAddr LLVMGetUnnamedAddress(LLVMValueRef Global)
Definition: Core.cpp:2070
LLVMMetadataRef LLVMValueMetadataEntriesGetMetadata(LLVMValueMetadataEntry *Entries, unsigned Index)
Returns the underlying metadata node of a value metadata entry at a specific index.
Definition: Core.cpp:2171
void LLVMSetUnnamedAddress(LLVMValueRef Global, LLVMUnnamedAddr UnnamedAddr)
Definition: Core.cpp:2082
void LLVMSetLinkage(LLVMValueRef Global, LLVMLinkage Linkage)
Definition: Core.cpp:1975
void LLVMSetUnnamedAddr(LLVMValueRef Global, LLVMBool HasUnnamedAddr)
Deprecated: Use LLVMSetUnnamedAddress instead.
Definition: Core.cpp:2099
void LLVMGlobalClearMetadata(LLVMValueRef Global)
Removes all metadata attachments from this value.
Definition: Core.cpp:2191
unsigned LLVMGetAlignment(LLVMValueRef V)
Obtain the preferred alignment of the value.
Definition: Core.cpp:2111
void LLVMSetSection(LLVMValueRef Global, const char *Section)
Definition: Core.cpp:2046
void LLVMGlobalEraseMetadata(LLVMValueRef Global, unsigned Kind)
Erases a metadata attachment of the given kind if it exists.
Definition: Core.cpp:2187
LLVMValueMetadataEntry * LLVMGlobalCopyAllMetadata(LLVMValueRef Value, size_t *NumEntries)
Retrieves an array of metadata entries representing the metadata attached to this value.
Definition: Core.cpp:2151
LLVMValueRef LLVMConstInt(LLVMTypeRef IntTy, unsigned long long N, LLVMBool SignExtend)
Obtain a constant value for an integer type.
Definition: Core.cpp:1536
LLVMValueRef LLVMConstIntOfArbitraryPrecision(LLVMTypeRef IntTy, unsigned NumWords, const uint64_t Words[])
Obtain a constant value for an integer of arbitrary precision.
Definition: Core.cpp:1541
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:1565
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:1582
long long LLVMConstIntGetSExtValue(LLVMValueRef ConstantVal)
Obtain the sign extended value for an integer constant value.
Definition: Core.cpp:1578
unsigned long long LLVMConstIntGetZExtValue(LLVMValueRef ConstantVal)
Obtain the zero extended value for an integer constant value.
Definition: Core.cpp:1574
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:1561
LLVMBool LLVMIsNull(LLVMValueRef Val)
Determine whether a value instance is null.
Definition: Core.cpp:1259
LLVMValueRef LLVMGetUndef(LLVMTypeRef Ty)
Obtain a constant value referring to an undefined value of a type.
Definition: Core.cpp:1247
LLVMValueRef LLVMGetPoison(LLVMTypeRef Ty)
Obtain a constant value referring to a poison value of a type.
Definition: Core.cpp:1251
LLVMValueRef LLVMConstAllOnes(LLVMTypeRef Ty)
Obtain a constant value referring to the instance of a type consisting of all ones.
Definition: Core.cpp:1243
LLVMValueRef LLVMConstPointerNull(LLVMTypeRef Ty)
Obtain a constant that is a constant pointer pointing to NULL for a specified type.
Definition: Core.cpp:1273
LLVMValueRef LLVMConstNull(LLVMTypeRef Ty)
Obtain a constant value referring to the null instance of a type.
Definition: Core.cpp:1239
unsigned LLVMCountParams(LLVMValueRef Fn)
Obtain the number of parameters in a function.
Definition: Core.cpp:2620
LLVMValueRef LLVMGetPreviousParam(LLVMValueRef Arg)
Obtain the previous parameter to a function.
Definition: Core.cpp:2665
LLVMValueRef LLVMGetNextParam(LLVMValueRef Arg)
Obtain the next parameter to a function.
Definition: Core.cpp:2657
LLVMValueRef LLVMGetParamParent(LLVMValueRef Inst)
Obtain the function to which this argument belongs.
Definition: Core.cpp:2637
LLVMValueRef LLVMGetFirstParam(LLVMValueRef Fn)
Obtain the first parameter to a function.
Definition: Core.cpp:2641
void LLVMSetParamAlignment(LLVMValueRef Arg, unsigned Align)
Set the alignment for a function parameter.
Definition: Core.cpp:2672
LLVMValueRef LLVMGetParam(LLVMValueRef Fn, unsigned Index)
Obtain the parameter at the specified index.
Definition: Core.cpp:2632
LLVMValueRef LLVMGetLastParam(LLVMValueRef Fn)
Obtain the last parameter to a function.
Definition: Core.cpp:2649
void LLVMGetParams(LLVMValueRef Fn, LLVMValueRef *Params)
Obtain the parameters in a function.
Definition: Core.cpp:2626
void LLVMSetGC(LLVMValueRef Fn, const char *Name)
Define the garbage collector to use during code generation.
Definition: Core.cpp:2530
const char * LLVMGetGC(LLVMValueRef Fn)
Obtain the name of the garbage collector to use during code generation.
Definition: Core.cpp:2525
LLVMValueRef LLVMGetPrologueData(LLVMValueRef Fn)
Gets the prologue data associated with a function.
Definition: Core.cpp:2554
void LLVMRemoveEnumAttributeAtIndex(LLVMValueRef F, LLVMAttributeIndex Idx, unsigned KindID)
Definition: Core.cpp:2601
unsigned LLVMGetAttributeCountAtIndex(LLVMValueRef F, LLVMAttributeIndex Idx)
Definition: Core.cpp:2575
LLVMBool LLVMHasPersonalityFn(LLVMValueRef Fn)
Check whether the given function has a personality function.
Definition: Core.cpp:2439
unsigned LLVMLookupIntrinsicID(const char *Name, size_t NameLen)
Obtain the intrinsic ID number which matches the given function name.
Definition: Core.cpp:2507
const char * LLVMIntrinsicGetName(unsigned ID, size_t *NameLength)
Retrieves the name of an intrinsic.
Definition: Core.cpp:2471
unsigned LLVMGetFunctionCallConv(LLVMValueRef Fn)
Obtain the calling function of a function.
Definition: Core.cpp:2516
LLVMValueRef LLVMGetPrefixData(LLVMValueRef Fn)
Gets the prefix data associated with a function.
Definition: Core.cpp:2538
void LLVMRemoveStringAttributeAtIndex(LLVMValueRef F, LLVMAttributeIndex Idx, const char *K, unsigned KLen)
Definition: Core.cpp:2606
void LLVMSetPrefixData(LLVMValueRef Fn, LLVMValueRef prefixData)
Sets the prefix data for the function.
Definition: Core.cpp:2548
LLVMAttributeRef LLVMGetStringAttributeAtIndex(LLVMValueRef F, LLVMAttributeIndex Idx, const char *K, unsigned KLen)
Definition: Core.cpp:2594
LLVMValueRef LLVMGetPersonalityFn(LLVMValueRef Fn)
Obtain the personality function attached to the function.
Definition: Core.cpp:2443
void LLVMSetPersonalityFn(LLVMValueRef Fn, LLVMValueRef PersonalityFn)
Set the personality function attached to the function.
Definition: Core.cpp:2447
LLVMBool LLVMIntrinsicIsOverloaded(unsigned ID)
Obtain if the intrinsic identified by the given ID is overloaded.
Definition: Core.cpp:2511
void LLVMAddAttributeAtIndex(LLVMValueRef F, LLVMAttributeIndex Idx, LLVMAttributeRef A)
Add an attribute to a function.
Definition: Core.cpp:2570
void LLVMDeleteFunction(LLVMValueRef Fn)
Remove a function from its containing module and deletes it.
Definition: Core.cpp:2435
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:2496
void LLVMSetPrologueData(LLVMValueRef Fn, LLVMValueRef prologueData)
Sets the prologue data for the function.
Definition: Core.cpp:2564
const char * LLVMIntrinsicCopyOverloadedName(unsigned ID, LLVMTypeRef *ParamTypes, size_t ParamCount, size_t *NameLength)
Deprecated: Use LLVMIntrinsicCopyOverloadedName2 instead.
Definition: Core.cpp:2485
LLVMBool LLVMHasPrologueData(LLVMValueRef Fn)
Check if a given function has prologue data.
Definition: Core.cpp:2559
LLVMBool LLVMHasPrefixData(LLVMValueRef Fn)
Check if a given function has prefix data.
Definition: Core.cpp:2543
void LLVMGetAttributesAtIndex(LLVMValueRef F, LLVMAttributeIndex Idx, LLVMAttributeRef *Attrs)
Definition: Core.cpp:2580
void LLVMSetFunctionCallConv(LLVMValueRef Fn, unsigned CC)
Set the calling convention of a function.
Definition: Core.cpp:2520
LLVMValueRef LLVMGetIntrinsicDeclaration(LLVMModuleRef Mod, unsigned ID, LLVMTypeRef *ParamTypes, size_t ParamCount)
Create or insert the declaration of an intrinsic.
Definition: Core.cpp:2462
LLVMAttributeRef LLVMGetEnumAttributeAtIndex(LLVMValueRef F, LLVMAttributeIndex Idx, unsigned KindID)
Definition: Core.cpp:2587
void LLVMAddTargetDependentFunctionAttr(LLVMValueRef Fn, const char *A, const char *V)
Add a target-dependent attribute to a function.
Definition: Core.cpp:2611
LLVMTypeRef LLVMIntrinsicGetType(LLVMContextRef Ctx, unsigned ID, LLVMTypeRef *ParamTypes, size_t ParamCount)
Retrieves the type of an intrinsic.
Definition: Core.cpp:2478
unsigned LLVMGetIntrinsicID(LLVMValueRef Fn)
Obtain the ID number from a function instance.
Definition: Core.cpp:2451
LLVMValueKind LLVMGetValueKind(LLVMValueRef Val)
Obtain the enumerated type of a Value instance.
Definition: Core.cpp:1004
const char * LLVMGetValueName(LLVMValueRef Val)
Deprecated: Use LLVMGetValueName2 instead.
Definition: Core.cpp:1026
LLVMTypeRef LLVMTypeOf(LLVMValueRef Val)
Obtain the type of a value.
Definition: Core.cpp:1000
LLVMBool LLVMIsConstant(LLVMValueRef Val)
Determine whether the specified value instance is constant.
Definition: Core.cpp:1255
void LLVMReplaceAllUsesWith(LLVMValueRef OldVal, LLVMValueRef NewVal)
Replace all uses of a value with another one.
Definition: Core.cpp:1070
const char * LLVMGetValueName2(LLVMValueRef Val, size_t *Length)
Obtain the string name of a value.
Definition: Core.cpp:1016
LLVMContextRef LLVMGetValueContext(LLVMValueRef Val)
Obtain the context to which this value is associated.
Definition: Core.cpp:1052
char * LLVMPrintDbgRecordToString(LLVMDbgRecordRef Record)
Return a string representation of the DbgRecord.
Definition: Core.cpp:1056
void LLVMSetValueName(LLVMValueRef Val, const char *Name)
Deprecated: Use LLVMSetValueName2 instead.
Definition: Core.cpp:1030
#define LLVM_DECLARE_VALUE_CAST(name)
Convert value instances between types.
Definition: Core.h:2029
void LLVMDumpValue(LLVMValueRef Val)
Dump a representation of a value to stderr.
Definition: Core.cpp:1034
LLVMBool LLVMIsUndef(LLVMValueRef Val)
Determine whether a value instance is undefined.
Definition: Core.cpp:1265
LLVMValueRef LLVMIsAMDNode(LLVMValueRef Val)
Definition: Core.cpp:1148
LLVMBool LLVMIsPoison(LLVMValueRef Val)
Determine whether a value instance is poisonous.
Definition: Core.cpp:1269
LLVMValueRef LLVMIsAMDString(LLVMValueRef Val)
Definition: Core.cpp:1163
void LLVMSetValueName2(LLVMValueRef Val, const char *Name, size_t NameLen)
Set the string name of a value.
Definition: Core.cpp:1022
LLVMValueRef LLVMIsAValueAsMetadata(LLVMValueRef Val)
Definition: Core.cpp:1156
char * LLVMPrintValueToString(LLVMValueRef Val)
Return a string representation of the value.
Definition: Core.cpp:1038
void LLVMEraseGlobalIFunc(LLVMValueRef IFunc)
Remove a global indirect function from its parent module and delete it.
Definition: Core.cpp:2734
void LLVMRemoveGlobalIFunc(LLVMValueRef IFunc)
Remove a global indirect function from its parent module.
Definition: Core.cpp:2738
LLVMValueRef LLVMGetNextGlobalIFunc(LLVMValueRef IFunc)
Advance a GlobalIFunc iterator to the next GlobalIFunc.
Definition: Core.cpp:2710
LLVMValueRef LLVMGetNamedGlobalIFunc(LLVMModuleRef M, const char *Name, size_t NameLen)
Obtain a GlobalIFunc value from a Module by its name.
Definition: Core.cpp:2689
LLVMValueRef LLVMGetLastGlobalIFunc(LLVMModuleRef M)
Obtain an iterator to the last GlobalIFunc in a Module.
Definition: Core.cpp:2702
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:2679
void LLVMSetGlobalIFuncResolver(LLVMValueRef IFunc, LLVMValueRef Resolver)
Sets the resolver function associated with this indirect function.
Definition: Core.cpp:2730
LLVMValueRef LLVMGetFirstGlobalIFunc(LLVMModuleRef M)
Obtain an iterator to the first GlobalIFunc in a Module.
Definition: Core.cpp:2694
LLVMValueRef LLVMGetGlobalIFuncResolver(LLVMValueRef IFunc)
Retrieves the resolver function associated with this indirect function, or NULL if it doesn't not exi...
Definition: Core.cpp:2726
LLVMValueRef LLVMGetPreviousGlobalIFunc(LLVMValueRef IFunc)
Decrement a GlobalIFunc iterator to the previous GlobalIFunc.
Definition: Core.cpp:2718
LLVMTypeRef LLVMGetAllocatedType(LLVMValueRef Alloca)
Obtain the type that is being allocated by the alloca instruction.
Definition: Core.cpp:3159
LLVMOperandBundleRef LLVMGetOperandBundleAtIndex(LLVMValueRef C, unsigned Index)
Obtain the operand bundle attached to this instruction at the given index.
Definition: Core.cpp:3059
LLVMValueRef LLVMGetCalledValue(LLVMValueRef Instr)
Obtain the pointer to the function invoked by this instruction.
Definition: Core.cpp:3047
void LLVMGetCallSiteAttributes(LLVMValueRef C, LLVMAttributeIndex Idx, LLVMAttributeRef *Attrs)
Definition: Core.cpp:3015
unsigned LLVMGetNumArgOperands(LLVMValueRef Instr)
Obtain the argument count for a call instruction.
Definition: Core.cpp:2977
void LLVMSetNormalDest(LLVMValueRef InvokeInst, LLVMBasicBlockRef B)
Set the normal destination basic block.
Definition: Core.cpp:3098
unsigned LLVMGetInstructionCallConv(LLVMValueRef Instr)
Obtain the calling convention for a call instruction.
Definition: Core.cpp:2986
LLVMTypeRef LLVMGetCalledFunctionType(LLVMValueRef C)
Obtain the function type called by this instruction.
Definition: Core.cpp:3051
unsigned LLVMGetCallSiteAttributeCount(LLVMValueRef C, LLVMAttributeIndex Idx)
Definition: Core.cpp:3008
void LLVMAddCallSiteAttribute(LLVMValueRef C, LLVMAttributeIndex Idx, LLVMAttributeRef A)
Definition: Core.cpp:3003
unsigned LLVMGetNumOperandBundles(LLVMValueRef C)
Obtain the number of operand bundles attached to this instruction.
Definition: Core.cpp:3055
LLVMBasicBlockRef LLVMGetCallBrIndirectDest(LLVMValueRef CallBr, unsigned Idx)
Get the indirect destination of a CallBr instruction at the given index.
Definition: Core.cpp:3119
void LLVMSetInstructionCallConv(LLVMValueRef Instr, unsigned CC)
Set the calling convention for a call instruction.
Definition: Core.cpp:2990
LLVMAttributeRef LLVMGetCallSiteEnumAttribute(LLVMValueRef C, LLVMAttributeIndex Idx, unsigned KindID)
Definition: Core.cpp:3023
LLVMBasicBlockRef LLVMGetNormalDest(LLVMValueRef InvokeInst)
Return the normal destination basic block.
Definition: Core.cpp:3085
void LLVMRemoveCallSiteEnumAttribute(LLVMValueRef C, LLVMAttributeIndex Idx, unsigned KindID)
Definition: Core.cpp:3037
unsigned LLVMGetCallBrNumIndirectDests(LLVMValueRef CallBr)
Get the number of indirect destinations of a CallBr instruction.
Definition: Core.cpp:3115
void LLVMSetUnwindDest(LLVMValueRef InvokeInst, LLVMBasicBlockRef B)
Set the unwind destination basic block.
Definition: Core.cpp:3102
void LLVMSetTailCall(LLVMValueRef CallInst, LLVMBool IsTailCall)
Set whether a call instruction is a tail call.
Definition: Core.cpp:3071
LLVMBool LLVMIsTailCall(LLVMValueRef CallInst)
Obtain whether a call instruction is a tail call.
Definition: Core.cpp:3067
void LLVMSetInstrParamAlignment(LLVMValueRef Instr, LLVMAttributeIndex Idx, unsigned Align)
Definition: Core.cpp:2995
LLVMBasicBlockRef LLVMGetCallBrDefaultDest(LLVMValueRef CallBr)
Get the default destination of a CallBr instruction.
Definition: Core.cpp:3111
void LLVMRemoveCallSiteStringAttribute(LLVMValueRef C, LLVMAttributeIndex Idx, const char *K, unsigned KLen)
Definition: Core.cpp:3042
LLVMTailCallKind LLVMGetTailCallKind(LLVMValueRef CallInst)
Obtain a tail call kind of the call instruction.
Definition: Core.cpp:3075
void LLVMSetTailCallKind(LLVMValueRef CallInst, LLVMTailCallKind kind)
Set the call kind of the call instruction.
Definition: Core.cpp:3079
LLVMAttributeRef LLVMGetCallSiteStringAttribute(LLVMValueRef C, LLVMAttributeIndex Idx, const char *K, unsigned KLen)
Definition: Core.cpp:3030
LLVMBasicBlockRef LLVMGetUnwindDest(LLVMValueRef InvokeInst)
Return the unwind destination basic block.
Definition: Core.cpp:3089
LLVMTypeRef LLVMGetGEPSourceElementType(LLVMValueRef GEP)
Get the source element type of the given GEP operator.
Definition: Core.cpp:3173
LLVMBool LLVMIsInBounds(LLVMValueRef GEP)
Check whether the given GEP operator is inbounds.
Definition: Core.cpp:3165
void LLVMSetIsInBounds(LLVMValueRef GEP, LLVMBool InBounds)
Set the given GEP instruction to be inbounds or not.
Definition: Core.cpp:3169
void LLVMGEPSetNoWrapFlags(LLVMValueRef GEP, LLVMGEPNoWrapFlags NoWrapFlags)
Set the no-wrap related flags for the given GEP instruction.
Definition: Core.cpp:3182
LLVMGEPNoWrapFlags LLVMGEPGetNoWrapFlags(LLVMValueRef GEP)
Get the no-wrap related flags for the given GEP instruction.
Definition: Core.cpp:3177
const unsigned * LLVMGetIndices(LLVMValueRef Inst)
Obtain the indices as an array.
Definition: Core.cpp:3222
unsigned LLVMGetNumIndices(LLVMValueRef Inst)
Obtain the number of indices.
Definition: Core.cpp:3210
void LLVMAddIncoming(LLVMValueRef PhiNode, LLVMValueRef *IncomingValues, LLVMBasicBlockRef *IncomingBlocks, unsigned Count)
Add an incoming value to the end of a PHI list.
Definition: Core.cpp:3189
LLVMValueRef LLVMGetIncomingValue(LLVMValueRef PhiNode, unsigned Index)
Obtain an incoming value to a PHI node as an LLVMValueRef.
Definition: Core.cpp:3200
unsigned LLVMCountIncoming(LLVMValueRef PhiNode)
Obtain the number of incoming basic blocks to a PHI node.
Definition: Core.cpp:3196
LLVMBasicBlockRef LLVMGetIncomingBlock(LLVMValueRef PhiNode, unsigned Index)
Obtain an incoming value to a PHI node as an LLVMBasicBlockRef.
Definition: Core.cpp:3204
unsigned LLVMGetNumSuccessors(LLVMValueRef Term)
Return the number of successors that this terminator has.
Definition: Core.cpp:3125
LLVMBasicBlockRef LLVMGetSwitchDefaultDest(LLVMValueRef SwitchInstr)
Obtain the default destination basic block of a switch instruction.
Definition: Core.cpp:3153
void LLVMSetSuccessor(LLVMValueRef Term, unsigned i, LLVMBasicBlockRef block)
Update the specified successor to point at the provided block.
Definition: Core.cpp:3133
void LLVMSetCondition(LLVMValueRef Branch, LLVMValueRef Cond)
Set the condition of a branch instruction.
Definition: Core.cpp:3147
LLVMValueRef LLVMGetCondition(LLVMValueRef Branch)
Return the condition of a branch instruction.
Definition: Core.cpp:3143
LLVMBool LLVMIsConditional(LLVMValueRef Branch)
Return if a branch is conditional.
Definition: Core.cpp:3139
LLVMBasicBlockRef LLVMGetSuccessor(LLVMValueRef Term, unsigned i)
Return the specified successor.
Definition: Core.cpp:3129
LLVMValueRef LLVMInstructionClone(LLVMValueRef Inst)
Create a copy of 'this' instruction that is identical in all ways except the following:
Definition: Core.cpp:2966
LLVMValueRef LLVMGetNextInstruction(LLVMValueRef Inst)
Obtain the instruction that occurs after the one specified.
Definition: Core.cpp:2920
void LLVMDeleteInstruction(LLVMValueRef Inst)
Delete an instruction.
Definition: Core.cpp:2944
LLVMValueRef LLVMIsATerminatorInst(LLVMValueRef Inst)
Determine whether an instruction is a terminator.
Definition: Core.cpp:2972
LLVMOpcode LLVMGetInstructionOpcode(LLVMValueRef Inst)
Obtain the code opcode for an individual instruction.
Definition: Core.cpp:2960
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:1131
LLVMRealPredicate LLVMGetFCmpPredicate(LLVMValueRef Inst)
Obtain the float predicate of an instruction.
Definition: Core.cpp:2954
int LLVMHasMetadata(LLVMValueRef Val)
Determine whether an instruction has any metadata attached.
Definition: Core.cpp:1074
void LLVMInstructionEraseFromParent(LLVMValueRef Inst)
Remove and delete an instruction.
Definition: Core.cpp:2940
void LLVMInstructionRemoveFromParent(LLVMValueRef Inst)
Remove an instruction.
Definition: Core.cpp:2936
LLVMValueRef LLVMGetMetadata(LLVMValueRef Val, unsigned KindID)
Return metadata associated with an instruction value.
Definition: Core.cpp:1078
LLVMIntPredicate LLVMGetICmpPredicate(LLVMValueRef Inst)
Obtain the predicate of an instruction.
Definition: Core.cpp:2948
void LLVMSetMetadata(LLVMValueRef Val, unsigned KindID, LLVMValueRef Node)
Set metadata associated with an instruction value.
Definition: Core.cpp:1100
LLVMBasicBlockRef LLVMGetInstructionParent(LLVMValueRef Inst)
Obtain the basic block to which an instruction belongs.
Definition: Core.cpp:2900
LLVMValueRef LLVMGetPreviousInstruction(LLVMValueRef Inst)
Obtain the instruction that occurred before this one.
Definition: Core.cpp:2928
LLVMValueRef LLVMMetadataAsValue(LLVMContextRef C, LLVMMetadataRef MD)
Obtain a Metadata as a Value.
Definition: Core.cpp:1331
LLVMValueRef LLVMMDString(const char *Str, unsigned SLen)
Deprecated: Use LLVMMDStringInContext2 instead.
Definition: Core.cpp:1296
void LLVMReplaceMDNodeOperandWith(LLVMValueRef V, unsigned Index, LLVMMetadataRef Replacement)
Replace an operand at a specific index in a llvm::MDNode value.
Definition: Core.cpp:1422
LLVMMetadataRef LLVMMDStringInContext2(LLVMContextRef C, const char *Str, size_t SLen)
Create an MDString value from a given string value.
Definition: Core.cpp:1279
LLVMMetadataRef LLVMMDNodeInContext2(LLVMContextRef C, LLVMMetadataRef *MDs, size_t Count)
Create an MDNode value with the given array of operands.
Definition: Core.cpp:1284
LLVMValueRef LLVMMDStringInContext(LLVMContextRef C, const char *Str, unsigned SLen)
Deprecated: Use LLVMMDStringInContext2 instead.
Definition: Core.cpp:1289
LLVMMetadataRef LLVMValueAsMetadata(LLVMValueRef Val)
Obtain a Value as a Metadata.
Definition: Core.cpp:1335
LLVMValueRef LLVMMDNodeInContext(LLVMContextRef C, LLVMValueRef *Vals, unsigned Count)
Deprecated: Use LLVMMDNodeInContext2 instead.
Definition: Core.cpp:1300
const char * LLVMGetMDString(LLVMValueRef V, unsigned *Length)
Obtain the underlying string from a MDString value.
Definition: Core.cpp:1344
unsigned LLVMGetMDNodeNumOperands(LLVMValueRef V)
Obtain the number of operands from an MDNode value.
Definition: Core.cpp:1354
void LLVMGetMDNodeOperands(LLVMValueRef V, LLVMValueRef *Dest)
Obtain the given MDNode's operands.
Definition: Core.cpp:1409
LLVMValueRef LLVMMDNode(LLVMValueRef *Vals, unsigned Count)
Deprecated: Use LLVMMDNodeInContext2 instead.
Definition: Core.cpp:1327
int LLVMGetNumOperands(LLVMValueRef Val)
Obtain the number of operands in a llvm::User value.
Definition: Core.cpp:1229
void LLVMSetOperand(LLVMValueRef User, unsigned Index, LLVMValueRef Val)
Set an operand at a specific index in a llvm::User value.
Definition: Core.cpp:1225
LLVMUseRef LLVMGetOperandUse(LLVMValueRef Val, unsigned Index)
Obtain the use of an operand at a specific index in a llvm::User value.
Definition: Core.cpp:1220
LLVMValueRef LLVMGetOperand(LLVMValueRef Val, unsigned Index)
Obtain an operand at a specific index in a llvm::User value.
Definition: Core.cpp:1206
LLVMValueRef LLVMGetUser(LLVMUseRef U)
Obtain the user value for a user.
Definition: Core.cpp:1186
LLVMUseRef LLVMGetFirstUse(LLVMValueRef Val)
Obtain the first use of a value.
Definition: Core.cpp:1171
LLVMUseRef LLVMGetNextUse(LLVMUseRef U)
Obtain the next use of a value.
Definition: Core.cpp:1179
LLVMValueRef LLVMGetUsedValue(LLVMUseRef U)
Obtain the value this use corresponds to.
Definition: Core.cpp:1190
#define LLVM_FOR_EACH_VALUE_SUBCLASS(macro)
Definition: Core.h:1835
void LLVMShutdown(void)
Deallocate and destroy all ManagedStatic variables.
Definition: Core.cpp:65
void LLVMGetVersion(unsigned *Major, unsigned *Minor, unsigned *Patch)
Return the major, minor, and patch version of LLVM.
Definition: Core.cpp:71
void LLVMDisposeMessage(char *Message)
Definition: Core.cpp:86
char * LLVMCreateMessage(const char *Message)
Definition: Core.cpp:82
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:2382
LLVMValueRef LLVMGetLastGlobalAlias(LLVMModuleRef M)
Obtain an iterator to the last GlobalAlias in a Module.
Definition: Core.cpp:2354
LLVMValueRef LLVMGetNextGlobalAlias(LLVMValueRef GA)
Advance a GlobalAlias iterator to the next GlobalAlias.
Definition: Core.cpp:2362
LLVMValueRef LLVMAliasGetAliasee(LLVMValueRef Alias)
Retrieve the target value of an alias.
Definition: Core.cpp:2378
LLVMValueRef LLVMGetPreviousGlobalAlias(LLVMValueRef GA)
Decrement a GlobalAlias iterator to the previous GlobalAlias.
Definition: Core.cpp:2370
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:2333
LLVMValueRef LLVMGetFirstGlobalAlias(LLVMModuleRef M)
Obtain an iterator to the first GlobalAlias in a Module.
Definition: Core.cpp:2346
LLVMValueRef LLVMGetNamedGlobalAlias(LLVMModuleRef M, const char *Name, size_t NameLen)
Obtain a GlobalAlias value from a Module by its name.
Definition: Core.cpp:2341
void LLVMSetGlobalConstant(LLVMValueRef GlobalVar, LLVMBool IsConstant)
Definition: Core.cpp:2280
void LLVMSetThreadLocalMode(LLVMValueRef GlobalVar, LLVMThreadLocalMode Mode)
Definition: Core.cpp:2301
LLVMThreadLocalMode LLVMGetThreadLocalMode(LLVMValueRef GlobalVar)
Definition: Core.cpp:2284
LLVMValueRef LLVMGetNamedGlobalWithLength(LLVMModuleRef M, const char *Name, size_t Length)
Definition: Core.cpp:2215
LLVMValueRef LLVMGetFirstGlobal(LLVMModuleRef M)
Definition: Core.cpp:2220
LLVMValueRef LLVMGetNextGlobal(LLVMValueRef GlobalVar)
Definition: Core.cpp:2236
LLVMBool LLVMIsExternallyInitialized(LLVMValueRef GlobalVar)
Definition: Core.cpp:2323
LLVMValueRef LLVMAddGlobal(LLVMModuleRef M, LLVMTypeRef Ty, const char *Name)
Definition: Core.cpp:2197
LLVMValueRef LLVMGetLastGlobal(LLVMModuleRef M)
Definition: Core.cpp:2228
void LLVMSetExternallyInitialized(LLVMValueRef GlobalVar, LLVMBool IsExtInit)
Definition: Core.cpp:2327
LLVMValueRef LLVMGetPreviousGlobal(LLVMValueRef GlobalVar)
Definition: Core.cpp:2244
void LLVMSetThreadLocal(LLVMValueRef GlobalVar, LLVMBool IsThreadLocal)
Definition: Core.cpp:2272
LLVMValueRef LLVMGetInitializer(LLVMValueRef GlobalVar)
Definition: Core.cpp:2256
void LLVMDeleteGlobal(LLVMValueRef GlobalVar)
Definition: Core.cpp:2252
LLVMBool LLVMIsThreadLocal(LLVMValueRef GlobalVar)
Definition: Core.cpp:2268
LLVMBool LLVMIsGlobalConstant(LLVMValueRef GlobalVar)
Definition: Core.cpp:2276
LLVMValueRef LLVMAddGlobalInAddressSpace(LLVMModuleRef M, LLVMTypeRef Ty, const char *Name, unsigned AddressSpace)
Definition: Core.cpp:2202
void LLVMSetInitializer(LLVMValueRef GlobalVar, LLVMValueRef ConstantVal)
Definition: Core.cpp:2263
LLVMValueRef LLVMGetNamedGlobal(LLVMModuleRef M, const char *Name)
Definition: Core.cpp:2211
#define N