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
474/**
475 * Tail call kind for LLVMSetTailCallKind and LLVMGetTailCallKind.
476 *
477 * Note that 'musttail' implies 'tail'.
478 *
479 * @see CallInst::TailCallKind
480 */
481typedef enum {
487
488typedef unsigned LLVMAttributeIndex;
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 * @}
1715 */
1716
1717/**
1718 * @}
1719 */
1720
1721/**
1722 * @defgroup LLVMCCoreValues Values
1723 *
1724 * The bulk of LLVM's object model consists of values, which comprise a very
1725 * rich type hierarchy.
1726 *
1727 * LLVMValueRef essentially represents llvm::Value. There is a rich
1728 * hierarchy of classes within this type. Depending on the instance
1729 * obtained, not all APIs are available.
1730 *
1731 * Callers can determine the type of an LLVMValueRef by calling the
1732 * LLVMIsA* family of functions (e.g. LLVMIsAArgument()). These
1733 * functions are defined by a macro, so it isn't obvious which are
1734 * available by looking at the Doxygen source code. Instead, look at the
1735 * source definition of LLVM_FOR_EACH_VALUE_SUBCLASS and note the list
1736 * of value names given. These value names also correspond to classes in
1737 * the llvm::Value hierarchy.
1738 *
1739 * @{
1740 */
1741
1742#define LLVM_FOR_EACH_VALUE_SUBCLASS(macro) \
1743 macro(Argument) \
1744 macro(BasicBlock) \
1745 macro(InlineAsm) \
1746 macro(User) \
1747 macro(Constant) \
1748 macro(BlockAddress) \
1749 macro(ConstantAggregateZero) \
1750 macro(ConstantArray) \
1751 macro(ConstantDataSequential) \
1752 macro(ConstantDataArray) \
1753 macro(ConstantDataVector) \
1754 macro(ConstantExpr) \
1755 macro(ConstantFP) \
1756 macro(ConstantInt) \
1757 macro(ConstantPointerNull) \
1758 macro(ConstantStruct) \
1759 macro(ConstantTokenNone) \
1760 macro(ConstantVector) \
1761 macro(GlobalValue) \
1762 macro(GlobalAlias) \
1763 macro(GlobalObject) \
1764 macro(Function) \
1765 macro(GlobalVariable) \
1766 macro(GlobalIFunc) \
1767 macro(UndefValue) \
1768 macro(PoisonValue) \
1769 macro(Instruction) \
1770 macro(UnaryOperator) \
1771 macro(BinaryOperator) \
1772 macro(CallInst) \
1773 macro(IntrinsicInst) \
1774 macro(DbgInfoIntrinsic) \
1775 macro(DbgVariableIntrinsic) \
1776 macro(DbgDeclareInst) \
1777 macro(DbgLabelInst) \
1778 macro(MemIntrinsic) \
1779 macro(MemCpyInst) \
1780 macro(MemMoveInst) \
1781 macro(MemSetInst) \
1782 macro(CmpInst) \
1783 macro(FCmpInst) \
1784 macro(ICmpInst) \
1785 macro(ExtractElementInst) \
1786 macro(GetElementPtrInst) \
1787 macro(InsertElementInst) \
1788 macro(InsertValueInst) \
1789 macro(LandingPadInst) \
1790 macro(PHINode) \
1791 macro(SelectInst) \
1792 macro(ShuffleVectorInst) \
1793 macro(StoreInst) \
1794 macro(BranchInst) \
1795 macro(IndirectBrInst) \
1796 macro(InvokeInst) \
1797 macro(ReturnInst) \
1798 macro(SwitchInst) \
1799 macro(UnreachableInst) \
1800 macro(ResumeInst) \
1801 macro(CleanupReturnInst) \
1802 macro(CatchReturnInst) \
1803 macro(CatchSwitchInst) \
1804 macro(CallBrInst) \
1805 macro(FuncletPadInst) \
1806 macro(CatchPadInst) \
1807 macro(CleanupPadInst) \
1808 macro(UnaryInstruction) \
1809 macro(AllocaInst) \
1810 macro(CastInst) \
1811 macro(AddrSpaceCastInst) \
1812 macro(BitCastInst) \
1813 macro(FPExtInst) \
1814 macro(FPToSIInst) \
1815 macro(FPToUIInst) \
1816 macro(FPTruncInst) \
1817 macro(IntToPtrInst) \
1818 macro(PtrToIntInst) \
1819 macro(SExtInst) \
1820 macro(SIToFPInst) \
1821 macro(TruncInst) \
1822 macro(UIToFPInst) \
1823 macro(ZExtInst) \
1824 macro(ExtractValueInst) \
1825 macro(LoadInst) \
1826 macro(VAArgInst) \
1827 macro(FreezeInst) \
1828 macro(AtomicCmpXchgInst) \
1829 macro(AtomicRMWInst) \
1830 macro(FenceInst)
1831
1832/**
1833 * @defgroup LLVMCCoreValueGeneral General APIs
1834 *
1835 * Functions in this section work on all LLVMValueRef instances,
1836 * regardless of their sub-type. They correspond to functions available
1837 * on llvm::Value.
1838 *
1839 * @{
1840 */
1841
1842/**
1843 * Obtain the type of a value.
1844 *
1845 * @see llvm::Value::getType()
1846 */
1848
1849/**
1850 * Obtain the enumerated type of a Value instance.
1851 *
1852 * @see llvm::Value::getValueID()
1853 */
1855
1856/**
1857 * Obtain the string name of a value.
1858 *
1859 * @see llvm::Value::getName()
1860 */
1861const char *LLVMGetValueName2(LLVMValueRef Val, size_t *Length);
1862
1863/**
1864 * Set the string name of a value.
1865 *
1866 * @see llvm::Value::setName()
1867 */
1868void LLVMSetValueName2(LLVMValueRef Val, const char *Name, size_t NameLen);
1869
1870/**
1871 * Dump a representation of a value to stderr.
1872 *
1873 * @see llvm::Value::dump()
1874 */
1875void LLVMDumpValue(LLVMValueRef Val);
1876
1877/**
1878 * Return a string representation of the value. Use
1879 * LLVMDisposeMessage to free the string.
1880 *
1881 * @see llvm::Value::print()
1882 */
1884
1885/**
1886 * Return a string representation of the DbgRecord. Use
1887 * LLVMDisposeMessage to free the string.
1888 *
1889 * @see llvm::DbgRecord::print()
1890 */
1892
1893/**
1894 * Replace all uses of a value with another one.
1895 *
1896 * @see llvm::Value::replaceAllUsesWith()
1897 */
1899
1900/**
1901 * Determine whether the specified value instance is constant.
1902 */
1904
1905/**
1906 * Determine whether a value instance is undefined.
1907 */
1909
1910/**
1911 * Determine whether a value instance is poisonous.
1912 */
1914
1915/**
1916 * Convert value instances between types.
1917 *
1918 * Internally, an LLVMValueRef is "pinned" to a specific type. This
1919 * series of functions allows you to cast an instance to a specific
1920 * type.
1921 *
1922 * If the cast is not valid for the specified type, NULL is returned.
1923 *
1924 * @see llvm::dyn_cast_or_null<>
1925 */
1926#define LLVM_DECLARE_VALUE_CAST(name) \
1927 LLVMValueRef LLVMIsA##name(LLVMValueRef Val);
1929
1933
1934/** Deprecated: Use LLVMGetValueName2 instead. */
1935const char *LLVMGetValueName(LLVMValueRef Val);
1936/** Deprecated: Use LLVMSetValueName2 instead. */
1937void LLVMSetValueName(LLVMValueRef Val, const char *Name);
1938
1939/**
1940 * @}
1941 */
1942
1943/**
1944 * @defgroup LLVMCCoreValueUses Usage
1945 *
1946 * This module defines functions that allow you to inspect the uses of a
1947 * LLVMValueRef.
1948 *
1949 * It is possible to obtain an LLVMUseRef for any LLVMValueRef instance.
1950 * Each LLVMUseRef (which corresponds to a llvm::Use instance) holds a
1951 * llvm::User and llvm::Value.
1952 *
1953 * @{
1954 */
1955
1956/**
1957 * Obtain the first use of a value.
1958 *
1959 * Uses are obtained in an iterator fashion. First, call this function
1960 * to obtain a reference to the first use. Then, call LLVMGetNextUse()
1961 * on that instance and all subsequently obtained instances until
1962 * LLVMGetNextUse() returns NULL.
1963 *
1964 * @see llvm::Value::use_begin()
1965 */
1967
1968/**
1969 * Obtain the next use of a value.
1970 *
1971 * This effectively advances the iterator. It returns NULL if you are on
1972 * the final use and no more are available.
1973 */
1975
1976/**
1977 * Obtain the user value for a user.
1978 *
1979 * The returned value corresponds to a llvm::User type.
1980 *
1981 * @see llvm::Use::getUser()
1982 */
1984
1985/**
1986 * Obtain the value this use corresponds to.
1987 *
1988 * @see llvm::Use::get().
1989 */
1991
1992/**
1993 * @}
1994 */
1995
1996/**
1997 * @defgroup LLVMCCoreValueUser User value
1998 *
1999 * Function in this group pertain to LLVMValueRef instances that descent
2000 * from llvm::User. This includes constants, instructions, and
2001 * operators.
2002 *
2003 * @{
2004 */
2005
2006/**
2007 * Obtain an operand at a specific index in a llvm::User value.
2008 *
2009 * @see llvm::User::getOperand()
2010 */
2012
2013/**
2014 * Obtain the use of an operand at a specific index in a llvm::User value.
2015 *
2016 * @see llvm::User::getOperandUse()
2017 */
2019
2020/**
2021 * Set an operand at a specific index in a llvm::User value.
2022 *
2023 * @see llvm::User::setOperand()
2024 */
2025void LLVMSetOperand(LLVMValueRef User, unsigned Index, LLVMValueRef Val);
2026
2027/**
2028 * Obtain the number of operands in a llvm::User value.
2029 *
2030 * @see llvm::User::getNumOperands()
2031 */
2033
2034/**
2035 * @}
2036 */
2037
2038/**
2039 * @defgroup LLVMCCoreValueConstant Constants
2040 *
2041 * This section contains APIs for interacting with LLVMValueRef that
2042 * correspond to llvm::Constant instances.
2043 *
2044 * These functions will work for any LLVMValueRef in the llvm::Constant
2045 * class hierarchy.
2046 *
2047 * @{
2048 */
2049
2050/**
2051 * Obtain a constant value referring to the null instance of a type.
2052 *
2053 * @see llvm::Constant::getNullValue()
2054 */
2055LLVMValueRef LLVMConstNull(LLVMTypeRef Ty); /* all zeroes */
2056
2057/**
2058 * Obtain a constant value referring to the instance of a type
2059 * consisting of all ones.
2060 *
2061 * This is only valid for integer types.
2062 *
2063 * @see llvm::Constant::getAllOnesValue()
2064 */
2066
2067/**
2068 * Obtain a constant value referring to an undefined value of a type.
2069 *
2070 * @see llvm::UndefValue::get()
2071 */
2073
2074/**
2075 * Obtain a constant value referring to a poison value of a type.
2076 *
2077 * @see llvm::PoisonValue::get()
2078 */
2080
2081/**
2082 * Determine whether a value instance is null.
2083 *
2084 * @see llvm::Constant::isNullValue()
2085 */
2087
2088/**
2089 * Obtain a constant that is a constant pointer pointing to NULL for a
2090 * specified type.
2091 */
2093
2094/**
2095 * @defgroup LLVMCCoreValueConstantScalar Scalar constants
2096 *
2097 * Functions in this group model LLVMValueRef instances that correspond
2098 * to constants referring to scalar types.
2099 *
2100 * For integer types, the LLVMTypeRef parameter should correspond to a
2101 * llvm::IntegerType instance and the returned LLVMValueRef will
2102 * correspond to a llvm::ConstantInt.
2103 *
2104 * For floating point types, the LLVMTypeRef returned corresponds to a
2105 * llvm::ConstantFP.
2106 *
2107 * @{
2108 */
2109
2110/**
2111 * Obtain a constant value for an integer type.
2112 *
2113 * The returned value corresponds to a llvm::ConstantInt.
2114 *
2115 * @see llvm::ConstantInt::get()
2116 *
2117 * @param IntTy Integer type to obtain value of.
2118 * @param N The value the returned instance should refer to.
2119 * @param SignExtend Whether to sign extend the produced value.
2120 */
2121LLVMValueRef LLVMConstInt(LLVMTypeRef IntTy, unsigned long long N,
2122 LLVMBool SignExtend);
2123
2124/**
2125 * Obtain a constant value for an integer of arbitrary precision.
2126 *
2127 * @see llvm::ConstantInt::get()
2128 */
2130 unsigned NumWords,
2131 const uint64_t Words[]);
2132
2133/**
2134 * Obtain a constant value for an integer parsed from a string.
2135 *
2136 * A similar API, LLVMConstIntOfStringAndSize is also available. If the
2137 * string's length is available, it is preferred to call that function
2138 * instead.
2139 *
2140 * @see llvm::ConstantInt::get()
2141 */
2143 uint8_t Radix);
2144
2145/**
2146 * Obtain a constant value for an integer parsed from a string with
2147 * specified length.
2148 *
2149 * @see llvm::ConstantInt::get()
2150 */
2152 unsigned SLen, uint8_t Radix);
2153
2154/**
2155 * Obtain a constant value referring to a double floating point value.
2156 */
2157LLVMValueRef LLVMConstReal(LLVMTypeRef RealTy, double N);
2158
2159/**
2160 * Obtain a constant for a floating point value parsed from a string.
2161 *
2162 * A similar API, LLVMConstRealOfStringAndSize is also available. It
2163 * should be used if the input string's length is known.
2164 */
2165LLVMValueRef LLVMConstRealOfString(LLVMTypeRef RealTy, const char *Text);
2166
2167/**
2168 * Obtain a constant for a floating point value parsed from a string.
2169 */
2171 unsigned SLen);
2172
2173/**
2174 * Obtain the zero extended value for an integer constant value.
2175 *
2176 * @see llvm::ConstantInt::getZExtValue()
2177 */
2178unsigned long long LLVMConstIntGetZExtValue(LLVMValueRef ConstantVal);
2179
2180/**
2181 * Obtain the sign extended value for an integer constant value.
2182 *
2183 * @see llvm::ConstantInt::getSExtValue()
2184 */
2185long long LLVMConstIntGetSExtValue(LLVMValueRef ConstantVal);
2186
2187/**
2188 * Obtain the double value for an floating point constant value.
2189 * losesInfo indicates if some precision was lost in the conversion.
2190 *
2191 * @see llvm::ConstantFP::getDoubleValue
2192 */
2193double LLVMConstRealGetDouble(LLVMValueRef ConstantVal, LLVMBool *losesInfo);
2194
2195/**
2196 * @}
2197 */
2198
2199/**
2200 * @defgroup LLVMCCoreValueConstantComposite Composite Constants
2201 *
2202 * Functions in this group operate on composite constants.
2203 *
2204 * @{
2205 */
2206
2207/**
2208 * Create a ConstantDataSequential and initialize it with a string.
2209 *
2210 * @deprecated LLVMConstStringInContext is deprecated in favor of the API
2211 * accurate LLVMConstStringInContext2
2212 * @see llvm::ConstantDataArray::getString()
2213 */
2215 unsigned Length, LLVMBool DontNullTerminate);
2216
2217/**
2218 * Create a ConstantDataSequential and initialize it with a string.
2219 *
2220 * @see llvm::ConstantDataArray::getString()
2221 */
2223 size_t Length,
2224 LLVMBool DontNullTerminate);
2225
2226/**
2227 * Create a ConstantDataSequential with string content in the global context.
2228 *
2229 * This is the same as LLVMConstStringInContext except it operates on the
2230 * global context.
2231 *
2232 * @see LLVMConstStringInContext()
2233 * @see llvm::ConstantDataArray::getString()
2234 */
2235LLVMValueRef LLVMConstString(const char *Str, unsigned Length,
2236 LLVMBool DontNullTerminate);
2237
2238/**
2239 * Returns true if the specified constant is an array of i8.
2240 *
2241 * @see ConstantDataSequential::getAsString()
2242 */
2244
2245/**
2246 * Get the given constant data sequential as a string.
2247 *
2248 * @see ConstantDataSequential::getAsString()
2249 */
2250const char *LLVMGetAsString(LLVMValueRef c, size_t *Length);
2251
2252/**
2253 * Create an anonymous ConstantStruct with the specified values.
2254 *
2255 * @see llvm::ConstantStruct::getAnon()
2256 */
2258 LLVMValueRef *ConstantVals,
2259 unsigned Count, LLVMBool Packed);
2260
2261/**
2262 * Create a ConstantStruct in the global Context.
2263 *
2264 * This is the same as LLVMConstStructInContext except it operates on the
2265 * global Context.
2266 *
2267 * @see LLVMConstStructInContext()
2268 */
2269LLVMValueRef LLVMConstStruct(LLVMValueRef *ConstantVals, unsigned Count,
2270 LLVMBool Packed);
2271
2272/**
2273 * Create a ConstantArray from values.
2274 *
2275 * @deprecated LLVMConstArray is deprecated in favor of the API accurate
2276 * LLVMConstArray2
2277 * @see llvm::ConstantArray::get()
2278 */
2280 LLVMValueRef *ConstantVals, unsigned Length);
2281
2282/**
2283 * Create a ConstantArray from values.
2284 *
2285 * @see llvm::ConstantArray::get()
2286 */
2287LLVMValueRef LLVMConstArray2(LLVMTypeRef ElementTy, LLVMValueRef *ConstantVals,
2288 uint64_t Length);
2289
2290/**
2291 * Create a non-anonymous ConstantStruct from values.
2292 *
2293 * @see llvm::ConstantStruct::get()
2294 */
2296 LLVMValueRef *ConstantVals,
2297 unsigned Count);
2298
2299/**
2300 * Get element of a constant aggregate (struct, array or vector) at the
2301 * specified index. Returns null if the index is out of range, or it's not
2302 * possible to determine the element (e.g., because the constant is a
2303 * constant expression.)
2304 *
2305 * @see llvm::Constant::getAggregateElement()
2306 */
2308
2309/**
2310 * Get an element at specified index as a constant.
2311 *
2312 * @see ConstantDataSequential::getElementAsConstant()
2313 */
2316 "Use LLVMGetAggregateElement instead");
2317
2318/**
2319 * Create a ConstantVector from values.
2320 *
2321 * @see llvm::ConstantVector::get()
2322 */
2323LLVMValueRef LLVMConstVector(LLVMValueRef *ScalarConstantVals, unsigned Size);
2324
2325/**
2326 * @}
2327 */
2328
2329/**
2330 * @defgroup LLVMCCoreValueConstantExpressions Constant Expressions
2331 *
2332 * Functions in this group correspond to APIs on llvm::ConstantExpr.
2333 *
2334 * @see llvm::ConstantExpr.
2335 *
2336 * @{
2337 */
2345 "Use LLVMConstNull instead.");
2347LLVMValueRef LLVMConstAdd(LLVMValueRef LHSConstant, LLVMValueRef RHSConstant);
2348LLVMValueRef LLVMConstNSWAdd(LLVMValueRef LHSConstant, LLVMValueRef RHSConstant);
2349LLVMValueRef LLVMConstNUWAdd(LLVMValueRef LHSConstant, LLVMValueRef RHSConstant);
2350LLVMValueRef LLVMConstSub(LLVMValueRef LHSConstant, LLVMValueRef RHSConstant);
2351LLVMValueRef LLVMConstNSWSub(LLVMValueRef LHSConstant, LLVMValueRef RHSConstant);
2352LLVMValueRef LLVMConstNUWSub(LLVMValueRef LHSConstant, LLVMValueRef RHSConstant);
2353LLVMValueRef LLVMConstMul(LLVMValueRef LHSConstant, LLVMValueRef RHSConstant);
2354LLVMValueRef LLVMConstNSWMul(LLVMValueRef LHSConstant, LLVMValueRef RHSConstant);
2355LLVMValueRef LLVMConstNUWMul(LLVMValueRef LHSConstant, LLVMValueRef RHSConstant);
2356LLVMValueRef LLVMConstXor(LLVMValueRef LHSConstant, LLVMValueRef RHSConstant);
2358 LLVMValueRef LHSConstant, LLVMValueRef RHSConstant);
2360 LLVMValueRef LHSConstant, LLVMValueRef RHSConstant);
2361LLVMValueRef LLVMConstShl(LLVMValueRef LHSConstant, LLVMValueRef RHSConstant);
2363 LLVMValueRef *ConstantIndices, unsigned NumIndices);
2365 LLVMValueRef *ConstantIndices,
2366 unsigned NumIndices);
2373 LLVMTypeRef ToType);
2375 LLVMTypeRef ToType);
2377 LLVMValueRef IndexConstant);
2379 LLVMValueRef ElementValueConstant,
2380 LLVMValueRef IndexConstant);
2382 LLVMValueRef VectorBConstant,
2383 LLVMValueRef MaskConstant);
2385
2386/**
2387 * Gets the function associated with a given BlockAddress constant value.
2388 */
2390
2391/**
2392 * Gets the basic block associated with a given BlockAddress constant value.
2393 */
2395
2396/** Deprecated: Use LLVMGetInlineAsm instead. */
2398 const char *AsmString, const char *Constraints,
2399 LLVMBool HasSideEffects, LLVMBool IsAlignStack);
2400
2401/**
2402 * @}
2403 */
2404
2405/**
2406 * @defgroup LLVMCCoreValueConstantGlobals Global Values
2407 *
2408 * This group contains functions that operate on global values. Functions in
2409 * this group relate to functions in the llvm::GlobalValue class tree.
2410 *
2411 * @see llvm::GlobalValue
2412 *
2413 * @{
2414 */
2415
2419void LLVMSetLinkage(LLVMValueRef Global, LLVMLinkage Linkage);
2420const char *LLVMGetSection(LLVMValueRef Global);
2421void LLVMSetSection(LLVMValueRef Global, const char *Section);
2427void LLVMSetUnnamedAddress(LLVMValueRef Global, LLVMUnnamedAddr UnnamedAddr);
2428
2429/**
2430 * Returns the "value type" of a global value. This differs from the formal
2431 * type of a global value which is always a pointer type.
2432 *
2433 * @see llvm::GlobalValue::getValueType()
2434 */
2436
2437/** Deprecated: Use LLVMGetUnnamedAddress instead. */
2439/** Deprecated: Use LLVMSetUnnamedAddress instead. */
2440void LLVMSetUnnamedAddr(LLVMValueRef Global, LLVMBool HasUnnamedAddr);
2441
2442/**
2443 * @defgroup LLVMCCoreValueWithAlignment Values with alignment
2444 *
2445 * Functions in this group only apply to values with alignment, i.e.
2446 * global variables, load and store instructions.
2447 */
2448
2449/**
2450 * Obtain the preferred alignment of the value.
2451 * @see llvm::AllocaInst::getAlignment()
2452 * @see llvm::LoadInst::getAlignment()
2453 * @see llvm::StoreInst::getAlignment()
2454 * @see llvm::AtomicRMWInst::setAlignment()
2455 * @see llvm::AtomicCmpXchgInst::setAlignment()
2456 * @see llvm::GlobalValue::getAlignment()
2457 */
2458unsigned LLVMGetAlignment(LLVMValueRef V);
2459
2460/**
2461 * Set the preferred alignment of the value.
2462 * @see llvm::AllocaInst::setAlignment()
2463 * @see llvm::LoadInst::setAlignment()
2464 * @see llvm::StoreInst::setAlignment()
2465 * @see llvm::AtomicRMWInst::setAlignment()
2466 * @see llvm::AtomicCmpXchgInst::setAlignment()
2467 * @see llvm::GlobalValue::setAlignment()
2468 */
2469void LLVMSetAlignment(LLVMValueRef V, unsigned Bytes);
2470
2471/**
2472 * Sets a metadata attachment, erasing the existing metadata attachment if
2473 * it already exists for the given kind.
2474 *
2475 * @see llvm::GlobalObject::setMetadata()
2476 */
2477void LLVMGlobalSetMetadata(LLVMValueRef Global, unsigned Kind,
2478 LLVMMetadataRef MD);
2479
2480/**
2481 * Erases a metadata attachment of the given kind if it exists.
2482 *
2483 * @see llvm::GlobalObject::eraseMetadata()
2484 */
2485void LLVMGlobalEraseMetadata(LLVMValueRef Global, unsigned Kind);
2486
2487/**
2488 * Removes all metadata attachments from this value.
2489 *
2490 * @see llvm::GlobalObject::clearMetadata()
2491 */
2493
2494/**
2495 * Retrieves an array of metadata entries representing the metadata attached to
2496 * this value. The caller is responsible for freeing this array by calling
2497 * \c LLVMDisposeValueMetadataEntries.
2498 *
2499 * @see llvm::GlobalObject::getAllMetadata()
2500 */
2502 size_t *NumEntries);
2503
2504/**
2505 * Destroys value metadata entries.
2506 */
2508
2509/**
2510 * Returns the kind of a value metadata entry at a specific index.
2511 */
2513 unsigned Index);
2514
2515/**
2516 * Returns the underlying metadata node of a value metadata entry at a
2517 * specific index.
2518 */
2521 unsigned Index);
2522
2523/**
2524 * @}
2525 */
2526
2527/**
2528 * @defgroup LLVMCoreValueConstantGlobalVariable Global Variables
2529 *
2530 * This group contains functions that operate on global variable values.
2531 *
2532 * @see llvm::GlobalVariable
2533 *
2534 * @{
2535 */
2538 const char *Name,
2539 unsigned AddressSpace);
2545void LLVMDeleteGlobal(LLVMValueRef GlobalVar);
2547void LLVMSetInitializer(LLVMValueRef GlobalVar, LLVMValueRef ConstantVal);
2549void LLVMSetThreadLocal(LLVMValueRef GlobalVar, LLVMBool IsThreadLocal);
2551void LLVMSetGlobalConstant(LLVMValueRef GlobalVar, LLVMBool IsConstant);
2555void LLVMSetExternallyInitialized(LLVMValueRef GlobalVar, LLVMBool IsExtInit);
2556
2557/**
2558 * @}
2559 */
2560
2561/**
2562 * @defgroup LLVMCoreValueConstantGlobalAlias Global Aliases
2563 *
2564 * This group contains function that operate on global alias values.
2565 *
2566 * @see llvm::GlobalAlias
2567 *
2568 * @{
2569 */
2570
2571/**
2572 * Add a GlobalAlias with the given value type, address space and aliasee.
2573 *
2574 * @see llvm::GlobalAlias::create()
2575 */
2577 unsigned AddrSpace, LLVMValueRef Aliasee,
2578 const char *Name);
2579
2580/**
2581 * Obtain a GlobalAlias value from a Module by its name.
2582 *
2583 * The returned value corresponds to a llvm::GlobalAlias value.
2584 *
2585 * @see llvm::Module::getNamedAlias()
2586 */
2588 const char *Name, size_t NameLen);
2589
2590/**
2591 * Obtain an iterator to the first GlobalAlias in a Module.
2592 *
2593 * @see llvm::Module::alias_begin()
2594 */
2596
2597/**
2598 * Obtain an iterator to the last GlobalAlias in a Module.
2599 *
2600 * @see llvm::Module::alias_end()
2601 */
2603
2604/**
2605 * Advance a GlobalAlias iterator to the next GlobalAlias.
2606 *
2607 * Returns NULL if the iterator was already at the end and there are no more
2608 * global aliases.
2609 */
2611
2612/**
2613 * Decrement a GlobalAlias iterator to the previous GlobalAlias.
2614 *
2615 * Returns NULL if the iterator was already at the beginning and there are
2616 * no previous global aliases.
2617 */
2619
2620/**
2621 * Retrieve the target value of an alias.
2622 */
2624
2625/**
2626 * Set the target value of an alias.
2627 */
2628void LLVMAliasSetAliasee(LLVMValueRef Alias, LLVMValueRef Aliasee);
2629
2630/**
2631 * @}
2632 */
2633
2634/**
2635 * @defgroup LLVMCCoreValueFunction Function values
2636 *
2637 * Functions in this group operate on LLVMValueRef instances that
2638 * correspond to llvm::Function instances.
2639 *
2640 * @see llvm::Function
2641 *
2642 * @{
2643 */
2644
2645/**
2646 * Remove a function from its containing module and deletes it.
2647 *
2648 * @see llvm::Function::eraseFromParent()
2649 */
2651
2652/**
2653 * Check whether the given function has a personality function.
2654 *
2655 * @see llvm::Function::hasPersonalityFn()
2656 */
2658
2659/**
2660 * Obtain the personality function attached to the function.
2661 *
2662 * @see llvm::Function::getPersonalityFn()
2663 */
2665
2666/**
2667 * Set the personality function attached to the function.
2668 *
2669 * @see llvm::Function::setPersonalityFn()
2670 */
2671void LLVMSetPersonalityFn(LLVMValueRef Fn, LLVMValueRef PersonalityFn);
2672
2673/**
2674 * Obtain the intrinsic ID number which matches the given function name.
2675 *
2676 * @see llvm::Function::lookupIntrinsicID()
2677 */
2678unsigned LLVMLookupIntrinsicID(const char *Name, size_t NameLen);
2679
2680/**
2681 * Obtain the ID number from a function instance.
2682 *
2683 * @see llvm::Function::getIntrinsicID()
2684 */
2685unsigned LLVMGetIntrinsicID(LLVMValueRef Fn);
2686
2687/**
2688 * Create or insert the declaration of an intrinsic. For overloaded intrinsics,
2689 * parameter types must be provided to uniquely identify an overload.
2690 *
2691 * @see llvm::Intrinsic::getDeclaration()
2692 */
2694 unsigned ID,
2695 LLVMTypeRef *ParamTypes,
2696 size_t ParamCount);
2697
2698/**
2699 * Retrieves the type of an intrinsic. For overloaded intrinsics, parameter
2700 * types must be provided to uniquely identify an overload.
2701 *
2702 * @see llvm::Intrinsic::getType()
2703 */
2705 LLVMTypeRef *ParamTypes, size_t ParamCount);
2706
2707/**
2708 * Retrieves the name of an intrinsic.
2709 *
2710 * @see llvm::Intrinsic::getName()
2711 */
2712const char *LLVMIntrinsicGetName(unsigned ID, size_t *NameLength);
2713
2714/** Deprecated: Use LLVMIntrinsicCopyOverloadedName2 instead. */
2715const char *LLVMIntrinsicCopyOverloadedName(unsigned ID,
2716 LLVMTypeRef *ParamTypes,
2717 size_t ParamCount,
2718 size_t *NameLength);
2719
2720/**
2721 * Copies the name of an overloaded intrinsic identified by a given list of
2722 * parameter types.
2723 *
2724 * Unlike LLVMIntrinsicGetName, the caller is responsible for freeing the
2725 * returned string.
2726 *
2727 * This version also supports unnamed types.
2728 *
2729 * @see llvm::Intrinsic::getName()
2730 */
2731const char *LLVMIntrinsicCopyOverloadedName2(LLVMModuleRef Mod, unsigned ID,
2732 LLVMTypeRef *ParamTypes,
2733 size_t ParamCount,
2734 size_t *NameLength);
2735
2736/**
2737 * Obtain if the intrinsic identified by the given ID is overloaded.
2738 *
2739 * @see llvm::Intrinsic::isOverloaded()
2740 */
2742
2743/**
2744 * Obtain the calling function of a function.
2745 *
2746 * The returned value corresponds to the LLVMCallConv enumeration.
2747 *
2748 * @see llvm::Function::getCallingConv()
2749 */
2751
2752/**
2753 * Set the calling convention of a function.
2754 *
2755 * @see llvm::Function::setCallingConv()
2756 *
2757 * @param Fn Function to operate on
2758 * @param CC LLVMCallConv to set calling convention to
2759 */
2760void LLVMSetFunctionCallConv(LLVMValueRef Fn, unsigned CC);
2761
2762/**
2763 * Obtain the name of the garbage collector to use during code
2764 * generation.
2765 *
2766 * @see llvm::Function::getGC()
2767 */
2768const char *LLVMGetGC(LLVMValueRef Fn);
2769
2770/**
2771 * Define the garbage collector to use during code generation.
2772 *
2773 * @see llvm::Function::setGC()
2774 */
2775void LLVMSetGC(LLVMValueRef Fn, const char *Name);
2776
2777/**
2778 * Gets the prefix data associated with a function. Only valid on functions, and
2779 * only if LLVMHasPrefixData returns true.
2780 * See https://llvm.org/docs/LangRef.html#prefix-data
2781 */
2783
2784/**
2785 * Check if a given function has prefix data. Only valid on functions.
2786 * See https://llvm.org/docs/LangRef.html#prefix-data
2787 */
2789
2790/**
2791 * Sets the prefix data for the function. Only valid on functions.
2792 * See https://llvm.org/docs/LangRef.html#prefix-data
2793 */
2794void LLVMSetPrefixData(LLVMValueRef Fn, LLVMValueRef prefixData);
2795
2796/**
2797 * Gets the prologue data associated with a function. Only valid on functions,
2798 * and only if LLVMHasPrologueData returns true.
2799 * See https://llvm.org/docs/LangRef.html#prologue-data
2800 */
2802
2803/**
2804 * Check if a given function has prologue data. Only valid on functions.
2805 * See https://llvm.org/docs/LangRef.html#prologue-data
2806 */
2808
2809/**
2810 * Sets the prologue data for the function. Only valid on functions.
2811 * See https://llvm.org/docs/LangRef.html#prologue-data
2812 */
2813void LLVMSetPrologueData(LLVMValueRef Fn, LLVMValueRef prologueData);
2814
2815/**
2816 * Add an attribute to a function.
2817 *
2818 * @see llvm::Function::addAttribute()
2819 */
2824 LLVMAttributeRef *Attrs);
2827 unsigned KindID);
2830 const char *K, unsigned KLen);
2832 unsigned KindID);
2834 const char *K, unsigned KLen);
2835
2836/**
2837 * Add a target-dependent attribute to a function
2838 * @see llvm::AttrBuilder::addAttribute()
2839 */
2841 const char *V);
2842
2843/**
2844 * @defgroup LLVMCCoreValueFunctionParameters Function Parameters
2845 *
2846 * Functions in this group relate to arguments/parameters on functions.
2847 *
2848 * Functions in this group expect LLVMValueRef instances that correspond
2849 * to llvm::Function instances.
2850 *
2851 * @{
2852 */
2853
2854/**
2855 * Obtain the number of parameters in a function.
2856 *
2857 * @see llvm::Function::arg_size()
2858 */
2859unsigned LLVMCountParams(LLVMValueRef Fn);
2860
2861/**
2862 * Obtain the parameters in a function.
2863 *
2864 * The takes a pointer to a pre-allocated array of LLVMValueRef that is
2865 * at least LLVMCountParams() long. This array will be filled with
2866 * LLVMValueRef instances which correspond to the parameters the
2867 * function receives. Each LLVMValueRef corresponds to a llvm::Argument
2868 * instance.
2869 *
2870 * @see llvm::Function::arg_begin()
2871 */
2872void LLVMGetParams(LLVMValueRef Fn, LLVMValueRef *Params);
2873
2874/**
2875 * Obtain the parameter at the specified index.
2876 *
2877 * Parameters are indexed from 0.
2878 *
2879 * @see llvm::Function::arg_begin()
2880 */
2882
2883/**
2884 * Obtain the function to which this argument belongs.
2885 *
2886 * Unlike other functions in this group, this one takes an LLVMValueRef
2887 * that corresponds to a llvm::Attribute.
2888 *
2889 * The returned LLVMValueRef is the llvm::Function to which this
2890 * argument belongs.
2891 */
2893
2894/**
2895 * Obtain the first parameter to a function.
2896 *
2897 * @see llvm::Function::arg_begin()
2898 */
2900
2901/**
2902 * Obtain the last parameter to a function.
2903 *
2904 * @see llvm::Function::arg_end()
2905 */
2907
2908/**
2909 * Obtain the next parameter to a function.
2910 *
2911 * This takes an LLVMValueRef obtained from LLVMGetFirstParam() (which is
2912 * actually a wrapped iterator) and obtains the next parameter from the
2913 * underlying iterator.
2914 */
2916
2917/**
2918 * Obtain the previous parameter to a function.
2919 *
2920 * This is the opposite of LLVMGetNextParam().
2921 */
2923
2924/**
2925 * Set the alignment for a function parameter.
2926 *
2927 * @see llvm::Argument::addAttr()
2928 * @see llvm::AttrBuilder::addAlignmentAttr()
2929 */
2930void LLVMSetParamAlignment(LLVMValueRef Arg, unsigned Align);
2931
2932/**
2933 * @}
2934 */
2935
2936/**
2937 * @defgroup LLVMCCoreValueGlobalIFunc IFuncs
2938 *
2939 * Functions in this group relate to indirect functions.
2940 *
2941 * Functions in this group expect LLVMValueRef instances that correspond
2942 * to llvm::GlobalIFunc instances.
2943 *
2944 * @{
2945 */
2946
2947/**
2948 * Add a global indirect function to a module under a specified name.
2949 *
2950 * @see llvm::GlobalIFunc::create()
2951 */
2953 const char *Name, size_t NameLen,
2954 LLVMTypeRef Ty, unsigned AddrSpace,
2955 LLVMValueRef Resolver);
2956
2957/**
2958 * Obtain a GlobalIFunc value from a Module by its name.
2959 *
2960 * The returned value corresponds to a llvm::GlobalIFunc value.
2961 *
2962 * @see llvm::Module::getNamedIFunc()
2963 */
2965 const char *Name, size_t NameLen);
2966
2967/**
2968 * Obtain an iterator to the first GlobalIFunc in a Module.
2969 *
2970 * @see llvm::Module::ifunc_begin()
2971 */
2973
2974/**
2975 * Obtain an iterator to the last GlobalIFunc in a Module.
2976 *
2977 * @see llvm::Module::ifunc_end()
2978 */
2980
2981/**
2982 * Advance a GlobalIFunc iterator to the next GlobalIFunc.
2983 *
2984 * Returns NULL if the iterator was already at the end and there are no more
2985 * global aliases.
2986 */
2988
2989/**
2990 * Decrement a GlobalIFunc iterator to the previous GlobalIFunc.
2991 *
2992 * Returns NULL if the iterator was already at the beginning and there are
2993 * no previous global aliases.
2994 */
2996
2997/**
2998 * Retrieves the resolver function associated with this indirect function, or
2999 * NULL if it doesn't not exist.
3000 *
3001 * @see llvm::GlobalIFunc::getResolver()
3002 */
3004
3005/**
3006 * Sets the resolver function associated with this indirect function.
3007 *
3008 * @see llvm::GlobalIFunc::setResolver()
3009 */
3011
3012/**
3013 * Remove a global indirect function from its parent module and delete it.
3014 *
3015 * @see llvm::GlobalIFunc::eraseFromParent()
3016 */
3018
3019/**
3020 * Remove a global indirect function from its parent module.
3021 *
3022 * This unlinks the global indirect function from its containing module but
3023 * keeps it alive.
3024 *
3025 * @see llvm::GlobalIFunc::removeFromParent()
3026 */
3028
3029/**
3030 * @}
3031 */
3032
3033/**
3034 * @}
3035 */
3036
3037/**
3038 * @}
3039 */
3040
3041/**
3042 * @}
3043 */
3044
3045/**
3046 * @defgroup LLVMCCoreValueMetadata Metadata
3047 *
3048 * @{
3049 */
3050
3051/**
3052 * Create an MDString value from a given string value.
3053 *
3054 * The MDString value does not take ownership of the given string, it remains
3055 * the responsibility of the caller to free it.
3056 *
3057 * @see llvm::MDString::get()
3058 */
3060 size_t SLen);
3061
3062/**
3063 * Create an MDNode value with the given array of operands.
3064 *
3065 * @see llvm::MDNode::get()
3066 */
3068 size_t Count);
3069
3070/**
3071 * Obtain a Metadata as a Value.
3072 */
3074
3075/**
3076 * Obtain a Value as a Metadata.
3077 */
3079
3080/**
3081 * Obtain the underlying string from a MDString value.
3082 *
3083 * @param V Instance to obtain string from.
3084 * @param Length Memory address which will hold length of returned string.
3085 * @return String data in MDString.
3086 */
3087const char *LLVMGetMDString(LLVMValueRef V, unsigned *Length);
3088
3089/**
3090 * Obtain the number of operands from an MDNode value.
3091 *
3092 * @param V MDNode to get number of operands from.
3093 * @return Number of operands of the MDNode.
3094 */
3096
3097/**
3098 * Obtain the given MDNode's operands.
3099 *
3100 * The passed LLVMValueRef pointer should point to enough memory to hold all of
3101 * the operands of the given MDNode (see LLVMGetMDNodeNumOperands) as
3102 * LLVMValueRefs. This memory will be populated with the LLVMValueRefs of the
3103 * MDNode's operands.
3104 *
3105 * @param V MDNode to get the operands from.
3106 * @param Dest Destination array for operands.
3107 */
3109
3110/**
3111 * Replace an operand at a specific index in a llvm::MDNode value.
3112 *
3113 * @see llvm::MDNode::replaceOperandWith()
3114 */
3116 LLVMMetadataRef Replacement);
3117
3118/** Deprecated: Use LLVMMDStringInContext2 instead. */
3120 unsigned SLen);
3121/** Deprecated: Use LLVMMDStringInContext2 instead. */
3122LLVMValueRef LLVMMDString(const char *Str, unsigned SLen);
3123/** Deprecated: Use LLVMMDNodeInContext2 instead. */
3125 unsigned Count);
3126/** Deprecated: Use LLVMMDNodeInContext2 instead. */
3127LLVMValueRef LLVMMDNode(LLVMValueRef *Vals, unsigned Count);
3128
3129/**
3130 * @}
3131 */
3132
3133/**
3134 * @defgroup LLVMCCoreOperandBundle Operand Bundles
3135 *
3136 * Functions in this group operate on LLVMOperandBundleRef instances that
3137 * correspond to llvm::OperandBundleDef instances.
3138 *
3139 * @see llvm::OperandBundleDef
3140 *
3141 * @{
3142 */
3143
3144/**
3145 * Create a new operand bundle.
3146 *
3147 * Every invocation should be paired with LLVMDisposeOperandBundle() or memory
3148 * will be leaked.
3149 *
3150 * @param Tag Tag name of the operand bundle
3151 * @param TagLen Length of Tag
3152 * @param Args Memory address of an array of bundle operands
3153 * @param NumArgs Length of Args
3154 */
3155LLVMOperandBundleRef LLVMCreateOperandBundle(const char *Tag, size_t TagLen,
3156 LLVMValueRef *Args,
3157 unsigned NumArgs);
3158
3159/**
3160 * Destroy an operand bundle.
3161 *
3162 * This must be called for every created operand bundle or memory will be
3163 * leaked.
3164 */
3166
3167/**
3168 * Obtain the tag of an operand bundle as a string.
3169 *
3170 * @param Bundle Operand bundle to obtain tag of.
3171 * @param Len Out parameter which holds the length of the returned string.
3172 * @return The tag name of Bundle.
3173 * @see OperandBundleDef::getTag()
3174 */
3175const char *LLVMGetOperandBundleTag(LLVMOperandBundleRef Bundle, size_t *Len);
3176
3177/**
3178 * Obtain the number of operands for an operand bundle.
3179 *
3180 * @param Bundle Operand bundle to obtain operand count of.
3181 * @return The number of operands.
3182 * @see OperandBundleDef::input_size()
3183 */
3185
3186/**
3187 * Obtain the operand for an operand bundle at the given index.
3188 *
3189 * @param Bundle Operand bundle to obtain operand of.
3190 * @param Index An operand index, must be less than
3191 * LLVMGetNumOperandBundleArgs().
3192 * @return The operand.
3193 */
3195 unsigned Index);
3196
3197/**
3198 * @}
3199 */
3200
3201/**
3202 * @defgroup LLVMCCoreValueBasicBlock Basic Block
3203 *
3204 * A basic block represents a single entry single exit section of code.
3205 * Basic blocks contain a list of instructions which form the body of
3206 * the block.
3207 *
3208 * Basic blocks belong to functions. They have the type of label.
3209 *
3210 * Basic blocks are themselves values. However, the C API models them as
3211 * LLVMBasicBlockRef.
3212 *
3213 * @see llvm::BasicBlock
3214 *
3215 * @{
3216 */
3217
3218/**
3219 * Convert a basic block instance to a value type.
3220 */
3222
3223/**
3224 * Determine whether an LLVMValueRef is itself a basic block.
3225 */
3227
3228/**
3229 * Convert an LLVMValueRef to an LLVMBasicBlockRef instance.
3230 */
3232
3233/**
3234 * Obtain the string name of a basic block.
3235 */
3237
3238/**
3239 * Obtain the function to which a basic block belongs.
3240 *
3241 * @see llvm::BasicBlock::getParent()
3242 */
3244
3245/**
3246 * Obtain the terminator instruction for a basic block.
3247 *
3248 * If the basic block does not have a terminator (it is not well-formed
3249 * if it doesn't), then NULL is returned.
3250 *
3251 * The returned LLVMValueRef corresponds to an llvm::Instruction.
3252 *
3253 * @see llvm::BasicBlock::getTerminator()
3254 */
3256
3257/**
3258 * Obtain the number of basic blocks in a function.
3259 *
3260 * @param Fn Function value to operate on.
3261 */
3263
3264/**
3265 * Obtain all of the basic blocks in a function.
3266 *
3267 * This operates on a function value. The BasicBlocks parameter is a
3268 * pointer to a pre-allocated array of LLVMBasicBlockRef of at least
3269 * LLVMCountBasicBlocks() in length. This array is populated with
3270 * LLVMBasicBlockRef instances.
3271 */
3273
3274/**
3275 * Obtain the first basic block in a function.
3276 *
3277 * The returned basic block can be used as an iterator. You will likely
3278 * eventually call into LLVMGetNextBasicBlock() with it.
3279 *
3280 * @see llvm::Function::begin()
3281 */
3283
3284/**
3285 * Obtain the last basic block in a function.
3286 *
3287 * @see llvm::Function::end()
3288 */
3290
3291/**
3292 * Advance a basic block iterator.
3293 */
3295
3296/**
3297 * Go backwards in a basic block iterator.
3298 */
3300
3301/**
3302 * Obtain the basic block that corresponds to the entry point of a
3303 * function.
3304 *
3305 * @see llvm::Function::getEntryBlock()
3306 */
3308
3309/**
3310 * Insert the given basic block after the insertion point of the given builder.
3311 *
3312 * The insertion point must be valid.
3313 *
3314 * @see llvm::Function::BasicBlockListType::insertAfter()
3315 */
3318
3319/**
3320 * Append the given basic block to the basic block list of the given function.
3321 *
3322 * @see llvm::Function::BasicBlockListType::push_back()
3323 */
3326
3327/**
3328 * Create a new basic block without inserting it into a function.
3329 *
3330 * @see llvm::BasicBlock::Create()
3331 */
3333 const char *Name);
3334
3335/**
3336 * Append a basic block to the end of a function.
3337 *
3338 * @see llvm::BasicBlock::Create()
3339 */
3341 LLVMValueRef Fn,
3342 const char *Name);
3343
3344/**
3345 * Append a basic block to the end of a function using the global
3346 * context.
3347 *
3348 * @see llvm::BasicBlock::Create()
3349 */
3351
3352/**
3353 * Insert a basic block in a function before another basic block.
3354 *
3355 * The function to add to is determined by the function of the
3356 * passed basic block.
3357 *
3358 * @see llvm::BasicBlock::Create()
3359 */
3362 const char *Name);
3363
3364/**
3365 * Insert a basic block in a function using the global context.
3366 *
3367 * @see llvm::BasicBlock::Create()
3368 */
3370 const char *Name);
3371
3372/**
3373 * Remove a basic block from a function and delete it.
3374 *
3375 * This deletes the basic block from its containing function and deletes
3376 * the basic block itself.
3377 *
3378 * @see llvm::BasicBlock::eraseFromParent()
3379 */
3381
3382/**
3383 * Remove a basic block from a function.
3384 *
3385 * This deletes the basic block from its containing function but keep
3386 * the basic block alive.
3387 *
3388 * @see llvm::BasicBlock::removeFromParent()
3389 */
3391
3392/**
3393 * Move a basic block to before another one.
3394 *
3395 * @see llvm::BasicBlock::moveBefore()
3396 */
3398
3399/**
3400 * Move a basic block to after another one.
3401 *
3402 * @see llvm::BasicBlock::moveAfter()
3403 */
3405
3406/**
3407 * Obtain the first instruction in a basic block.
3408 *
3409 * The returned LLVMValueRef corresponds to a llvm::Instruction
3410 * instance.
3411 */
3413
3414/**
3415 * Obtain the last instruction in a basic block.
3416 *
3417 * The returned LLVMValueRef corresponds to an LLVM:Instruction.
3418 */
3420
3421/**
3422 * @}
3423 */
3424
3425/**
3426 * @defgroup LLVMCCoreValueInstruction Instructions
3427 *
3428 * Functions in this group relate to the inspection and manipulation of
3429 * individual instructions.
3430 *
3431 * In the C++ API, an instruction is modeled by llvm::Instruction. This
3432 * class has a large number of descendents. llvm::Instruction is a
3433 * llvm::Value and in the C API, instructions are modeled by
3434 * LLVMValueRef.
3435 *
3436 * This group also contains sub-groups which operate on specific
3437 * llvm::Instruction types, e.g. llvm::CallInst.
3438 *
3439 * @{
3440 */
3441
3442/**
3443 * Determine whether an instruction has any metadata attached.
3444 */
3446
3447/**
3448 * Return metadata associated with an instruction value.
3449 */
3450LLVMValueRef LLVMGetMetadata(LLVMValueRef Val, unsigned KindID);
3451
3452/**
3453 * Set metadata associated with an instruction value.
3454 */
3455void LLVMSetMetadata(LLVMValueRef Val, unsigned KindID, LLVMValueRef Node);
3456
3457/**
3458 * Returns the metadata associated with an instruction value, but filters out
3459 * all the debug locations.
3460 *
3461 * @see llvm::Instruction::getAllMetadataOtherThanDebugLoc()
3462 */
3465 size_t *NumEntries);
3466
3467/**
3468 * Obtain the basic block to which an instruction belongs.
3469 *
3470 * @see llvm::Instruction::getParent()
3471 */
3473
3474/**
3475 * Obtain the instruction that occurs after the one specified.
3476 *
3477 * The next instruction will be from the same basic block.
3478 *
3479 * If this is the last instruction in a basic block, NULL will be
3480 * returned.
3481 */
3483
3484/**
3485 * Obtain the instruction that occurred before this one.
3486 *
3487 * If the instruction is the first instruction in a basic block, NULL
3488 * will be returned.
3489 */
3491
3492/**
3493 * Remove an instruction.
3494 *
3495 * The instruction specified is removed from its containing building
3496 * block but is kept alive.
3497 *
3498 * @see llvm::Instruction::removeFromParent()
3499 */
3501
3502/**
3503 * Remove and delete an instruction.
3504 *
3505 * The instruction specified is removed from its containing building
3506 * block and then deleted.
3507 *
3508 * @see llvm::Instruction::eraseFromParent()
3509 */
3511
3512/**
3513 * Delete an instruction.
3514 *
3515 * The instruction specified is deleted. It must have previously been
3516 * removed from its containing building block.
3517 *
3518 * @see llvm::Value::deleteValue()
3519 */
3521
3522/**
3523 * Obtain the code opcode for an individual instruction.
3524 *
3525 * @see llvm::Instruction::getOpCode()
3526 */
3528
3529/**
3530 * Obtain the predicate of an instruction.
3531 *
3532 * This is only valid for instructions that correspond to llvm::ICmpInst
3533 * or llvm::ConstantExpr whose opcode is llvm::Instruction::ICmp.
3534 *
3535 * @see llvm::ICmpInst::getPredicate()
3536 */
3538
3539/**
3540 * Obtain the float predicate of an instruction.
3541 *
3542 * This is only valid for instructions that correspond to llvm::FCmpInst
3543 * or llvm::ConstantExpr whose opcode is llvm::Instruction::FCmp.
3544 *
3545 * @see llvm::FCmpInst::getPredicate()
3546 */
3548
3549/**
3550 * Create a copy of 'this' instruction that is identical in all ways
3551 * except the following:
3552 * * The instruction has no parent
3553 * * The instruction has no name
3554 *
3555 * @see llvm::Instruction::clone()
3556 */
3558
3559/**
3560 * Determine whether an instruction is a terminator. This routine is named to
3561 * be compatible with historical functions that did this by querying the
3562 * underlying C++ type.
3563 *
3564 * @see llvm::Instruction::isTerminator()
3565 */
3567
3568/**
3569 * @defgroup LLVMCCoreValueInstructionCall Call Sites and Invocations
3570 *
3571 * Functions in this group apply to instructions that refer to call
3572 * sites and invocations. These correspond to C++ types in the
3573 * llvm::CallInst class tree.
3574 *
3575 * @{
3576 */
3577
3578/**
3579 * Obtain the argument count for a call instruction.
3580 *
3581 * This expects an LLVMValueRef that corresponds to a llvm::CallInst,
3582 * llvm::InvokeInst, or llvm:FuncletPadInst.
3583 *
3584 * @see llvm::CallInst::getNumArgOperands()
3585 * @see llvm::InvokeInst::getNumArgOperands()
3586 * @see llvm::FuncletPadInst::getNumArgOperands()
3587 */
3588unsigned LLVMGetNumArgOperands(LLVMValueRef Instr);
3589
3590/**
3591 * Set the calling convention for a call instruction.
3592 *
3593 * This expects an LLVMValueRef that corresponds to a llvm::CallInst or
3594 * llvm::InvokeInst.
3595 *
3596 * @see llvm::CallInst::setCallingConv()
3597 * @see llvm::InvokeInst::setCallingConv()
3598 */
3599void LLVMSetInstructionCallConv(LLVMValueRef Instr, unsigned CC);
3600
3601/**
3602 * Obtain the calling convention for a call instruction.
3603 *
3604 * This is the opposite of LLVMSetInstructionCallConv(). Reads its
3605 * usage.
3606 *
3607 * @see LLVMSetInstructionCallConv()
3608 */
3610
3612 unsigned Align);
3613
3618 LLVMAttributeRef *Attrs);
3621 unsigned KindID);
3624 const char *K, unsigned KLen);
3626 unsigned KindID);
3628 const char *K, unsigned KLen);
3629
3630/**
3631 * Obtain the function type called by this instruction.
3632 *
3633 * @see llvm::CallBase::getFunctionType()
3634 */
3636
3637/**
3638 * Obtain the pointer to the function invoked by this instruction.
3639 *
3640 * This expects an LLVMValueRef that corresponds to a llvm::CallInst or
3641 * llvm::InvokeInst.
3642 *
3643 * @see llvm::CallInst::getCalledOperand()
3644 * @see llvm::InvokeInst::getCalledOperand()
3645 */
3647
3648/**
3649 * Obtain the number of operand bundles attached to this instruction.
3650 *
3651 * This only works on llvm::CallInst and llvm::InvokeInst instructions.
3652 *
3653 * @see llvm::CallBase::getNumOperandBundles()
3654 */
3656
3657/**
3658 * Obtain the operand bundle attached to this instruction at the given index.
3659 * Use LLVMDisposeOperandBundle to free the operand bundle.
3660 *
3661 * This only works on llvm::CallInst and llvm::InvokeInst instructions.
3662 */
3664 unsigned Index);
3665
3666/**
3667 * Obtain whether a call instruction is a tail call.
3668 *
3669 * This only works on llvm::CallInst instructions.
3670 *
3671 * @see llvm::CallInst::isTailCall()
3672 */
3674
3675/**
3676 * Set whether a call instruction is a tail call.
3677 *
3678 * This only works on llvm::CallInst instructions.
3679 *
3680 * @see llvm::CallInst::setTailCall()
3681 */
3682void LLVMSetTailCall(LLVMValueRef CallInst, LLVMBool IsTailCall);
3683
3684/**
3685 * Obtain a tail call kind of the call instruction.
3686 *
3687 * @see llvm::CallInst::setTailCallKind()
3688 */
3690
3691/**
3692 * Set the call kind of the call instruction.
3693 *
3694 * @see llvm::CallInst::getTailCallKind()
3695 */
3697
3698/**
3699 * Return the normal destination basic block.
3700 *
3701 * This only works on llvm::InvokeInst instructions.
3702 *
3703 * @see llvm::InvokeInst::getNormalDest()
3704 */
3706
3707/**
3708 * Return the unwind destination basic block.
3709 *
3710 * Works on llvm::InvokeInst, llvm::CleanupReturnInst, and
3711 * llvm::CatchSwitchInst instructions.
3712 *
3713 * @see llvm::InvokeInst::getUnwindDest()
3714 * @see llvm::CleanupReturnInst::getUnwindDest()
3715 * @see llvm::CatchSwitchInst::getUnwindDest()
3716 */
3718
3719/**
3720 * Set the normal destination basic block.
3721 *
3722 * This only works on llvm::InvokeInst instructions.
3723 *
3724 * @see llvm::InvokeInst::setNormalDest()
3725 */
3727
3728/**
3729 * Set the unwind destination basic block.
3730 *
3731 * Works on llvm::InvokeInst, llvm::CleanupReturnInst, and
3732 * llvm::CatchSwitchInst instructions.
3733 *
3734 * @see llvm::InvokeInst::setUnwindDest()
3735 * @see llvm::CleanupReturnInst::setUnwindDest()
3736 * @see llvm::CatchSwitchInst::setUnwindDest()
3737 */
3739
3740/**
3741 * @}
3742 */
3743
3744/**
3745 * @defgroup LLVMCCoreValueInstructionTerminator Terminators
3746 *
3747 * Functions in this group only apply to instructions for which
3748 * LLVMIsATerminatorInst returns true.
3749 *
3750 * @{
3751 */
3752
3753/**
3754 * Return the number of successors that this terminator has.
3755 *
3756 * @see llvm::Instruction::getNumSuccessors
3757 */
3758unsigned LLVMGetNumSuccessors(LLVMValueRef Term);
3759
3760/**
3761 * Return the specified successor.
3762 *
3763 * @see llvm::Instruction::getSuccessor
3764 */
3766
3767/**
3768 * Update the specified successor to point at the provided block.
3769 *
3770 * @see llvm::Instruction::setSuccessor
3771 */
3773
3774/**
3775 * Return if a branch is conditional.
3776 *
3777 * This only works on llvm::BranchInst instructions.
3778 *
3779 * @see llvm::BranchInst::isConditional
3780 */
3782
3783/**
3784 * Return the condition of a branch instruction.
3785 *
3786 * This only works on llvm::BranchInst instructions.
3787 *
3788 * @see llvm::BranchInst::getCondition
3789 */
3791
3792/**
3793 * Set the condition of a branch instruction.
3794 *
3795 * This only works on llvm::BranchInst instructions.
3796 *
3797 * @see llvm::BranchInst::setCondition
3798 */
3800
3801/**
3802 * Obtain the default destination basic block of a switch instruction.
3803 *
3804 * This only works on llvm::SwitchInst instructions.
3805 *
3806 * @see llvm::SwitchInst::getDefaultDest()
3807 */
3809
3810/**
3811 * @}
3812 */
3813
3814/**
3815 * @defgroup LLVMCCoreValueInstructionAlloca Allocas
3816 *
3817 * Functions in this group only apply to instructions that map to
3818 * llvm::AllocaInst instances.
3819 *
3820 * @{
3821 */
3822
3823/**
3824 * Obtain the type that is being allocated by the alloca instruction.
3825 */
3827
3828/**
3829 * @}
3830 */
3831
3832/**
3833 * @defgroup LLVMCCoreValueInstructionGetElementPointer GEPs
3834 *
3835 * Functions in this group only apply to instructions that map to
3836 * llvm::GetElementPtrInst instances.
3837 *
3838 * @{
3839 */
3840
3841/**
3842 * Check whether the given GEP operator is inbounds.
3843 */
3845
3846/**
3847 * Set the given GEP instruction to be inbounds or not.
3848 */
3850
3851/**
3852 * Get the source element type of the given GEP operator.
3853 */
3855
3856/**
3857 * @}
3858 */
3859
3860/**
3861 * @defgroup LLVMCCoreValueInstructionPHINode PHI Nodes
3862 *
3863 * Functions in this group only apply to instructions that map to
3864 * llvm::PHINode instances.
3865 *
3866 * @{
3867 */
3868
3869/**
3870 * Add an incoming value to the end of a PHI list.
3871 */
3872void LLVMAddIncoming(LLVMValueRef PhiNode, LLVMValueRef *IncomingValues,
3873 LLVMBasicBlockRef *IncomingBlocks, unsigned Count);
3874
3875/**
3876 * Obtain the number of incoming basic blocks to a PHI node.
3877 */
3878unsigned LLVMCountIncoming(LLVMValueRef PhiNode);
3879
3880/**
3881 * Obtain an incoming value to a PHI node as an LLVMValueRef.
3882 */
3884
3885/**
3886 * Obtain an incoming value to a PHI node as an LLVMBasicBlockRef.
3887 */
3889
3890/**
3891 * @}
3892 */
3893
3894/**
3895 * @defgroup LLVMCCoreValueInstructionExtractValue ExtractValue
3896 * @defgroup LLVMCCoreValueInstructionInsertValue InsertValue
3897 *
3898 * Functions in this group only apply to instructions that map to
3899 * llvm::ExtractValue and llvm::InsertValue instances.
3900 *
3901 * @{
3902 */
3903
3904/**
3905 * Obtain the number of indices.
3906 * NB: This also works on GEP operators.
3907 */
3908unsigned LLVMGetNumIndices(LLVMValueRef Inst);
3909
3910/**
3911 * Obtain the indices as an array.
3912 */
3913const unsigned *LLVMGetIndices(LLVMValueRef Inst);
3914
3915/**
3916 * @}
3917 */
3918
3919/**
3920 * @}
3921 */
3922
3923/**
3924 * @}
3925 */
3926
3927/**
3928 * @defgroup LLVMCCoreInstructionBuilder Instruction Builders
3929 *
3930 * An instruction builder represents a point within a basic block and is
3931 * the exclusive means of building instructions using the C interface.
3932 *
3933 * @{
3934 */
3935
3939 LLVMValueRef Instr);
3946 const char *Name);
3948
3949/* Metadata */
3950
3951/**
3952 * Get location information used by debugging information.
3953 *
3954 * @see llvm::IRBuilder::getCurrentDebugLocation()
3955 */
3957
3958/**
3959 * Set location information used by debugging information.
3960 *
3961 * To clear the location metadata of the given instruction, pass NULL to \p Loc.
3962 *
3963 * @see llvm::IRBuilder::SetCurrentDebugLocation()
3964 */
3966
3967/**
3968 * Attempts to set the debug location for the given instruction using the
3969 * current debug location for the given builder. If the builder has no current
3970 * debug location, this function is a no-op.
3971 *
3972 * @deprecated LLVMSetInstDebugLocation is deprecated in favor of the more general
3973 * LLVMAddMetadataToInst.
3974 *
3975 * @see llvm::IRBuilder::SetInstDebugLocation()
3976 */
3978
3979/**
3980 * Adds the metadata registered with the given builder to the given instruction.
3981 *
3982 * @see llvm::IRBuilder::AddMetadataToInst()
3983 */
3985
3986/**
3987 * Get the dafult floating-point math metadata for a given builder.
3988 *
3989 * @see llvm::IRBuilder::getDefaultFPMathTag()
3990 */
3992
3993/**
3994 * Set the default floating-point math metadata for the given builder.
3995 *
3996 * To clear the metadata, pass NULL to \p FPMathTag.
3997 *
3998 * @see llvm::IRBuilder::setDefaultFPMathTag()
3999 */
4001 LLVMMetadataRef FPMathTag);
4002
4003/**
4004 * Deprecated: Passing the NULL location will crash.
4005 * Use LLVMGetCurrentDebugLocation2 instead.
4006 */
4008/**
4009 * Deprecated: Returning the NULL location will crash.
4010 * Use LLVMGetCurrentDebugLocation2 instead.
4011 */
4013
4014/* Terminators */
4018 unsigned N);
4023 LLVMBasicBlockRef Else, unsigned NumCases);
4025 unsigned NumDests);
4027 LLVMValueRef *Args, unsigned NumArgs,
4029 const char *Name);
4032 unsigned NumArgs, LLVMBasicBlockRef Then, LLVMBasicBlockRef Catch,
4033 LLVMOperandBundleRef *Bundles, unsigned NumBundles, const char *Name);
4035
4036/* Exception Handling */
4039 LLVMValueRef PersFn, unsigned NumClauses,
4040 const char *Name);
4046 LLVMValueRef *Args, unsigned NumArgs,
4047 const char *Name);
4049 LLVMValueRef *Args, unsigned NumArgs,
4050 const char *Name);
4052 LLVMBasicBlockRef UnwindBB,
4053 unsigned NumHandlers, const char *Name);
4054
4055/* Add a case to the switch instruction */
4056void LLVMAddCase(LLVMValueRef Switch, LLVMValueRef OnVal,
4057 LLVMBasicBlockRef Dest);
4058
4059/* Add a destination to the indirectbr instruction */
4061
4062/* Get the number of clauses on the landingpad instruction */
4063unsigned LLVMGetNumClauses(LLVMValueRef LandingPad);
4064
4065/* Get the value of the clause at index Idx on the landingpad instruction */
4066LLVMValueRef LLVMGetClause(LLVMValueRef LandingPad, unsigned Idx);
4067
4068/* Add a catch or filter clause to the landingpad instruction */
4069void LLVMAddClause(LLVMValueRef LandingPad, LLVMValueRef ClauseVal);
4070
4071/* Get the 'cleanup' flag in the landingpad instruction */
4073
4074/* Set the 'cleanup' flag in the landingpad instruction */
4075void LLVMSetCleanup(LLVMValueRef LandingPad, LLVMBool Val);
4076
4077/* Add a destination to the catchswitch instruction */
4078void LLVMAddHandler(LLVMValueRef CatchSwitch, LLVMBasicBlockRef Dest);
4079
4080/* Get the number of handlers on the catchswitch instruction */
4081unsigned LLVMGetNumHandlers(LLVMValueRef CatchSwitch);
4082
4083/**
4084 * Obtain the basic blocks acting as handlers for a catchswitch instruction.
4085 *
4086 * The Handlers parameter should point to a pre-allocated array of
4087 * LLVMBasicBlockRefs at least LLVMGetNumHandlers() large. On return, the
4088 * first LLVMGetNumHandlers() entries in the array will be populated
4089 * with LLVMBasicBlockRef instances.
4090 *
4091 * @param CatchSwitch The catchswitch instruction to operate on.
4092 * @param Handlers Memory address of an array to be filled with basic blocks.
4093 */
4094void LLVMGetHandlers(LLVMValueRef CatchSwitch, LLVMBasicBlockRef *Handlers);
4095
4096/* Funclets */
4097
4098/* Get the number of funcletpad arguments. */
4099LLVMValueRef LLVMGetArgOperand(LLVMValueRef Funclet, unsigned i);
4100
4101/* Set a funcletpad argument at the given index. */
4102void LLVMSetArgOperand(LLVMValueRef Funclet, unsigned i, LLVMValueRef value);
4103
4104/**
4105 * Get the parent catchswitch instruction of a catchpad instruction.
4106 *
4107 * This only works on llvm::CatchPadInst instructions.
4108 *
4109 * @see llvm::CatchPadInst::getCatchSwitch()
4110 */
4112
4113/**
4114 * Set the parent catchswitch instruction of a catchpad instruction.
4115 *
4116 * This only works on llvm::CatchPadInst instructions.
4117 *
4118 * @see llvm::CatchPadInst::setCatchSwitch()
4119 */
4120void LLVMSetParentCatchSwitch(LLVMValueRef CatchPad, LLVMValueRef CatchSwitch);
4121
4122/* Arithmetic */
4124 const char *Name);
4126 const char *Name);
4128 const char *Name);
4130 const char *Name);
4132 const char *Name);
4134 const char *Name);
4136 const char *Name);
4138 const char *Name);
4140 const char *Name);
4142 const char *Name);
4144 const char *Name);
4146 const char *Name);
4148 const char *Name);
4150 const char *Name);
4152 const char *Name);
4154 const char *Name);
4156 const char *Name);
4158 const char *Name);
4160 const char *Name);
4162 const char *Name);
4164 const char *Name);
4166 const char *Name);
4168 const char *Name);
4170 const char *Name);
4172 const char *Name);
4174 const char *Name);
4177 const char *Name);
4180 const char *Name);
4182 LLVMValueRef V,
4183 const char *Name),
4184 "Use LLVMBuildNeg + LLVMSetNUW instead.");
4187
4189void LLVMSetNUW(LLVMValueRef ArithInst, LLVMBool HasNUW);
4191void LLVMSetNSW(LLVMValueRef ArithInst, LLVMBool HasNSW);
4192LLVMBool LLVMGetExact(LLVMValueRef DivOrShrInst);
4193void LLVMSetExact(LLVMValueRef DivOrShrInst, LLVMBool IsExact);
4194
4195/**
4196 * Gets if the instruction has the non-negative flag set.
4197 * Only valid for zext instructions.
4198 */
4200/**
4201 * Sets the non-negative flag for the instruction.
4202 * Only valid for zext instructions.
4203 */
4204void LLVMSetNNeg(LLVMValueRef NonNegInst, LLVMBool IsNonNeg);
4205
4206/**
4207 * Get the flags for which fast-math-style optimizations are allowed for this
4208 * value.
4209 *
4210 * Only valid on floating point instructions.
4211 * @see LLVMCanValueUseFastMathFlags
4212 */
4214
4215/**
4216 * Sets the flags for which fast-math-style optimizations are allowed for this
4217 * value.
4218 *
4219 * Only valid on floating point instructions.
4220 * @see LLVMCanValueUseFastMathFlags
4221 */
4223
4224/**
4225 * Check if a given value can potentially have fast math flags.
4226 *
4227 * Will return true for floating point arithmetic instructions, and for select,
4228 * phi, and call instructions whose type is a floating point type, or a vector
4229 * or array thereof. See https://llvm.org/docs/LangRef.html#fast-math-flags
4230 */
4232
4233/**
4234 * Gets whether the instruction has the disjoint flag set.
4235 * Only valid for or instructions.
4236 */
4238/**
4239 * Sets the disjoint flag for the instruction.
4240 * Only valid for or instructions.
4241 */
4242void LLVMSetIsDisjoint(LLVMValueRef Inst, LLVMBool IsDisjoint);
4243
4244/* Memory */
4247 LLVMValueRef Val, const char *Name);
4248
4249/**
4250 * Creates and inserts a memset to the specified pointer and the
4251 * specified value.
4252 *
4253 * @see llvm::IRRBuilder::CreateMemSet()
4254 */
4256 LLVMValueRef Val, LLVMValueRef Len,
4257 unsigned Align);
4258/**
4259 * Creates and inserts a memcpy between the specified pointers.
4260 *
4261 * @see llvm::IRRBuilder::CreateMemCpy()
4262 */
4264 LLVMValueRef Dst, unsigned DstAlign,
4265 LLVMValueRef Src, unsigned SrcAlign,
4267/**
4268 * Creates and inserts a memmove between the specified pointers.
4269 *
4270 * @see llvm::IRRBuilder::CreateMemMove()
4271 */
4273 LLVMValueRef Dst, unsigned DstAlign,
4274 LLVMValueRef Src, unsigned SrcAlign,
4276
4279 LLVMValueRef Val, const char *Name);
4282 LLVMValueRef PointerVal, const char *Name);
4285 LLVMValueRef Pointer, LLVMValueRef *Indices,
4286 unsigned NumIndices, const char *Name);
4288 LLVMValueRef Pointer, LLVMValueRef *Indices,
4289 unsigned NumIndices, const char *Name);
4291 LLVMValueRef Pointer, unsigned Idx,
4292 const char *Name);
4294 const char *Name);
4296 const char *Name);
4297LLVMBool LLVMGetVolatile(LLVMValueRef MemoryAccessInst);
4298void LLVMSetVolatile(LLVMValueRef MemoryAccessInst, LLVMBool IsVolatile);
4299LLVMBool LLVMGetWeak(LLVMValueRef CmpXchgInst);
4300void LLVMSetWeak(LLVMValueRef CmpXchgInst, LLVMBool IsWeak);
4302void LLVMSetOrdering(LLVMValueRef MemoryAccessInst, LLVMAtomicOrdering Ordering);
4304void LLVMSetAtomicRMWBinOp(LLVMValueRef AtomicRMWInst, LLVMAtomicRMWBinOp BinOp);
4305
4306/* Casts */
4308 LLVMTypeRef DestTy, const char *Name);
4310 LLVMTypeRef DestTy, const char *Name);
4312 LLVMTypeRef DestTy, const char *Name);
4314 LLVMTypeRef DestTy, const char *Name);
4316 LLVMTypeRef DestTy, const char *Name);
4318 LLVMTypeRef DestTy, const char *Name);
4320 LLVMTypeRef DestTy, const char *Name);
4322 LLVMTypeRef DestTy, const char *Name);
4324 LLVMTypeRef DestTy, const char *Name);
4326 LLVMTypeRef DestTy, const char *Name);
4328 LLVMTypeRef DestTy, const char *Name);
4330 LLVMTypeRef DestTy, const char *Name);
4332 LLVMTypeRef DestTy, const char *Name);
4334 LLVMTypeRef DestTy, const char *Name);
4336 LLVMTypeRef DestTy, const char *Name);
4338 LLVMTypeRef DestTy, const char *Name);
4340 LLVMTypeRef DestTy, const char *Name);
4342 LLVMTypeRef DestTy, const char *Name);
4344 LLVMTypeRef DestTy, LLVMBool IsSigned,
4345 const char *Name);
4347 LLVMTypeRef DestTy, const char *Name);
4348
4349/** Deprecated: This cast is always signed. Use LLVMBuildIntCast2 instead. */
4351 LLVMTypeRef DestTy, const char *Name);
4352
4354 LLVMTypeRef DestTy, LLVMBool DestIsSigned);
4355
4356/* Comparisons */
4359 const char *Name);
4362 const char *Name);
4363
4364/* Miscellaneous instructions */
4367 LLVMValueRef *Args, unsigned NumArgs,
4368 const char *Name);
4371 LLVMValueRef *Args, unsigned NumArgs,
4372 LLVMOperandBundleRef *Bundles,
4373 unsigned NumBundles, const char *Name);
4375 LLVMValueRef Then, LLVMValueRef Else,
4376 const char *Name);
4378 const char *Name);
4380 LLVMValueRef Index, const char *Name);
4383 const char *Name);
4385 LLVMValueRef V2, LLVMValueRef Mask,
4386 const char *Name);
4388 unsigned Index, const char *Name);
4390 LLVMValueRef EltVal, unsigned Index,
4391 const char *Name);
4393 const char *Name);
4394
4396 const char *Name);
4398 const char *Name);
4401 const char *Name);
4403 LLVMBool singleThread, const char *Name);
4405 LLVMValueRef PTR, LLVMValueRef Val,
4406 LLVMAtomicOrdering ordering,
4407 LLVMBool singleThread);
4409 LLVMValueRef Cmp, LLVMValueRef New,
4410 LLVMAtomicOrdering SuccessOrdering,
4411 LLVMAtomicOrdering FailureOrdering,
4413
4414/**
4415 * Get the number of elements in the mask of a ShuffleVector instruction.
4416 */
4417unsigned LLVMGetNumMaskElements(LLVMValueRef ShuffleVectorInst);
4418
4419/**
4420 * \returns a constant that specifies that the result of a \c ShuffleVectorInst
4421 * is undefined.
4422 */
4423int LLVMGetUndefMaskElem(void);
4424
4425/**
4426 * Get the mask value at position Elt in the mask of a ShuffleVector
4427 * instruction.
4428 *
4429 * \Returns the result of \c LLVMGetUndefMaskElem() if the mask value is
4430 * poison at that position.
4431 */
4432int LLVMGetMaskValue(LLVMValueRef ShuffleVectorInst, unsigned Elt);
4433
4436
4439 LLVMAtomicOrdering Ordering);
4442 LLVMAtomicOrdering Ordering);
4443
4444/**
4445 * @}
4446 */
4447
4448/**
4449 * @defgroup LLVMCCoreModuleProvider Module Providers
4450 *
4451 * @{
4452 */
4453
4454/**
4455 * Changes the type of M so it can be passed to FunctionPassManagers and the
4456 * JIT. They take ModuleProviders for historical reasons.
4457 */
4460
4461/**
4462 * Destroys the module M.
4463 */
4465
4466/**
4467 * @}
4468 */
4469
4470/**
4471 * @defgroup LLVMCCoreMemoryBuffers Memory Buffers
4472 *
4473 * @{
4474 */
4475
4477 LLVMMemoryBufferRef *OutMemBuf,
4478 char **OutMessage);
4480 char **OutMessage);
4482 size_t InputDataLength,
4483 const char *BufferName,
4484 LLVMBool RequiresNullTerminator);
4486 size_t InputDataLength,
4487 const char *BufferName);
4488const char *LLVMGetBufferStart(LLVMMemoryBufferRef MemBuf);
4491
4492/**
4493 * @}
4494 */
4495
4496/**
4497 * @defgroup LLVMCCorePassManagers Pass Managers
4498 * @ingroup LLVMCCore
4499 *
4500 * @{
4501 */
4502
4503/** Constructs a new whole-module pass pipeline. This type of pipeline is
4504 suitable for link-time optimization and whole-module transformations.
4505 @see llvm::PassManager::PassManager */
4507
4508/** Constructs a new function-by-function pass pipeline over the module
4509 provider. It does not take ownership of the module provider. This type of
4510 pipeline is suitable for code generation and JIT compilation tasks.
4511 @see llvm::FunctionPassManager::FunctionPassManager */
4513
4514/** Deprecated: Use LLVMCreateFunctionPassManagerForModule instead. */
4516
4517/** Initializes, executes on the provided module, and finalizes all of the
4518 passes scheduled in the pass manager. Returns 1 if any of the passes
4519 modified the module, 0 otherwise.
4520 @see llvm::PassManager::run(Module&) */
4522
4523/** Initializes all of the function passes scheduled in the function pass
4524 manager. Returns 1 if any of the passes modified the module, 0 otherwise.
4525 @see llvm::FunctionPassManager::doInitialization */
4527
4528/** Executes all of the function passes scheduled in the function pass manager
4529 on the provided function. Returns 1 if any of the passes modified the
4530 function, false otherwise.
4531 @see llvm::FunctionPassManager::run(Function&) */
4533
4534/** Finalizes all of the function passes scheduled in the function pass
4535 manager. Returns 1 if any of the passes modified the module, 0 otherwise.
4536 @see llvm::FunctionPassManager::doFinalization */
4538
4539/** Frees the memory of a pass pipeline. For function pipelines, does not free
4540 the module provider.
4541 @see llvm::PassManagerBase::~PassManagerBase. */
4543
4544/**
4545 * @}
4546 */
4547
4548/**
4549 * @defgroup LLVMCCoreThreading Threading
4550 *
4551 * Handle the structures needed to make LLVM safe for multithreading.
4552 *
4553 * @{
4554 */
4555
4556/** Deprecated: Multi-threading can only be enabled/disabled with the compile
4557 time define LLVM_ENABLE_THREADS. This function always returns
4558 LLVMIsMultithreaded(). */
4560
4561/** Deprecated: Multi-threading can only be enabled/disabled with the compile
4562 time define LLVM_ENABLE_THREADS. */
4563void LLVMStopMultithreaded(void);
4564
4565/** Check whether LLVM is executing in thread-safe mode or not.
4566 @see llvm::llvm_is_multithreaded */
4568
4569/**
4570 * @}
4571 */
4572
4573/**
4574 * @}
4575 */
4576
4577/**
4578 * @}
4579 */
4580
4582
4583#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:1582
LLVMValueRef LLVMBuildNUWNeg(LLVMBuilderRef B, LLVMValueRef V, const char *Name)
Definition: Core.cpp:3588
LLVMValueRef LLVMConstNUWNeg(LLVMValueRef ConstantVal)
Definition: Core.cpp:1680
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:97
unsigned LLVMGetEnumAttributeKind(LLVMAttributeRef A)
Get the unique id corresponding to the enum attribute passed as argument.
Definition: Core.cpp:160
void LLVMContextSetDiscardValueNames(LLVMContextRef C, LLVMBool Discard)
Set whether the given context discards all value names.
Definition: Core.cpp:128
uint64_t LLVMGetEnumAttributeValue(LLVMAttributeRef A)
Get the enum attribute's value.
Definition: Core.cpp:164
LLVMTypeRef LLVMGetTypeAttributeValue(LLVMAttributeRef A)
Get the type attribute's value.
Definition: Core.cpp:178
unsigned LLVMGetMDKindIDInContext(LLVMContextRef C, const char *Name, unsigned SLen)
Definition: Core.cpp:136
LLVMDiagnosticSeverity LLVMGetDiagInfoSeverity(LLVMDiagnosticInfoRef DI)
Return an enum LLVMDiagnosticSeverity.
Definition: Core.cpp:242
char * LLVMGetDiagInfoDescription(LLVMDiagnosticInfoRef DI)
Return a string representation of the DiagnosticInfo.
Definition: Core.cpp:231
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:145
LLVMDiagnosticHandler LLVMContextGetDiagnosticHandler(LLVMContextRef C)
Get the diagnostic handler of this context.
Definition: Core.cpp:108
LLVMBool LLVMContextShouldDiscardValueNames(LLVMContextRef C)
Retrieve whether the given context is set to discard all value names.
Definition: Core.cpp:124
LLVMAttributeRef LLVMCreateTypeAttribute(LLVMContextRef C, unsigned KindID, LLVMTypeRef type_ref)
Create a type attribute.
Definition: Core.cpp:171
LLVMAttributeRef LLVMCreateStringAttribute(LLVMContextRef C, const char *K, unsigned KLength, const char *V, unsigned VLength)
Create a string attribute.
Definition: Core.cpp:197
LLVMAttributeRef LLVMCreateConstantRangeAttribute(LLVMContextRef C, unsigned KindID, unsigned NumBits, const uint64_t LowerWords[], const uint64_t UpperWords[])
Create a ConstantRange attribute.
Definition: Core.cpp:183
void LLVMContextDispose(LLVMContextRef C)
Destroy a context instance.
Definition: Core.cpp:132
LLVMAttributeRef LLVMCreateEnumAttribute(LLVMContextRef C, unsigned KindID, uint64_t Val)
Create an enum attribute.
Definition: Core.cpp:153
const char * LLVMGetStringAttributeKind(LLVMAttributeRef A, unsigned *Length)
Get the string attribute's kind.
Definition: Core.cpp:204
LLVMTypeRef LLVMGetTypeByName2(LLVMContextRef C, const char *Name)
Obtain a Type from a context by its registered name.
Definition: Core.cpp:850
LLVMContextRef LLVMContextCreate(void)
Create a new context.
Definition: Core.cpp:93
void(* LLVMYieldCallback)(LLVMContextRef, void *)
Definition: Core.h:550
unsigned LLVMGetLastEnumAttributeKind(void)
Definition: Core.cpp:149
LLVMBool LLVMIsStringAttribute(LLVMAttributeRef A)
Definition: Core.cpp:223
LLVMBool LLVMIsTypeAttribute(LLVMAttributeRef A)
Definition: Core.cpp:227
const char * LLVMGetStringAttributeValue(LLVMAttributeRef A, unsigned *Length)
Get the string attribute's value.
Definition: Core.cpp:211
void LLVMContextSetYieldCallback(LLVMContextRef C, LLVMYieldCallback Callback, void *OpaqueHandle)
Set the yield callback function for this context.
Definition: Core.cpp:117
unsigned LLVMGetMDKindID(const char *Name, unsigned SLen)
Definition: Core.cpp:141
void LLVMContextSetDiagnosticHandler(LLVMContextRef C, LLVMDiagnosticHandler Handler, void *DiagnosticContext)
Set the diagnostic handler for this context.
Definition: Core.cpp:99
void(* LLVMDiagnosticHandler)(LLVMDiagnosticInfoRef, void *)
Definition: Core.h:549
void * LLVMContextGetDiagnosticContext(LLVMContextRef C)
Get the diagnostic context of this context.
Definition: Core.cpp:113
LLVMBool LLVMIsEnumAttribute(LLVMAttributeRef A)
Check for the different types of attributes.
Definition: Core.cpp:218
LLVMValueRef LLVMBuildLoad2(LLVMBuilderRef, LLVMTypeRef Ty, LLVMValueRef PointerVal, const char *Name)
Definition: Core.cpp:3729
LLVMValueRef LLVMBuildGlobalStringPtr(LLVMBuilderRef B, const char *Str, const char *Name)
Definition: Core.cpp:3862
LLVMValueRef LLVMBuildFence(LLVMBuilderRef B, LLVMAtomicOrdering ordering, LLVMBool singleThread, const char *Name)
Definition: Core.cpp:3826
LLVMValueRef LLVMBuildAtomicRMW(LLVMBuilderRef B, LLVMAtomicRMWBinOp op, LLVMValueRef PTR, LLVMValueRef Val, LLVMAtomicOrdering ordering, LLVMBool singleThread)
Definition: Core.cpp:4163
LLVMBool LLVMGetIsDisjoint(LLVMValueRef Inst)
Gets whether the instruction has the disjoint flag set.
Definition: Core.cpp:3660
LLVMValueRef LLVMBuildNot(LLVMBuilderRef, LLVMValueRef V, const char *Name)
Definition: Core.cpp:3600
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:3270
LLVMValueRef LLVMBuildNSWSub(LLVMBuilderRef, LLVMValueRef LHS, LLVMValueRef RHS, const char *Name)
Definition: Core.cpp:3467
LLVMValueRef LLVMBuildAnd(LLVMBuilderRef, LLVMValueRef LHS, LLVMValueRef RHS, const char *Name)
Definition: Core.cpp:3557
LLVMValueRef LLVMBuildFPExt(LLVMBuilderRef, LLVMValueRef Val, LLVMTypeRef DestTy, const char *Name)
Definition: Core.cpp:3974
void LLVMClearInsertionPosition(LLVMBuilderRef Builder)
Definition: Core.cpp:3165
LLVMValueRef LLVMBuildFDiv(LLVMBuilderRef, LLVMValueRef LHS, LLVMValueRef RHS, const char *Name)
Definition: Core.cpp:3522
void LLVMSetWeak(LLVMValueRef CmpXchgInst, LLVMBool IsWeak)
Definition: Core.cpp:3893
void LLVMSetNSW(LLVMValueRef ArithInst, LLVMBool HasNSW)
Definition: Core.cpp:3619
LLVMValueRef LLVMBuildFreeze(LLVMBuilderRef, LLVMValueRef Val, const char *Name)
Definition: Core.cpp:4141
LLVMValueRef LLVMBuildFAdd(LLVMBuilderRef, LLVMValueRef LHS, LLVMValueRef RHS, const char *Name)
Definition: Core.cpp:3457
LLVMValueRef LLVMBuildFMul(LLVMBuilderRef, LLVMValueRef LHS, LLVMValueRef RHS, const char *Name)
Definition: Core.cpp:3497
LLVMValueRef LLVMBuildZExt(LLVMBuilderRef, LLVMValueRef Val, LLVMTypeRef DestTy, const char *Name)
Definition: Core.cpp:3939
LLVMValueRef LLVMBuildSExt(LLVMBuilderRef, LLVMValueRef Val, LLVMTypeRef DestTy, const char *Name)
Definition: Core.cpp:3944
LLVMValueRef LLVMBuildTruncOrBitCast(LLVMBuilderRef, LLVMValueRef Val, LLVMTypeRef DestTy, const char *Name)
Definition: Core.cpp:4011
LLVMValueRef LLVMBuildSExtOrBitCast(LLVMBuilderRef, LLVMValueRef Val, LLVMTypeRef DestTy, const char *Name)
Definition: Core.cpp:4005
LLVMValueRef LLVMBuildBitCast(LLVMBuilderRef, LLVMValueRef Val, LLVMTypeRef DestTy, const char *Name)
Definition: Core.cpp:3989
void LLVMBuilderSetDefaultFPMathTag(LLVMBuilderRef Builder, LLVMMetadataRef FPMathTag)
Set the default floating-point math metadata for the given builder.
Definition: Core.cpp:3215
LLVMValueRef LLVMBuildExtractValue(LLVMBuilderRef, LLVMValueRef AggVal, unsigned Index, const char *Name)
Definition: Core.cpp:4129
LLVMValueRef LLVMBuildFCmp(LLVMBuilderRef, LLVMRealPredicate Op, LLVMValueRef LHS, LLVMValueRef RHS, const char *Name)
Definition: Core.cpp:4061
void LLVMSetCmpXchgFailureOrdering(LLVMValueRef CmpXchgInst, LLVMAtomicOrdering Ordering)
Definition: Core.cpp:4249
LLVMValueRef LLVMBuildFPTrunc(LLVMBuilderRef, LLVMValueRef Val, LLVMTypeRef DestTy, const char *Name)
Definition: Core.cpp:3969
LLVMAtomicOrdering LLVMGetCmpXchgFailureOrdering(LLVMValueRef CmpXchgInst)
Definition: Core.cpp:4244
LLVMOpcode LLVMGetCastOpcode(LLVMValueRef Src, LLVMBool SrcIsSigned, LLVMTypeRef DestTy, LLVMBool DestIsSigned)
Definition: Core.cpp:4046
LLVMAtomicRMWBinOp LLVMGetAtomicRMWBinOp(LLVMValueRef AtomicRMWInst)
Definition: Core.cpp:3924
void LLVMSetNUW(LLVMValueRef ArithInst, LLVMBool HasNUW)
Definition: Core.cpp:3609
LLVMValueRef LLVMBuildSIToFP(LLVMBuilderRef, LLVMValueRef Val, LLVMTypeRef DestTy, const char *Name)
Definition: Core.cpp:3964
LLVMValueRef LLVMBuildShl(LLVMBuilderRef, LLVMValueRef LHS, LLVMValueRef RHS, const char *Name)
Definition: Core.cpp:3542
void LLVMSetCurrentDebugLocation2(LLVMBuilderRef Builder, LLVMMetadataRef Loc)
Set location information used by debugging information.
Definition: Core.cpp:3188
int LLVMGetUndefMaskElem(void)
Definition: Core.cpp:4199
LLVMBool LLVMGetWeak(LLVMValueRef CmpXchgInst)
Definition: Core.cpp:3889
LLVMValueRef LLVMBuildFRem(LLVMBuilderRef, LLVMValueRef LHS, LLVMValueRef RHS, const char *Name)
Definition: Core.cpp:3537
LLVMValueRef LLVMBuildAlloca(LLVMBuilderRef, LLVMTypeRef Ty, const char *Name)
Definition: Core.cpp:3715
LLVMValueRef LLVMBuildSelect(LLVMBuilderRef, LLVMValueRef If, LLVMValueRef Then, LLVMValueRef Else, const char *Name)
Definition: Core.cpp:4097
LLVMValueRef LLVMBuildCatchPad(LLVMBuilderRef B, LLVMValueRef ParentPad, LLVMValueRef *Args, unsigned NumArgs, const char *Name)
Definition: Core.cpp:3296
void LLVMSetIsDisjoint(LLVMValueRef Inst, LLVMBool IsDisjoint)
Sets the disjoint flag for the instruction.
Definition: Core.cpp:3665
LLVMValueRef LLVMBuildMul(LLVMBuilderRef, LLVMValueRef LHS, LLVMValueRef RHS, const char *Name)
Definition: Core.cpp:3482
LLVMValueRef LLVMBuildExactSDiv(LLVMBuilderRef, LLVMValueRef LHS, LLVMValueRef RHS, const char *Name)
Definition: Core.cpp:3517
LLVMValueRef LLVMBuildNUWSub(LLVMBuilderRef, LLVMValueRef LHS, LLVMValueRef RHS, const char *Name)
Definition: Core.cpp:3472
LLVMValueRef LLVMBuildMalloc(LLVMBuilderRef, LLVMTypeRef Ty, const char *Name)
Definition: Core.cpp:3672
LLVMValueRef LLVMBuildIsNull(LLVMBuilderRef, LLVMValueRef Val, const char *Name)
Definition: Core.cpp:4146
LLVMValueRef LLVMBuildLandingPad(LLVMBuilderRef B, LLVMTypeRef Ty, LLVMValueRef PersFn, unsigned NumClauses, const char *Name)
Definition: Core.cpp:3284
LLVMValueRef LLVMBuildAggregateRet(LLVMBuilderRef, LLVMValueRef *RetVals, unsigned N)
Definition: Core.cpp:3237
LLVMValueRef LLVMBuildAShr(LLVMBuilderRef, LLVMValueRef LHS, LLVMValueRef RHS, const char *Name)
Definition: Core.cpp:3552
LLVMValueRef LLVMBuildInvoke2(LLVMBuilderRef, LLVMTypeRef Ty, LLVMValueRef Fn, LLVMValueRef *Args, unsigned NumArgs, LLVMBasicBlockRef Then, LLVMBasicBlockRef Catch, const char *Name)
Definition: Core.cpp:3261
LLVMValueRef LLVMBuildCallWithOperandBundles(LLVMBuilderRef, LLVMTypeRef, LLVMValueRef Fn, LLVMValueRef *Args, unsigned NumArgs, LLVMOperandBundleRef *Bundles, unsigned NumBundles, const char *Name)
Definition: Core.cpp:4083
LLVMValueRef LLVMBuildExactUDiv(LLVMBuilderRef, LLVMValueRef LHS, LLVMValueRef RHS, const char *Name)
Definition: Core.cpp:3507
void LLVMSetOrdering(LLVMValueRef MemoryAccessInst, LLVMAtomicOrdering Ordering)
Definition: Core.cpp:3911
void LLVMSetCleanup(LLVMValueRef LandingPad, LLVMBool Val)
Definition: Core.cpp:3370
LLVMValueRef LLVMGetArgOperand(LLVMValueRef Funclet, unsigned i)
Definition: Core.cpp:3399
LLVMValueRef LLVMBuildInsertValue(LLVMBuilderRef, LLVMValueRef AggVal, LLVMValueRef EltVal, unsigned Index, const char *Name)
Definition: Core.cpp:4134
LLVMValueRef LLVMBuildAdd(LLVMBuilderRef, LLVMValueRef LHS, LLVMValueRef RHS, const char *Name)
Definition: Core.cpp:3442
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:3690
LLVMValueRef LLVMBuildBr(LLVMBuilderRef, LLVMBasicBlockRef Dest)
Definition: Core.cpp:3242
LLVMValueRef LLVMBuildNSWMul(LLVMBuilderRef, LLVMValueRef LHS, LLVMValueRef RHS, const char *Name)
Definition: Core.cpp:3487
LLVMValueRef LLVMBuildBinOp(LLVMBuilderRef B, LLVMOpcode Op, LLVMValueRef LHS, LLVMValueRef RHS, const char *Name)
Definition: Core.cpp:3572
LLVMValueRef LLVMBuildSRem(LLVMBuilderRef, LLVMValueRef LHS, LLVMValueRef RHS, const char *Name)
Definition: Core.cpp:3532
void LLVMDisposeBuilder(LLVMBuilderRef Builder)
Definition: Core.cpp:3178
int LLVMGetMaskValue(LLVMValueRef ShuffleVectorInst, unsigned Elt)
Get the mask value at position Elt in the mask of a ShuffleVector instruction.
Definition: Core.cpp:4193
LLVMValueRef LLVMBuildFSub(LLVMBuilderRef, LLVMValueRef LHS, LLVMValueRef RHS, const char *Name)
Definition: Core.cpp:3477
LLVMValueRef LLVMGetClause(LLVMValueRef LandingPad, unsigned Idx)
Definition: Core.cpp:3358
LLVMMetadataRef LLVMGetCurrentDebugLocation2(LLVMBuilderRef Builder)
Get location information used by debugging information.
Definition: Core.cpp:3184
LLVMValueRef LLVMBuildArrayAlloca(LLVMBuilderRef, LLVMTypeRef Ty, LLVMValueRef Val, const char *Name)
Definition: Core.cpp:3720
LLVMValueRef LLVMBuildVAArg(LLVMBuilderRef, LLVMValueRef List, LLVMTypeRef Ty, const char *Name)
Definition: Core.cpp:4104
LLVMBuilderRef LLVMCreateBuilderInContext(LLVMContextRef C)
Definition: Core.cpp:3136
LLVMValueRef LLVMBuildAtomicCmpXchg(LLVMBuilderRef B, LLVMValueRef Ptr, LLVMValueRef Cmp, LLVMValueRef New, LLVMAtomicOrdering SuccessOrdering, LLVMAtomicOrdering FailureOrdering, LLVMBool SingleThread)
Definition: Core.cpp:4174
LLVMValueRef LLVMBuildICmp(LLVMBuilderRef, LLVMIntPredicate Op, LLVMValueRef LHS, LLVMValueRef RHS, const char *Name)
Definition: Core.cpp:4054
LLVMValueRef LLVMBuildPointerCast(LLVMBuilderRef, LLVMValueRef Val, LLVMTypeRef DestTy, const char *Name)
Definition: Core.cpp:4023
LLVMValueRef LLVMGetParentCatchSwitch(LLVMValueRef CatchPad)
Get the parent catchswitch instruction of a catchpad instruction.
Definition: Core.cpp:3388
void LLVMSetAtomicSingleThread(LLVMValueRef AtomicInst, LLVMBool SingleThread)
Definition: Core.cpp:4216
LLVMValueRef LLVMBuildCast(LLVMBuilderRef B, LLVMOpcode Op, LLVMValueRef Val, LLVMTypeRef DestTy, const char *Name)
Definition: Core.cpp:4017
LLVMValueRef LLVMBuildTrunc(LLVMBuilderRef, LLVMValueRef Val, LLVMTypeRef DestTy, const char *Name)
Definition: Core.cpp:3934
LLVMValueRef LLVMBuildURem(LLVMBuilderRef, LLVMValueRef LHS, LLVMValueRef RHS, const char *Name)
Definition: Core.cpp:3527
void LLVMSetAtomicRMWBinOp(LLVMValueRef AtomicRMWInst, LLVMAtomicRMWBinOp BinOp)
Definition: Core.cpp:3928
LLVMValueRef LLVMBuildCall2(LLVMBuilderRef, LLVMTypeRef, LLVMValueRef Fn, LLVMValueRef *Args, unsigned NumArgs, const char *Name)
Definition: Core.cpp:4074
void LLVMAddClause(LLVMValueRef LandingPad, LLVMValueRef ClauseVal)
Definition: Core.cpp:3362
LLVMValueRef LLVMBuildOr(LLVMBuilderRef, LLVMValueRef LHS, LLVMValueRef RHS, const char *Name)
Definition: Core.cpp:3562
LLVMBool LLVMGetNUW(LLVMValueRef ArithInst)
Definition: Core.cpp:3604
LLVMValueRef LLVMBuildAddrSpaceCast(LLVMBuilderRef, LLVMValueRef Val, LLVMTypeRef DestTy, const char *Name)
Definition: Core.cpp:3994
LLVMValueRef LLVMBuildFPToUI(LLVMBuilderRef, LLVMValueRef Val, LLVMTypeRef DestTy, const char *Name)
Definition: Core.cpp:3949
void LLVMSetCurrentDebugLocation(LLVMBuilderRef Builder, LLVMValueRef L)
Deprecated: Passing the NULL location will crash.
Definition: Core.cpp:3195
LLVMValueRef LLVMBuildFPToSI(LLVMBuilderRef, LLVMValueRef Val, LLVMTypeRef DestTy, const char *Name)
Definition: Core.cpp:3954
LLVMValueRef LLVMBuildIntCast2(LLVMBuilderRef, LLVMValueRef Val, LLVMTypeRef DestTy, LLVMBool IsSigned, const char *Name)
Definition: Core.cpp:4028
LLVMValueRef LLVMBuildNSWAdd(LLVMBuilderRef, LLVMValueRef LHS, LLVMValueRef RHS, const char *Name)
Definition: Core.cpp:3447
LLVMValueRef LLVMBuildFNeg(LLVMBuilderRef, LLVMValueRef V, const char *Name)
Definition: Core.cpp:3596
LLVMMetadataRef LLVMBuilderGetDefaultFPMathTag(LLVMBuilderRef Builder)
Get the dafult floating-point math metadata for a given builder.
Definition: Core.cpp:3223
LLVMValueRef LLVMBuildUDiv(LLVMBuilderRef, LLVMValueRef LHS, LLVMValueRef RHS, const char *Name)
Definition: Core.cpp:3502
void LLVMSetParentCatchSwitch(LLVMValueRef CatchPad, LLVMValueRef CatchSwitch)
Set the parent catchswitch instruction of a catchpad instruction.
Definition: Core.cpp:3392
LLVMValueRef LLVMBuildCatchRet(LLVMBuilderRef B, LLVMValueRef CatchPad, LLVMBasicBlockRef BB)
Definition: Core.cpp:3329
LLVMValueRef LLVMBuildStructGEP2(LLVMBuilderRef B, LLVMTypeRef Ty, LLVMValueRef Pointer, unsigned Idx, const char *Name)
Definition: Core.cpp:3850
unsigned LLVMGetNumClauses(LLVMValueRef LandingPad)
Definition: Core.cpp:3354
LLVMBool LLVMGetNNeg(LLVMValueRef NonNegInst)
Gets if the instruction has the non-negative flag set.
Definition: Core.cpp:3634
LLVMValueRef LLVMBuildSDiv(LLVMBuilderRef, LLVMValueRef LHS, LLVMValueRef RHS, const char *Name)
Definition: Core.cpp:3512
LLVMValueRef LLVMBuildStore(LLVMBuilderRef, LLVMValueRef Val, LLVMValueRef Ptr)
Definition: Core.cpp:3734
LLVMValueRef LLVMBuildCatchSwitch(LLVMBuilderRef B, LLVMValueRef ParentPad, LLVMBasicBlockRef UnwindBB, unsigned NumHandlers, const char *Name)
Definition: Core.cpp:3318
LLVMValueRef LLVMBuildIntCast(LLVMBuilderRef, LLVMValueRef Val, LLVMTypeRef DestTy, const char *Name)
Deprecated: This cast is always signed.
Definition: Core.cpp:4035
LLVMValueRef LLVMBuildArrayMalloc(LLVMBuilderRef, LLVMTypeRef Ty, LLVMValueRef Val, const char *Name)
Definition: Core.cpp:3681
LLVMValueRef LLVMBuildZExtOrBitCast(LLVMBuilderRef, LLVMValueRef Val, LLVMTypeRef DestTy, const char *Name)
Definition: Core.cpp:3999
LLVMValueRef LLVMBuildInBoundsGEP2(LLVMBuilderRef B, LLVMTypeRef Ty, LLVMValueRef Pointer, LLVMValueRef *Indices, unsigned NumIndices, const char *Name)
Definition: Core.cpp:3842
void LLVMGetHandlers(LLVMValueRef CatchSwitch, LLVMBasicBlockRef *Handlers)
Obtain the basic blocks acting as handlers for a catchswitch instruction.
Definition: Core.cpp:3382
LLVMAtomicOrdering LLVMGetOrdering(LLVMValueRef MemoryAccessInst)
Definition: Core.cpp:3897
LLVMValueRef LLVMBuildUIToFP(LLVMBuilderRef, LLVMValueRef Val, LLVMTypeRef DestTy, const char *Name)
Definition: Core.cpp:3959
LLVMValueRef LLVMBuildIntToPtr(LLVMBuilderRef, LLVMValueRef Val, LLVMTypeRef DestTy, const char *Name)
Definition: Core.cpp:3984
LLVMValueRef LLVMBuildCondBr(LLVMBuilderRef, LLVMValueRef If, LLVMBasicBlockRef Then, LLVMBasicBlockRef Else)
Definition: Core.cpp:3246
LLVMValueRef LLVMBuildIndirectBr(LLVMBuilderRef B, LLVMValueRef Addr, unsigned NumDests)
Definition: Core.cpp:3256
void LLVMAddDestination(LLVMValueRef IndirectBr, LLVMBasicBlockRef Dest)
Definition: Core.cpp:3350
LLVMValueRef LLVMBuildNSWNeg(LLVMBuilderRef B, LLVMValueRef V, const char *Name)
Definition: Core.cpp:3583
LLVMValueRef LLVMBuildXor(LLVMBuilderRef, LLVMValueRef LHS, LLVMValueRef RHS, const char *Name)
Definition: Core.cpp:3567
LLVMValueRef LLVMBuildGlobalString(LLVMBuilderRef B, const char *Str, const char *Name)
Definition: Core.cpp:3857
LLVMBool LLVMGetExact(LLVMValueRef DivOrShrInst)
Definition: Core.cpp:3624
LLVMValueRef LLVMBuildIsNotNull(LLVMBuilderRef, LLVMValueRef Val, const char *Name)
Definition: Core.cpp:4151
void LLVMSetArgOperand(LLVMValueRef Funclet, unsigned i, LLVMValueRef value)
Definition: Core.cpp:3403
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:3697
LLVMValueRef LLVMBuildPtrDiff2(LLVMBuilderRef, LLVMTypeRef ElemTy, LLVMValueRef LHS, LLVMValueRef RHS, const char *Name)
Definition: Core.cpp:4156
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:3207
void LLVMAddMetadataToInst(LLVMBuilderRef Builder, LLVMValueRef Inst)
Adds the metadata registered with the given builder to the given instruction.
Definition: Core.cpp:3211
LLVMValueRef LLVMBuildSub(LLVMBuilderRef, LLVMValueRef LHS, LLVMValueRef RHS, const char *Name)
Definition: Core.cpp:3462
LLVMValueRef LLVMBuildNUWAdd(LLVMBuilderRef, LLVMValueRef LHS, LLVMValueRef RHS, const char *Name)
Definition: Core.cpp:3452
LLVMValueRef LLVMBuildUnreachable(LLVMBuilderRef)
Definition: Core.cpp:3341
LLVMValueRef LLVMBuildShuffleVector(LLVMBuilderRef, LLVMValueRef V1, LLVMValueRef V2, LLVMValueRef Mask, const char *Name)
Definition: Core.cpp:4122
void LLVMSetVolatile(LLVMValueRef MemoryAccessInst, LLVMBool IsVolatile)
Definition: Core.cpp:3878
LLVMValueRef LLVMBuildFree(LLVMBuilderRef, LLVMValueRef PointerVal)
Definition: Core.cpp:3725
LLVMValueRef LLVMBuildGEP2(LLVMBuilderRef B, LLVMTypeRef Ty, LLVMValueRef Pointer, LLVMValueRef *Indices, unsigned NumIndices, const char *Name)
Definition: Core.cpp:3835
unsigned LLVMGetNumHandlers(LLVMValueRef CatchSwitch)
Definition: Core.cpp:3378
LLVMValueRef LLVMBuildFPCast(LLVMBuilderRef, LLVMValueRef Val, LLVMTypeRef DestTy, const char *Name)
Definition: Core.cpp:4041
LLVMBuilderRef LLVMCreateBuilder(void)
Definition: Core.cpp:3140
void LLVMSetCmpXchgSuccessOrdering(LLVMValueRef CmpXchgInst, LLVMAtomicOrdering Ordering)
Definition: Core.cpp:4236
LLVMValueRef LLVMBuildPhi(LLVMBuilderRef, LLVMTypeRef Ty, const char *Name)
Definition: Core.cpp:4070
LLVMBool LLVMCanValueUseFastMathFlags(LLVMValueRef Inst)
Check if a given value can potentially have fast math flags.
Definition: Core.cpp:3655
void LLVMAddCase(LLVMValueRef Switch, LLVMValueRef OnVal, LLVMBasicBlockRef Dest)
Definition: Core.cpp:3345
LLVMBool LLVMIsAtomicSingleThread(LLVMValueRef AtomicInst)
Definition: Core.cpp:4201
LLVMValueRef LLVMBuildResume(LLVMBuilderRef B, LLVMValueRef Exn)
Definition: Core.cpp:3314
LLVMValueRef LLVMBuildSwitch(LLVMBuilderRef, LLVMValueRef V, LLVMBasicBlockRef Else, unsigned NumCases)
Definition: Core.cpp:3251
void LLVMInsertIntoBuilder(LLVMBuilderRef Builder, LLVMValueRef Instr)
Definition: Core.cpp:3169
LLVMValueRef LLVMBuildPtrToInt(LLVMBuilderRef, LLVMValueRef Val, LLVMTypeRef DestTy, const char *Name)
Definition: Core.cpp:3979
LLVMBool LLVMIsCleanup(LLVMValueRef LandingPad)
Definition: Core.cpp:3366
LLVMBool LLVMGetNSW(LLVMValueRef ArithInst)
Definition: Core.cpp:3614
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:3706
LLVMValueRef LLVMBuildLShr(LLVMBuilderRef, LLVMValueRef LHS, LLVMValueRef RHS, const char *Name)
Definition: Core.cpp:3547
unsigned LLVMGetNumMaskElements(LLVMValueRef ShuffleVectorInst)
Get the number of elements in the mask of a ShuffleVector instruction.
Definition: Core.cpp:4187
LLVMValueRef LLVMBuildRetVoid(LLVMBuilderRef)
Definition: Core.cpp:3229
LLVMValueRef LLVMBuildRet(LLVMBuilderRef, LLVMValueRef V)
Definition: Core.cpp:3233
void LLVMAddHandler(LLVMValueRef CatchSwitch, LLVMBasicBlockRef Dest)
Definition: Core.cpp:3374
LLVMValueRef LLVMBuildExtractElement(LLVMBuilderRef, LLVMValueRef VecVal, LLVMValueRef Index, const char *Name)
Definition: Core.cpp:4109
void LLVMPositionBuilderBefore(LLVMBuilderRef Builder, LLVMValueRef Instr)
Definition: Core.cpp:3151
LLVMValueRef LLVMGetCurrentDebugLocation(LLVMBuilderRef Builder)
Deprecated: Returning the NULL location will crash.
Definition: Core.cpp:3201
LLVMAtomicOrdering LLVMGetCmpXchgSuccessOrdering(LLVMValueRef CmpXchgInst)
Definition: Core.cpp:4231
void LLVMSetNNeg(LLVMValueRef NonNegInst, LLVMBool IsNonNeg)
Sets the non-negative flag for the instruction.
Definition: Core.cpp:3639
void LLVMSetExact(LLVMValueRef DivOrShrInst, LLVMBool IsExact)
Definition: Core.cpp:3629
LLVMBasicBlockRef LLVMGetInsertBlock(LLVMBuilderRef Builder)
Definition: Core.cpp:3161
LLVMValueRef LLVMBuildCleanupPad(LLVMBuilderRef B, LLVMValueRef ParentPad, LLVMValueRef *Args, unsigned NumArgs, const char *Name)
Definition: Core.cpp:3303
void LLVMInsertIntoBuilderWithName(LLVMBuilderRef Builder, LLVMValueRef Instr, const char *Name)
Definition: Core.cpp:3173
void LLVMSetFastMathFlags(LLVMValueRef FPMathInst, LLVMFastMathFlags FMF)
Sets the flags for which fast-math-style optimizations are allowed for this value.
Definition: Core.cpp:3650
LLVMFastMathFlags LLVMGetFastMathFlags(LLVMValueRef FPMathInst)
Get the flags for which fast-math-style optimizations are allowed for this value.
Definition: Core.cpp:3644
LLVMValueRef LLVMBuildNeg(LLVMBuilderRef, LLVMValueRef V, const char *Name)
Definition: Core.cpp:3579
LLVMBool LLVMGetVolatile(LLVMValueRef MemoryAccessInst)
Definition: Core.cpp:3867
LLVMValueRef LLVMBuildNUWMul(LLVMBuilderRef, LLVMValueRef LHS, LLVMValueRef RHS, const char *Name)
Definition: Core.cpp:3492
void LLVMPositionBuilder(LLVMBuilderRef Builder, LLVMBasicBlockRef Block, LLVMValueRef Instr)
Definition: Core.cpp:3144
void LLVMPositionBuilderAtEnd(LLVMBuilderRef Builder, LLVMBasicBlockRef Block)
Definition: Core.cpp:3156
LLVMValueRef LLVMBuildInsertElement(LLVMBuilderRef, LLVMValueRef VecVal, LLVMValueRef EltVal, LLVMValueRef Index, const char *Name)
Definition: Core.cpp:4115
LLVMValueRef LLVMBuildCleanupRet(LLVMBuilderRef B, LLVMValueRef CatchPad, LLVMBasicBlockRef BB)
Definition: Core.cpp:3335
void LLVMDisposeMemoryBuffer(LLVMMemoryBufferRef MemBuf)
Definition: Core.cpp:4325
size_t LLVMGetBufferSize(LLVMMemoryBufferRef MemBuf)
Definition: Core.cpp:4321
LLVMBool LLVMCreateMemoryBufferWithSTDIN(LLVMMemoryBufferRef *OutMemBuf, char **OutMessage)
Definition: Core.cpp:4285
LLVMMemoryBufferRef LLVMCreateMemoryBufferWithMemoryRange(const char *InputData, size_t InputDataLength, const char *BufferName, LLVMBool RequiresNullTerminator)
Definition: Core.cpp:4296
LLVMBool LLVMCreateMemoryBufferWithContentsOfFile(const char *Path, LLVMMemoryBufferRef *OutMemBuf, char **OutMessage)
Definition: Core.cpp:4271
const char * LLVMGetBufferStart(LLVMMemoryBufferRef MemBuf)
Definition: Core.cpp:4317
LLVMMemoryBufferRef LLVMCreateMemoryBufferWithMemoryRangeCopy(const char *InputData, size_t InputDataLength, const char *BufferName)
Definition: Core.cpp:4307
LLVMModuleProviderRef LLVMCreateModuleProviderForExistingModule(LLVMModuleRef M)
Changes the type of M so it can be passed to FunctionPassManagers and the JIT.
Definition: Core.cpp:4260
void LLVMDisposeModuleProvider(LLVMModuleProviderRef M)
Destroys the module M.
Definition: Core.cpp:4264
const char * LLVMGetModuleIdentifier(LLVMModuleRef M, size_t *Len)
Obtain the identifier of a module.
Definition: Core.cpp:278
void LLVMSetDataLayout(LLVMModuleRef M, const char *DataLayoutStr)
Set the data layout for a module.
Definition: Core.cpp:307
LLVMValueRef LLVMAddFunction(LLVMModuleRef M, const char *Name, LLVMTypeRef FunctionTy)
Add a function to a module under a specified name.
Definition: Core.cpp:2310
LLVMBool LLVMIsNewDbgInfoFormat(LLVMModuleRef M)
Soon to be deprecated.
Definition: Core.cpp:423
LLVMNamedMDNodeRef LLVMGetPreviousNamedMetadata(LLVMNamedMDNodeRef NamedMDNode)
Decrement a NamedMDNode iterator to the previous NamedMDNode.
Definition: Core.cpp:1338
LLVMTypeRef LLVMGetTypeByName(LLVMModuleRef M, const char *Name)
Deprecated: Use LLVMGetTypeByName2 instead.
Definition: Core.cpp:846
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:294
void LLVMDumpModule(LLVMModuleRef M)
Dump a representation of a module to stderr.
Definition: Core.cpp:433
void LLVMAppendModuleInlineAsm(LLVMModuleRef M, const char *Asm, size_t Len)
Append inline assembly to a module.
Definition: Core.cpp:479
LLVMValueRef LLVMGetFirstFunction(LLVMModuleRef M)
Obtain an iterator to the first Function in a Module.
Definition: Core.cpp:2320
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:1433
LLVMBool LLVMPrintModuleToFile(LLVMModuleRef M, const char *Filename, char **ErrorMessage)
Print a representation of a module to a file.
Definition: Core.cpp:438
void LLVMDisposeModule(LLVMModuleRef M)
Destroy a module instance.
Definition: Core.cpp:274
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:489
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:1409
const char * LLVMGetModuleInlineAsm(LLVMModuleRef M, size_t *Len)
Get inline assembly for a module.
Definition: Core.cpp:483
const char * LLVMGetSourceFileName(LLVMModuleRef M, size_t *Len)
Obtain the module's original source file name.
Definition: Core.cpp:288
const char * LLVMGetNamedMetadataName(LLVMNamedMDNodeRef NamedMD, size_t *NameLen)
Retrieve the name of a NamedMDNode.
Definition: Core.cpp:1356
LLVMContextRef LLVMGetModuleContext(LLVMModuleRef M)
Obtain the context to which this module is associated.
Definition: Core.cpp:565
const char * LLVMGetInlineAsmConstraintString(LLVMValueRef InlineAsmVal, size_t *Len)
Get the raw constraint string for an inline assembly snippet.
Definition: Core.cpp:518
LLVMModuleRef LLVMModuleCreateWithNameInContext(const char *ModuleID, LLVMContextRef C)
Create a new, empty module in a specific context.
Definition: Core.cpp:269
LLVMMetadataRef LLVMModuleFlagEntriesGetMetadata(LLVMModuleFlagEntry *Entries, unsigned Index)
Returns the metadata for a module flag entry at a specific index.
Definition: Core.cpp:404
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:396
LLVMValueRef LLVMGetLastFunction(LLVMModuleRef M)
Obtain an iterator to the last Function in a Module.
Definition: Core.cpp:2328
void LLVMSetTarget(LLVMModuleRef M, const char *Triple)
Set the target triple for a module.
Definition: Core.cpp:316
const char * LLVMGetDataLayoutStr(LLVMModuleRef M)
Obtain the data layout for a module.
Definition: Core.cpp:299
const char * LLVMGetInlineAsmAsmString(LLVMValueRef InlineAsmVal, size_t *Len)
Get the template string used for an inline assembly snippet.
Definition: Core.cpp:509
LLVMModuleFlagBehavior LLVMModuleFlagEntriesGetFlagBehavior(LLVMModuleFlagEntry *Entries, unsigned Index)
Returns the flag behavior for a module flag entry at a specific index.
Definition: Core.cpp:389
unsigned LLVMGetDebugLocColumn(LLVMValueRef Val)
Return the column number of the debug location for this value, which must be an llvm::Instruction.
Definition: Core.cpp:1479
unsigned LLVMGetDebugLocLine(LLVMValueRef Val)
Return the line number of the debug location for this value, which must be an llvm::Instruction,...
Definition: Core.cpp:1457
LLVMBool LLVMGetInlineAsmNeedsAlignedStack(LLVMValueRef InlineAsmVal)
Get if the inline asm snippet needs an aligned stack.
Definition: Core.cpp:554
LLVMModuleRef LLVMModuleCreateWithName(const char *ModuleID)
Create a new, empty module in the global context.
Definition: Core.cpp:265
LLVMModuleFlagEntry * LLVMCopyModuleFlagsMetadata(LLVMModuleRef M, size_t *Len)
Returns the module flags as an array of flag-key-value triples.
Definition: Core.cpp:367
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:416
void LLVMSetModuleInlineAsm(LLVMModuleRef M, const char *Asm)
Deprecated: Use LLVMSetModuleInlineAsm2 instead.
Definition: Core.cpp:475
LLVMBool LLVMGetInlineAsmHasSideEffects(LLVMValueRef InlineAsmVal)
Get if the inline asm snippet has side effects.
Definition: Core.cpp:549
void LLVMDisposeModuleFlagsMetadata(LLVMModuleFlagEntry *Entries)
Destroys module flags metadata entries.
Definition: Core.cpp:384
LLVMInlineAsmDialect LLVMGetInlineAsmDialect(LLVMValueRef InlineAsmVal)
Get the dialect used by the inline asm snippet.
Definition: Core.cpp:528
unsigned LLVMGetNamedMetadataNumOperands(LLVMModuleRef M, const char *Name)
Obtain the number of operands for named metadata in a module.
Definition: Core.cpp:1382
const char * LLVMGetTarget(LLVMModuleRef M)
Obtain the target triple for a module.
Definition: Core.cpp:312
LLVMNamedMDNodeRef LLVMGetNextNamedMetadata(LLVMNamedMDNodeRef NamedMDNode)
Advance a NamedMDNode iterator to the next NamedMDNode.
Definition: Core.cpp:1330
void LLVMSetModuleInlineAsm2(LLVMModuleRef M, const char *Asm, size_t Len)
Set inline assembly for a module.
Definition: Core.cpp:471
LLVMNamedMDNodeRef LLVMGetLastNamedMetadata(LLVMModuleRef M)
Obtain an iterator to the last NamedMDNode in a Module.
Definition: Core.cpp:1322
LLVMBool LLVMGetInlineAsmCanUnwind(LLVMValueRef InlineAsmVal)
Get if the inline asm snippet may unwind the stack.
Definition: Core.cpp:559
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:411
LLVMModuleRef LLVMCloneModule(LLVMModuleRef M)
Return an exact copy of the specified module.
const char * LLVMGetDataLayout(LLVMModuleRef M)
Definition: Core.cpp:303
LLVMValueRef LLVMGetNamedFunction(LLVMModuleRef M, const char *Name)
Obtain a Function value from a Module by its name.
Definition: Core.cpp:2316
void LLVMSetIsNewDbgInfoFormat(LLVMModuleRef M, LLVMBool UseNewFormat)
Soon to be deprecated.
Definition: Core.cpp:427
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:1346
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:1351
LLVMValueRef LLVMGetPreviousFunction(LLVMValueRef Fn)
Decrement a Function iterator to the previous Function.
Definition: Core.cpp:2344
char * LLVMPrintModuleToString(LLVMModuleRef M)
Return a string representation of the module.
Definition: Core.cpp:460
void LLVMGetNamedMetadataOperands(LLVMModuleRef M, const char *Name, LLVMValueRef *Dest)
Obtain the named metadata operands for a module.
Definition: Core.cpp:1389
LLVMValueRef LLVMGetNextFunction(LLVMValueRef Fn)
Advance a Function iterator to the next Function.
Definition: Core.cpp:2336
LLVMTypeRef LLVMGetInlineAsmFunctionType(LLVMValueRef InlineAsmVal)
Get the function type of the inline assembly snippet.
Definition: Core.cpp:544
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:284
void LLVMAddNamedMetadataOperand(LLVMModuleRef M, const char *Name, LLVMValueRef Val)
Add an operand to named metadata.
Definition: Core.cpp:1399
LLVMNamedMDNodeRef LLVMGetFirstNamedMetadata(LLVMModuleRef M)
Obtain an iterator to the first NamedMDNode in a Module.
Definition: Core.cpp:1314
LLVMValueRef LLVMGetOperandBundleArgAtIndex(LLVMOperandBundleRef Bundle, unsigned Index)
Obtain the operand for an operand bundle at the given index.
Definition: Core.cpp:2682
unsigned LLVMGetNumOperandBundleArgs(LLVMOperandBundleRef Bundle)
Obtain the number of operands for an operand bundle.
Definition: Core.cpp:2678
LLVMOperandBundleRef LLVMCreateOperandBundle(const char *Tag, size_t TagLen, LLVMValueRef *Args, unsigned NumArgs)
Create a new operand bundle.
Definition: Core.cpp:2661
void LLVMDisposeOperandBundle(LLVMOperandBundleRef Bundle)
Destroy an operand bundle.
Definition: Core.cpp:2668
const char * LLVMGetOperandBundleTag(LLVMOperandBundleRef Bundle, size_t *Len)
Obtain the tag of an operand bundle as a string.
Definition: Core.cpp:2672
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:4344
LLVMPassManagerRef LLVMCreateFunctionPassManager(LLVMModuleProviderRef MP)
Deprecated: Use LLVMCreateFunctionPassManagerForModule instead.
Definition: Core.cpp:4339
LLVMPassManagerRef LLVMCreatePassManager(void)
Constructs a new whole-module pass pipeline.
Definition: Core.cpp:4331
void LLVMDisposePassManager(LLVMPassManagerRef PM)
Frees the memory of a pass pipeline.
Definition: Core.cpp:4360
LLVMBool LLVMFinalizeFunctionPassManager(LLVMPassManagerRef FPM)
Finalizes all of the function passes scheduled in the function pass manager.
Definition: Core.cpp:4356
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:4352
LLVMBool LLVMInitializeFunctionPassManager(LLVMPassManagerRef FPM)
Initializes all of the function passes scheduled in the function pass manager.
Definition: Core.cpp:4348
LLVMPassManagerRef LLVMCreateFunctionPassManagerForModule(LLVMModuleRef M)
Constructs a new function-by-function pass pipeline over the module provider.
Definition: Core.cpp:4335
LLVMBool LLVMIsMultithreaded(void)
Check whether LLVM is executing in thread-safe mode or not.
Definition: Core.cpp:4373
LLVMBool LLVMStartMultithreaded(void)
Deprecated: Multi-threading can only be enabled/disabled with the compile time define LLVM_ENABLE_THR...
Definition: Core.cpp:4366
void LLVMStopMultithreaded(void)
Deprecated: Multi-threading can only be enabled/disabled with the compile time define LLVM_ENABLE_THR...
Definition: Core.cpp:4370
LLVMTypeRef LLVMFP128Type(void)
Definition: Core.cpp:746
LLVMTypeRef LLVMFP128TypeInContext(LLVMContextRef C)
Obtain a 128-bit floating point type (112-bit mantissa) from a context.
Definition: Core.cpp:718
LLVMTypeRef LLVMDoubleTypeInContext(LLVMContextRef C)
Obtain a 64-bit floating point type from a context.
Definition: Core.cpp:712
LLVMTypeRef LLVMX86FP80TypeInContext(LLVMContextRef C)
Obtain a 80-bit floating point type (X87) from a context.
Definition: Core.cpp:715
LLVMTypeRef LLVMHalfTypeInContext(LLVMContextRef C)
Obtain a 16-bit floating point type from a context.
Definition: Core.cpp:703
LLVMTypeRef LLVMBFloatTypeInContext(LLVMContextRef C)
Obtain a 16-bit brain floating point type from a context.
Definition: Core.cpp:706
LLVMTypeRef LLVMBFloatType(void)
Definition: Core.cpp:734
LLVMTypeRef LLVMFloatTypeInContext(LLVMContextRef C)
Obtain a 32-bit floating point type from a context.
Definition: Core.cpp:709
LLVMTypeRef LLVMHalfType(void)
Obtain a floating point type from the global context.
Definition: Core.cpp:731
LLVMTypeRef LLVMX86FP80Type(void)
Definition: Core.cpp:743
LLVMTypeRef LLVMPPCFP128Type(void)
Definition: Core.cpp:749
LLVMTypeRef LLVMFloatType(void)
Definition: Core.cpp:737
LLVMTypeRef LLVMDoubleType(void)
Definition: Core.cpp:740
LLVMTypeRef LLVMPPCFP128TypeInContext(LLVMContextRef C)
Obtain a 128-bit floating point type (two 64-bits) from a context.
Definition: Core.cpp:721
LLVMBool LLVMIsFunctionVarArg(LLVMTypeRef FunctionTy)
Returns whether a function type is variadic.
Definition: Core.cpp:768
unsigned LLVMCountParamTypes(LLVMTypeRef FunctionTy)
Obtain the number of parameters this function accepts.
Definition: Core.cpp:776
void LLVMGetParamTypes(LLVMTypeRef FunctionTy, LLVMTypeRef *Dest)
Obtain the types of a function's parameters.
Definition: Core.cpp:780
LLVMTypeRef LLVMFunctionType(LLVMTypeRef ReturnType, LLVMTypeRef *ParamTypes, unsigned ParamCount, LLVMBool IsVarArg)
Obtain a function type consisting of a specified signature.
Definition: Core.cpp:761
LLVMTypeRef LLVMGetReturnType(LLVMTypeRef FunctionTy)
Obtain the Type this function Type returns.
Definition: Core.cpp:772
LLVMTypeRef LLVMInt64Type(void)
Definition: Core.cpp:687
LLVMTypeRef LLVMInt64TypeInContext(LLVMContextRef C)
Definition: Core.cpp:665
LLVMTypeRef LLVMInt16TypeInContext(LLVMContextRef C)
Definition: Core.cpp:659
LLVMTypeRef LLVMIntTypeInContext(LLVMContextRef C, unsigned NumBits)
Definition: Core.cpp:671
LLVMTypeRef LLVMInt1TypeInContext(LLVMContextRef C)
Obtain an integer type from a context with specified bit width.
Definition: Core.cpp:653
LLVMTypeRef LLVMInt32Type(void)
Definition: Core.cpp:684
LLVMTypeRef LLVMInt32TypeInContext(LLVMContextRef C)
Definition: Core.cpp:662
LLVMTypeRef LLVMInt128TypeInContext(LLVMContextRef C)
Definition: Core.cpp:668
LLVMTypeRef LLVMIntType(unsigned NumBits)
Definition: Core.cpp:693
LLVMTypeRef LLVMInt8TypeInContext(LLVMContextRef C)
Definition: Core.cpp:656
LLVMTypeRef LLVMInt8Type(void)
Definition: Core.cpp:678
LLVMTypeRef LLVMInt1Type(void)
Obtain an integer type from the global context with a specified bit width.
Definition: Core.cpp:675
LLVMTypeRef LLVMInt128Type(void)
Definition: Core.cpp:690
unsigned LLVMGetIntTypeWidth(LLVMTypeRef IntegerTy)
Definition: Core.cpp:697
LLVMTypeRef LLVMInt16Type(void)
Definition: Core.cpp:681
LLVMTypeRef LLVMX86MMXTypeInContext(LLVMContextRef C)
Create a X86 MMX type in a context.
Definition: Core.cpp:724
LLVMTypeRef LLVMVoidType(void)
These are similar to the above functions except they operate on the global context.
Definition: Core.cpp:935
LLVMTypeRef LLVMX86AMXTypeInContext(LLVMContextRef C)
Create a X86 AMX type in a context.
Definition: Core.cpp:727
LLVMTypeRef LLVMMetadataTypeInContext(LLVMContextRef C)
Create a metadata type in a context.
Definition: Core.cpp:931
LLVMTypeRef LLVMTokenTypeInContext(LLVMContextRef C)
Create a token type in a context.
Definition: Core.cpp:928
LLVMTypeRef LLVMX86AMXType(void)
Definition: Core.cpp:755
LLVMTypeRef LLVMLabelTypeInContext(LLVMContextRef C)
Create a label type in a context.
Definition: Core.cpp:925
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:942
LLVMTypeRef LLVMX86MMXType(void)
Definition: Core.cpp:752
LLVMTypeRef LLVMLabelType(void)
Definition: Core.cpp:938
LLVMTypeRef LLVMVoidTypeInContext(LLVMContextRef C)
Create a void type in a context.
Definition: Core.cpp:922
unsigned LLVMGetArrayLength(LLVMTypeRef ArrayTy)
Obtain the length of an array type.
Definition: Core.cpp:900
LLVMTypeRef LLVMGetElementType(LLVMTypeRef Ty)
Obtain the element type of an array or vector type.
Definition: Core.cpp:889
unsigned LLVMGetPointerAddressSpace(LLVMTypeRef PointerTy)
Obtain the address space of a pointer type.
Definition: Core.cpp:908
uint64_t LLVMGetArrayLength2(LLVMTypeRef ArrayTy)
Obtain the length of an array type.
Definition: Core.cpp:904
LLVMTypeRef LLVMPointerType(LLVMTypeRef ElementType, unsigned AddressSpace)
Create a pointer type that points to a defined type.
Definition: Core.cpp:872
unsigned LLVMGetNumContainedTypes(LLVMTypeRef Tp)
Return the number of types in the derived type.
Definition: Core.cpp:896
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:880
LLVMBool LLVMPointerTypeIsOpaque(LLVMTypeRef Ty)
Determine whether a pointer is opaque.
Definition: Core.cpp:876
LLVMTypeRef LLVMPointerTypeInContext(LLVMContextRef C, unsigned AddressSpace)
Create an opaque pointer type in a context.
Definition: Core.cpp:918
LLVMTypeRef LLVMArrayType(LLVMTypeRef ElementType, unsigned ElementCount)
Create a fixed size array type that refers to a specific type.
Definition: Core.cpp:864
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:884
LLVMTypeRef LLVMArrayType2(LLVMTypeRef ElementType, uint64_t ElementCount)
Create a fixed size array type that refers to a specific type.
Definition: Core.cpp:868
void LLVMGetSubtypes(LLVMTypeRef Tp, LLVMTypeRef *Arr)
Returns type's subtypes.
Definition: Core.cpp:856
unsigned LLVMGetVectorSize(LLVMTypeRef VectorTy)
Obtain the (possibly scalable) number of elements in a vector type.
Definition: Core.cpp:912
void LLVMStructSetBody(LLVMTypeRef StructTy, LLVMTypeRef *ElementTypes, unsigned ElementCount, LLVMBool Packed)
Set the contents of a structure type.
Definition: Core.cpp:813
LLVMBool LLVMIsPackedStruct(LLVMTypeRef StructTy)
Determine whether a structure is packed.
Definition: Core.cpp:834
LLVMTypeRef LLVMStructGetTypeAtIndex(LLVMTypeRef StructTy, unsigned i)
Get the type of the element at a given index in the structure.
Definition: Core.cpp:829
LLVMTypeRef LLVMStructType(LLVMTypeRef *ElementTypes, unsigned ElementCount, LLVMBool Packed)
Create a new structure type in the global context.
Definition: Core.cpp:794
const char * LLVMGetStructName(LLVMTypeRef Ty)
Obtain the name of a structure.
Definition: Core.cpp:805
void LLVMGetStructElementTypes(LLVMTypeRef StructTy, LLVMTypeRef *Dest)
Get the elements within a structure.
Definition: Core.cpp:823
LLVMBool LLVMIsOpaqueStruct(LLVMTypeRef StructTy)
Determine whether a structure is opaque.
Definition: Core.cpp:838
unsigned LLVMCountStructElementTypes(LLVMTypeRef StructTy)
Get the number of elements defined inside the structure.
Definition: Core.cpp:819
LLVMTypeRef LLVMStructCreateNamed(LLVMContextRef C, const char *Name)
Create an empty structure in a context having a specified name.
Definition: Core.cpp:800
LLVMBool LLVMIsLiteralStruct(LLVMTypeRef StructTy)
Determine whether a structure is literal.
Definition: Core.cpp:842
LLVMTypeRef LLVMStructTypeInContext(LLVMContextRef C, LLVMTypeRef *ElementTypes, unsigned ElementCount, LLVMBool Packed)
Create a new structure type in a context.
Definition: Core.cpp:788
LLVMBool LLVMTypeIsSized(LLVMTypeRef Ty)
Whether the type has a known size.
Definition: Core.cpp:624
LLVMTypeKind LLVMGetTypeKind(LLVMTypeRef Ty)
Obtain the enumerated type of a Type instance.
Definition: Core.cpp:574
char * LLVMPrintTypeToString(LLVMTypeRef Val)
Return a string representation of the type.
Definition: Core.cpp:637
void LLVMDumpType(LLVMTypeRef Val)
Dump a representation of a type to stderr.
Definition: Core.cpp:633
LLVMContextRef LLVMGetTypeContext(LLVMTypeRef Ty)
Obtain the context to which this type instance is associated.
Definition: Core.cpp:629
LLVMTailCallKind
Tail call kind for LLVMSetTailCallKind and LLVMGetTailCallKind.
Definition: Core.h:481
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:488
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:485
@ LLVMTailCallKindNone
Definition: Core.h:482
@ LLVMTailCallKindTail
Definition: Core.h:483
@ LLVMTailCallKindMustTail
Definition: Core.h:484
@ 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:2743
void LLVMAppendExistingBasicBlock(LLVMValueRef Fn, LLVMBasicBlockRef BB)
Append the given basic block to the basic block list of the given function.
Definition: Core.cpp:2772
void LLVMDeleteBasicBlock(LLVMBasicBlockRef BB)
Remove a basic block from a function and delete it.
Definition: Core.cpp:2799
LLVMBasicBlockRef LLVMGetFirstBasicBlock(LLVMValueRef Fn)
Obtain the first basic block in a function.
Definition: Core.cpp:2727
LLVMBasicBlockRef LLVMValueAsBasicBlock(LLVMValueRef Val)
Convert an LLVMValueRef to an LLVMBasicBlockRef instance.
Definition: Core.cpp:2697
LLVMBasicBlockRef LLVMCreateBasicBlockInContext(LLVMContextRef C, const char *Name)
Create a new basic block without inserting it into a function.
Definition: Core.cpp:2759
void LLVMRemoveBasicBlockFromParent(LLVMBasicBlockRef BB)
Remove a basic block from a function.
Definition: Core.cpp:2803
void LLVMMoveBasicBlockBefore(LLVMBasicBlockRef BB, LLVMBasicBlockRef MovePos)
Move a basic block to before another one.
Definition: Core.cpp:2807
LLVMValueRef LLVMBasicBlockAsValue(LLVMBasicBlockRef BB)
Convert a basic block instance to a value type.
Definition: Core.cpp:2689
void LLVMInsertExistingBasicBlockAfterInsertBlock(LLVMBuilderRef Builder, LLVMBasicBlockRef BB)
Insert the given basic block after the insertion point of the given builder.
Definition: Core.cpp:2764
void LLVMGetBasicBlocks(LLVMValueRef Fn, LLVMBasicBlockRef *BasicBlocks)
Obtain all of the basic blocks in a function.
Definition: Core.cpp:2717
LLVMBasicBlockRef LLVMAppendBasicBlock(LLVMValueRef Fn, const char *Name)
Append a basic block to the end of a function using the global context.
Definition: Core.cpp:2783
LLVMValueRef LLVMGetBasicBlockTerminator(LLVMBasicBlockRef BB)
Obtain the terminator instruction for a basic block.
Definition: Core.cpp:2709
unsigned LLVMCountBasicBlocks(LLVMValueRef Fn)
Obtain the number of basic blocks in a function.
Definition: Core.cpp:2713
void LLVMMoveBasicBlockAfter(LLVMBasicBlockRef BB, LLVMBasicBlockRef MovePos)
Move a basic block to after another one.
Definition: Core.cpp:2811
LLVMBasicBlockRef LLVMGetLastBasicBlock(LLVMValueRef Fn)
Obtain the last basic block in a function.
Definition: Core.cpp:2735
LLVMBasicBlockRef LLVMAppendBasicBlockInContext(LLVMContextRef C, LLVMValueRef Fn, const char *Name)
Append a basic block to the end of a function.
Definition: Core.cpp:2777
LLVMValueRef LLVMGetBasicBlockParent(LLVMBasicBlockRef BB)
Obtain the function to which a basic block belongs.
Definition: Core.cpp:2705
LLVMValueRef LLVMGetFirstInstruction(LLVMBasicBlockRef BB)
Obtain the first instruction in a basic block.
Definition: Core.cpp:2821
LLVMValueRef LLVMGetLastInstruction(LLVMBasicBlockRef BB)
Obtain the last instruction in a basic block.
Definition: Core.cpp:2829
LLVMBasicBlockRef LLVMInsertBasicBlockInContext(LLVMContextRef C, LLVMBasicBlockRef BB, const char *Name)
Insert a basic block in a function before another basic block.
Definition: Core.cpp:2787
LLVMBasicBlockRef LLVMInsertBasicBlock(LLVMBasicBlockRef InsertBeforeBB, const char *Name)
Insert a basic block in a function using the global context.
Definition: Core.cpp:2794
LLVMBasicBlockRef LLVMGetEntryBasicBlock(LLVMValueRef Fn)
Obtain the basic block that corresponds to the entry point of a function.
Definition: Core.cpp:2723
LLVMBool LLVMValueIsBasicBlock(LLVMValueRef Val)
Determine whether an LLVMValueRef is itself a basic block.
Definition: Core.cpp:2693
const char * LLVMGetBasicBlockName(LLVMBasicBlockRef BB)
Obtain the string name of a basic block.
Definition: Core.cpp:2701
LLVMBasicBlockRef LLVMGetPreviousBasicBlock(LLVMBasicBlockRef BB)
Go backwards in a basic block iterator.
Definition: Core.cpp:2751
LLVMValueRef LLVMConstStruct(LLVMValueRef *ConstantVals, unsigned Count, LLVMBool Packed)
Create a ConstantStruct in the global Context.
Definition: Core.cpp:1616
LLVMValueRef LLVMConstArray(LLVMTypeRef ElementTy, LLVMValueRef *ConstantVals, unsigned Length)
Create a ConstantArray from values.
Definition: Core.cpp:1596
LLVMValueRef LLVMConstArray2(LLVMTypeRef ElementTy, LLVMValueRef *ConstantVals, uint64_t Length)
Create a ConstantArray from values.
Definition: Core.cpp:1602
LLVMValueRef LLVMConstVector(LLVMValueRef *ScalarConstantVals, unsigned Size)
Create a ConstantVector from values.
Definition: Core.cpp:1631
LLVMValueRef LLVMConstStringInContext(LLVMContextRef C, const char *Str, unsigned Length, LLVMBool DontNullTerminate)
Create a ConstantDataSequential and initialize it with a string.
Definition: Core.cpp:1554
LLVMValueRef LLVMConstNamedStruct(LLVMTypeRef StructTy, LLVMValueRef *ConstantVals, unsigned Count)
Create a non-anonymous ConstantStruct from values.
Definition: Core.cpp:1622
LLVMBool LLVMIsConstantString(LLVMValueRef c)
Returns true if the specified constant is an array of i8.
Definition: Core.cpp:1586
LLVMValueRef LLVMGetAggregateElement(LLVMValueRef C, unsigned Idx)
Get element of a constant aggregate (struct, array or vector) at the specified index.
Definition: Core.cpp:1578
LLVMValueRef LLVMConstString(const char *Str, unsigned Length, LLVMBool DontNullTerminate)
Create a ConstantDataSequential with string content in the global context.
Definition: Core.cpp:1572
const char * LLVMGetAsString(LLVMValueRef c, size_t *Length)
Get the given constant data sequential as a string.
Definition: Core.cpp:1590
LLVMValueRef LLVMConstStringInContext2(LLVMContextRef C, const char *Str, size_t Length, LLVMBool DontNullTerminate)
Create a ConstantDataSequential and initialize it with a string.
Definition: Core.cpp:1563
LLVMValueRef LLVMConstStructInContext(LLVMContextRef C, LLVMValueRef *ConstantVals, unsigned Count, LLVMBool Packed)
Create an anonymous ConstantStruct with the specified values.
Definition: Core.cpp:1608
LLVMValueRef LLVMConstPointerCast(LLVMValueRef ConstantVal, LLVMTypeRef ToType)
Definition: Core.cpp:1813
LLVMValueRef LLVMConstMul(LLVMValueRef LHSConstant, LLVMValueRef RHSConstant)
Definition: Core.cpp:1723
LLVMValueRef LLVMConstTruncOrBitCast(LLVMValueRef ConstantVal, LLVMTypeRef ToType)
Definition: Core.cpp:1807
LLVMValueRef LLVMSizeOf(LLVMTypeRef Ty)
Definition: Core.cpp:1668
LLVMValueRef LLVMConstPtrToInt(LLVMValueRef ConstantVal, LLVMTypeRef ToType)
Definition: Core.cpp:1786
LLVMValueRef LLVMConstNUWSub(LLVMValueRef LHSConstant, LLVMValueRef RHSConstant)
Definition: Core.cpp:1717
LLVMValueRef LLVMConstNUWAdd(LLVMValueRef LHSConstant, LLVMValueRef RHSConstant)
Definition: Core.cpp:1700
LLVMValueRef LLVMConstIntToPtr(LLVMValueRef ConstantVal, LLVMTypeRef ToType)
Definition: Core.cpp:1791
LLVMValueRef LLVMConstTrunc(LLVMValueRef ConstantVal, LLVMTypeRef ToType)
Definition: Core.cpp:1781
LLVMValueRef LLVMConstNot(LLVMValueRef ConstantVal)
Definition: Core.cpp:1685
LLVMValueRef LLVMGetBlockAddressFunction(LLVMValueRef BlockAddr)
Gets the function associated with a given BlockAddress constant value.
Definition: Core.cpp:1855
LLVMValueRef LLVMConstNSWMul(LLVMValueRef LHSConstant, LLVMValueRef RHSConstant)
Definition: Core.cpp:1728
LLVMValueRef LLVMConstExtractElement(LLVMValueRef VectorConstant, LLVMValueRef IndexConstant)
Definition: Core.cpp:1819
LLVMValueRef LLVMConstInsertElement(LLVMValueRef VectorConstant, LLVMValueRef ElementValueConstant, LLVMValueRef IndexConstant)
Definition: Core.cpp:1825
LLVMValueRef LLVMConstInBoundsGEP2(LLVMTypeRef Ty, LLVMValueRef ConstantVal, LLVMValueRef *ConstantIndices, unsigned NumIndices)
Definition: Core.cpp:1772
LLVMValueRef LLVMConstAddrSpaceCast(LLVMValueRef ConstantVal, LLVMTypeRef ToType)
Definition: Core.cpp:1801
LLVMValueRef LLVMConstICmp(LLVMIntPredicate Predicate, LLVMValueRef LHSConstant, LLVMValueRef RHSConstant)
Definition: Core.cpp:1745
LLVMBasicBlockRef LLVMGetBlockAddressBasicBlock(LLVMValueRef BlockAddr)
Gets the basic block associated with a given BlockAddress constant value.
Definition: Core.cpp:1859
LLVMValueRef LLVMConstNSWAdd(LLVMValueRef LHSConstant, LLVMValueRef RHSConstant)
Definition: Core.cpp:1694
LLVMValueRef LLVMAlignOf(LLVMTypeRef Ty)
Definition: Core.cpp:1664
LLVMValueRef LLVMConstInlineAsm(LLVMTypeRef Ty, const char *AsmString, const char *Constraints, LLVMBool HasSideEffects, LLVMBool IsAlignStack)
Deprecated: Use LLVMGetInlineAsm instead.
Definition: Core.cpp:1843
LLVMValueRef LLVMConstXor(LLVMValueRef LHSConstant, LLVMValueRef RHSConstant)
Definition: Core.cpp:1740
LLVMValueRef LLVMConstBitCast(LLVMValueRef ConstantVal, LLVMTypeRef ToType)
Definition: Core.cpp:1796
LLVMValueRef LLVMConstNSWNeg(LLVMValueRef ConstantVal)
Definition: Core.cpp:1676
LLVMValueRef LLVMConstNUWMul(LLVMValueRef LHSConstant, LLVMValueRef RHSConstant)
Definition: Core.cpp:1734
LLVMValueRef LLVMConstShl(LLVMValueRef LHSConstant, LLVMValueRef RHSConstant)
Definition: Core.cpp:1759
LLVMValueRef LLVMConstFCmp(LLVMRealPredicate Predicate, LLVMValueRef LHSConstant, LLVMValueRef RHSConstant)
Definition: Core.cpp:1752
LLVMValueRef LLVMConstGEP2(LLVMTypeRef Ty, LLVMValueRef ConstantVal, LLVMValueRef *ConstantIndices, unsigned NumIndices)
Definition: Core.cpp:1764
LLVMValueRef LLVMConstSub(LLVMValueRef LHSConstant, LLVMValueRef RHSConstant)
Definition: Core.cpp:1706
LLVMValueRef LLVMConstAdd(LLVMValueRef LHSConstant, LLVMValueRef RHSConstant)
Definition: Core.cpp:1689
LLVMValueRef LLVMConstShuffleVector(LLVMValueRef VectorAConstant, LLVMValueRef VectorBConstant, LLVMValueRef MaskConstant)
Definition: Core.cpp:1833
LLVMValueRef LLVMConstNeg(LLVMValueRef ConstantVal)
Definition: Core.cpp:1672
LLVMValueRef LLVMBlockAddress(LLVMValueRef F, LLVMBasicBlockRef BB)
Definition: Core.cpp:1851
LLVMOpcode LLVMGetConstOpcode(LLVMValueRef ConstantVal)
Definition: Core.cpp:1660
LLVMValueRef LLVMConstNSWSub(LLVMValueRef LHSConstant, LLVMValueRef RHSConstant)
Definition: Core.cpp:1711
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:2109
unsigned LLVMValueMetadataEntriesGetKind(LLVMValueMetadataEntry *Entries, unsigned Index)
Returns the kind of a value metadata entry at a specific index.
Definition: Core.cpp:2090
void LLVMDisposeValueMetadataEntries(LLVMValueMetadataEntry *Entries)
Destroys value metadata entries.
Definition: Core.cpp:2105
void LLVMSetVisibility(LLVMValueRef Global, LLVMVisibility Viz)
Definition: Core.cpp:1982
LLVMDLLStorageClass LLVMGetDLLStorageClass(LLVMValueRef Global)
Definition: Core.cpp:1987
void LLVMSetAlignment(LLVMValueRef V, unsigned Bytes)
Set the preferred alignment of the value.
Definition: Core.cpp:2058
LLVMModuleRef LLVMGetGlobalParent(LLVMValueRef Global)
Definition: Core.cpp:1865
const char * LLVMGetSection(LLVMValueRef Global)
Definition: Core.cpp:1967
LLVMTypeRef LLVMGlobalGetValueType(LLVMValueRef Global)
Returns the "value type" of a global value.
Definition: Core.cpp:2032
LLVMBool LLVMIsDeclaration(LLVMValueRef Global)
Definition: Core.cpp:1869
LLVMVisibility LLVMGetVisibility(LLVMValueRef Global)
Definition: Core.cpp:1977
void LLVMSetDLLStorageClass(LLVMValueRef Global, LLVMDLLStorageClass Class)
Definition: Core.cpp:1992
LLVMBool LLVMHasUnnamedAddr(LLVMValueRef Global)
Deprecated: Use LLVMGetUnnamedAddress instead.
Definition: Core.cpp:2022
LLVMLinkage LLVMGetLinkage(LLVMValueRef Global)
Definition: Core.cpp:1873
LLVMUnnamedAddr LLVMGetUnnamedAddress(LLVMValueRef Global)
Definition: Core.cpp:1997
LLVMMetadataRef LLVMValueMetadataEntriesGetMetadata(LLVMValueMetadataEntry *Entries, unsigned Index)
Returns the underlying metadata node of a value metadata entry at a specific index.
Definition: Core.cpp:2098
void LLVMSetUnnamedAddress(LLVMValueRef Global, LLVMUnnamedAddr UnnamedAddr)
Definition: Core.cpp:2009
void LLVMSetLinkage(LLVMValueRef Global, LLVMLinkage Linkage)
Definition: Core.cpp:1902
void LLVMSetUnnamedAddr(LLVMValueRef Global, LLVMBool HasUnnamedAddr)
Deprecated: Use LLVMSetUnnamedAddress instead.
Definition: Core.cpp:2026
void LLVMGlobalClearMetadata(LLVMValueRef Global)
Removes all metadata attachments from this value.
Definition: Core.cpp:2118
unsigned LLVMGetAlignment(LLVMValueRef V)
Obtain the preferred alignment of the value.
Definition: Core.cpp:2038
void LLVMSetSection(LLVMValueRef Global, const char *Section)
Definition: Core.cpp:1973
void LLVMGlobalEraseMetadata(LLVMValueRef Global, unsigned Kind)
Erases a metadata attachment of the given kind if it exists.
Definition: Core.cpp:2114
LLVMValueMetadataEntry * LLVMGlobalCopyAllMetadata(LLVMValueRef Value, size_t *NumEntries)
Retrieves an array of metadata entries representing the metadata attached to this value.
Definition: Core.cpp:2078
LLVMValueRef LLVMConstInt(LLVMTypeRef IntTy, unsigned long long N, LLVMBool SignExtend)
Obtain a constant value for an integer type.
Definition: Core.cpp:1489
LLVMValueRef LLVMConstIntOfArbitraryPrecision(LLVMTypeRef IntTy, unsigned NumWords, const uint64_t Words[])
Obtain a constant value for an integer of arbitrary precision.
Definition: Core.cpp:1494
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:1518
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:1535
long long LLVMConstIntGetSExtValue(LLVMValueRef ConstantVal)
Obtain the sign extended value for an integer constant value.
Definition: Core.cpp:1531
unsigned long long LLVMConstIntGetZExtValue(LLVMValueRef ConstantVal)
Obtain the zero extended value for an integer constant value.
Definition: Core.cpp:1527
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:1514
LLVMBool LLVMIsNull(LLVMValueRef Val)
Determine whether a value instance is null.
Definition: Core.cpp:1212
LLVMValueRef LLVMGetUndef(LLVMTypeRef Ty)
Obtain a constant value referring to an undefined value of a type.
Definition: Core.cpp:1200
LLVMValueRef LLVMGetPoison(LLVMTypeRef Ty)
Obtain a constant value referring to a poison value of a type.
Definition: Core.cpp:1204
LLVMValueRef LLVMConstAllOnes(LLVMTypeRef Ty)
Obtain a constant value referring to the instance of a type consisting of all ones.
Definition: Core.cpp:1196
LLVMValueRef LLVMConstPointerNull(LLVMTypeRef Ty)
Obtain a constant that is a constant pointer pointing to NULL for a specified type.
Definition: Core.cpp:1226
LLVMValueRef LLVMConstNull(LLVMTypeRef Ty)
Obtain a constant value referring to the null instance of a type.
Definition: Core.cpp:1192
unsigned LLVMCountParams(LLVMValueRef Fn)
Obtain the number of parameters in a function.
Definition: Core.cpp:2537
LLVMValueRef LLVMGetPreviousParam(LLVMValueRef Arg)
Obtain the previous parameter to a function.
Definition: Core.cpp:2582
LLVMValueRef LLVMGetNextParam(LLVMValueRef Arg)
Obtain the next parameter to a function.
Definition: Core.cpp:2574
LLVMValueRef LLVMGetParamParent(LLVMValueRef Inst)
Obtain the function to which this argument belongs.
Definition: Core.cpp:2554
LLVMValueRef LLVMGetFirstParam(LLVMValueRef Fn)
Obtain the first parameter to a function.
Definition: Core.cpp:2558
void LLVMSetParamAlignment(LLVMValueRef Arg, unsigned Align)
Set the alignment for a function parameter.
Definition: Core.cpp:2589
LLVMValueRef LLVMGetParam(LLVMValueRef Fn, unsigned Index)
Obtain the parameter at the specified index.
Definition: Core.cpp:2549
LLVMValueRef LLVMGetLastParam(LLVMValueRef Fn)
Obtain the last parameter to a function.
Definition: Core.cpp:2566
void LLVMGetParams(LLVMValueRef Fn, LLVMValueRef *Params)
Obtain the parameters in a function.
Definition: Core.cpp:2543
void LLVMSetGC(LLVMValueRef Fn, const char *Name)
Define the garbage collector to use during code generation.
Definition: Core.cpp:2447
const char * LLVMGetGC(LLVMValueRef Fn)
Obtain the name of the garbage collector to use during code generation.
Definition: Core.cpp:2442
LLVMValueRef LLVMGetPrologueData(LLVMValueRef Fn)
Gets the prologue data associated with a function.
Definition: Core.cpp:2471
void LLVMRemoveEnumAttributeAtIndex(LLVMValueRef F, LLVMAttributeIndex Idx, unsigned KindID)
Definition: Core.cpp:2518
unsigned LLVMGetAttributeCountAtIndex(LLVMValueRef F, LLVMAttributeIndex Idx)
Definition: Core.cpp:2492
LLVMBool LLVMHasPersonalityFn(LLVMValueRef Fn)
Check whether the given function has a personality function.
Definition: Core.cpp:2356
unsigned LLVMLookupIntrinsicID(const char *Name, size_t NameLen)
Obtain the intrinsic ID number which matches the given function name.
Definition: Core.cpp:2424
const char * LLVMIntrinsicGetName(unsigned ID, size_t *NameLength)
Retrieves the name of an intrinsic.
Definition: Core.cpp:2388
unsigned LLVMGetFunctionCallConv(LLVMValueRef Fn)
Obtain the calling function of a function.
Definition: Core.cpp:2433
LLVMValueRef LLVMGetPrefixData(LLVMValueRef Fn)
Gets the prefix data associated with a function.
Definition: Core.cpp:2455
void LLVMRemoveStringAttributeAtIndex(LLVMValueRef F, LLVMAttributeIndex Idx, const char *K, unsigned KLen)
Definition: Core.cpp:2523
void LLVMSetPrefixData(LLVMValueRef Fn, LLVMValueRef prefixData)
Sets the prefix data for the function.
Definition: Core.cpp:2465
LLVMAttributeRef LLVMGetStringAttributeAtIndex(LLVMValueRef F, LLVMAttributeIndex Idx, const char *K, unsigned KLen)
Definition: Core.cpp:2511
LLVMValueRef LLVMGetPersonalityFn(LLVMValueRef Fn)
Obtain the personality function attached to the function.
Definition: Core.cpp:2360
void LLVMSetPersonalityFn(LLVMValueRef Fn, LLVMValueRef PersonalityFn)
Set the personality function attached to the function.
Definition: Core.cpp:2364
LLVMBool LLVMIntrinsicIsOverloaded(unsigned ID)
Obtain if the intrinsic identified by the given ID is overloaded.
Definition: Core.cpp:2428
void LLVMAddAttributeAtIndex(LLVMValueRef F, LLVMAttributeIndex Idx, LLVMAttributeRef A)
Add an attribute to a function.
Definition: Core.cpp:2487
void LLVMDeleteFunction(LLVMValueRef Fn)
Remove a function from its containing module and deletes it.
Definition: Core.cpp:2352
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:2413
void LLVMSetPrologueData(LLVMValueRef Fn, LLVMValueRef prologueData)
Sets the prologue data for the function.
Definition: Core.cpp:2481
const char * LLVMIntrinsicCopyOverloadedName(unsigned ID, LLVMTypeRef *ParamTypes, size_t ParamCount, size_t *NameLength)
Deprecated: Use LLVMIntrinsicCopyOverloadedName2 instead.
Definition: Core.cpp:2402
LLVMBool LLVMHasPrologueData(LLVMValueRef Fn)
Check if a given function has prologue data.
Definition: Core.cpp:2476
LLVMBool LLVMHasPrefixData(LLVMValueRef Fn)
Check if a given function has prefix data.
Definition: Core.cpp:2460
void LLVMGetAttributesAtIndex(LLVMValueRef F, LLVMAttributeIndex Idx, LLVMAttributeRef *Attrs)
Definition: Core.cpp:2497
void LLVMSetFunctionCallConv(LLVMValueRef Fn, unsigned CC)
Set the calling convention of a function.
Definition: Core.cpp:2437
LLVMValueRef LLVMGetIntrinsicDeclaration(LLVMModuleRef Mod, unsigned ID, LLVMTypeRef *ParamTypes, size_t ParamCount)
Create or insert the declaration of an intrinsic.
Definition: Core.cpp:2379
LLVMAttributeRef LLVMGetEnumAttributeAtIndex(LLVMValueRef F, LLVMAttributeIndex Idx, unsigned KindID)
Definition: Core.cpp:2504
void LLVMAddTargetDependentFunctionAttr(LLVMValueRef Fn, const char *A, const char *V)
Add a target-dependent attribute to a function.
Definition: Core.cpp:2528
LLVMTypeRef LLVMIntrinsicGetType(LLVMContextRef Ctx, unsigned ID, LLVMTypeRef *ParamTypes, size_t ParamCount)
Retrieves the type of an intrinsic.
Definition: Core.cpp:2395
unsigned LLVMGetIntrinsicID(LLVMValueRef Fn)
Obtain the ID number from a function instance.
Definition: Core.cpp:2368
LLVMValueKind LLVMGetValueKind(LLVMValueRef Val)
Obtain the enumerated type of a Value instance.
Definition: Core.cpp:961
const char * LLVMGetValueName(LLVMValueRef Val)
Deprecated: Use LLVMGetValueName2 instead.
Definition: Core.cpp:983
LLVMTypeRef LLVMTypeOf(LLVMValueRef Val)
Obtain the type of a value.
Definition: Core.cpp:957
LLVMBool LLVMIsConstant(LLVMValueRef Val)
Determine whether the specified value instance is constant.
Definition: Core.cpp:1208
void LLVMReplaceAllUsesWith(LLVMValueRef OldVal, LLVMValueRef NewVal)
Replace all uses of a value with another one.
Definition: Core.cpp:1023
const char * LLVMGetValueName2(LLVMValueRef Val, size_t *Length)
Obtain the string name of a value.
Definition: Core.cpp:973
char * LLVMPrintDbgRecordToString(LLVMDbgRecordRef Record)
Return a string representation of the DbgRecord.
Definition: Core.cpp:1009
void LLVMSetValueName(LLVMValueRef Val, const char *Name)
Deprecated: Use LLVMSetValueName2 instead.
Definition: Core.cpp:987
#define LLVM_DECLARE_VALUE_CAST(name)
Convert value instances between types.
Definition: Core.h:1926
void LLVMDumpValue(LLVMValueRef Val)
Dump a representation of a value to stderr.
Definition: Core.cpp:991
LLVMBool LLVMIsUndef(LLVMValueRef Val)
Determine whether a value instance is undefined.
Definition: Core.cpp:1218
LLVMValueRef LLVMIsAMDNode(LLVMValueRef Val)
Definition: Core.cpp:1101
LLVMBool LLVMIsPoison(LLVMValueRef Val)
Determine whether a value instance is poisonous.
Definition: Core.cpp:1222
LLVMValueRef LLVMIsAMDString(LLVMValueRef Val)
Definition: Core.cpp:1116
void LLVMSetValueName2(LLVMValueRef Val, const char *Name, size_t NameLen)
Set the string name of a value.
Definition: Core.cpp:979
LLVMValueRef LLVMIsAValueAsMetadata(LLVMValueRef Val)
Definition: Core.cpp:1109
char * LLVMPrintValueToString(LLVMValueRef Val)
Return a string representation of the value.
Definition: Core.cpp:995
void LLVMEraseGlobalIFunc(LLVMValueRef IFunc)
Remove a global indirect function from its parent module and delete it.
Definition: Core.cpp:2651
void LLVMRemoveGlobalIFunc(LLVMValueRef IFunc)
Remove a global indirect function from its parent module.
Definition: Core.cpp:2655
LLVMValueRef LLVMGetNextGlobalIFunc(LLVMValueRef IFunc)
Advance a GlobalIFunc iterator to the next GlobalIFunc.
Definition: Core.cpp:2627
LLVMValueRef LLVMGetNamedGlobalIFunc(LLVMModuleRef M, const char *Name, size_t NameLen)
Obtain a GlobalIFunc value from a Module by its name.
Definition: Core.cpp:2606
LLVMValueRef LLVMGetLastGlobalIFunc(LLVMModuleRef M)
Obtain an iterator to the last GlobalIFunc in a Module.
Definition: Core.cpp:2619
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:2596
void LLVMSetGlobalIFuncResolver(LLVMValueRef IFunc, LLVMValueRef Resolver)
Sets the resolver function associated with this indirect function.
Definition: Core.cpp:2647
LLVMValueRef LLVMGetFirstGlobalIFunc(LLVMModuleRef M)
Obtain an iterator to the first GlobalIFunc in a Module.
Definition: Core.cpp:2611
LLVMValueRef LLVMGetGlobalIFuncResolver(LLVMValueRef IFunc)
Retrieves the resolver function associated with this indirect function, or NULL if it doesn't not exi...
Definition: Core.cpp:2643
LLVMValueRef LLVMGetPreviousGlobalIFunc(LLVMValueRef IFunc)
Decrement a GlobalIFunc iterator to the previous GlobalIFunc.
Definition: Core.cpp:2635
LLVMTypeRef LLVMGetAllocatedType(LLVMValueRef Alloca)
Obtain the type that is being allocated by the alloca instruction.
Definition: Core.cpp:3070
LLVMOperandBundleRef LLVMGetOperandBundleAtIndex(LLVMValueRef C, unsigned Index)
Obtain the operand bundle attached to this instruction at the given index.
Definition: Core.cpp:2982
LLVMValueRef LLVMGetCalledValue(LLVMValueRef Instr)
Obtain the pointer to the function invoked by this instruction.
Definition: Core.cpp:2970
void LLVMGetCallSiteAttributes(LLVMValueRef C, LLVMAttributeIndex Idx, LLVMAttributeRef *Attrs)
Definition: Core.cpp:2938
unsigned LLVMGetNumArgOperands(LLVMValueRef Instr)
Obtain the argument count for a call instruction.
Definition: Core.cpp:2900
void LLVMSetNormalDest(LLVMValueRef InvokeInst, LLVMBasicBlockRef B)
Set the normal destination basic block.
Definition: Core.cpp:3021
unsigned LLVMGetInstructionCallConv(LLVMValueRef Instr)
Obtain the calling convention for a call instruction.
Definition: Core.cpp:2909
LLVMTypeRef LLVMGetCalledFunctionType(LLVMValueRef C)
Obtain the function type called by this instruction.
Definition: Core.cpp:2974
unsigned LLVMGetCallSiteAttributeCount(LLVMValueRef C, LLVMAttributeIndex Idx)
Definition: Core.cpp:2931
void LLVMAddCallSiteAttribute(LLVMValueRef C, LLVMAttributeIndex Idx, LLVMAttributeRef A)
Definition: Core.cpp:2926
unsigned LLVMGetNumOperandBundles(LLVMValueRef C)
Obtain the number of operand bundles attached to this instruction.
Definition: Core.cpp:2978
void LLVMSetInstructionCallConv(LLVMValueRef Instr, unsigned CC)
Set the calling convention for a call instruction.
Definition: Core.cpp:2913
LLVMAttributeRef LLVMGetCallSiteEnumAttribute(LLVMValueRef C, LLVMAttributeIndex Idx, unsigned KindID)
Definition: Core.cpp:2946
LLVMBasicBlockRef LLVMGetNormalDest(LLVMValueRef InvokeInst)
Return the normal destination basic block.
Definition: Core.cpp:3008
void LLVMRemoveCallSiteEnumAttribute(LLVMValueRef C, LLVMAttributeIndex Idx, unsigned KindID)
Definition: Core.cpp:2960
void LLVMSetUnwindDest(LLVMValueRef InvokeInst, LLVMBasicBlockRef B)
Set the unwind destination basic block.
Definition: Core.cpp:3025
void LLVMSetTailCall(LLVMValueRef CallInst, LLVMBool IsTailCall)
Set whether a call instruction is a tail call.
Definition: Core.cpp:2994
LLVMBool LLVMIsTailCall(LLVMValueRef CallInst)
Obtain whether a call instruction is a tail call.
Definition: Core.cpp:2990
void LLVMSetInstrParamAlignment(LLVMValueRef Instr, LLVMAttributeIndex Idx, unsigned Align)
Definition: Core.cpp:2918
void LLVMRemoveCallSiteStringAttribute(LLVMValueRef C, LLVMAttributeIndex Idx, const char *K, unsigned KLen)
Definition: Core.cpp:2965
LLVMTailCallKind LLVMGetTailCallKind(LLVMValueRef CallInst)
Obtain a tail call kind of the call instruction.
Definition: Core.cpp:2998
void LLVMSetTailCallKind(LLVMValueRef CallInst, LLVMTailCallKind kind)
Set the call kind of the call instruction.
Definition: Core.cpp:3002
LLVMAttributeRef LLVMGetCallSiteStringAttribute(LLVMValueRef C, LLVMAttributeIndex Idx, const char *K, unsigned KLen)
Definition: Core.cpp:2953
LLVMBasicBlockRef LLVMGetUnwindDest(LLVMValueRef InvokeInst)
Return the unwind destination basic block.
Definition: Core.cpp:3012
LLVMTypeRef LLVMGetGEPSourceElementType(LLVMValueRef GEP)
Get the source element type of the given GEP operator.
Definition: Core.cpp:3084
LLVMBool LLVMIsInBounds(LLVMValueRef GEP)
Check whether the given GEP operator is inbounds.
Definition: Core.cpp:3076
void LLVMSetIsInBounds(LLVMValueRef GEP, LLVMBool InBounds)
Set the given GEP instruction to be inbounds or not.
Definition: Core.cpp:3080
const unsigned * LLVMGetIndices(LLVMValueRef Inst)
Obtain the indices as an array.
Definition: Core.cpp:3123
unsigned LLVMGetNumIndices(LLVMValueRef Inst)
Obtain the number of indices.
Definition: Core.cpp:3111
void LLVMAddIncoming(LLVMValueRef PhiNode, LLVMValueRef *IncomingValues, LLVMBasicBlockRef *IncomingBlocks, unsigned Count)
Add an incoming value to the end of a PHI list.
Definition: Core.cpp:3090
LLVMValueRef LLVMGetIncomingValue(LLVMValueRef PhiNode, unsigned Index)
Obtain an incoming value to a PHI node as an LLVMValueRef.
Definition: Core.cpp:3101
unsigned LLVMCountIncoming(LLVMValueRef PhiNode)
Obtain the number of incoming basic blocks to a PHI node.
Definition: Core.cpp:3097
LLVMBasicBlockRef LLVMGetIncomingBlock(LLVMValueRef PhiNode, unsigned Index)
Obtain an incoming value to a PHI node as an LLVMBasicBlockRef.
Definition: Core.cpp:3105
unsigned LLVMGetNumSuccessors(LLVMValueRef Term)
Return the number of successors that this terminator has.
Definition: Core.cpp:3036
LLVMBasicBlockRef LLVMGetSwitchDefaultDest(LLVMValueRef SwitchInstr)
Obtain the default destination basic block of a switch instruction.
Definition: Core.cpp:3064
void LLVMSetSuccessor(LLVMValueRef Term, unsigned i, LLVMBasicBlockRef block)
Update the specified successor to point at the provided block.
Definition: Core.cpp:3044
void LLVMSetCondition(LLVMValueRef Branch, LLVMValueRef Cond)
Set the condition of a branch instruction.
Definition: Core.cpp:3058
LLVMValueRef LLVMGetCondition(LLVMValueRef Branch)
Return the condition of a branch instruction.
Definition: Core.cpp:3054
LLVMBool LLVMIsConditional(LLVMValueRef Branch)
Return if a branch is conditional.
Definition: Core.cpp:3050
LLVMBasicBlockRef LLVMGetSuccessor(LLVMValueRef Term, unsigned i)
Return the specified successor.
Definition: Core.cpp:3040
LLVMValueRef LLVMInstructionClone(LLVMValueRef Inst)
Create a copy of 'this' instruction that is identical in all ways except the following:
Definition: Core.cpp:2889
LLVMValueRef LLVMGetNextInstruction(LLVMValueRef Inst)
Obtain the instruction that occurs after the one specified.
Definition: Core.cpp:2837
void LLVMDeleteInstruction(LLVMValueRef Inst)
Delete an instruction.
Definition: Core.cpp:2861
LLVMValueRef LLVMIsATerminatorInst(LLVMValueRef Inst)
Determine whether an instruction is a terminator.
Definition: Core.cpp:2895
LLVMOpcode LLVMGetInstructionOpcode(LLVMValueRef Inst)
Obtain the code opcode for an individual instruction.
Definition: Core.cpp:2883
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:1084
LLVMRealPredicate LLVMGetFCmpPredicate(LLVMValueRef Inst)
Obtain the float predicate of an instruction.
Definition: Core.cpp:2874
int LLVMHasMetadata(LLVMValueRef Val)
Determine whether an instruction has any metadata attached.
Definition: Core.cpp:1027
void LLVMInstructionEraseFromParent(LLVMValueRef Inst)
Remove and delete an instruction.
Definition: Core.cpp:2857
void LLVMInstructionRemoveFromParent(LLVMValueRef Inst)
Remove an instruction.
Definition: Core.cpp:2853
LLVMValueRef LLVMGetMetadata(LLVMValueRef Val, unsigned KindID)
Return metadata associated with an instruction value.
Definition: Core.cpp:1031
LLVMIntPredicate LLVMGetICmpPredicate(LLVMValueRef Inst)
Obtain the predicate of an instruction.
Definition: Core.cpp:2865
void LLVMSetMetadata(LLVMValueRef Val, unsigned KindID, LLVMValueRef Node)
Set metadata associated with an instruction value.
Definition: Core.cpp:1053
LLVMBasicBlockRef LLVMGetInstructionParent(LLVMValueRef Inst)
Obtain the basic block to which an instruction belongs.
Definition: Core.cpp:2817
LLVMValueRef LLVMGetPreviousInstruction(LLVMValueRef Inst)
Obtain the instruction that occurred before this one.
Definition: Core.cpp:2845
LLVMValueRef LLVMMetadataAsValue(LLVMContextRef C, LLVMMetadataRef MD)
Obtain a Metadata as a Value.
Definition: Core.cpp:1284
LLVMValueRef LLVMMDString(const char *Str, unsigned SLen)
Deprecated: Use LLVMMDStringInContext2 instead.
Definition: Core.cpp:1249
void LLVMReplaceMDNodeOperandWith(LLVMValueRef V, unsigned Index, LLVMMetadataRef Replacement)
Replace an operand at a specific index in a llvm::MDNode value.
Definition: Core.cpp:1375
LLVMMetadataRef LLVMMDStringInContext2(LLVMContextRef C, const char *Str, size_t SLen)
Create an MDString value from a given string value.
Definition: Core.cpp:1232
LLVMMetadataRef LLVMMDNodeInContext2(LLVMContextRef C, LLVMMetadataRef *MDs, size_t Count)
Create an MDNode value with the given array of operands.
Definition: Core.cpp:1237
LLVMValueRef LLVMMDStringInContext(LLVMContextRef C, const char *Str, unsigned SLen)
Deprecated: Use LLVMMDStringInContext2 instead.
Definition: Core.cpp:1242
LLVMMetadataRef LLVMValueAsMetadata(LLVMValueRef Val)
Obtain a Value as a Metadata.
Definition: Core.cpp:1288
LLVMValueRef LLVMMDNodeInContext(LLVMContextRef C, LLVMValueRef *Vals, unsigned Count)
Deprecated: Use LLVMMDNodeInContext2 instead.
Definition: Core.cpp:1253
const char * LLVMGetMDString(LLVMValueRef V, unsigned *Length)
Obtain the underlying string from a MDString value.
Definition: Core.cpp:1297
unsigned LLVMGetMDNodeNumOperands(LLVMValueRef V)
Obtain the number of operands from an MDNode value.
Definition: Core.cpp:1307
void LLVMGetMDNodeOperands(LLVMValueRef V, LLVMValueRef *Dest)
Obtain the given MDNode's operands.
Definition: Core.cpp:1362
LLVMValueRef LLVMMDNode(LLVMValueRef *Vals, unsigned Count)
Deprecated: Use LLVMMDNodeInContext2 instead.
Definition: Core.cpp:1280
int LLVMGetNumOperands(LLVMValueRef Val)
Obtain the number of operands in a llvm::User value.
Definition: Core.cpp:1182
void LLVMSetOperand(LLVMValueRef User, unsigned Index, LLVMValueRef Val)
Set an operand at a specific index in a llvm::User value.
Definition: Core.cpp:1178
LLVMUseRef LLVMGetOperandUse(LLVMValueRef Val, unsigned Index)
Obtain the use of an operand at a specific index in a llvm::User value.
Definition: Core.cpp:1173
LLVMValueRef LLVMGetOperand(LLVMValueRef Val, unsigned Index)
Obtain an operand at a specific index in a llvm::User value.
Definition: Core.cpp:1159
LLVMValueRef LLVMGetUser(LLVMUseRef U)
Obtain the user value for a user.
Definition: Core.cpp:1139
LLVMUseRef LLVMGetFirstUse(LLVMValueRef Val)
Obtain the first use of a value.
Definition: Core.cpp:1124
LLVMUseRef LLVMGetNextUse(LLVMUseRef U)
Obtain the next use of a value.
Definition: Core.cpp:1132
LLVMValueRef LLVMGetUsedValue(LLVMUseRef U)
Obtain the value this use corresponds to.
Definition: Core.cpp:1143
#define LLVM_FOR_EACH_VALUE_SUBCLASS(macro)
Definition: Core.h:1742
void LLVMShutdown(void)
Deallocate and destroy all ManagedStatic variables.
Definition: Core.cpp:60
void LLVMGetVersion(unsigned *Major, unsigned *Minor, unsigned *Patch)
Return the major, minor, and patch version of LLVM.
Definition: Core.cpp:66
void LLVMDisposeMessage(char *Message)
Definition: Core.cpp:81
char * LLVMCreateMessage(const char *Message)
Definition: Core.cpp:77
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:2304
LLVMValueRef LLVMGetLastGlobalAlias(LLVMModuleRef M)
Obtain an iterator to the last GlobalAlias in a Module.
Definition: Core.cpp:2276
LLVMValueRef LLVMGetNextGlobalAlias(LLVMValueRef GA)
Advance a GlobalAlias iterator to the next GlobalAlias.
Definition: Core.cpp:2284
LLVMValueRef LLVMAliasGetAliasee(LLVMValueRef Alias)
Retrieve the target value of an alias.
Definition: Core.cpp:2300
LLVMValueRef LLVMGetPreviousGlobalAlias(LLVMValueRef GA)
Decrement a GlobalAlias iterator to the previous GlobalAlias.
Definition: Core.cpp:2292
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:2255
LLVMValueRef LLVMGetFirstGlobalAlias(LLVMModuleRef M)
Obtain an iterator to the first GlobalAlias in a Module.
Definition: Core.cpp:2268
LLVMValueRef LLVMGetNamedGlobalAlias(LLVMModuleRef M, const char *Name, size_t NameLen)
Obtain a GlobalAlias value from a Module by its name.
Definition: Core.cpp:2263
void LLVMSetGlobalConstant(LLVMValueRef GlobalVar, LLVMBool IsConstant)
Definition: Core.cpp:2202
void LLVMSetThreadLocalMode(LLVMValueRef GlobalVar, LLVMThreadLocalMode Mode)
Definition: Core.cpp:2223
LLVMThreadLocalMode LLVMGetThreadLocalMode(LLVMValueRef GlobalVar)
Definition: Core.cpp:2206
LLVMValueRef LLVMGetFirstGlobal(LLVMModuleRef M)
Definition: Core.cpp:2142
LLVMValueRef LLVMGetNextGlobal(LLVMValueRef GlobalVar)
Definition: Core.cpp:2158
LLVMBool LLVMIsExternallyInitialized(LLVMValueRef GlobalVar)
Definition: Core.cpp:2245
LLVMValueRef LLVMAddGlobal(LLVMModuleRef M, LLVMTypeRef Ty, const char *Name)
Definition: Core.cpp:2124
LLVMValueRef LLVMGetLastGlobal(LLVMModuleRef M)
Definition: Core.cpp:2150
void LLVMSetExternallyInitialized(LLVMValueRef GlobalVar, LLVMBool IsExtInit)
Definition: Core.cpp:2249
LLVMValueRef LLVMGetPreviousGlobal(LLVMValueRef GlobalVar)
Definition: Core.cpp:2166
void LLVMSetThreadLocal(LLVMValueRef GlobalVar, LLVMBool IsThreadLocal)
Definition: Core.cpp:2194
LLVMValueRef LLVMGetInitializer(LLVMValueRef GlobalVar)
Definition: Core.cpp:2178
void LLVMDeleteGlobal(LLVMValueRef GlobalVar)
Definition: Core.cpp:2174
LLVMBool LLVMIsThreadLocal(LLVMValueRef GlobalVar)
Definition: Core.cpp:2190
LLVMBool LLVMIsGlobalConstant(LLVMValueRef GlobalVar)
Definition: Core.cpp:2198
LLVMValueRef LLVMAddGlobalInAddressSpace(LLVMModuleRef M, LLVMTypeRef Ty, const char *Name, unsigned AddressSpace)
Definition: Core.cpp:2129
void LLVMSetInitializer(LLVMValueRef GlobalVar, LLVMValueRef ConstantVal)
Definition: Core.cpp:2185
LLVMValueRef LLVMGetNamedGlobal(LLVMModuleRef M, const char *Name)
Definition: Core.cpp:2138
#define N