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