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 string attribute.
678 */
680 const char *K, unsigned KLength,
681 const char *V, unsigned VLength);
682
683/**
684 * Get the string attribute's kind.
685 */
686const char *LLVMGetStringAttributeKind(LLVMAttributeRef A, unsigned *Length);
687
688/**
689 * Get the string attribute's value.
690 */
691const char *LLVMGetStringAttributeValue(LLVMAttributeRef A, unsigned *Length);
692
693/**
694 * Check for the different types of attributes.
695 */
699
700/**
701 * Obtain a Type from a context by its registered name.
702 */
704
705/**
706 * @}
707 */
708
709/**
710 * @defgroup LLVMCCoreModule Modules
711 *
712 * Modules represent the top-level structure in an LLVM program. An LLVM
713 * module is effectively a translation unit or a collection of
714 * translation units merged together.
715 *
716 * @{
717 */
718
719/**
720 * Create a new, empty module in the global context.
721 *
722 * This is equivalent to calling LLVMModuleCreateWithNameInContext with
723 * LLVMGetGlobalContext() as the context parameter.
724 *
725 * Every invocation should be paired with LLVMDisposeModule() or memory
726 * will be leaked.
727 */
728LLVMModuleRef LLVMModuleCreateWithName(const char *ModuleID);
729
730/**
731 * Create a new, empty module in a specific context.
732 *
733 * Every invocation should be paired with LLVMDisposeModule() or memory
734 * will be leaked.
735 */
738/**
739 * Return an exact copy of the specified module.
740 */
742
743/**
744 * Destroy a module instance.
745 *
746 * This must be called for every created module or memory will be
747 * leaked.
748 */
750
751/**
752 * Soon to be deprecated.
753 * See https://llvm.org/docs/RemoveDIsDebugInfo.html#c-api-changes
754 *
755 * Returns true if the module is in the new debug info mode which uses
756 * non-instruction debug records instead of debug intrinsics for variable
757 * location tracking.
758 */
760
761/**
762 * Soon to be deprecated.
763 * See https://llvm.org/docs/RemoveDIsDebugInfo.html#c-api-changes
764 *
765 * Convert module into desired debug info format.
766 */
768
769/**
770 * Obtain the identifier of a module.
771 *
772 * @param M Module to obtain identifier of
773 * @param Len Out parameter which holds the length of the returned string.
774 * @return The identifier of M.
775 * @see Module::getModuleIdentifier()
776 */
777const char *LLVMGetModuleIdentifier(LLVMModuleRef M, size_t *Len);
778
779/**
780 * Set the identifier of a module to a string Ident with length Len.
781 *
782 * @param M The module to set identifier
783 * @param Ident The string to set M's identifier to
784 * @param Len Length of Ident
785 * @see Module::setModuleIdentifier()
786 */
787void LLVMSetModuleIdentifier(LLVMModuleRef M, const char *Ident, size_t Len);
788
789/**
790 * Obtain the module's original source file name.
791 *
792 * @param M Module to obtain the name of
793 * @param Len Out parameter which holds the length of the returned string
794 * @return The original source file name of M
795 * @see Module::getSourceFileName()
796 */
797const char *LLVMGetSourceFileName(LLVMModuleRef M, size_t *Len);
798
799/**
800 * Set the original source file name of a module to a string Name with length
801 * Len.
802 *
803 * @param M The module to set the source file name of
804 * @param Name The string to set M's source file name to
805 * @param Len Length of Name
806 * @see Module::setSourceFileName()
807 */
808void LLVMSetSourceFileName(LLVMModuleRef M, const char *Name, size_t Len);
809
810/**
811 * Obtain the data layout for a module.
812 *
813 * @see Module::getDataLayoutStr()
814 *
815 * LLVMGetDataLayout is DEPRECATED, as the name is not only incorrect,
816 * but match the name of another method on the module. Prefer the use
817 * of LLVMGetDataLayoutStr, which is not ambiguous.
818 */
820const char *LLVMGetDataLayout(LLVMModuleRef M);
821
822/**
823 * Set the data layout for a module.
824 *
825 * @see Module::setDataLayout()
826 */
827void LLVMSetDataLayout(LLVMModuleRef M, const char *DataLayoutStr);
828
829/**
830 * Obtain the target triple for a module.
831 *
832 * @see Module::getTargetTriple()
833 */
834const char *LLVMGetTarget(LLVMModuleRef M);
835
836/**
837 * Set the target triple for a module.
838 *
839 * @see Module::setTargetTriple()
840 */
841void LLVMSetTarget(LLVMModuleRef M, const char *Triple);
842
843/**
844 * Returns the module flags as an array of flag-key-value triples. The caller
845 * is responsible for freeing this array by calling
846 * \c LLVMDisposeModuleFlagsMetadata.
847 *
848 * @see Module::getModuleFlagsMetadata()
849 */
851
852/**
853 * Destroys module flags metadata entries.
854 */
856
857/**
858 * Returns the flag behavior for a module flag entry at a specific index.
859 *
860 * @see Module::ModuleFlagEntry::Behavior
861 */
864 unsigned Index);
865
866/**
867 * Returns the key for a module flag entry at a specific index.
868 *
869 * @see Module::ModuleFlagEntry::Key
870 */
872 unsigned Index, size_t *Len);
873
874/**
875 * Returns the metadata for a module flag entry at a specific index.
876 *
877 * @see Module::ModuleFlagEntry::Val
878 */
880 unsigned Index);
881
882/**
883 * Add a module-level flag to the module-level flags metadata if it doesn't
884 * already exist.
885 *
886 * @see Module::getModuleFlag()
887 */
889 const char *Key, size_t KeyLen);
890
891/**
892 * Add a module-level flag to the module-level flags metadata if it doesn't
893 * already exist.
894 *
895 * @see Module::addModuleFlag()
896 */
898 const char *Key, size_t KeyLen,
899 LLVMMetadataRef Val);
900
901/**
902 * Dump a representation of a module to stderr.
903 *
904 * @see Module::dump()
905 */
907
908/**
909 * Print a representation of a module to a file. The ErrorMessage needs to be
910 * disposed with LLVMDisposeMessage. Returns 0 on success, 1 otherwise.
911 *
912 * @see Module::print()
913 */
914LLVMBool LLVMPrintModuleToFile(LLVMModuleRef M, const char *Filename,
915 char **ErrorMessage);
916
917/**
918 * Return a string representation of the module. Use
919 * LLVMDisposeMessage to free the string.
920 *
921 * @see Module::print()
922 */
924
925/**
926 * Get inline assembly for a module.
927 *
928 * @see Module::getModuleInlineAsm()
929 */
930const char *LLVMGetModuleInlineAsm(LLVMModuleRef M, size_t *Len);
931
932/**
933 * Set inline assembly for a module.
934 *
935 * @see Module::setModuleInlineAsm()
936 */
937void LLVMSetModuleInlineAsm2(LLVMModuleRef M, const char *Asm, size_t Len);
938
939/**
940 * Append inline assembly to a module.
941 *
942 * @see Module::appendModuleInlineAsm()
943 */
944void LLVMAppendModuleInlineAsm(LLVMModuleRef M, const char *Asm, size_t Len);
945
946/**
947 * Create the specified uniqued inline asm string.
948 *
949 * @see InlineAsm::get()
950 */
951LLVMValueRef LLVMGetInlineAsm(LLVMTypeRef Ty, const char *AsmString,
952 size_t AsmStringSize, const char *Constraints,
953 size_t ConstraintsSize, LLVMBool HasSideEffects,
954 LLVMBool IsAlignStack,
955 LLVMInlineAsmDialect Dialect, LLVMBool CanThrow);
956
957/**
958 * Get the template string used for an inline assembly snippet
959 *
960 */
961const char *LLVMGetInlineAsmAsmString(LLVMValueRef InlineAsmVal, size_t *Len);
962
963/**
964 * Get the raw constraint string for an inline assembly snippet
965 *
966 */
967const char *LLVMGetInlineAsmConstraintString(LLVMValueRef InlineAsmVal,
968 size_t *Len);
969
970/**
971 * Get the dialect used by the inline asm snippet
972 *
973 */
975
976/**
977 * Get the function type of the inline assembly snippet. The same type that
978 * was passed into LLVMGetInlineAsm originally
979 *
980 * @see LLVMGetInlineAsm
981 *
982 */
984
985/**
986 * Get if the inline asm snippet has side effects
987 *
988 */
990
991/**
992 * Get if the inline asm snippet needs an aligned stack
993 *
994 */
996
997/**
998 * Get if the inline asm snippet may unwind the stack
999 *
1000 */
1002
1003/**
1004 * Obtain the context to which this module is associated.
1005 *
1006 * @see Module::getContext()
1007 */
1009
1010/** Deprecated: Use LLVMGetTypeByName2 instead. */
1012
1013/**
1014 * Obtain an iterator to the first NamedMDNode in a Module.
1015 *
1016 * @see llvm::Module::named_metadata_begin()
1017 */
1019
1020/**
1021 * Obtain an iterator to the last NamedMDNode in a Module.
1022 *
1023 * @see llvm::Module::named_metadata_end()
1024 */
1026
1027/**
1028 * Advance a NamedMDNode iterator to the next NamedMDNode.
1029 *
1030 * Returns NULL if the iterator was already at the end and there are no more
1031 * named metadata nodes.
1032 */
1034
1035/**
1036 * Decrement a NamedMDNode iterator to the previous NamedMDNode.
1037 *
1038 * Returns NULL if the iterator was already at the beginning and there are
1039 * no previous named metadata nodes.
1040 */
1042
1043/**
1044 * Retrieve a NamedMDNode with the given name, returning NULL if no such
1045 * node exists.
1046 *
1047 * @see llvm::Module::getNamedMetadata()
1048 */
1050 const char *Name, size_t NameLen);
1051
1052/**
1053 * Retrieve a NamedMDNode with the given name, creating a new node if no such
1054 * node exists.
1055 *
1056 * @see llvm::Module::getOrInsertNamedMetadata()
1057 */
1059 const char *Name,
1060 size_t NameLen);
1061
1062/**
1063 * Retrieve the name of a NamedMDNode.
1064 *
1065 * @see llvm::NamedMDNode::getName()
1066 */
1068 size_t *NameLen);
1069
1070/**
1071 * Obtain the number of operands for named metadata in a module.
1072 *
1073 * @see llvm::Module::getNamedMetadata()
1074 */
1075unsigned LLVMGetNamedMetadataNumOperands(LLVMModuleRef M, const char *Name);
1076
1077/**
1078 * Obtain the named metadata operands for a module.
1079 *
1080 * The passed LLVMValueRef pointer should refer to an array of
1081 * LLVMValueRef at least LLVMGetNamedMetadataNumOperands long. This
1082 * array will be populated with the LLVMValueRef instances. Each
1083 * instance corresponds to a llvm::MDNode.
1084 *
1085 * @see llvm::Module::getNamedMetadata()
1086 * @see llvm::MDNode::getOperand()
1087 */
1089 LLVMValueRef *Dest);
1090
1091/**
1092 * Add an operand to named metadata.
1093 *
1094 * @see llvm::Module::getNamedMetadata()
1095 * @see llvm::MDNode::addOperand()
1096 */
1098 LLVMValueRef Val);
1099
1100/**
1101 * Return the directory of the debug location for this value, which must be
1102 * an llvm::Instruction, llvm::GlobalVariable, or llvm::Function.
1103 *
1104 * @see llvm::Instruction::getDebugLoc()
1105 * @see llvm::GlobalVariable::getDebugInfo()
1106 * @see llvm::Function::getSubprogram()
1107 */
1108const char *LLVMGetDebugLocDirectory(LLVMValueRef Val, unsigned *Length);
1109
1110/**
1111 * Return the filename of the debug location for this value, which must be
1112 * an llvm::Instruction, llvm::GlobalVariable, or llvm::Function.
1113 *
1114 * @see llvm::Instruction::getDebugLoc()
1115 * @see llvm::GlobalVariable::getDebugInfo()
1116 * @see llvm::Function::getSubprogram()
1117 */
1118const char *LLVMGetDebugLocFilename(LLVMValueRef Val, unsigned *Length);
1119
1120/**
1121 * Return the line number of the debug location for this value, which must be
1122 * an llvm::Instruction, llvm::GlobalVariable, or llvm::Function.
1123 *
1124 * @see llvm::Instruction::getDebugLoc()
1125 * @see llvm::GlobalVariable::getDebugInfo()
1126 * @see llvm::Function::getSubprogram()
1127 */
1128unsigned LLVMGetDebugLocLine(LLVMValueRef Val);
1129
1130/**
1131 * Return the column number of the debug location for this value, which must be
1132 * an llvm::Instruction.
1133 *
1134 * @see llvm::Instruction::getDebugLoc()
1135 */
1137
1138/**
1139 * Add a function to a module under a specified name.
1140 *
1141 * @see llvm::Function::Create()
1142 */
1144 LLVMTypeRef FunctionTy);
1145
1146/**
1147 * Obtain a Function value from a Module by its name.
1148 *
1149 * The returned value corresponds to a llvm::Function value.
1150 *
1151 * @see llvm::Module::getFunction()
1152 */
1154
1155/**
1156 * Obtain an iterator to the first Function in a Module.
1157 *
1158 * @see llvm::Module::begin()
1159 */
1161
1162/**
1163 * Obtain an iterator to the last Function in a Module.
1164 *
1165 * @see llvm::Module::end()
1166 */
1168
1169/**
1170 * Advance a Function iterator to the next Function.
1171 *
1172 * Returns NULL if the iterator was already at the end and there are no more
1173 * functions.
1174 */
1176
1177/**
1178 * Decrement a Function iterator to the previous Function.
1179 *
1180 * Returns NULL if the iterator was already at the beginning and there are
1181 * no previous functions.
1182 */
1184
1185/** Deprecated: Use LLVMSetModuleInlineAsm2 instead. */
1186void LLVMSetModuleInlineAsm(LLVMModuleRef M, const char *Asm);
1187
1188/**
1189 * @}
1190 */
1191
1192/**
1193 * @defgroup LLVMCCoreType Types
1194 *
1195 * Types represent the type of a value.
1196 *
1197 * Types are associated with a context instance. The context internally
1198 * deduplicates types so there is only 1 instance of a specific type
1199 * alive at a time. In other words, a unique type is shared among all
1200 * consumers within a context.
1201 *
1202 * A Type in the C API corresponds to llvm::Type.
1203 *
1204 * Types have the following hierarchy:
1205 *
1206 * types:
1207 * integer type
1208 * real type
1209 * function type
1210 * sequence types:
1211 * array type
1212 * pointer type
1213 * vector type
1214 * void type
1215 * label type
1216 * opaque type
1217 *
1218 * @{
1219 */
1220
1221/**
1222 * Obtain the enumerated type of a Type instance.
1223 *
1224 * @see llvm::Type:getTypeID()
1225 */
1227
1228/**
1229 * Whether the type has a known size.
1230 *
1231 * Things that don't have a size are abstract types, labels, and void.a
1232 *
1233 * @see llvm::Type::isSized()
1234 */
1236
1237/**
1238 * Obtain the context to which this type instance is associated.
1239 *
1240 * @see llvm::Type::getContext()
1241 */
1243
1244/**
1245 * Dump a representation of a type to stderr.
1246 *
1247 * @see llvm::Type::dump()
1248 */
1249void LLVMDumpType(LLVMTypeRef Val);
1250
1251/**
1252 * Return a string representation of the type. Use
1253 * LLVMDisposeMessage to free the string.
1254 *
1255 * @see llvm::Type::print()
1256 */
1258
1259/**
1260 * @defgroup LLVMCCoreTypeInt Integer Types
1261 *
1262 * Functions in this section operate on integer types.
1263 *
1264 * @{
1265 */
1266
1267/**
1268 * Obtain an integer type from a context with specified bit width.
1269 */
1277
1278/**
1279 * Obtain an integer type from the global context with a specified bit
1280 * width.
1281 */
1288LLVMTypeRef LLVMIntType(unsigned NumBits);
1289unsigned LLVMGetIntTypeWidth(LLVMTypeRef IntegerTy);
1290
1291/**
1292 * @}
1293 */
1294
1295/**
1296 * @defgroup LLVMCCoreTypeFloat Floating Point Types
1297 *
1298 * @{
1299 */
1300
1301/**
1302 * Obtain a 16-bit floating point type from a context.
1303 */
1305
1306/**
1307 * Obtain a 16-bit brain floating point type from a context.
1308 */
1310
1311/**
1312 * Obtain a 32-bit floating point type from a context.
1313 */
1315
1316/**
1317 * Obtain a 64-bit floating point type from a context.
1318 */
1320
1321/**
1322 * Obtain a 80-bit floating point type (X87) from a context.
1323 */
1325
1326/**
1327 * Obtain a 128-bit floating point type (112-bit mantissa) from a
1328 * context.
1329 */
1331
1332/**
1333 * Obtain a 128-bit floating point type (two 64-bits) from a context.
1334 */
1336
1337/**
1338 * Obtain a floating point type from the global context.
1339 *
1340 * These map to the functions in this group of the same name.
1341 */
1349
1350/**
1351 * @}
1352 */
1353
1354/**
1355 * @defgroup LLVMCCoreTypeFunction Function Types
1356 *
1357 * @{
1358 */
1359
1360/**
1361 * Obtain a function type consisting of a specified signature.
1362 *
1363 * The function is defined as a tuple of a return Type, a list of
1364 * parameter types, and whether the function is variadic.
1365 */
1367 LLVMTypeRef *ParamTypes, unsigned ParamCount,
1368 LLVMBool IsVarArg);
1369
1370/**
1371 * Returns whether a function type is variadic.
1372 */
1374
1375/**
1376 * Obtain the Type this function Type returns.
1377 */
1379
1380/**
1381 * Obtain the number of parameters this function accepts.
1382 */
1383unsigned LLVMCountParamTypes(LLVMTypeRef FunctionTy);
1384
1385/**
1386 * Obtain the types of a function's parameters.
1387 *
1388 * The Dest parameter should point to a pre-allocated array of
1389 * LLVMTypeRef at least LLVMCountParamTypes() large. On return, the
1390 * first LLVMCountParamTypes() entries in the array will be populated
1391 * with LLVMTypeRef instances.
1392 *
1393 * @param FunctionTy The function type to operate on.
1394 * @param Dest Memory address of an array to be filled with result.
1395 */
1396void LLVMGetParamTypes(LLVMTypeRef FunctionTy, LLVMTypeRef *Dest);
1397
1398/**
1399 * @}
1400 */
1401
1402/**
1403 * @defgroup LLVMCCoreTypeStruct Structure Types
1404 *
1405 * These functions relate to LLVMTypeRef instances.
1406 *
1407 * @see llvm::StructType
1408 *
1409 * @{
1410 */
1411
1412/**
1413 * Create a new structure type in a context.
1414 *
1415 * A structure is specified by a list of inner elements/types and
1416 * whether these can be packed together.
1417 *
1418 * @see llvm::StructType::create()
1419 */
1421 unsigned ElementCount, LLVMBool Packed);
1422
1423/**
1424 * Create a new structure type in the global context.
1425 *
1426 * @see llvm::StructType::create()
1427 */
1428LLVMTypeRef LLVMStructType(LLVMTypeRef *ElementTypes, unsigned ElementCount,
1429 LLVMBool Packed);
1430
1431/**
1432 * Create an empty structure in a context having a specified name.
1433 *
1434 * @see llvm::StructType::create()
1435 */
1437
1438/**
1439 * Obtain the name of a structure.
1440 *
1441 * @see llvm::StructType::getName()
1442 */
1443const char *LLVMGetStructName(LLVMTypeRef Ty);
1444
1445/**
1446 * Set the contents of a structure type.
1447 *
1448 * @see llvm::StructType::setBody()
1449 */
1450void LLVMStructSetBody(LLVMTypeRef StructTy, LLVMTypeRef *ElementTypes,
1451 unsigned ElementCount, LLVMBool Packed);
1452
1453/**
1454 * Get the number of elements defined inside the structure.
1455 *
1456 * @see llvm::StructType::getNumElements()
1457 */
1458unsigned LLVMCountStructElementTypes(LLVMTypeRef StructTy);
1459
1460/**
1461 * Get the elements within a structure.
1462 *
1463 * The function is passed the address of a pre-allocated array of
1464 * LLVMTypeRef at least LLVMCountStructElementTypes() long. After
1465 * invocation, this array will be populated with the structure's
1466 * elements. The objects in the destination array will have a lifetime
1467 * of the structure type itself, which is the lifetime of the context it
1468 * is contained in.
1469 */
1471
1472/**
1473 * Get the type of the element at a given index in the structure.
1474 *
1475 * @see llvm::StructType::getTypeAtIndex()
1476 */
1478
1479/**
1480 * Determine whether a structure is packed.
1481 *
1482 * @see llvm::StructType::isPacked()
1483 */
1485
1486/**
1487 * Determine whether a structure is opaque.
1488 *
1489 * @see llvm::StructType::isOpaque()
1490 */
1492
1493/**
1494 * Determine whether a structure is literal.
1495 *
1496 * @see llvm::StructType::isLiteral()
1497 */
1499
1500/**
1501 * @}
1502 */
1503
1504/**
1505 * @defgroup LLVMCCoreTypeSequential Sequential Types
1506 *
1507 * Sequential types represents "arrays" of types. This is a super class
1508 * for array, vector, and pointer types.
1509 *
1510 * @{
1511 */
1512
1513/**
1514 * Obtain the element type of an array or vector type.
1515 *
1516 * @see llvm::SequentialType::getElementType()
1517 */
1519
1520/**
1521 * Returns type's subtypes
1522 *
1523 * @see llvm::Type::subtypes()
1524 */
1526
1527/**
1528 * Return the number of types in the derived type.
1529 *
1530 * @see llvm::Type::getNumContainedTypes()
1531 */
1533
1534/**
1535 * Create a fixed size array type that refers to a specific type.
1536 *
1537 * The created type will exist in the context that its element type
1538 * exists in.
1539 *
1540 * @deprecated LLVMArrayType is deprecated in favor of the API accurate
1541 * LLVMArrayType2
1542 * @see llvm::ArrayType::get()
1543 */
1544LLVMTypeRef LLVMArrayType(LLVMTypeRef ElementType, unsigned ElementCount);
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 * @see llvm::ArrayType::get()
1553 */
1554LLVMTypeRef LLVMArrayType2(LLVMTypeRef ElementType, uint64_t ElementCount);
1555
1556/**
1557 * Obtain the length of an array type.
1558 *
1559 * This only works on types that represent arrays.
1560 *
1561 * @deprecated LLVMGetArrayLength is deprecated in favor of the API accurate
1562 * LLVMGetArrayLength2
1563 * @see llvm::ArrayType::getNumElements()
1564 */
1565unsigned LLVMGetArrayLength(LLVMTypeRef ArrayTy);
1566
1567/**
1568 * Obtain the length of an array type.
1569 *
1570 * This only works on types that represent arrays.
1571 *
1572 * @see llvm::ArrayType::getNumElements()
1573 */
1575
1576/**
1577 * Create a pointer type that points to a defined type.
1578 *
1579 * The created type will exist in the context that its pointee type
1580 * exists in.
1581 *
1582 * @see llvm::PointerType::get()
1583 */
1584LLVMTypeRef LLVMPointerType(LLVMTypeRef ElementType, unsigned AddressSpace);
1585
1586/**
1587 * Determine whether a pointer is opaque.
1588 *
1589 * True if this is an instance of an opaque PointerType.
1590 *
1591 * @see llvm::Type::isOpaquePointerTy()
1592 */
1594
1595/**
1596 * Create an opaque pointer type in a context.
1597 *
1598 * @see llvm::PointerType::get()
1599 */
1601
1602/**
1603 * Obtain the address space of a pointer type.
1604 *
1605 * This only works on types that represent pointers.
1606 *
1607 * @see llvm::PointerType::getAddressSpace()
1608 */
1609unsigned LLVMGetPointerAddressSpace(LLVMTypeRef PointerTy);
1610
1611/**
1612 * Create a vector type that contains a defined type and has a specific
1613 * number of elements.
1614 *
1615 * The created type will exist in the context thats its element type
1616 * exists in.
1617 *
1618 * @see llvm::VectorType::get()
1619 */
1620LLVMTypeRef LLVMVectorType(LLVMTypeRef ElementType, unsigned ElementCount);
1621
1622/**
1623 * Create a vector type that contains a defined type and has a scalable
1624 * number of elements.
1625 *
1626 * The created type will exist in the context thats its element type
1627 * exists in.
1628 *
1629 * @see llvm::ScalableVectorType::get()
1630 */
1632 unsigned ElementCount);
1633
1634/**
1635 * Obtain the (possibly scalable) number of elements in a vector type.
1636 *
1637 * This only works on types that represent vectors (fixed or scalable).
1638 *
1639 * @see llvm::VectorType::getNumElements()
1640 */
1641unsigned LLVMGetVectorSize(LLVMTypeRef VectorTy);
1642
1643/**
1644 * @}
1645 */
1646
1647/**
1648 * @defgroup LLVMCCoreTypeOther Other Types
1649 *
1650 * @{
1651 */
1652
1653/**
1654 * Create a void type in a context.
1655 */
1657
1658/**
1659 * Create a label type in a context.
1660 */
1662
1663/**
1664 * Create a X86 MMX type in a context.
1665 */
1667
1668/**
1669 * Create a X86 AMX type in a context.
1670 */
1672
1673/**
1674 * Create a token type in a context.
1675 */
1677
1678/**
1679 * Create a metadata type in a context.
1680 */
1682
1683/**
1684 * These are similar to the above functions except they operate on the
1685 * global context.
1686 */
1691
1692/**
1693 * Create a target extension type in LLVM context.
1694 */
1696 LLVMTypeRef *TypeParams,
1697 unsigned TypeParamCount,
1698 unsigned *IntParams,
1699 unsigned IntParamCount);
1700
1701/**
1702 * @}
1703 */
1704
1705/**
1706 * @}
1707 */
1708
1709/**
1710 * @defgroup LLVMCCoreValues Values
1711 *
1712 * The bulk of LLVM's object model consists of values, which comprise a very
1713 * rich type hierarchy.
1714 *
1715 * LLVMValueRef essentially represents llvm::Value. There is a rich
1716 * hierarchy of classes within this type. Depending on the instance
1717 * obtained, not all APIs are available.
1718 *
1719 * Callers can determine the type of an LLVMValueRef by calling the
1720 * LLVMIsA* family of functions (e.g. LLVMIsAArgument()). These
1721 * functions are defined by a macro, so it isn't obvious which are
1722 * available by looking at the Doxygen source code. Instead, look at the
1723 * source definition of LLVM_FOR_EACH_VALUE_SUBCLASS and note the list
1724 * of value names given. These value names also correspond to classes in
1725 * the llvm::Value hierarchy.
1726 *
1727 * @{
1728 */
1729
1730#define LLVM_FOR_EACH_VALUE_SUBCLASS(macro) \
1731 macro(Argument) \
1732 macro(BasicBlock) \
1733 macro(InlineAsm) \
1734 macro(User) \
1735 macro(Constant) \
1736 macro(BlockAddress) \
1737 macro(ConstantAggregateZero) \
1738 macro(ConstantArray) \
1739 macro(ConstantDataSequential) \
1740 macro(ConstantDataArray) \
1741 macro(ConstantDataVector) \
1742 macro(ConstantExpr) \
1743 macro(ConstantFP) \
1744 macro(ConstantInt) \
1745 macro(ConstantPointerNull) \
1746 macro(ConstantStruct) \
1747 macro(ConstantTokenNone) \
1748 macro(ConstantVector) \
1749 macro(GlobalValue) \
1750 macro(GlobalAlias) \
1751 macro(GlobalObject) \
1752 macro(Function) \
1753 macro(GlobalVariable) \
1754 macro(GlobalIFunc) \
1755 macro(UndefValue) \
1756 macro(PoisonValue) \
1757 macro(Instruction) \
1758 macro(UnaryOperator) \
1759 macro(BinaryOperator) \
1760 macro(CallInst) \
1761 macro(IntrinsicInst) \
1762 macro(DbgInfoIntrinsic) \
1763 macro(DbgVariableIntrinsic) \
1764 macro(DbgDeclareInst) \
1765 macro(DbgLabelInst) \
1766 macro(MemIntrinsic) \
1767 macro(MemCpyInst) \
1768 macro(MemMoveInst) \
1769 macro(MemSetInst) \
1770 macro(CmpInst) \
1771 macro(FCmpInst) \
1772 macro(ICmpInst) \
1773 macro(ExtractElementInst) \
1774 macro(GetElementPtrInst) \
1775 macro(InsertElementInst) \
1776 macro(InsertValueInst) \
1777 macro(LandingPadInst) \
1778 macro(PHINode) \
1779 macro(SelectInst) \
1780 macro(ShuffleVectorInst) \
1781 macro(StoreInst) \
1782 macro(BranchInst) \
1783 macro(IndirectBrInst) \
1784 macro(InvokeInst) \
1785 macro(ReturnInst) \
1786 macro(SwitchInst) \
1787 macro(UnreachableInst) \
1788 macro(ResumeInst) \
1789 macro(CleanupReturnInst) \
1790 macro(CatchReturnInst) \
1791 macro(CatchSwitchInst) \
1792 macro(CallBrInst) \
1793 macro(FuncletPadInst) \
1794 macro(CatchPadInst) \
1795 macro(CleanupPadInst) \
1796 macro(UnaryInstruction) \
1797 macro(AllocaInst) \
1798 macro(CastInst) \
1799 macro(AddrSpaceCastInst) \
1800 macro(BitCastInst) \
1801 macro(FPExtInst) \
1802 macro(FPToSIInst) \
1803 macro(FPToUIInst) \
1804 macro(FPTruncInst) \
1805 macro(IntToPtrInst) \
1806 macro(PtrToIntInst) \
1807 macro(SExtInst) \
1808 macro(SIToFPInst) \
1809 macro(TruncInst) \
1810 macro(UIToFPInst) \
1811 macro(ZExtInst) \
1812 macro(ExtractValueInst) \
1813 macro(LoadInst) \
1814 macro(VAArgInst) \
1815 macro(FreezeInst) \
1816 macro(AtomicCmpXchgInst) \
1817 macro(AtomicRMWInst) \
1818 macro(FenceInst)
1819
1820/**
1821 * @defgroup LLVMCCoreValueGeneral General APIs
1822 *
1823 * Functions in this section work on all LLVMValueRef instances,
1824 * regardless of their sub-type. They correspond to functions available
1825 * on llvm::Value.
1826 *
1827 * @{
1828 */
1829
1830/**
1831 * Obtain the type of a value.
1832 *
1833 * @see llvm::Value::getType()
1834 */
1836
1837/**
1838 * Obtain the enumerated type of a Value instance.
1839 *
1840 * @see llvm::Value::getValueID()
1841 */
1843
1844/**
1845 * Obtain the string name of a value.
1846 *
1847 * @see llvm::Value::getName()
1848 */
1849const char *LLVMGetValueName2(LLVMValueRef Val, size_t *Length);
1850
1851/**
1852 * Set the string name of a value.
1853 *
1854 * @see llvm::Value::setName()
1855 */
1856void LLVMSetValueName2(LLVMValueRef Val, const char *Name, size_t NameLen);
1857
1858/**
1859 * Dump a representation of a value to stderr.
1860 *
1861 * @see llvm::Value::dump()
1862 */
1863void LLVMDumpValue(LLVMValueRef Val);
1864
1865/**
1866 * Return a string representation of the value. Use
1867 * LLVMDisposeMessage to free the string.
1868 *
1869 * @see llvm::Value::print()
1870 */
1872
1873/**
1874 * Return a string representation of the DbgRecord. Use
1875 * LLVMDisposeMessage to free the string.
1876 *
1877 * @see llvm::DbgRecord::print()
1878 */
1880
1881/**
1882 * Replace all uses of a value with another one.
1883 *
1884 * @see llvm::Value::replaceAllUsesWith()
1885 */
1887
1888/**
1889 * Determine whether the specified value instance is constant.
1890 */
1892
1893/**
1894 * Determine whether a value instance is undefined.
1895 */
1897
1898/**
1899 * Determine whether a value instance is poisonous.
1900 */
1902
1903/**
1904 * Convert value instances between types.
1905 *
1906 * Internally, an LLVMValueRef is "pinned" to a specific type. This
1907 * series of functions allows you to cast an instance to a specific
1908 * type.
1909 *
1910 * If the cast is not valid for the specified type, NULL is returned.
1911 *
1912 * @see llvm::dyn_cast_or_null<>
1913 */
1914#define LLVM_DECLARE_VALUE_CAST(name) \
1915 LLVMValueRef LLVMIsA##name(LLVMValueRef Val);
1917
1921
1922/** Deprecated: Use LLVMGetValueName2 instead. */
1923const char *LLVMGetValueName(LLVMValueRef Val);
1924/** Deprecated: Use LLVMSetValueName2 instead. */
1925void LLVMSetValueName(LLVMValueRef Val, const char *Name);
1926
1927/**
1928 * @}
1929 */
1930
1931/**
1932 * @defgroup LLVMCCoreValueUses Usage
1933 *
1934 * This module defines functions that allow you to inspect the uses of a
1935 * LLVMValueRef.
1936 *
1937 * It is possible to obtain an LLVMUseRef for any LLVMValueRef instance.
1938 * Each LLVMUseRef (which corresponds to a llvm::Use instance) holds a
1939 * llvm::User and llvm::Value.
1940 *
1941 * @{
1942 */
1943
1944/**
1945 * Obtain the first use of a value.
1946 *
1947 * Uses are obtained in an iterator fashion. First, call this function
1948 * to obtain a reference to the first use. Then, call LLVMGetNextUse()
1949 * on that instance and all subsequently obtained instances until
1950 * LLVMGetNextUse() returns NULL.
1951 *
1952 * @see llvm::Value::use_begin()
1953 */
1955
1956/**
1957 * Obtain the next use of a value.
1958 *
1959 * This effectively advances the iterator. It returns NULL if you are on
1960 * the final use and no more are available.
1961 */
1963
1964/**
1965 * Obtain the user value for a user.
1966 *
1967 * The returned value corresponds to a llvm::User type.
1968 *
1969 * @see llvm::Use::getUser()
1970 */
1972
1973/**
1974 * Obtain the value this use corresponds to.
1975 *
1976 * @see llvm::Use::get().
1977 */
1979
1980/**
1981 * @}
1982 */
1983
1984/**
1985 * @defgroup LLVMCCoreValueUser User value
1986 *
1987 * Function in this group pertain to LLVMValueRef instances that descent
1988 * from llvm::User. This includes constants, instructions, and
1989 * operators.
1990 *
1991 * @{
1992 */
1993
1994/**
1995 * Obtain an operand at a specific index in a llvm::User value.
1996 *
1997 * @see llvm::User::getOperand()
1998 */
2000
2001/**
2002 * Obtain the use of an operand at a specific index in a llvm::User value.
2003 *
2004 * @see llvm::User::getOperandUse()
2005 */
2007
2008/**
2009 * Set an operand at a specific index in a llvm::User value.
2010 *
2011 * @see llvm::User::setOperand()
2012 */
2013void LLVMSetOperand(LLVMValueRef User, unsigned Index, LLVMValueRef Val);
2014
2015/**
2016 * Obtain the number of operands in a llvm::User value.
2017 *
2018 * @see llvm::User::getNumOperands()
2019 */
2021
2022/**
2023 * @}
2024 */
2025
2026/**
2027 * @defgroup LLVMCCoreValueConstant Constants
2028 *
2029 * This section contains APIs for interacting with LLVMValueRef that
2030 * correspond to llvm::Constant instances.
2031 *
2032 * These functions will work for any LLVMValueRef in the llvm::Constant
2033 * class hierarchy.
2034 *
2035 * @{
2036 */
2037
2038/**
2039 * Obtain a constant value referring to the null instance of a type.
2040 *
2041 * @see llvm::Constant::getNullValue()
2042 */
2043LLVMValueRef LLVMConstNull(LLVMTypeRef Ty); /* all zeroes */
2044
2045/**
2046 * Obtain a constant value referring to the instance of a type
2047 * consisting of all ones.
2048 *
2049 * This is only valid for integer types.
2050 *
2051 * @see llvm::Constant::getAllOnesValue()
2052 */
2054
2055/**
2056 * Obtain a constant value referring to an undefined value of a type.
2057 *
2058 * @see llvm::UndefValue::get()
2059 */
2061
2062/**
2063 * Obtain a constant value referring to a poison value of a type.
2064 *
2065 * @see llvm::PoisonValue::get()
2066 */
2068
2069/**
2070 * Determine whether a value instance is null.
2071 *
2072 * @see llvm::Constant::isNullValue()
2073 */
2075
2076/**
2077 * Obtain a constant that is a constant pointer pointing to NULL for a
2078 * specified type.
2079 */
2081
2082/**
2083 * @defgroup LLVMCCoreValueConstantScalar Scalar constants
2084 *
2085 * Functions in this group model LLVMValueRef instances that correspond
2086 * to constants referring to scalar types.
2087 *
2088 * For integer types, the LLVMTypeRef parameter should correspond to a
2089 * llvm::IntegerType instance and the returned LLVMValueRef will
2090 * correspond to a llvm::ConstantInt.
2091 *
2092 * For floating point types, the LLVMTypeRef returned corresponds to a
2093 * llvm::ConstantFP.
2094 *
2095 * @{
2096 */
2097
2098/**
2099 * Obtain a constant value for an integer type.
2100 *
2101 * The returned value corresponds to a llvm::ConstantInt.
2102 *
2103 * @see llvm::ConstantInt::get()
2104 *
2105 * @param IntTy Integer type to obtain value of.
2106 * @param N The value the returned instance should refer to.
2107 * @param SignExtend Whether to sign extend the produced value.
2108 */
2109LLVMValueRef LLVMConstInt(LLVMTypeRef IntTy, unsigned long long N,
2110 LLVMBool SignExtend);
2111
2112/**
2113 * Obtain a constant value for an integer of arbitrary precision.
2114 *
2115 * @see llvm::ConstantInt::get()
2116 */
2118 unsigned NumWords,
2119 const uint64_t Words[]);
2120
2121/**
2122 * Obtain a constant value for an integer parsed from a string.
2123 *
2124 * A similar API, LLVMConstIntOfStringAndSize is also available. If the
2125 * string's length is available, it is preferred to call that function
2126 * instead.
2127 *
2128 * @see llvm::ConstantInt::get()
2129 */
2131 uint8_t Radix);
2132
2133/**
2134 * Obtain a constant value for an integer parsed from a string with
2135 * specified length.
2136 *
2137 * @see llvm::ConstantInt::get()
2138 */
2140 unsigned SLen, uint8_t Radix);
2141
2142/**
2143 * Obtain a constant value referring to a double floating point value.
2144 */
2145LLVMValueRef LLVMConstReal(LLVMTypeRef RealTy, double N);
2146
2147/**
2148 * Obtain a constant for a floating point value parsed from a string.
2149 *
2150 * A similar API, LLVMConstRealOfStringAndSize is also available. It
2151 * should be used if the input string's length is known.
2152 */
2153LLVMValueRef LLVMConstRealOfString(LLVMTypeRef RealTy, const char *Text);
2154
2155/**
2156 * Obtain a constant for a floating point value parsed from a string.
2157 */
2159 unsigned SLen);
2160
2161/**
2162 * Obtain the zero extended value for an integer constant value.
2163 *
2164 * @see llvm::ConstantInt::getZExtValue()
2165 */
2166unsigned long long LLVMConstIntGetZExtValue(LLVMValueRef ConstantVal);
2167
2168/**
2169 * Obtain the sign extended value for an integer constant value.
2170 *
2171 * @see llvm::ConstantInt::getSExtValue()
2172 */
2173long long LLVMConstIntGetSExtValue(LLVMValueRef ConstantVal);
2174
2175/**
2176 * Obtain the double value for an floating point constant value.
2177 * losesInfo indicates if some precision was lost in the conversion.
2178 *
2179 * @see llvm::ConstantFP::getDoubleValue
2180 */
2181double LLVMConstRealGetDouble(LLVMValueRef ConstantVal, LLVMBool *losesInfo);
2182
2183/**
2184 * @}
2185 */
2186
2187/**
2188 * @defgroup LLVMCCoreValueConstantComposite Composite Constants
2189 *
2190 * Functions in this group operate on composite constants.
2191 *
2192 * @{
2193 */
2194
2195/**
2196 * Create a ConstantDataSequential and initialize it with a string.
2197 *
2198 * @deprecated LLVMConstStringInContext is deprecated in favor of the API
2199 * accurate LLVMConstStringInContext2
2200 * @see llvm::ConstantDataArray::getString()
2201 */
2203 unsigned Length, LLVMBool DontNullTerminate);
2204
2205/**
2206 * Create a ConstantDataSequential and initialize it with a string.
2207 *
2208 * @see llvm::ConstantDataArray::getString()
2209 */
2211 size_t Length,
2212 LLVMBool DontNullTerminate);
2213
2214/**
2215 * Create a ConstantDataSequential with string content in the global context.
2216 *
2217 * This is the same as LLVMConstStringInContext except it operates on the
2218 * global context.
2219 *
2220 * @see LLVMConstStringInContext()
2221 * @see llvm::ConstantDataArray::getString()
2222 */
2223LLVMValueRef LLVMConstString(const char *Str, unsigned Length,
2224 LLVMBool DontNullTerminate);
2225
2226/**
2227 * Returns true if the specified constant is an array of i8.
2228 *
2229 * @see ConstantDataSequential::getAsString()
2230 */
2232
2233/**
2234 * Get the given constant data sequential as a string.
2235 *
2236 * @see ConstantDataSequential::getAsString()
2237 */
2238const char *LLVMGetAsString(LLVMValueRef c, size_t *Length);
2239
2240/**
2241 * Create an anonymous ConstantStruct with the specified values.
2242 *
2243 * @see llvm::ConstantStruct::getAnon()
2244 */
2246 LLVMValueRef *ConstantVals,
2247 unsigned Count, LLVMBool Packed);
2248
2249/**
2250 * Create a ConstantStruct in the global Context.
2251 *
2252 * This is the same as LLVMConstStructInContext except it operates on the
2253 * global Context.
2254 *
2255 * @see LLVMConstStructInContext()
2256 */
2257LLVMValueRef LLVMConstStruct(LLVMValueRef *ConstantVals, unsigned Count,
2258 LLVMBool Packed);
2259
2260/**
2261 * Create a ConstantArray from values.
2262 *
2263 * @deprecated LLVMConstArray is deprecated in favor of the API accurate
2264 * LLVMConstArray2
2265 * @see llvm::ConstantArray::get()
2266 */
2268 LLVMValueRef *ConstantVals, unsigned Length);
2269
2270/**
2271 * Create a ConstantArray from values.
2272 *
2273 * @see llvm::ConstantArray::get()
2274 */
2275LLVMValueRef LLVMConstArray2(LLVMTypeRef ElementTy, LLVMValueRef *ConstantVals,
2276 uint64_t Length);
2277
2278/**
2279 * Create a non-anonymous ConstantStruct from values.
2280 *
2281 * @see llvm::ConstantStruct::get()
2282 */
2284 LLVMValueRef *ConstantVals,
2285 unsigned Count);
2286
2287/**
2288 * Get element of a constant aggregate (struct, array or vector) at the
2289 * specified index. Returns null if the index is out of range, or it's not
2290 * possible to determine the element (e.g., because the constant is a
2291 * constant expression.)
2292 *
2293 * @see llvm::Constant::getAggregateElement()
2294 */
2296
2297/**
2298 * Get an element at specified index as a constant.
2299 *
2300 * @see ConstantDataSequential::getElementAsConstant()
2301 */
2304 "Use LLVMGetAggregateElement instead");
2305
2306/**
2307 * Create a ConstantVector from values.
2308 *
2309 * @see llvm::ConstantVector::get()
2310 */
2311LLVMValueRef LLVMConstVector(LLVMValueRef *ScalarConstantVals, unsigned Size);
2312
2313/**
2314 * @}
2315 */
2316
2317/**
2318 * @defgroup LLVMCCoreValueConstantExpressions Constant Expressions
2319 *
2320 * Functions in this group correspond to APIs on llvm::ConstantExpr.
2321 *
2322 * @see llvm::ConstantExpr.
2323 *
2324 * @{
2325 */
2333 "Use LLVMConstNull instead.");
2335LLVMValueRef LLVMConstAdd(LLVMValueRef LHSConstant, LLVMValueRef RHSConstant);
2336LLVMValueRef LLVMConstNSWAdd(LLVMValueRef LHSConstant, LLVMValueRef RHSConstant);
2337LLVMValueRef LLVMConstNUWAdd(LLVMValueRef LHSConstant, LLVMValueRef RHSConstant);
2338LLVMValueRef LLVMConstSub(LLVMValueRef LHSConstant, LLVMValueRef RHSConstant);
2339LLVMValueRef LLVMConstNSWSub(LLVMValueRef LHSConstant, LLVMValueRef RHSConstant);
2340LLVMValueRef LLVMConstNUWSub(LLVMValueRef LHSConstant, LLVMValueRef RHSConstant);
2341LLVMValueRef LLVMConstMul(LLVMValueRef LHSConstant, LLVMValueRef RHSConstant);
2342LLVMValueRef LLVMConstNSWMul(LLVMValueRef LHSConstant, LLVMValueRef RHSConstant);
2343LLVMValueRef LLVMConstNUWMul(LLVMValueRef LHSConstant, LLVMValueRef RHSConstant);
2344LLVMValueRef LLVMConstXor(LLVMValueRef LHSConstant, LLVMValueRef RHSConstant);
2346 LLVMValueRef LHSConstant, LLVMValueRef RHSConstant);
2348 LLVMValueRef LHSConstant, LLVMValueRef RHSConstant);
2349LLVMValueRef LLVMConstShl(LLVMValueRef LHSConstant, LLVMValueRef RHSConstant);
2351 LLVMValueRef *ConstantIndices, unsigned NumIndices);
2353 LLVMValueRef *ConstantIndices,
2354 unsigned NumIndices);
2361 LLVMTypeRef ToType);
2363 LLVMTypeRef ToType);
2365 LLVMValueRef IndexConstant);
2367 LLVMValueRef ElementValueConstant,
2368 LLVMValueRef IndexConstant);
2370 LLVMValueRef VectorBConstant,
2371 LLVMValueRef MaskConstant);
2373
2374/**
2375 * Gets the function associated with a given BlockAddress constant value.
2376 */
2378
2379/**
2380 * Gets the basic block associated with a given BlockAddress constant value.
2381 */
2383
2384/** Deprecated: Use LLVMGetInlineAsm instead. */
2386 const char *AsmString, const char *Constraints,
2387 LLVMBool HasSideEffects, LLVMBool IsAlignStack);
2388
2389/**
2390 * @}
2391 */
2392
2393/**
2394 * @defgroup LLVMCCoreValueConstantGlobals Global Values
2395 *
2396 * This group contains functions that operate on global values. Functions in
2397 * this group relate to functions in the llvm::GlobalValue class tree.
2398 *
2399 * @see llvm::GlobalValue
2400 *
2401 * @{
2402 */
2403
2407void LLVMSetLinkage(LLVMValueRef Global, LLVMLinkage Linkage);
2408const char *LLVMGetSection(LLVMValueRef Global);
2409void LLVMSetSection(LLVMValueRef Global, const char *Section);
2415void LLVMSetUnnamedAddress(LLVMValueRef Global, LLVMUnnamedAddr UnnamedAddr);
2416
2417/**
2418 * Returns the "value type" of a global value. This differs from the formal
2419 * type of a global value which is always a pointer type.
2420 *
2421 * @see llvm::GlobalValue::getValueType()
2422 */
2424
2425/** Deprecated: Use LLVMGetUnnamedAddress instead. */
2427/** Deprecated: Use LLVMSetUnnamedAddress instead. */
2428void LLVMSetUnnamedAddr(LLVMValueRef Global, LLVMBool HasUnnamedAddr);
2429
2430/**
2431 * @defgroup LLVMCCoreValueWithAlignment Values with alignment
2432 *
2433 * Functions in this group only apply to values with alignment, i.e.
2434 * global variables, load and store instructions.
2435 */
2436
2437/**
2438 * Obtain the preferred alignment of the value.
2439 * @see llvm::AllocaInst::getAlignment()
2440 * @see llvm::LoadInst::getAlignment()
2441 * @see llvm::StoreInst::getAlignment()
2442 * @see llvm::AtomicRMWInst::setAlignment()
2443 * @see llvm::AtomicCmpXchgInst::setAlignment()
2444 * @see llvm::GlobalValue::getAlignment()
2445 */
2446unsigned LLVMGetAlignment(LLVMValueRef V);
2447
2448/**
2449 * Set the preferred alignment of the value.
2450 * @see llvm::AllocaInst::setAlignment()
2451 * @see llvm::LoadInst::setAlignment()
2452 * @see llvm::StoreInst::setAlignment()
2453 * @see llvm::AtomicRMWInst::setAlignment()
2454 * @see llvm::AtomicCmpXchgInst::setAlignment()
2455 * @see llvm::GlobalValue::setAlignment()
2456 */
2457void LLVMSetAlignment(LLVMValueRef V, unsigned Bytes);
2458
2459/**
2460 * Sets a metadata attachment, erasing the existing metadata attachment if
2461 * it already exists for the given kind.
2462 *
2463 * @see llvm::GlobalObject::setMetadata()
2464 */
2465void LLVMGlobalSetMetadata(LLVMValueRef Global, unsigned Kind,
2466 LLVMMetadataRef MD);
2467
2468/**
2469 * Erases a metadata attachment of the given kind if it exists.
2470 *
2471 * @see llvm::GlobalObject::eraseMetadata()
2472 */
2473void LLVMGlobalEraseMetadata(LLVMValueRef Global, unsigned Kind);
2474
2475/**
2476 * Removes all metadata attachments from this value.
2477 *
2478 * @see llvm::GlobalObject::clearMetadata()
2479 */
2481
2482/**
2483 * Retrieves an array of metadata entries representing the metadata attached to
2484 * this value. The caller is responsible for freeing this array by calling
2485 * \c LLVMDisposeValueMetadataEntries.
2486 *
2487 * @see llvm::GlobalObject::getAllMetadata()
2488 */
2490 size_t *NumEntries);
2491
2492/**
2493 * Destroys value metadata entries.
2494 */
2496
2497/**
2498 * Returns the kind of a value metadata entry at a specific index.
2499 */
2501 unsigned Index);
2502
2503/**
2504 * Returns the underlying metadata node of a value metadata entry at a
2505 * specific index.
2506 */
2509 unsigned Index);
2510
2511/**
2512 * @}
2513 */
2514
2515/**
2516 * @defgroup LLVMCoreValueConstantGlobalVariable Global Variables
2517 *
2518 * This group contains functions that operate on global variable values.
2519 *
2520 * @see llvm::GlobalVariable
2521 *
2522 * @{
2523 */
2526 const char *Name,
2527 unsigned AddressSpace);
2533void LLVMDeleteGlobal(LLVMValueRef GlobalVar);
2535void LLVMSetInitializer(LLVMValueRef GlobalVar, LLVMValueRef ConstantVal);
2537void LLVMSetThreadLocal(LLVMValueRef GlobalVar, LLVMBool IsThreadLocal);
2539void LLVMSetGlobalConstant(LLVMValueRef GlobalVar, LLVMBool IsConstant);
2543void LLVMSetExternallyInitialized(LLVMValueRef GlobalVar, LLVMBool IsExtInit);
2544
2545/**
2546 * @}
2547 */
2548
2549/**
2550 * @defgroup LLVMCoreValueConstantGlobalAlias Global Aliases
2551 *
2552 * This group contains function that operate on global alias values.
2553 *
2554 * @see llvm::GlobalAlias
2555 *
2556 * @{
2557 */
2558
2559/**
2560 * Add a GlobalAlias with the given value type, address space and aliasee.
2561 *
2562 * @see llvm::GlobalAlias::create()
2563 */
2565 unsigned AddrSpace, LLVMValueRef Aliasee,
2566 const char *Name);
2567
2568/**
2569 * Obtain a GlobalAlias value from a Module by its name.
2570 *
2571 * The returned value corresponds to a llvm::GlobalAlias value.
2572 *
2573 * @see llvm::Module::getNamedAlias()
2574 */
2576 const char *Name, size_t NameLen);
2577
2578/**
2579 * Obtain an iterator to the first GlobalAlias in a Module.
2580 *
2581 * @see llvm::Module::alias_begin()
2582 */
2584
2585/**
2586 * Obtain an iterator to the last GlobalAlias in a Module.
2587 *
2588 * @see llvm::Module::alias_end()
2589 */
2591
2592/**
2593 * Advance a GlobalAlias iterator to the next GlobalAlias.
2594 *
2595 * Returns NULL if the iterator was already at the end and there are no more
2596 * global aliases.
2597 */
2599
2600/**
2601 * Decrement a GlobalAlias iterator to the previous GlobalAlias.
2602 *
2603 * Returns NULL if the iterator was already at the beginning and there are
2604 * no previous global aliases.
2605 */
2607
2608/**
2609 * Retrieve the target value of an alias.
2610 */
2612
2613/**
2614 * Set the target value of an alias.
2615 */
2616void LLVMAliasSetAliasee(LLVMValueRef Alias, LLVMValueRef Aliasee);
2617
2618/**
2619 * @}
2620 */
2621
2622/**
2623 * @defgroup LLVMCCoreValueFunction Function values
2624 *
2625 * Functions in this group operate on LLVMValueRef instances that
2626 * correspond to llvm::Function instances.
2627 *
2628 * @see llvm::Function
2629 *
2630 * @{
2631 */
2632
2633/**
2634 * Remove a function from its containing module and deletes it.
2635 *
2636 * @see llvm::Function::eraseFromParent()
2637 */
2639
2640/**
2641 * Check whether the given function has a personality function.
2642 *
2643 * @see llvm::Function::hasPersonalityFn()
2644 */
2646
2647/**
2648 * Obtain the personality function attached to the function.
2649 *
2650 * @see llvm::Function::getPersonalityFn()
2651 */
2653
2654/**
2655 * Set the personality function attached to the function.
2656 *
2657 * @see llvm::Function::setPersonalityFn()
2658 */
2659void LLVMSetPersonalityFn(LLVMValueRef Fn, LLVMValueRef PersonalityFn);
2660
2661/**
2662 * Obtain the intrinsic ID number which matches the given function name.
2663 *
2664 * @see llvm::Function::lookupIntrinsicID()
2665 */
2666unsigned LLVMLookupIntrinsicID(const char *Name, size_t NameLen);
2667
2668/**
2669 * Obtain the ID number from a function instance.
2670 *
2671 * @see llvm::Function::getIntrinsicID()
2672 */
2673unsigned LLVMGetIntrinsicID(LLVMValueRef Fn);
2674
2675/**
2676 * Create or insert the declaration of an intrinsic. For overloaded intrinsics,
2677 * parameter types must be provided to uniquely identify an overload.
2678 *
2679 * @see llvm::Intrinsic::getDeclaration()
2680 */
2682 unsigned ID,
2683 LLVMTypeRef *ParamTypes,
2684 size_t ParamCount);
2685
2686/**
2687 * Retrieves the type of an intrinsic. For overloaded intrinsics, parameter
2688 * types must be provided to uniquely identify an overload.
2689 *
2690 * @see llvm::Intrinsic::getType()
2691 */
2693 LLVMTypeRef *ParamTypes, size_t ParamCount);
2694
2695/**
2696 * Retrieves the name of an intrinsic.
2697 *
2698 * @see llvm::Intrinsic::getName()
2699 */
2700const char *LLVMIntrinsicGetName(unsigned ID, size_t *NameLength);
2701
2702/** Deprecated: Use LLVMIntrinsicCopyOverloadedName2 instead. */
2703const char *LLVMIntrinsicCopyOverloadedName(unsigned ID,
2704 LLVMTypeRef *ParamTypes,
2705 size_t ParamCount,
2706 size_t *NameLength);
2707
2708/**
2709 * Copies the name of an overloaded intrinsic identified by a given list of
2710 * parameter types.
2711 *
2712 * Unlike LLVMIntrinsicGetName, the caller is responsible for freeing the
2713 * returned string.
2714 *
2715 * This version also supports unnamed types.
2716 *
2717 * @see llvm::Intrinsic::getName()
2718 */
2719const char *LLVMIntrinsicCopyOverloadedName2(LLVMModuleRef Mod, unsigned ID,
2720 LLVMTypeRef *ParamTypes,
2721 size_t ParamCount,
2722 size_t *NameLength);
2723
2724/**
2725 * Obtain if the intrinsic identified by the given ID is overloaded.
2726 *
2727 * @see llvm::Intrinsic::isOverloaded()
2728 */
2730
2731/**
2732 * Obtain the calling function of a function.
2733 *
2734 * The returned value corresponds to the LLVMCallConv enumeration.
2735 *
2736 * @see llvm::Function::getCallingConv()
2737 */
2739
2740/**
2741 * Set the calling convention of a function.
2742 *
2743 * @see llvm::Function::setCallingConv()
2744 *
2745 * @param Fn Function to operate on
2746 * @param CC LLVMCallConv to set calling convention to
2747 */
2748void LLVMSetFunctionCallConv(LLVMValueRef Fn, unsigned CC);
2749
2750/**
2751 * Obtain the name of the garbage collector to use during code
2752 * generation.
2753 *
2754 * @see llvm::Function::getGC()
2755 */
2756const char *LLVMGetGC(LLVMValueRef Fn);
2757
2758/**
2759 * Define the garbage collector to use during code generation.
2760 *
2761 * @see llvm::Function::setGC()
2762 */
2763void LLVMSetGC(LLVMValueRef Fn, const char *Name);
2764
2765/**
2766 * Gets the prefix data associated with a function. Only valid on functions, and
2767 * only if LLVMHasPrefixData returns true.
2768 * See https://llvm.org/docs/LangRef.html#prefix-data
2769 */
2771
2772/**
2773 * Check if a given function has prefix data. Only valid on functions.
2774 * See https://llvm.org/docs/LangRef.html#prefix-data
2775 */
2777
2778/**
2779 * Sets the prefix data for the function. Only valid on functions.
2780 * See https://llvm.org/docs/LangRef.html#prefix-data
2781 */
2782void LLVMSetPrefixData(LLVMValueRef Fn, LLVMValueRef prefixData);
2783
2784/**
2785 * Gets the prologue data associated with a function. Only valid on functions,
2786 * and only if LLVMHasPrologueData returns true.
2787 * See https://llvm.org/docs/LangRef.html#prologue-data
2788 */
2790
2791/**
2792 * Check if a given function has prologue data. Only valid on functions.
2793 * See https://llvm.org/docs/LangRef.html#prologue-data
2794 */
2796
2797/**
2798 * Sets the prologue data for the function. Only valid on functions.
2799 * See https://llvm.org/docs/LangRef.html#prologue-data
2800 */
2801void LLVMSetPrologueData(LLVMValueRef Fn, LLVMValueRef prologueData);
2802
2803/**
2804 * Add an attribute to a function.
2805 *
2806 * @see llvm::Function::addAttribute()
2807 */
2812 LLVMAttributeRef *Attrs);
2815 unsigned KindID);
2818 const char *K, unsigned KLen);
2820 unsigned KindID);
2822 const char *K, unsigned KLen);
2823
2824/**
2825 * Add a target-dependent attribute to a function
2826 * @see llvm::AttrBuilder::addAttribute()
2827 */
2829 const char *V);
2830
2831/**
2832 * @defgroup LLVMCCoreValueFunctionParameters Function Parameters
2833 *
2834 * Functions in this group relate to arguments/parameters on functions.
2835 *
2836 * Functions in this group expect LLVMValueRef instances that correspond
2837 * to llvm::Function instances.
2838 *
2839 * @{
2840 */
2841
2842/**
2843 * Obtain the number of parameters in a function.
2844 *
2845 * @see llvm::Function::arg_size()
2846 */
2847unsigned LLVMCountParams(LLVMValueRef Fn);
2848
2849/**
2850 * Obtain the parameters in a function.
2851 *
2852 * The takes a pointer to a pre-allocated array of LLVMValueRef that is
2853 * at least LLVMCountParams() long. This array will be filled with
2854 * LLVMValueRef instances which correspond to the parameters the
2855 * function receives. Each LLVMValueRef corresponds to a llvm::Argument
2856 * instance.
2857 *
2858 * @see llvm::Function::arg_begin()
2859 */
2860void LLVMGetParams(LLVMValueRef Fn, LLVMValueRef *Params);
2861
2862/**
2863 * Obtain the parameter at the specified index.
2864 *
2865 * Parameters are indexed from 0.
2866 *
2867 * @see llvm::Function::arg_begin()
2868 */
2870
2871/**
2872 * Obtain the function to which this argument belongs.
2873 *
2874 * Unlike other functions in this group, this one takes an LLVMValueRef
2875 * that corresponds to a llvm::Attribute.
2876 *
2877 * The returned LLVMValueRef is the llvm::Function to which this
2878 * argument belongs.
2879 */
2881
2882/**
2883 * Obtain the first parameter to a function.
2884 *
2885 * @see llvm::Function::arg_begin()
2886 */
2888
2889/**
2890 * Obtain the last parameter to a function.
2891 *
2892 * @see llvm::Function::arg_end()
2893 */
2895
2896/**
2897 * Obtain the next parameter to a function.
2898 *
2899 * This takes an LLVMValueRef obtained from LLVMGetFirstParam() (which is
2900 * actually a wrapped iterator) and obtains the next parameter from the
2901 * underlying iterator.
2902 */
2904
2905/**
2906 * Obtain the previous parameter to a function.
2907 *
2908 * This is the opposite of LLVMGetNextParam().
2909 */
2911
2912/**
2913 * Set the alignment for a function parameter.
2914 *
2915 * @see llvm::Argument::addAttr()
2916 * @see llvm::AttrBuilder::addAlignmentAttr()
2917 */
2918void LLVMSetParamAlignment(LLVMValueRef Arg, unsigned Align);
2919
2920/**
2921 * @}
2922 */
2923
2924/**
2925 * @defgroup LLVMCCoreValueGlobalIFunc IFuncs
2926 *
2927 * Functions in this group relate to indirect functions.
2928 *
2929 * Functions in this group expect LLVMValueRef instances that correspond
2930 * to llvm::GlobalIFunc instances.
2931 *
2932 * @{
2933 */
2934
2935/**
2936 * Add a global indirect function to a module under a specified name.
2937 *
2938 * @see llvm::GlobalIFunc::create()
2939 */
2941 const char *Name, size_t NameLen,
2942 LLVMTypeRef Ty, unsigned AddrSpace,
2943 LLVMValueRef Resolver);
2944
2945/**
2946 * Obtain a GlobalIFunc value from a Module by its name.
2947 *
2948 * The returned value corresponds to a llvm::GlobalIFunc value.
2949 *
2950 * @see llvm::Module::getNamedIFunc()
2951 */
2953 const char *Name, size_t NameLen);
2954
2955/**
2956 * Obtain an iterator to the first GlobalIFunc in a Module.
2957 *
2958 * @see llvm::Module::ifunc_begin()
2959 */
2961
2962/**
2963 * Obtain an iterator to the last GlobalIFunc in a Module.
2964 *
2965 * @see llvm::Module::ifunc_end()
2966 */
2968
2969/**
2970 * Advance a GlobalIFunc iterator to the next GlobalIFunc.
2971 *
2972 * Returns NULL if the iterator was already at the end and there are no more
2973 * global aliases.
2974 */
2976
2977/**
2978 * Decrement a GlobalIFunc iterator to the previous GlobalIFunc.
2979 *
2980 * Returns NULL if the iterator was already at the beginning and there are
2981 * no previous global aliases.
2982 */
2984
2985/**
2986 * Retrieves the resolver function associated with this indirect function, or
2987 * NULL if it doesn't not exist.
2988 *
2989 * @see llvm::GlobalIFunc::getResolver()
2990 */
2992
2993/**
2994 * Sets the resolver function associated with this indirect function.
2995 *
2996 * @see llvm::GlobalIFunc::setResolver()
2997 */
2999
3000/**
3001 * Remove a global indirect function from its parent module and delete it.
3002 *
3003 * @see llvm::GlobalIFunc::eraseFromParent()
3004 */
3006
3007/**
3008 * Remove a global indirect function from its parent module.
3009 *
3010 * This unlinks the global indirect function from its containing module but
3011 * keeps it alive.
3012 *
3013 * @see llvm::GlobalIFunc::removeFromParent()
3014 */
3016
3017/**
3018 * @}
3019 */
3020
3021/**
3022 * @}
3023 */
3024
3025/**
3026 * @}
3027 */
3028
3029/**
3030 * @}
3031 */
3032
3033/**
3034 * @defgroup LLVMCCoreValueMetadata Metadata
3035 *
3036 * @{
3037 */
3038
3039/**
3040 * Create an MDString value from a given string value.
3041 *
3042 * The MDString value does not take ownership of the given string, it remains
3043 * the responsibility of the caller to free it.
3044 *
3045 * @see llvm::MDString::get()
3046 */
3048 size_t SLen);
3049
3050/**
3051 * Create an MDNode value with the given array of operands.
3052 *
3053 * @see llvm::MDNode::get()
3054 */
3056 size_t Count);
3057
3058/**
3059 * Obtain a Metadata as a Value.
3060 */
3062
3063/**
3064 * Obtain a Value as a Metadata.
3065 */
3067
3068/**
3069 * Obtain the underlying string from a MDString value.
3070 *
3071 * @param V Instance to obtain string from.
3072 * @param Length Memory address which will hold length of returned string.
3073 * @return String data in MDString.
3074 */
3075const char *LLVMGetMDString(LLVMValueRef V, unsigned *Length);
3076
3077/**
3078 * Obtain the number of operands from an MDNode value.
3079 *
3080 * @param V MDNode to get number of operands from.
3081 * @return Number of operands of the MDNode.
3082 */
3084
3085/**
3086 * Obtain the given MDNode's operands.
3087 *
3088 * The passed LLVMValueRef pointer should point to enough memory to hold all of
3089 * the operands of the given MDNode (see LLVMGetMDNodeNumOperands) as
3090 * LLVMValueRefs. This memory will be populated with the LLVMValueRefs of the
3091 * MDNode's operands.
3092 *
3093 * @param V MDNode to get the operands from.
3094 * @param Dest Destination array for operands.
3095 */
3097
3098/**
3099 * Replace an operand at a specific index in a llvm::MDNode value.
3100 *
3101 * @see llvm::MDNode::replaceOperandWith()
3102 */
3104 LLVMMetadataRef Replacement);
3105
3106/** Deprecated: Use LLVMMDStringInContext2 instead. */
3108 unsigned SLen);
3109/** Deprecated: Use LLVMMDStringInContext2 instead. */
3110LLVMValueRef LLVMMDString(const char *Str, unsigned SLen);
3111/** Deprecated: Use LLVMMDNodeInContext2 instead. */
3113 unsigned Count);
3114/** Deprecated: Use LLVMMDNodeInContext2 instead. */
3115LLVMValueRef LLVMMDNode(LLVMValueRef *Vals, unsigned Count);
3116
3117/**
3118 * @}
3119 */
3120
3121/**
3122 * @defgroup LLVMCCoreOperandBundle Operand Bundles
3123 *
3124 * Functions in this group operate on LLVMOperandBundleRef instances that
3125 * correspond to llvm::OperandBundleDef instances.
3126 *
3127 * @see llvm::OperandBundleDef
3128 *
3129 * @{
3130 */
3131
3132/**
3133 * Create a new operand bundle.
3134 *
3135 * Every invocation should be paired with LLVMDisposeOperandBundle() or memory
3136 * will be leaked.
3137 *
3138 * @param Tag Tag name of the operand bundle
3139 * @param TagLen Length of Tag
3140 * @param Args Memory address of an array of bundle operands
3141 * @param NumArgs Length of Args
3142 */
3143LLVMOperandBundleRef LLVMCreateOperandBundle(const char *Tag, size_t TagLen,
3144 LLVMValueRef *Args,
3145 unsigned NumArgs);
3146
3147/**
3148 * Destroy an operand bundle.
3149 *
3150 * This must be called for every created operand bundle or memory will be
3151 * leaked.
3152 */
3154
3155/**
3156 * Obtain the tag of an operand bundle as a string.
3157 *
3158 * @param Bundle Operand bundle to obtain tag of.
3159 * @param Len Out parameter which holds the length of the returned string.
3160 * @return The tag name of Bundle.
3161 * @see OperandBundleDef::getTag()
3162 */
3163const char *LLVMGetOperandBundleTag(LLVMOperandBundleRef Bundle, size_t *Len);
3164
3165/**
3166 * Obtain the number of operands for an operand bundle.
3167 *
3168 * @param Bundle Operand bundle to obtain operand count of.
3169 * @return The number of operands.
3170 * @see OperandBundleDef::input_size()
3171 */
3173
3174/**
3175 * Obtain the operand for an operand bundle at the given index.
3176 *
3177 * @param Bundle Operand bundle to obtain operand of.
3178 * @param Index An operand index, must be less than
3179 * LLVMGetNumOperandBundleArgs().
3180 * @return The operand.
3181 */
3183 unsigned Index);
3184
3185/**
3186 * @}
3187 */
3188
3189/**
3190 * @defgroup LLVMCCoreValueBasicBlock Basic Block
3191 *
3192 * A basic block represents a single entry single exit section of code.
3193 * Basic blocks contain a list of instructions which form the body of
3194 * the block.
3195 *
3196 * Basic blocks belong to functions. They have the type of label.
3197 *
3198 * Basic blocks are themselves values. However, the C API models them as
3199 * LLVMBasicBlockRef.
3200 *
3201 * @see llvm::BasicBlock
3202 *
3203 * @{
3204 */
3205
3206/**
3207 * Convert a basic block instance to a value type.
3208 */
3210
3211/**
3212 * Determine whether an LLVMValueRef is itself a basic block.
3213 */
3215
3216/**
3217 * Convert an LLVMValueRef to an LLVMBasicBlockRef instance.
3218 */
3220
3221/**
3222 * Obtain the string name of a basic block.
3223 */
3225
3226/**
3227 * Obtain the function to which a basic block belongs.
3228 *
3229 * @see llvm::BasicBlock::getParent()
3230 */
3232
3233/**
3234 * Obtain the terminator instruction for a basic block.
3235 *
3236 * If the basic block does not have a terminator (it is not well-formed
3237 * if it doesn't), then NULL is returned.
3238 *
3239 * The returned LLVMValueRef corresponds to an llvm::Instruction.
3240 *
3241 * @see llvm::BasicBlock::getTerminator()
3242 */
3244
3245/**
3246 * Obtain the number of basic blocks in a function.
3247 *
3248 * @param Fn Function value to operate on.
3249 */
3251
3252/**
3253 * Obtain all of the basic blocks in a function.
3254 *
3255 * This operates on a function value. The BasicBlocks parameter is a
3256 * pointer to a pre-allocated array of LLVMBasicBlockRef of at least
3257 * LLVMCountBasicBlocks() in length. This array is populated with
3258 * LLVMBasicBlockRef instances.
3259 */
3261
3262/**
3263 * Obtain the first basic block in a function.
3264 *
3265 * The returned basic block can be used as an iterator. You will likely
3266 * eventually call into LLVMGetNextBasicBlock() with it.
3267 *
3268 * @see llvm::Function::begin()
3269 */
3271
3272/**
3273 * Obtain the last basic block in a function.
3274 *
3275 * @see llvm::Function::end()
3276 */
3278
3279/**
3280 * Advance a basic block iterator.
3281 */
3283
3284/**
3285 * Go backwards in a basic block iterator.
3286 */
3288
3289/**
3290 * Obtain the basic block that corresponds to the entry point of a
3291 * function.
3292 *
3293 * @see llvm::Function::getEntryBlock()
3294 */
3296
3297/**
3298 * Insert the given basic block after the insertion point of the given builder.
3299 *
3300 * The insertion point must be valid.
3301 *
3302 * @see llvm::Function::BasicBlockListType::insertAfter()
3303 */
3306
3307/**
3308 * Append the given basic block to the basic block list of the given function.
3309 *
3310 * @see llvm::Function::BasicBlockListType::push_back()
3311 */
3314
3315/**
3316 * Create a new basic block without inserting it into a function.
3317 *
3318 * @see llvm::BasicBlock::Create()
3319 */
3321 const char *Name);
3322
3323/**
3324 * Append a basic block to the end of a function.
3325 *
3326 * @see llvm::BasicBlock::Create()
3327 */
3329 LLVMValueRef Fn,
3330 const char *Name);
3331
3332/**
3333 * Append a basic block to the end of a function using the global
3334 * context.
3335 *
3336 * @see llvm::BasicBlock::Create()
3337 */
3339
3340/**
3341 * Insert a basic block in a function before another basic block.
3342 *
3343 * The function to add to is determined by the function of the
3344 * passed basic block.
3345 *
3346 * @see llvm::BasicBlock::Create()
3347 */
3350 const char *Name);
3351
3352/**
3353 * Insert a basic block in a function using the global context.
3354 *
3355 * @see llvm::BasicBlock::Create()
3356 */
3358 const char *Name);
3359
3360/**
3361 * Remove a basic block from a function and delete it.
3362 *
3363 * This deletes the basic block from its containing function and deletes
3364 * the basic block itself.
3365 *
3366 * @see llvm::BasicBlock::eraseFromParent()
3367 */
3369
3370/**
3371 * Remove a basic block from a function.
3372 *
3373 * This deletes the basic block from its containing function but keep
3374 * the basic block alive.
3375 *
3376 * @see llvm::BasicBlock::removeFromParent()
3377 */
3379
3380/**
3381 * Move a basic block to before another one.
3382 *
3383 * @see llvm::BasicBlock::moveBefore()
3384 */
3386
3387/**
3388 * Move a basic block to after another one.
3389 *
3390 * @see llvm::BasicBlock::moveAfter()
3391 */
3393
3394/**
3395 * Obtain the first instruction in a basic block.
3396 *
3397 * The returned LLVMValueRef corresponds to a llvm::Instruction
3398 * instance.
3399 */
3401
3402/**
3403 * Obtain the last instruction in a basic block.
3404 *
3405 * The returned LLVMValueRef corresponds to an LLVM:Instruction.
3406 */
3408
3409/**
3410 * @}
3411 */
3412
3413/**
3414 * @defgroup LLVMCCoreValueInstruction Instructions
3415 *
3416 * Functions in this group relate to the inspection and manipulation of
3417 * individual instructions.
3418 *
3419 * In the C++ API, an instruction is modeled by llvm::Instruction. This
3420 * class has a large number of descendents. llvm::Instruction is a
3421 * llvm::Value and in the C API, instructions are modeled by
3422 * LLVMValueRef.
3423 *
3424 * This group also contains sub-groups which operate on specific
3425 * llvm::Instruction types, e.g. llvm::CallInst.
3426 *
3427 * @{
3428 */
3429
3430/**
3431 * Determine whether an instruction has any metadata attached.
3432 */
3434
3435/**
3436 * Return metadata associated with an instruction value.
3437 */
3438LLVMValueRef LLVMGetMetadata(LLVMValueRef Val, unsigned KindID);
3439
3440/**
3441 * Set metadata associated with an instruction value.
3442 */
3443void LLVMSetMetadata(LLVMValueRef Val, unsigned KindID, LLVMValueRef Node);
3444
3445/**
3446 * Returns the metadata associated with an instruction value, but filters out
3447 * all the debug locations.
3448 *
3449 * @see llvm::Instruction::getAllMetadataOtherThanDebugLoc()
3450 */
3453 size_t *NumEntries);
3454
3455/**
3456 * Obtain the basic block to which an instruction belongs.
3457 *
3458 * @see llvm::Instruction::getParent()
3459 */
3461
3462/**
3463 * Obtain the instruction that occurs after the one specified.
3464 *
3465 * The next instruction will be from the same basic block.
3466 *
3467 * If this is the last instruction in a basic block, NULL will be
3468 * returned.
3469 */
3471
3472/**
3473 * Obtain the instruction that occurred before this one.
3474 *
3475 * If the instruction is the first instruction in a basic block, NULL
3476 * will be returned.
3477 */
3479
3480/**
3481 * Remove an instruction.
3482 *
3483 * The instruction specified is removed from its containing building
3484 * block but is kept alive.
3485 *
3486 * @see llvm::Instruction::removeFromParent()
3487 */
3489
3490/**
3491 * Remove and delete an instruction.
3492 *
3493 * The instruction specified is removed from its containing building
3494 * block and then deleted.
3495 *
3496 * @see llvm::Instruction::eraseFromParent()
3497 */
3499
3500/**
3501 * Delete an instruction.
3502 *
3503 * The instruction specified is deleted. It must have previously been
3504 * removed from its containing building block.
3505 *
3506 * @see llvm::Value::deleteValue()
3507 */
3509
3510/**
3511 * Obtain the code opcode for an individual instruction.
3512 *
3513 * @see llvm::Instruction::getOpCode()
3514 */
3516
3517/**
3518 * Obtain the predicate of an instruction.
3519 *
3520 * This is only valid for instructions that correspond to llvm::ICmpInst
3521 * or llvm::ConstantExpr whose opcode is llvm::Instruction::ICmp.
3522 *
3523 * @see llvm::ICmpInst::getPredicate()
3524 */
3526
3527/**
3528 * Obtain the float predicate of an instruction.
3529 *
3530 * This is only valid for instructions that correspond to llvm::FCmpInst
3531 * or llvm::ConstantExpr whose opcode is llvm::Instruction::FCmp.
3532 *
3533 * @see llvm::FCmpInst::getPredicate()
3534 */
3536
3537/**
3538 * Create a copy of 'this' instruction that is identical in all ways
3539 * except the following:
3540 * * The instruction has no parent
3541 * * The instruction has no name
3542 *
3543 * @see llvm::Instruction::clone()
3544 */
3546
3547/**
3548 * Determine whether an instruction is a terminator. This routine is named to
3549 * be compatible with historical functions that did this by querying the
3550 * underlying C++ type.
3551 *
3552 * @see llvm::Instruction::isTerminator()
3553 */
3555
3556/**
3557 * @defgroup LLVMCCoreValueInstructionCall Call Sites and Invocations
3558 *
3559 * Functions in this group apply to instructions that refer to call
3560 * sites and invocations. These correspond to C++ types in the
3561 * llvm::CallInst class tree.
3562 *
3563 * @{
3564 */
3565
3566/**
3567 * Obtain the argument count for a call instruction.
3568 *
3569 * This expects an LLVMValueRef that corresponds to a llvm::CallInst,
3570 * llvm::InvokeInst, or llvm:FuncletPadInst.
3571 *
3572 * @see llvm::CallInst::getNumArgOperands()
3573 * @see llvm::InvokeInst::getNumArgOperands()
3574 * @see llvm::FuncletPadInst::getNumArgOperands()
3575 */
3576unsigned LLVMGetNumArgOperands(LLVMValueRef Instr);
3577
3578/**
3579 * Set the calling convention for a call instruction.
3580 *
3581 * This expects an LLVMValueRef that corresponds to a llvm::CallInst or
3582 * llvm::InvokeInst.
3583 *
3584 * @see llvm::CallInst::setCallingConv()
3585 * @see llvm::InvokeInst::setCallingConv()
3586 */
3587void LLVMSetInstructionCallConv(LLVMValueRef Instr, unsigned CC);
3588
3589/**
3590 * Obtain the calling convention for a call instruction.
3591 *
3592 * This is the opposite of LLVMSetInstructionCallConv(). Reads its
3593 * usage.
3594 *
3595 * @see LLVMSetInstructionCallConv()
3596 */
3598
3600 unsigned Align);
3601
3606 LLVMAttributeRef *Attrs);
3609 unsigned KindID);
3612 const char *K, unsigned KLen);
3614 unsigned KindID);
3616 const char *K, unsigned KLen);
3617
3618/**
3619 * Obtain the function type called by this instruction.
3620 *
3621 * @see llvm::CallBase::getFunctionType()
3622 */
3624
3625/**
3626 * Obtain the pointer to the function invoked by this instruction.
3627 *
3628 * This expects an LLVMValueRef that corresponds to a llvm::CallInst or
3629 * llvm::InvokeInst.
3630 *
3631 * @see llvm::CallInst::getCalledOperand()
3632 * @see llvm::InvokeInst::getCalledOperand()
3633 */
3635
3636/**
3637 * Obtain the number of operand bundles attached to this instruction.
3638 *
3639 * This only works on llvm::CallInst and llvm::InvokeInst instructions.
3640 *
3641 * @see llvm::CallBase::getNumOperandBundles()
3642 */
3644
3645/**
3646 * Obtain the operand bundle attached to this instruction at the given index.
3647 * Use LLVMDisposeOperandBundle to free the operand bundle.
3648 *
3649 * This only works on llvm::CallInst and llvm::InvokeInst instructions.
3650 */
3652 unsigned Index);
3653
3654/**
3655 * Obtain whether a call instruction is a tail call.
3656 *
3657 * This only works on llvm::CallInst instructions.
3658 *
3659 * @see llvm::CallInst::isTailCall()
3660 */
3662
3663/**
3664 * Set whether a call instruction is a tail call.
3665 *
3666 * This only works on llvm::CallInst instructions.
3667 *
3668 * @see llvm::CallInst::setTailCall()
3669 */
3670void LLVMSetTailCall(LLVMValueRef CallInst, LLVMBool IsTailCall);
3671
3672/**
3673 * Obtain a tail call kind of the call instruction.
3674 *
3675 * @see llvm::CallInst::setTailCallKind()
3676 */
3678
3679/**
3680 * Set the call kind of the call instruction.
3681 *
3682 * @see llvm::CallInst::getTailCallKind()
3683 */
3685
3686/**
3687 * Return the normal destination basic block.
3688 *
3689 * This only works on llvm::InvokeInst instructions.
3690 *
3691 * @see llvm::InvokeInst::getNormalDest()
3692 */
3694
3695/**
3696 * Return the unwind destination basic block.
3697 *
3698 * Works on llvm::InvokeInst, llvm::CleanupReturnInst, and
3699 * llvm::CatchSwitchInst instructions.
3700 *
3701 * @see llvm::InvokeInst::getUnwindDest()
3702 * @see llvm::CleanupReturnInst::getUnwindDest()
3703 * @see llvm::CatchSwitchInst::getUnwindDest()
3704 */
3706
3707/**
3708 * Set the normal destination basic block.
3709 *
3710 * This only works on llvm::InvokeInst instructions.
3711 *
3712 * @see llvm::InvokeInst::setNormalDest()
3713 */
3715
3716/**
3717 * Set the unwind destination basic block.
3718 *
3719 * Works on llvm::InvokeInst, llvm::CleanupReturnInst, and
3720 * llvm::CatchSwitchInst instructions.
3721 *
3722 * @see llvm::InvokeInst::setUnwindDest()
3723 * @see llvm::CleanupReturnInst::setUnwindDest()
3724 * @see llvm::CatchSwitchInst::setUnwindDest()
3725 */
3727
3728/**
3729 * @}
3730 */
3731
3732/**
3733 * @defgroup LLVMCCoreValueInstructionTerminator Terminators
3734 *
3735 * Functions in this group only apply to instructions for which
3736 * LLVMIsATerminatorInst returns true.
3737 *
3738 * @{
3739 */
3740
3741/**
3742 * Return the number of successors that this terminator has.
3743 *
3744 * @see llvm::Instruction::getNumSuccessors
3745 */
3746unsigned LLVMGetNumSuccessors(LLVMValueRef Term);
3747
3748/**
3749 * Return the specified successor.
3750 *
3751 * @see llvm::Instruction::getSuccessor
3752 */
3754
3755/**
3756 * Update the specified successor to point at the provided block.
3757 *
3758 * @see llvm::Instruction::setSuccessor
3759 */
3761
3762/**
3763 * Return if a branch is conditional.
3764 *
3765 * This only works on llvm::BranchInst instructions.
3766 *
3767 * @see llvm::BranchInst::isConditional
3768 */
3770
3771/**
3772 * Return the condition of a branch instruction.
3773 *
3774 * This only works on llvm::BranchInst instructions.
3775 *
3776 * @see llvm::BranchInst::getCondition
3777 */
3779
3780/**
3781 * Set the condition of a branch instruction.
3782 *
3783 * This only works on llvm::BranchInst instructions.
3784 *
3785 * @see llvm::BranchInst::setCondition
3786 */
3788
3789/**
3790 * Obtain the default destination basic block of a switch instruction.
3791 *
3792 * This only works on llvm::SwitchInst instructions.
3793 *
3794 * @see llvm::SwitchInst::getDefaultDest()
3795 */
3797
3798/**
3799 * @}
3800 */
3801
3802/**
3803 * @defgroup LLVMCCoreValueInstructionAlloca Allocas
3804 *
3805 * Functions in this group only apply to instructions that map to
3806 * llvm::AllocaInst instances.
3807 *
3808 * @{
3809 */
3810
3811/**
3812 * Obtain the type that is being allocated by the alloca instruction.
3813 */
3815
3816/**
3817 * @}
3818 */
3819
3820/**
3821 * @defgroup LLVMCCoreValueInstructionGetElementPointer GEPs
3822 *
3823 * Functions in this group only apply to instructions that map to
3824 * llvm::GetElementPtrInst instances.
3825 *
3826 * @{
3827 */
3828
3829/**
3830 * Check whether the given GEP operator is inbounds.
3831 */
3833
3834/**
3835 * Set the given GEP instruction to be inbounds or not.
3836 */
3838
3839/**
3840 * Get the source element type of the given GEP operator.
3841 */
3843
3844/**
3845 * @}
3846 */
3847
3848/**
3849 * @defgroup LLVMCCoreValueInstructionPHINode PHI Nodes
3850 *
3851 * Functions in this group only apply to instructions that map to
3852 * llvm::PHINode instances.
3853 *
3854 * @{
3855 */
3856
3857/**
3858 * Add an incoming value to the end of a PHI list.
3859 */
3860void LLVMAddIncoming(LLVMValueRef PhiNode, LLVMValueRef *IncomingValues,
3861 LLVMBasicBlockRef *IncomingBlocks, unsigned Count);
3862
3863/**
3864 * Obtain the number of incoming basic blocks to a PHI node.
3865 */
3866unsigned LLVMCountIncoming(LLVMValueRef PhiNode);
3867
3868/**
3869 * Obtain an incoming value to a PHI node as an LLVMValueRef.
3870 */
3872
3873/**
3874 * Obtain an incoming value to a PHI node as an LLVMBasicBlockRef.
3875 */
3877
3878/**
3879 * @}
3880 */
3881
3882/**
3883 * @defgroup LLVMCCoreValueInstructionExtractValue ExtractValue
3884 * @defgroup LLVMCCoreValueInstructionInsertValue InsertValue
3885 *
3886 * Functions in this group only apply to instructions that map to
3887 * llvm::ExtractValue and llvm::InsertValue instances.
3888 *
3889 * @{
3890 */
3891
3892/**
3893 * Obtain the number of indices.
3894 * NB: This also works on GEP operators.
3895 */
3896unsigned LLVMGetNumIndices(LLVMValueRef Inst);
3897
3898/**
3899 * Obtain the indices as an array.
3900 */
3901const unsigned *LLVMGetIndices(LLVMValueRef Inst);
3902
3903/**
3904 * @}
3905 */
3906
3907/**
3908 * @}
3909 */
3910
3911/**
3912 * @}
3913 */
3914
3915/**
3916 * @defgroup LLVMCCoreInstructionBuilder Instruction Builders
3917 *
3918 * An instruction builder represents a point within a basic block and is
3919 * the exclusive means of building instructions using the C interface.
3920 *
3921 * @{
3922 */
3923
3927 LLVMValueRef Instr);
3934 const char *Name);
3936
3937/* Metadata */
3938
3939/**
3940 * Get location information used by debugging information.
3941 *
3942 * @see llvm::IRBuilder::getCurrentDebugLocation()
3943 */
3945
3946/**
3947 * Set location information used by debugging information.
3948 *
3949 * To clear the location metadata of the given instruction, pass NULL to \p Loc.
3950 *
3951 * @see llvm::IRBuilder::SetCurrentDebugLocation()
3952 */
3954
3955/**
3956 * Attempts to set the debug location for the given instruction using the
3957 * current debug location for the given builder. If the builder has no current
3958 * debug location, this function is a no-op.
3959 *
3960 * @deprecated LLVMSetInstDebugLocation is deprecated in favor of the more general
3961 * LLVMAddMetadataToInst.
3962 *
3963 * @see llvm::IRBuilder::SetInstDebugLocation()
3964 */
3966
3967/**
3968 * Adds the metadata registered with the given builder to the given instruction.
3969 *
3970 * @see llvm::IRBuilder::AddMetadataToInst()
3971 */
3973
3974/**
3975 * Get the dafult floating-point math metadata for a given builder.
3976 *
3977 * @see llvm::IRBuilder::getDefaultFPMathTag()
3978 */
3980
3981/**
3982 * Set the default floating-point math metadata for the given builder.
3983 *
3984 * To clear the metadata, pass NULL to \p FPMathTag.
3985 *
3986 * @see llvm::IRBuilder::setDefaultFPMathTag()
3987 */
3989 LLVMMetadataRef FPMathTag);
3990
3991/**
3992 * Deprecated: Passing the NULL location will crash.
3993 * Use LLVMGetCurrentDebugLocation2 instead.
3994 */
3996/**
3997 * Deprecated: Returning the NULL location will crash.
3998 * Use LLVMGetCurrentDebugLocation2 instead.
3999 */
4001
4002/* Terminators */
4006 unsigned N);
4011 LLVMBasicBlockRef Else, unsigned NumCases);
4013 unsigned NumDests);
4015 LLVMValueRef *Args, unsigned NumArgs,
4017 const char *Name);
4020 unsigned NumArgs, LLVMBasicBlockRef Then, LLVMBasicBlockRef Catch,
4021 LLVMOperandBundleRef *Bundles, unsigned NumBundles, const char *Name);
4023
4024/* Exception Handling */
4027 LLVMValueRef PersFn, unsigned NumClauses,
4028 const char *Name);
4034 LLVMValueRef *Args, unsigned NumArgs,
4035 const char *Name);
4037 LLVMValueRef *Args, unsigned NumArgs,
4038 const char *Name);
4040 LLVMBasicBlockRef UnwindBB,
4041 unsigned NumHandlers, const char *Name);
4042
4043/* Add a case to the switch instruction */
4044void LLVMAddCase(LLVMValueRef Switch, LLVMValueRef OnVal,
4045 LLVMBasicBlockRef Dest);
4046
4047/* Add a destination to the indirectbr instruction */
4049
4050/* Get the number of clauses on the landingpad instruction */
4051unsigned LLVMGetNumClauses(LLVMValueRef LandingPad);
4052
4053/* Get the value of the clause at index Idx on the landingpad instruction */
4054LLVMValueRef LLVMGetClause(LLVMValueRef LandingPad, unsigned Idx);
4055
4056/* Add a catch or filter clause to the landingpad instruction */
4057void LLVMAddClause(LLVMValueRef LandingPad, LLVMValueRef ClauseVal);
4058
4059/* Get the 'cleanup' flag in the landingpad instruction */
4061
4062/* Set the 'cleanup' flag in the landingpad instruction */
4063void LLVMSetCleanup(LLVMValueRef LandingPad, LLVMBool Val);
4064
4065/* Add a destination to the catchswitch instruction */
4066void LLVMAddHandler(LLVMValueRef CatchSwitch, LLVMBasicBlockRef Dest);
4067
4068/* Get the number of handlers on the catchswitch instruction */
4069unsigned LLVMGetNumHandlers(LLVMValueRef CatchSwitch);
4070
4071/**
4072 * Obtain the basic blocks acting as handlers for a catchswitch instruction.
4073 *
4074 * The Handlers parameter should point to a pre-allocated array of
4075 * LLVMBasicBlockRefs at least LLVMGetNumHandlers() large. On return, the
4076 * first LLVMGetNumHandlers() entries in the array will be populated
4077 * with LLVMBasicBlockRef instances.
4078 *
4079 * @param CatchSwitch The catchswitch instruction to operate on.
4080 * @param Handlers Memory address of an array to be filled with basic blocks.
4081 */
4082void LLVMGetHandlers(LLVMValueRef CatchSwitch, LLVMBasicBlockRef *Handlers);
4083
4084/* Funclets */
4085
4086/* Get the number of funcletpad arguments. */
4087LLVMValueRef LLVMGetArgOperand(LLVMValueRef Funclet, unsigned i);
4088
4089/* Set a funcletpad argument at the given index. */
4090void LLVMSetArgOperand(LLVMValueRef Funclet, unsigned i, LLVMValueRef value);
4091
4092/**
4093 * Get the parent catchswitch instruction of a catchpad instruction.
4094 *
4095 * This only works on llvm::CatchPadInst instructions.
4096 *
4097 * @see llvm::CatchPadInst::getCatchSwitch()
4098 */
4100
4101/**
4102 * Set the parent catchswitch instruction of a catchpad instruction.
4103 *
4104 * This only works on llvm::CatchPadInst instructions.
4105 *
4106 * @see llvm::CatchPadInst::setCatchSwitch()
4107 */
4108void LLVMSetParentCatchSwitch(LLVMValueRef CatchPad, LLVMValueRef CatchSwitch);
4109
4110/* Arithmetic */
4112 const char *Name);
4114 const char *Name);
4116 const char *Name);
4118 const char *Name);
4120 const char *Name);
4122 const char *Name);
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);
4165 const char *Name);
4168 const char *Name);
4170 LLVMValueRef V,
4171 const char *Name),
4172 "Use LLVMBuildNeg + LLVMSetNUW instead.");
4175
4177void LLVMSetNUW(LLVMValueRef ArithInst, LLVMBool HasNUW);
4179void LLVMSetNSW(LLVMValueRef ArithInst, LLVMBool HasNSW);
4180LLVMBool LLVMGetExact(LLVMValueRef DivOrShrInst);
4181void LLVMSetExact(LLVMValueRef DivOrShrInst, LLVMBool IsExact);
4182
4183/**
4184 * Gets if the instruction has the non-negative flag set.
4185 * Only valid for zext instructions.
4186 */
4188/**
4189 * Sets the non-negative flag for the instruction.
4190 * Only valid for zext instructions.
4191 */
4192void LLVMSetNNeg(LLVMValueRef NonNegInst, LLVMBool IsNonNeg);
4193
4194/**
4195 * Get the flags for which fast-math-style optimizations are allowed for this
4196 * value.
4197 *
4198 * Only valid on floating point instructions.
4199 * @see LLVMCanValueUseFastMathFlags
4200 */
4202
4203/**
4204 * Sets the flags for which fast-math-style optimizations are allowed for this
4205 * value.
4206 *
4207 * Only valid on floating point instructions.
4208 * @see LLVMCanValueUseFastMathFlags
4209 */
4211
4212/**
4213 * Check if a given value can potentially have fast math flags.
4214 *
4215 * Will return true for floating point arithmetic instructions, and for select,
4216 * phi, and call instructions whose type is a floating point type, or a vector
4217 * or array thereof. See https://llvm.org/docs/LangRef.html#fast-math-flags
4218 */
4220
4221/**
4222 * Gets whether the instruction has the disjoint flag set.
4223 * Only valid for or instructions.
4224 */
4226/**
4227 * Sets the disjoint flag for the instruction.
4228 * Only valid for or instructions.
4229 */
4230void LLVMSetIsDisjoint(LLVMValueRef Inst, LLVMBool IsDisjoint);
4231
4232/* Memory */
4235 LLVMValueRef Val, const char *Name);
4236
4237/**
4238 * Creates and inserts a memset to the specified pointer and the
4239 * specified value.
4240 *
4241 * @see llvm::IRRBuilder::CreateMemSet()
4242 */
4244 LLVMValueRef Val, LLVMValueRef Len,
4245 unsigned Align);
4246/**
4247 * Creates and inserts a memcpy between the specified pointers.
4248 *
4249 * @see llvm::IRRBuilder::CreateMemCpy()
4250 */
4252 LLVMValueRef Dst, unsigned DstAlign,
4253 LLVMValueRef Src, unsigned SrcAlign,
4255/**
4256 * Creates and inserts a memmove between the specified pointers.
4257 *
4258 * @see llvm::IRRBuilder::CreateMemMove()
4259 */
4261 LLVMValueRef Dst, unsigned DstAlign,
4262 LLVMValueRef Src, unsigned SrcAlign,
4264
4267 LLVMValueRef Val, const char *Name);
4270 LLVMValueRef PointerVal, const char *Name);
4273 LLVMValueRef Pointer, LLVMValueRef *Indices,
4274 unsigned NumIndices, const char *Name);
4276 LLVMValueRef Pointer, LLVMValueRef *Indices,
4277 unsigned NumIndices, const char *Name);
4279 LLVMValueRef Pointer, unsigned Idx,
4280 const char *Name);
4282 const char *Name);
4284 const char *Name);
4285LLVMBool LLVMGetVolatile(LLVMValueRef MemoryAccessInst);
4286void LLVMSetVolatile(LLVMValueRef MemoryAccessInst, LLVMBool IsVolatile);
4287LLVMBool LLVMGetWeak(LLVMValueRef CmpXchgInst);
4288void LLVMSetWeak(LLVMValueRef CmpXchgInst, LLVMBool IsWeak);
4290void LLVMSetOrdering(LLVMValueRef MemoryAccessInst, LLVMAtomicOrdering Ordering);
4292void LLVMSetAtomicRMWBinOp(LLVMValueRef AtomicRMWInst, LLVMAtomicRMWBinOp BinOp);
4293
4294/* Casts */
4296 LLVMTypeRef DestTy, const char *Name);
4298 LLVMTypeRef DestTy, const char *Name);
4300 LLVMTypeRef DestTy, const char *Name);
4302 LLVMTypeRef DestTy, const char *Name);
4304 LLVMTypeRef DestTy, const char *Name);
4306 LLVMTypeRef DestTy, const char *Name);
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, LLVMBool IsSigned,
4333 const char *Name);
4335 LLVMTypeRef DestTy, const char *Name);
4336
4337/** Deprecated: This cast is always signed. Use LLVMBuildIntCast2 instead. */
4339 LLVMTypeRef DestTy, const char *Name);
4340
4342 LLVMTypeRef DestTy, LLVMBool DestIsSigned);
4343
4344/* Comparisons */
4347 const char *Name);
4350 const char *Name);
4351
4352/* Miscellaneous instructions */
4355 LLVMValueRef *Args, unsigned NumArgs,
4356 const char *Name);
4359 LLVMValueRef *Args, unsigned NumArgs,
4360 LLVMOperandBundleRef *Bundles,
4361 unsigned NumBundles, const char *Name);
4363 LLVMValueRef Then, LLVMValueRef Else,
4364 const char *Name);
4366 const char *Name);
4368 LLVMValueRef Index, const char *Name);
4371 const char *Name);
4373 LLVMValueRef V2, LLVMValueRef Mask,
4374 const char *Name);
4376 unsigned Index, const char *Name);
4378 LLVMValueRef EltVal, unsigned Index,
4379 const char *Name);
4381 const char *Name);
4382
4384 const char *Name);
4386 const char *Name);
4389 const char *Name);
4391 LLVMBool singleThread, const char *Name);
4393 LLVMValueRef PTR, LLVMValueRef Val,
4394 LLVMAtomicOrdering ordering,
4395 LLVMBool singleThread);
4397 LLVMValueRef Cmp, LLVMValueRef New,
4398 LLVMAtomicOrdering SuccessOrdering,
4399 LLVMAtomicOrdering FailureOrdering,
4401
4402/**
4403 * Get the number of elements in the mask of a ShuffleVector instruction.
4404 */
4405unsigned LLVMGetNumMaskElements(LLVMValueRef ShuffleVectorInst);
4406
4407/**
4408 * \returns a constant that specifies that the result of a \c ShuffleVectorInst
4409 * is undefined.
4410 */
4411int LLVMGetUndefMaskElem(void);
4412
4413/**
4414 * Get the mask value at position Elt in the mask of a ShuffleVector
4415 * instruction.
4416 *
4417 * \Returns the result of \c LLVMGetUndefMaskElem() if the mask value is
4418 * poison at that position.
4419 */
4420int LLVMGetMaskValue(LLVMValueRef ShuffleVectorInst, unsigned Elt);
4421
4424
4427 LLVMAtomicOrdering Ordering);
4430 LLVMAtomicOrdering Ordering);
4431
4432/**
4433 * @}
4434 */
4435
4436/**
4437 * @defgroup LLVMCCoreModuleProvider Module Providers
4438 *
4439 * @{
4440 */
4441
4442/**
4443 * Changes the type of M so it can be passed to FunctionPassManagers and the
4444 * JIT. They take ModuleProviders for historical reasons.
4445 */
4448
4449/**
4450 * Destroys the module M.
4451 */
4453
4454/**
4455 * @}
4456 */
4457
4458/**
4459 * @defgroup LLVMCCoreMemoryBuffers Memory Buffers
4460 *
4461 * @{
4462 */
4463
4465 LLVMMemoryBufferRef *OutMemBuf,
4466 char **OutMessage);
4468 char **OutMessage);
4470 size_t InputDataLength,
4471 const char *BufferName,
4472 LLVMBool RequiresNullTerminator);
4474 size_t InputDataLength,
4475 const char *BufferName);
4476const char *LLVMGetBufferStart(LLVMMemoryBufferRef MemBuf);
4479
4480/**
4481 * @}
4482 */
4483
4484/**
4485 * @defgroup LLVMCCorePassManagers Pass Managers
4486 * @ingroup LLVMCCore
4487 *
4488 * @{
4489 */
4490
4491/** Constructs a new whole-module pass pipeline. This type of pipeline is
4492 suitable for link-time optimization and whole-module transformations.
4493 @see llvm::PassManager::PassManager */
4495
4496/** Constructs a new function-by-function pass pipeline over the module
4497 provider. It does not take ownership of the module provider. This type of
4498 pipeline is suitable for code generation and JIT compilation tasks.
4499 @see llvm::FunctionPassManager::FunctionPassManager */
4501
4502/** Deprecated: Use LLVMCreateFunctionPassManagerForModule instead. */
4504
4505/** Initializes, executes on the provided module, and finalizes all of the
4506 passes scheduled in the pass manager. Returns 1 if any of the passes
4507 modified the module, 0 otherwise.
4508 @see llvm::PassManager::run(Module&) */
4510
4511/** Initializes all of the function passes scheduled in the function pass
4512 manager. Returns 1 if any of the passes modified the module, 0 otherwise.
4513 @see llvm::FunctionPassManager::doInitialization */
4515
4516/** Executes all of the function passes scheduled in the function pass manager
4517 on the provided function. Returns 1 if any of the passes modified the
4518 function, false otherwise.
4519 @see llvm::FunctionPassManager::run(Function&) */
4521
4522/** Finalizes all of the function passes scheduled in the function pass
4523 manager. Returns 1 if any of the passes modified the module, 0 otherwise.
4524 @see llvm::FunctionPassManager::doFinalization */
4526
4527/** Frees the memory of a pass pipeline. For function pipelines, does not free
4528 the module provider.
4529 @see llvm::PassManagerBase::~PassManagerBase. */
4531
4532/**
4533 * @}
4534 */
4535
4536/**
4537 * @defgroup LLVMCCoreThreading Threading
4538 *
4539 * Handle the structures needed to make LLVM safe for multithreading.
4540 *
4541 * @{
4542 */
4543
4544/** Deprecated: Multi-threading can only be enabled/disabled with the compile
4545 time define LLVM_ENABLE_THREADS. This function always returns
4546 LLVMIsMultithreaded(). */
4548
4549/** Deprecated: Multi-threading can only be enabled/disabled with the compile
4550 time define LLVM_ENABLE_THREADS. */
4551void LLVMStopMultithreaded(void);
4552
4553/** Check whether LLVM is executing in thread-safe mode or not.
4554 @see llvm::llvm_is_multithreaded */
4556
4557/**
4558 * @}
4559 */
4560
4561/**
4562 * @}
4563 */
4564
4565/**
4566 * @}
4567 */
4568
4570
4571#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:1566
LLVMValueRef LLVMBuildNUWNeg(LLVMBuilderRef B, LLVMValueRef V, const char *Name)
Definition: Core.cpp:3572
LLVMValueRef LLVMConstNUWNeg(LLVMValueRef ConstantVal)
Definition: Core.cpp:1664
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:95
unsigned LLVMGetEnumAttributeKind(LLVMAttributeRef A)
Get the unique id corresponding to the enum attribute passed as argument.
Definition: Core.cpp:158
void LLVMContextSetDiscardValueNames(LLVMContextRef C, LLVMBool Discard)
Set whether the given context discards all value names.
Definition: Core.cpp:126
uint64_t LLVMGetEnumAttributeValue(LLVMAttributeRef A)
Get the enum attribute's value.
Definition: Core.cpp:162
LLVMTypeRef LLVMGetTypeAttributeValue(LLVMAttributeRef A)
Get the type attribute's value.
Definition: Core.cpp:176
unsigned LLVMGetMDKindIDInContext(LLVMContextRef C, const char *Name, unsigned SLen)
Definition: Core.cpp:134
LLVMDiagnosticSeverity LLVMGetDiagInfoSeverity(LLVMDiagnosticInfoRef DI)
Return an enum LLVMDiagnosticSeverity.
Definition: Core.cpp:226
char * LLVMGetDiagInfoDescription(LLVMDiagnosticInfoRef DI)
Return a string representation of the DiagnosticInfo.
Definition: Core.cpp:215
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:143
LLVMDiagnosticHandler LLVMContextGetDiagnosticHandler(LLVMContextRef C)
Get the diagnostic handler of this context.
Definition: Core.cpp:106
LLVMBool LLVMContextShouldDiscardValueNames(LLVMContextRef C)
Retrieve whether the given context is set to discard all value names.
Definition: Core.cpp:122
LLVMAttributeRef LLVMCreateTypeAttribute(LLVMContextRef C, unsigned KindID, LLVMTypeRef type_ref)
Create a type attribute.
Definition: Core.cpp:169
LLVMAttributeRef LLVMCreateStringAttribute(LLVMContextRef C, const char *K, unsigned KLength, const char *V, unsigned VLength)
Create a string attribute.
Definition: Core.cpp:181
void LLVMContextDispose(LLVMContextRef C)
Destroy a context instance.
Definition: Core.cpp:130
LLVMAttributeRef LLVMCreateEnumAttribute(LLVMContextRef C, unsigned KindID, uint64_t Val)
Create an enum attribute.
Definition: Core.cpp:151
const char * LLVMGetStringAttributeKind(LLVMAttributeRef A, unsigned *Length)
Get the string attribute's kind.
Definition: Core.cpp:188
LLVMTypeRef LLVMGetTypeByName2(LLVMContextRef C, const char *Name)
Obtain a Type from a context by its registered name.
Definition: Core.cpp:834
LLVMContextRef LLVMContextCreate(void)
Create a new context.
Definition: Core.cpp:91
void(* LLVMYieldCallback)(LLVMContextRef, void *)
Definition: Core.h:550
unsigned LLVMGetLastEnumAttributeKind(void)
Definition: Core.cpp:147
LLVMBool LLVMIsStringAttribute(LLVMAttributeRef A)
Definition: Core.cpp:207
LLVMBool LLVMIsTypeAttribute(LLVMAttributeRef A)
Definition: Core.cpp:211
const char * LLVMGetStringAttributeValue(LLVMAttributeRef A, unsigned *Length)
Get the string attribute's value.
Definition: Core.cpp:195
void LLVMContextSetYieldCallback(LLVMContextRef C, LLVMYieldCallback Callback, void *OpaqueHandle)
Set the yield callback function for this context.
Definition: Core.cpp:115
unsigned LLVMGetMDKindID(const char *Name, unsigned SLen)
Definition: Core.cpp:139
void LLVMContextSetDiagnosticHandler(LLVMContextRef C, LLVMDiagnosticHandler Handler, void *DiagnosticContext)
Set the diagnostic handler for this context.
Definition: Core.cpp:97
void(* LLVMDiagnosticHandler)(LLVMDiagnosticInfoRef, void *)
Definition: Core.h:549
void * LLVMContextGetDiagnosticContext(LLVMContextRef C)
Get the diagnostic context of this context.
Definition: Core.cpp:111
LLVMBool LLVMIsEnumAttribute(LLVMAttributeRef A)
Check for the different types of attributes.
Definition: Core.cpp:202
LLVMValueRef LLVMBuildLoad2(LLVMBuilderRef, LLVMTypeRef Ty, LLVMValueRef PointerVal, const char *Name)
Definition: Core.cpp:3713
LLVMValueRef LLVMBuildGlobalStringPtr(LLVMBuilderRef B, const char *Str, const char *Name)
Definition: Core.cpp:3846
LLVMValueRef LLVMBuildFence(LLVMBuilderRef B, LLVMAtomicOrdering ordering, LLVMBool singleThread, const char *Name)
Definition: Core.cpp:3810
LLVMValueRef LLVMBuildAtomicRMW(LLVMBuilderRef B, LLVMAtomicRMWBinOp op, LLVMValueRef PTR, LLVMValueRef Val, LLVMAtomicOrdering ordering, LLVMBool singleThread)
Definition: Core.cpp:4147
LLVMBool LLVMGetIsDisjoint(LLVMValueRef Inst)
Gets whether the instruction has the disjoint flag set.
Definition: Core.cpp:3644
LLVMValueRef LLVMBuildNot(LLVMBuilderRef, LLVMValueRef V, const char *Name)
Definition: Core.cpp:3584
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:3254
LLVMValueRef LLVMBuildNSWSub(LLVMBuilderRef, LLVMValueRef LHS, LLVMValueRef RHS, const char *Name)
Definition: Core.cpp:3451
LLVMValueRef LLVMBuildAnd(LLVMBuilderRef, LLVMValueRef LHS, LLVMValueRef RHS, const char *Name)
Definition: Core.cpp:3541
LLVMValueRef LLVMBuildFPExt(LLVMBuilderRef, LLVMValueRef Val, LLVMTypeRef DestTy, const char *Name)
Definition: Core.cpp:3958
void LLVMClearInsertionPosition(LLVMBuilderRef Builder)
Definition: Core.cpp:3149
LLVMValueRef LLVMBuildFDiv(LLVMBuilderRef, LLVMValueRef LHS, LLVMValueRef RHS, const char *Name)
Definition: Core.cpp:3506
void LLVMSetWeak(LLVMValueRef CmpXchgInst, LLVMBool IsWeak)
Definition: Core.cpp:3877
void LLVMSetNSW(LLVMValueRef ArithInst, LLVMBool HasNSW)
Definition: Core.cpp:3603
LLVMValueRef LLVMBuildFreeze(LLVMBuilderRef, LLVMValueRef Val, const char *Name)
Definition: Core.cpp:4125
LLVMValueRef LLVMBuildFAdd(LLVMBuilderRef, LLVMValueRef LHS, LLVMValueRef RHS, const char *Name)
Definition: Core.cpp:3441
LLVMValueRef LLVMBuildFMul(LLVMBuilderRef, LLVMValueRef LHS, LLVMValueRef RHS, const char *Name)
Definition: Core.cpp:3481
LLVMValueRef LLVMBuildZExt(LLVMBuilderRef, LLVMValueRef Val, LLVMTypeRef DestTy, const char *Name)
Definition: Core.cpp:3923
LLVMValueRef LLVMBuildSExt(LLVMBuilderRef, LLVMValueRef Val, LLVMTypeRef DestTy, const char *Name)
Definition: Core.cpp:3928
LLVMValueRef LLVMBuildTruncOrBitCast(LLVMBuilderRef, LLVMValueRef Val, LLVMTypeRef DestTy, const char *Name)
Definition: Core.cpp:3995
LLVMValueRef LLVMBuildSExtOrBitCast(LLVMBuilderRef, LLVMValueRef Val, LLVMTypeRef DestTy, const char *Name)
Definition: Core.cpp:3989
LLVMValueRef LLVMBuildBitCast(LLVMBuilderRef, LLVMValueRef Val, LLVMTypeRef DestTy, const char *Name)
Definition: Core.cpp:3973
void LLVMBuilderSetDefaultFPMathTag(LLVMBuilderRef Builder, LLVMMetadataRef FPMathTag)
Set the default floating-point math metadata for the given builder.
Definition: Core.cpp:3199
LLVMValueRef LLVMBuildExtractValue(LLVMBuilderRef, LLVMValueRef AggVal, unsigned Index, const char *Name)
Definition: Core.cpp:4113
LLVMValueRef LLVMBuildFCmp(LLVMBuilderRef, LLVMRealPredicate Op, LLVMValueRef LHS, LLVMValueRef RHS, const char *Name)
Definition: Core.cpp:4045
void LLVMSetCmpXchgFailureOrdering(LLVMValueRef CmpXchgInst, LLVMAtomicOrdering Ordering)
Definition: Core.cpp:4233
LLVMValueRef LLVMBuildFPTrunc(LLVMBuilderRef, LLVMValueRef Val, LLVMTypeRef DestTy, const char *Name)
Definition: Core.cpp:3953
LLVMAtomicOrdering LLVMGetCmpXchgFailureOrdering(LLVMValueRef CmpXchgInst)
Definition: Core.cpp:4228
LLVMOpcode LLVMGetCastOpcode(LLVMValueRef Src, LLVMBool SrcIsSigned, LLVMTypeRef DestTy, LLVMBool DestIsSigned)
Definition: Core.cpp:4030
LLVMAtomicRMWBinOp LLVMGetAtomicRMWBinOp(LLVMValueRef AtomicRMWInst)
Definition: Core.cpp:3908
void LLVMSetNUW(LLVMValueRef ArithInst, LLVMBool HasNUW)
Definition: Core.cpp:3593
LLVMValueRef LLVMBuildSIToFP(LLVMBuilderRef, LLVMValueRef Val, LLVMTypeRef DestTy, const char *Name)
Definition: Core.cpp:3948
LLVMValueRef LLVMBuildShl(LLVMBuilderRef, LLVMValueRef LHS, LLVMValueRef RHS, const char *Name)
Definition: Core.cpp:3526
void LLVMSetCurrentDebugLocation2(LLVMBuilderRef Builder, LLVMMetadataRef Loc)
Set location information used by debugging information.
Definition: Core.cpp:3172
int LLVMGetUndefMaskElem(void)
Definition: Core.cpp:4183
LLVMBool LLVMGetWeak(LLVMValueRef CmpXchgInst)
Definition: Core.cpp:3873
LLVMValueRef LLVMBuildFRem(LLVMBuilderRef, LLVMValueRef LHS, LLVMValueRef RHS, const char *Name)
Definition: Core.cpp:3521
LLVMValueRef LLVMBuildAlloca(LLVMBuilderRef, LLVMTypeRef Ty, const char *Name)
Definition: Core.cpp:3699
LLVMValueRef LLVMBuildSelect(LLVMBuilderRef, LLVMValueRef If, LLVMValueRef Then, LLVMValueRef Else, const char *Name)
Definition: Core.cpp:4081
LLVMValueRef LLVMBuildCatchPad(LLVMBuilderRef B, LLVMValueRef ParentPad, LLVMValueRef *Args, unsigned NumArgs, const char *Name)
Definition: Core.cpp:3280
void LLVMSetIsDisjoint(LLVMValueRef Inst, LLVMBool IsDisjoint)
Sets the disjoint flag for the instruction.
Definition: Core.cpp:3649
LLVMValueRef LLVMBuildMul(LLVMBuilderRef, LLVMValueRef LHS, LLVMValueRef RHS, const char *Name)
Definition: Core.cpp:3466
LLVMValueRef LLVMBuildExactSDiv(LLVMBuilderRef, LLVMValueRef LHS, LLVMValueRef RHS, const char *Name)
Definition: Core.cpp:3501
LLVMValueRef LLVMBuildNUWSub(LLVMBuilderRef, LLVMValueRef LHS, LLVMValueRef RHS, const char *Name)
Definition: Core.cpp:3456
LLVMValueRef LLVMBuildMalloc(LLVMBuilderRef, LLVMTypeRef Ty, const char *Name)
Definition: Core.cpp:3656
LLVMValueRef LLVMBuildIsNull(LLVMBuilderRef, LLVMValueRef Val, const char *Name)
Definition: Core.cpp:4130
LLVMValueRef LLVMBuildLandingPad(LLVMBuilderRef B, LLVMTypeRef Ty, LLVMValueRef PersFn, unsigned NumClauses, const char *Name)
Definition: Core.cpp:3268
LLVMValueRef LLVMBuildAggregateRet(LLVMBuilderRef, LLVMValueRef *RetVals, unsigned N)
Definition: Core.cpp:3221
LLVMValueRef LLVMBuildAShr(LLVMBuilderRef, LLVMValueRef LHS, LLVMValueRef RHS, const char *Name)
Definition: Core.cpp:3536
LLVMValueRef LLVMBuildInvoke2(LLVMBuilderRef, LLVMTypeRef Ty, LLVMValueRef Fn, LLVMValueRef *Args, unsigned NumArgs, LLVMBasicBlockRef Then, LLVMBasicBlockRef Catch, const char *Name)
Definition: Core.cpp:3245
LLVMValueRef LLVMBuildCallWithOperandBundles(LLVMBuilderRef, LLVMTypeRef, LLVMValueRef Fn, LLVMValueRef *Args, unsigned NumArgs, LLVMOperandBundleRef *Bundles, unsigned NumBundles, const char *Name)
Definition: Core.cpp:4067
LLVMValueRef LLVMBuildExactUDiv(LLVMBuilderRef, LLVMValueRef LHS, LLVMValueRef RHS, const char *Name)
Definition: Core.cpp:3491
void LLVMSetOrdering(LLVMValueRef MemoryAccessInst, LLVMAtomicOrdering Ordering)
Definition: Core.cpp:3895
void LLVMSetCleanup(LLVMValueRef LandingPad, LLVMBool Val)
Definition: Core.cpp:3354
LLVMValueRef LLVMGetArgOperand(LLVMValueRef Funclet, unsigned i)
Definition: Core.cpp:3383
LLVMValueRef LLVMBuildInsertValue(LLVMBuilderRef, LLVMValueRef AggVal, LLVMValueRef EltVal, unsigned Index, const char *Name)
Definition: Core.cpp:4118
LLVMValueRef LLVMBuildAdd(LLVMBuilderRef, LLVMValueRef LHS, LLVMValueRef RHS, const char *Name)
Definition: Core.cpp:3426
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:3674
LLVMValueRef LLVMBuildBr(LLVMBuilderRef, LLVMBasicBlockRef Dest)
Definition: Core.cpp:3226
LLVMValueRef LLVMBuildNSWMul(LLVMBuilderRef, LLVMValueRef LHS, LLVMValueRef RHS, const char *Name)
Definition: Core.cpp:3471
LLVMValueRef LLVMBuildBinOp(LLVMBuilderRef B, LLVMOpcode Op, LLVMValueRef LHS, LLVMValueRef RHS, const char *Name)
Definition: Core.cpp:3556
LLVMValueRef LLVMBuildSRem(LLVMBuilderRef, LLVMValueRef LHS, LLVMValueRef RHS, const char *Name)
Definition: Core.cpp:3516
void LLVMDisposeBuilder(LLVMBuilderRef Builder)
Definition: Core.cpp:3162
int LLVMGetMaskValue(LLVMValueRef ShuffleVectorInst, unsigned Elt)
Get the mask value at position Elt in the mask of a ShuffleVector instruction.
Definition: Core.cpp:4177
LLVMValueRef LLVMBuildFSub(LLVMBuilderRef, LLVMValueRef LHS, LLVMValueRef RHS, const char *Name)
Definition: Core.cpp:3461
LLVMValueRef LLVMGetClause(LLVMValueRef LandingPad, unsigned Idx)
Definition: Core.cpp:3342
LLVMMetadataRef LLVMGetCurrentDebugLocation2(LLVMBuilderRef Builder)
Get location information used by debugging information.
Definition: Core.cpp:3168
LLVMValueRef LLVMBuildArrayAlloca(LLVMBuilderRef, LLVMTypeRef Ty, LLVMValueRef Val, const char *Name)
Definition: Core.cpp:3704
LLVMValueRef LLVMBuildVAArg(LLVMBuilderRef, LLVMValueRef List, LLVMTypeRef Ty, const char *Name)
Definition: Core.cpp:4088
LLVMBuilderRef LLVMCreateBuilderInContext(LLVMContextRef C)
Definition: Core.cpp:3120
LLVMValueRef LLVMBuildAtomicCmpXchg(LLVMBuilderRef B, LLVMValueRef Ptr, LLVMValueRef Cmp, LLVMValueRef New, LLVMAtomicOrdering SuccessOrdering, LLVMAtomicOrdering FailureOrdering, LLVMBool SingleThread)
Definition: Core.cpp:4158
LLVMValueRef LLVMBuildICmp(LLVMBuilderRef, LLVMIntPredicate Op, LLVMValueRef LHS, LLVMValueRef RHS, const char *Name)
Definition: Core.cpp:4038
LLVMValueRef LLVMBuildPointerCast(LLVMBuilderRef, LLVMValueRef Val, LLVMTypeRef DestTy, const char *Name)
Definition: Core.cpp:4007
LLVMValueRef LLVMGetParentCatchSwitch(LLVMValueRef CatchPad)
Get the parent catchswitch instruction of a catchpad instruction.
Definition: Core.cpp:3372
void LLVMSetAtomicSingleThread(LLVMValueRef AtomicInst, LLVMBool SingleThread)
Definition: Core.cpp:4200
LLVMValueRef LLVMBuildCast(LLVMBuilderRef B, LLVMOpcode Op, LLVMValueRef Val, LLVMTypeRef DestTy, const char *Name)
Definition: Core.cpp:4001
LLVMValueRef LLVMBuildTrunc(LLVMBuilderRef, LLVMValueRef Val, LLVMTypeRef DestTy, const char *Name)
Definition: Core.cpp:3918
LLVMValueRef LLVMBuildURem(LLVMBuilderRef, LLVMValueRef LHS, LLVMValueRef RHS, const char *Name)
Definition: Core.cpp:3511
void LLVMSetAtomicRMWBinOp(LLVMValueRef AtomicRMWInst, LLVMAtomicRMWBinOp BinOp)
Definition: Core.cpp:3912
LLVMValueRef LLVMBuildCall2(LLVMBuilderRef, LLVMTypeRef, LLVMValueRef Fn, LLVMValueRef *Args, unsigned NumArgs, const char *Name)
Definition: Core.cpp:4058
void LLVMAddClause(LLVMValueRef LandingPad, LLVMValueRef ClauseVal)
Definition: Core.cpp:3346
LLVMValueRef LLVMBuildOr(LLVMBuilderRef, LLVMValueRef LHS, LLVMValueRef RHS, const char *Name)
Definition: Core.cpp:3546
LLVMBool LLVMGetNUW(LLVMValueRef ArithInst)
Definition: Core.cpp:3588
LLVMValueRef LLVMBuildAddrSpaceCast(LLVMBuilderRef, LLVMValueRef Val, LLVMTypeRef DestTy, const char *Name)
Definition: Core.cpp:3978
LLVMValueRef LLVMBuildFPToUI(LLVMBuilderRef, LLVMValueRef Val, LLVMTypeRef DestTy, const char *Name)
Definition: Core.cpp:3933
void LLVMSetCurrentDebugLocation(LLVMBuilderRef Builder, LLVMValueRef L)
Deprecated: Passing the NULL location will crash.
Definition: Core.cpp:3179
LLVMValueRef LLVMBuildFPToSI(LLVMBuilderRef, LLVMValueRef Val, LLVMTypeRef DestTy, const char *Name)
Definition: Core.cpp:3938
LLVMValueRef LLVMBuildIntCast2(LLVMBuilderRef, LLVMValueRef Val, LLVMTypeRef DestTy, LLVMBool IsSigned, const char *Name)
Definition: Core.cpp:4012
LLVMValueRef LLVMBuildNSWAdd(LLVMBuilderRef, LLVMValueRef LHS, LLVMValueRef RHS, const char *Name)
Definition: Core.cpp:3431
LLVMValueRef LLVMBuildFNeg(LLVMBuilderRef, LLVMValueRef V, const char *Name)
Definition: Core.cpp:3580
LLVMMetadataRef LLVMBuilderGetDefaultFPMathTag(LLVMBuilderRef Builder)
Get the dafult floating-point math metadata for a given builder.
Definition: Core.cpp:3207
LLVMValueRef LLVMBuildUDiv(LLVMBuilderRef, LLVMValueRef LHS, LLVMValueRef RHS, const char *Name)
Definition: Core.cpp:3486
void LLVMSetParentCatchSwitch(LLVMValueRef CatchPad, LLVMValueRef CatchSwitch)
Set the parent catchswitch instruction of a catchpad instruction.
Definition: Core.cpp:3376
LLVMValueRef LLVMBuildCatchRet(LLVMBuilderRef B, LLVMValueRef CatchPad, LLVMBasicBlockRef BB)
Definition: Core.cpp:3313
LLVMValueRef LLVMBuildStructGEP2(LLVMBuilderRef B, LLVMTypeRef Ty, LLVMValueRef Pointer, unsigned Idx, const char *Name)
Definition: Core.cpp:3834
unsigned LLVMGetNumClauses(LLVMValueRef LandingPad)
Definition: Core.cpp:3338
LLVMBool LLVMGetNNeg(LLVMValueRef NonNegInst)
Gets if the instruction has the non-negative flag set.
Definition: Core.cpp:3618
LLVMValueRef LLVMBuildSDiv(LLVMBuilderRef, LLVMValueRef LHS, LLVMValueRef RHS, const char *Name)
Definition: Core.cpp:3496
LLVMValueRef LLVMBuildStore(LLVMBuilderRef, LLVMValueRef Val, LLVMValueRef Ptr)
Definition: Core.cpp:3718
LLVMValueRef LLVMBuildCatchSwitch(LLVMBuilderRef B, LLVMValueRef ParentPad, LLVMBasicBlockRef UnwindBB, unsigned NumHandlers, const char *Name)
Definition: Core.cpp:3302
LLVMValueRef LLVMBuildIntCast(LLVMBuilderRef, LLVMValueRef Val, LLVMTypeRef DestTy, const char *Name)
Deprecated: This cast is always signed.
Definition: Core.cpp:4019
LLVMValueRef LLVMBuildArrayMalloc(LLVMBuilderRef, LLVMTypeRef Ty, LLVMValueRef Val, const char *Name)
Definition: Core.cpp:3665
LLVMValueRef LLVMBuildZExtOrBitCast(LLVMBuilderRef, LLVMValueRef Val, LLVMTypeRef DestTy, const char *Name)
Definition: Core.cpp:3983
LLVMValueRef LLVMBuildInBoundsGEP2(LLVMBuilderRef B, LLVMTypeRef Ty, LLVMValueRef Pointer, LLVMValueRef *Indices, unsigned NumIndices, const char *Name)
Definition: Core.cpp:3826
void LLVMGetHandlers(LLVMValueRef CatchSwitch, LLVMBasicBlockRef *Handlers)
Obtain the basic blocks acting as handlers for a catchswitch instruction.
Definition: Core.cpp:3366
LLVMAtomicOrdering LLVMGetOrdering(LLVMValueRef MemoryAccessInst)
Definition: Core.cpp:3881
LLVMValueRef LLVMBuildUIToFP(LLVMBuilderRef, LLVMValueRef Val, LLVMTypeRef DestTy, const char *Name)
Definition: Core.cpp:3943
LLVMValueRef LLVMBuildIntToPtr(LLVMBuilderRef, LLVMValueRef Val, LLVMTypeRef DestTy, const char *Name)
Definition: Core.cpp:3968
LLVMValueRef LLVMBuildCondBr(LLVMBuilderRef, LLVMValueRef If, LLVMBasicBlockRef Then, LLVMBasicBlockRef Else)
Definition: Core.cpp:3230
LLVMValueRef LLVMBuildIndirectBr(LLVMBuilderRef B, LLVMValueRef Addr, unsigned NumDests)
Definition: Core.cpp:3240
void LLVMAddDestination(LLVMValueRef IndirectBr, LLVMBasicBlockRef Dest)
Definition: Core.cpp:3334
LLVMValueRef LLVMBuildNSWNeg(LLVMBuilderRef B, LLVMValueRef V, const char *Name)
Definition: Core.cpp:3567
LLVMValueRef LLVMBuildXor(LLVMBuilderRef, LLVMValueRef LHS, LLVMValueRef RHS, const char *Name)
Definition: Core.cpp:3551
LLVMValueRef LLVMBuildGlobalString(LLVMBuilderRef B, const char *Str, const char *Name)
Definition: Core.cpp:3841
LLVMBool LLVMGetExact(LLVMValueRef DivOrShrInst)
Definition: Core.cpp:3608
LLVMValueRef LLVMBuildIsNotNull(LLVMBuilderRef, LLVMValueRef Val, const char *Name)
Definition: Core.cpp:4135
void LLVMSetArgOperand(LLVMValueRef Funclet, unsigned i, LLVMValueRef value)
Definition: Core.cpp:3387
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:3681
LLVMValueRef LLVMBuildPtrDiff2(LLVMBuilderRef, LLVMTypeRef ElemTy, LLVMValueRef LHS, LLVMValueRef RHS, const char *Name)
Definition: Core.cpp:4140
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:3191
void LLVMAddMetadataToInst(LLVMBuilderRef Builder, LLVMValueRef Inst)
Adds the metadata registered with the given builder to the given instruction.
Definition: Core.cpp:3195
LLVMValueRef LLVMBuildSub(LLVMBuilderRef, LLVMValueRef LHS, LLVMValueRef RHS, const char *Name)
Definition: Core.cpp:3446
LLVMValueRef LLVMBuildNUWAdd(LLVMBuilderRef, LLVMValueRef LHS, LLVMValueRef RHS, const char *Name)
Definition: Core.cpp:3436
LLVMValueRef LLVMBuildUnreachable(LLVMBuilderRef)
Definition: Core.cpp:3325
LLVMValueRef LLVMBuildShuffleVector(LLVMBuilderRef, LLVMValueRef V1, LLVMValueRef V2, LLVMValueRef Mask, const char *Name)
Definition: Core.cpp:4106
void LLVMSetVolatile(LLVMValueRef MemoryAccessInst, LLVMBool IsVolatile)
Definition: Core.cpp:3862
LLVMValueRef LLVMBuildFree(LLVMBuilderRef, LLVMValueRef PointerVal)
Definition: Core.cpp:3709
LLVMValueRef LLVMBuildGEP2(LLVMBuilderRef B, LLVMTypeRef Ty, LLVMValueRef Pointer, LLVMValueRef *Indices, unsigned NumIndices, const char *Name)
Definition: Core.cpp:3819
unsigned LLVMGetNumHandlers(LLVMValueRef CatchSwitch)
Definition: Core.cpp:3362
LLVMValueRef LLVMBuildFPCast(LLVMBuilderRef, LLVMValueRef Val, LLVMTypeRef DestTy, const char *Name)
Definition: Core.cpp:4025
LLVMBuilderRef LLVMCreateBuilder(void)
Definition: Core.cpp:3124
void LLVMSetCmpXchgSuccessOrdering(LLVMValueRef CmpXchgInst, LLVMAtomicOrdering Ordering)
Definition: Core.cpp:4220
LLVMValueRef LLVMBuildPhi(LLVMBuilderRef, LLVMTypeRef Ty, const char *Name)
Definition: Core.cpp:4054
LLVMBool LLVMCanValueUseFastMathFlags(LLVMValueRef Inst)
Check if a given value can potentially have fast math flags.
Definition: Core.cpp:3639
void LLVMAddCase(LLVMValueRef Switch, LLVMValueRef OnVal, LLVMBasicBlockRef Dest)
Definition: Core.cpp:3329
LLVMBool LLVMIsAtomicSingleThread(LLVMValueRef AtomicInst)
Definition: Core.cpp:4185
LLVMValueRef LLVMBuildResume(LLVMBuilderRef B, LLVMValueRef Exn)
Definition: Core.cpp:3298
LLVMValueRef LLVMBuildSwitch(LLVMBuilderRef, LLVMValueRef V, LLVMBasicBlockRef Else, unsigned NumCases)
Definition: Core.cpp:3235
void LLVMInsertIntoBuilder(LLVMBuilderRef Builder, LLVMValueRef Instr)
Definition: Core.cpp:3153
LLVMValueRef LLVMBuildPtrToInt(LLVMBuilderRef, LLVMValueRef Val, LLVMTypeRef DestTy, const char *Name)
Definition: Core.cpp:3963
LLVMBool LLVMIsCleanup(LLVMValueRef LandingPad)
Definition: Core.cpp:3350
LLVMBool LLVMGetNSW(LLVMValueRef ArithInst)
Definition: Core.cpp:3598
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:3690
LLVMValueRef LLVMBuildLShr(LLVMBuilderRef, LLVMValueRef LHS, LLVMValueRef RHS, const char *Name)
Definition: Core.cpp:3531
unsigned LLVMGetNumMaskElements(LLVMValueRef ShuffleVectorInst)
Get the number of elements in the mask of a ShuffleVector instruction.
Definition: Core.cpp:4171
LLVMValueRef LLVMBuildRetVoid(LLVMBuilderRef)
Definition: Core.cpp:3213
LLVMValueRef LLVMBuildRet(LLVMBuilderRef, LLVMValueRef V)
Definition: Core.cpp:3217
void LLVMAddHandler(LLVMValueRef CatchSwitch, LLVMBasicBlockRef Dest)
Definition: Core.cpp:3358
LLVMValueRef LLVMBuildExtractElement(LLVMBuilderRef, LLVMValueRef VecVal, LLVMValueRef Index, const char *Name)
Definition: Core.cpp:4093
void LLVMPositionBuilderBefore(LLVMBuilderRef Builder, LLVMValueRef Instr)
Definition: Core.cpp:3135
LLVMValueRef LLVMGetCurrentDebugLocation(LLVMBuilderRef Builder)
Deprecated: Returning the NULL location will crash.
Definition: Core.cpp:3185
LLVMAtomicOrdering LLVMGetCmpXchgSuccessOrdering(LLVMValueRef CmpXchgInst)
Definition: Core.cpp:4215
void LLVMSetNNeg(LLVMValueRef NonNegInst, LLVMBool IsNonNeg)
Sets the non-negative flag for the instruction.
Definition: Core.cpp:3623
void LLVMSetExact(LLVMValueRef DivOrShrInst, LLVMBool IsExact)
Definition: Core.cpp:3613
LLVMBasicBlockRef LLVMGetInsertBlock(LLVMBuilderRef Builder)
Definition: Core.cpp:3145
LLVMValueRef LLVMBuildCleanupPad(LLVMBuilderRef B, LLVMValueRef ParentPad, LLVMValueRef *Args, unsigned NumArgs, const char *Name)
Definition: Core.cpp:3287
void LLVMInsertIntoBuilderWithName(LLVMBuilderRef Builder, LLVMValueRef Instr, const char *Name)
Definition: Core.cpp:3157
void LLVMSetFastMathFlags(LLVMValueRef FPMathInst, LLVMFastMathFlags FMF)
Sets the flags for which fast-math-style optimizations are allowed for this value.
Definition: Core.cpp:3634
LLVMFastMathFlags LLVMGetFastMathFlags(LLVMValueRef FPMathInst)
Get the flags for which fast-math-style optimizations are allowed for this value.
Definition: Core.cpp:3628
LLVMValueRef LLVMBuildNeg(LLVMBuilderRef, LLVMValueRef V, const char *Name)
Definition: Core.cpp:3563
LLVMBool LLVMGetVolatile(LLVMValueRef MemoryAccessInst)
Definition: Core.cpp:3851
LLVMValueRef LLVMBuildNUWMul(LLVMBuilderRef, LLVMValueRef LHS, LLVMValueRef RHS, const char *Name)
Definition: Core.cpp:3476
void LLVMPositionBuilder(LLVMBuilderRef Builder, LLVMBasicBlockRef Block, LLVMValueRef Instr)
Definition: Core.cpp:3128
void LLVMPositionBuilderAtEnd(LLVMBuilderRef Builder, LLVMBasicBlockRef Block)
Definition: Core.cpp:3140
LLVMValueRef LLVMBuildInsertElement(LLVMBuilderRef, LLVMValueRef VecVal, LLVMValueRef EltVal, LLVMValueRef Index, const char *Name)
Definition: Core.cpp:4099
LLVMValueRef LLVMBuildCleanupRet(LLVMBuilderRef B, LLVMValueRef CatchPad, LLVMBasicBlockRef BB)
Definition: Core.cpp:3319
void LLVMDisposeMemoryBuffer(LLVMMemoryBufferRef MemBuf)
Definition: Core.cpp:4309
size_t LLVMGetBufferSize(LLVMMemoryBufferRef MemBuf)
Definition: Core.cpp:4305
LLVMBool LLVMCreateMemoryBufferWithSTDIN(LLVMMemoryBufferRef *OutMemBuf, char **OutMessage)
Definition: Core.cpp:4269
LLVMMemoryBufferRef LLVMCreateMemoryBufferWithMemoryRange(const char *InputData, size_t InputDataLength, const char *BufferName, LLVMBool RequiresNullTerminator)
Definition: Core.cpp:4280
LLVMBool LLVMCreateMemoryBufferWithContentsOfFile(const char *Path, LLVMMemoryBufferRef *OutMemBuf, char **OutMessage)
Definition: Core.cpp:4255
const char * LLVMGetBufferStart(LLVMMemoryBufferRef MemBuf)
Definition: Core.cpp:4301
LLVMMemoryBufferRef LLVMCreateMemoryBufferWithMemoryRangeCopy(const char *InputData, size_t InputDataLength, const char *BufferName)
Definition: Core.cpp:4291
LLVMModuleProviderRef LLVMCreateModuleProviderForExistingModule(LLVMModuleRef M)
Changes the type of M so it can be passed to FunctionPassManagers and the JIT.
Definition: Core.cpp:4244
void LLVMDisposeModuleProvider(LLVMModuleProviderRef M)
Destroys the module M.
Definition: Core.cpp:4248
const char * LLVMGetModuleIdentifier(LLVMModuleRef M, size_t *Len)
Obtain the identifier of a module.
Definition: Core.cpp:262
void LLVMSetDataLayout(LLVMModuleRef M, const char *DataLayoutStr)
Set the data layout for a module.
Definition: Core.cpp:291
LLVMValueRef LLVMAddFunction(LLVMModuleRef M, const char *Name, LLVMTypeRef FunctionTy)
Add a function to a module under a specified name.
Definition: Core.cpp:2294
LLVMBool LLVMIsNewDbgInfoFormat(LLVMModuleRef M)
Soon to be deprecated.
Definition: Core.cpp:407
LLVMNamedMDNodeRef LLVMGetPreviousNamedMetadata(LLVMNamedMDNodeRef NamedMDNode)
Decrement a NamedMDNode iterator to the previous NamedMDNode.
Definition: Core.cpp:1322
LLVMTypeRef LLVMGetTypeByName(LLVMModuleRef M, const char *Name)
Deprecated: Use LLVMGetTypeByName2 instead.
Definition: Core.cpp:830
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:278
void LLVMDumpModule(LLVMModuleRef M)
Dump a representation of a module to stderr.
Definition: Core.cpp:417
void LLVMAppendModuleInlineAsm(LLVMModuleRef M, const char *Asm, size_t Len)
Append inline assembly to a module.
Definition: Core.cpp:463
LLVMValueRef LLVMGetFirstFunction(LLVMModuleRef M)
Obtain an iterator to the first Function in a Module.
Definition: Core.cpp:2304
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:1417
LLVMBool LLVMPrintModuleToFile(LLVMModuleRef M, const char *Filename, char **ErrorMessage)
Print a representation of a module to a file.
Definition: Core.cpp:422
void LLVMDisposeModule(LLVMModuleRef M)
Destroy a module instance.
Definition: Core.cpp:258
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:473
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:1393
const char * LLVMGetModuleInlineAsm(LLVMModuleRef M, size_t *Len)
Get inline assembly for a module.
Definition: Core.cpp:467
const char * LLVMGetSourceFileName(LLVMModuleRef M, size_t *Len)
Obtain the module's original source file name.
Definition: Core.cpp:272
const char * LLVMGetNamedMetadataName(LLVMNamedMDNodeRef NamedMD, size_t *NameLen)
Retrieve the name of a NamedMDNode.
Definition: Core.cpp:1340
LLVMContextRef LLVMGetModuleContext(LLVMModuleRef M)
Obtain the context to which this module is associated.
Definition: Core.cpp:549
const char * LLVMGetInlineAsmConstraintString(LLVMValueRef InlineAsmVal, size_t *Len)
Get the raw constraint string for an inline assembly snippet.
Definition: Core.cpp:502
LLVMModuleRef LLVMModuleCreateWithNameInContext(const char *ModuleID, LLVMContextRef C)
Create a new, empty module in a specific context.
Definition: Core.cpp:253
LLVMMetadataRef LLVMModuleFlagEntriesGetMetadata(LLVMModuleFlagEntry *Entries, unsigned Index)
Returns the metadata for a module flag entry at a specific index.
Definition: Core.cpp:388
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:380
LLVMValueRef LLVMGetLastFunction(LLVMModuleRef M)
Obtain an iterator to the last Function in a Module.
Definition: Core.cpp:2312
void LLVMSetTarget(LLVMModuleRef M, const char *Triple)
Set the target triple for a module.
Definition: Core.cpp:300
const char * LLVMGetDataLayoutStr(LLVMModuleRef M)
Obtain the data layout for a module.
Definition: Core.cpp:283
const char * LLVMGetInlineAsmAsmString(LLVMValueRef InlineAsmVal, size_t *Len)
Get the template string used for an inline assembly snippet.
Definition: Core.cpp:493
LLVMModuleFlagBehavior LLVMModuleFlagEntriesGetFlagBehavior(LLVMModuleFlagEntry *Entries, unsigned Index)
Returns the flag behavior for a module flag entry at a specific index.
Definition: Core.cpp:373
unsigned LLVMGetDebugLocColumn(LLVMValueRef Val)
Return the column number of the debug location for this value, which must be an llvm::Instruction.
Definition: Core.cpp:1463
unsigned LLVMGetDebugLocLine(LLVMValueRef Val)
Return the line number of the debug location for this value, which must be an llvm::Instruction,...
Definition: Core.cpp:1441
LLVMBool LLVMGetInlineAsmNeedsAlignedStack(LLVMValueRef InlineAsmVal)
Get if the inline asm snippet needs an aligned stack.
Definition: Core.cpp:538
LLVMModuleRef LLVMModuleCreateWithName(const char *ModuleID)
Create a new, empty module in the global context.
Definition: Core.cpp:249
LLVMModuleFlagEntry * LLVMCopyModuleFlagsMetadata(LLVMModuleRef M, size_t *Len)
Returns the module flags as an array of flag-key-value triples.
Definition: Core.cpp:351
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:400
void LLVMSetModuleInlineAsm(LLVMModuleRef M, const char *Asm)
Deprecated: Use LLVMSetModuleInlineAsm2 instead.
Definition: Core.cpp:459
LLVMBool LLVMGetInlineAsmHasSideEffects(LLVMValueRef InlineAsmVal)
Get if the inline asm snippet has side effects.
Definition: Core.cpp:533
void LLVMDisposeModuleFlagsMetadata(LLVMModuleFlagEntry *Entries)
Destroys module flags metadata entries.
Definition: Core.cpp:368
LLVMInlineAsmDialect LLVMGetInlineAsmDialect(LLVMValueRef InlineAsmVal)
Get the dialect used by the inline asm snippet.
Definition: Core.cpp:512
unsigned LLVMGetNamedMetadataNumOperands(LLVMModuleRef M, const char *Name)
Obtain the number of operands for named metadata in a module.
Definition: Core.cpp:1366
const char * LLVMGetTarget(LLVMModuleRef M)
Obtain the target triple for a module.
Definition: Core.cpp:296
LLVMNamedMDNodeRef LLVMGetNextNamedMetadata(LLVMNamedMDNodeRef NamedMDNode)
Advance a NamedMDNode iterator to the next NamedMDNode.
Definition: Core.cpp:1314
void LLVMSetModuleInlineAsm2(LLVMModuleRef M, const char *Asm, size_t Len)
Set inline assembly for a module.
Definition: Core.cpp:455
LLVMNamedMDNodeRef LLVMGetLastNamedMetadata(LLVMModuleRef M)
Obtain an iterator to the last NamedMDNode in a Module.
Definition: Core.cpp:1306
LLVMBool LLVMGetInlineAsmCanUnwind(LLVMValueRef InlineAsmVal)
Get if the inline asm snippet may unwind the stack.
Definition: Core.cpp:543
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:395
LLVMModuleRef LLVMCloneModule(LLVMModuleRef M)
Return an exact copy of the specified module.
const char * LLVMGetDataLayout(LLVMModuleRef M)
Definition: Core.cpp:287
LLVMValueRef LLVMGetNamedFunction(LLVMModuleRef M, const char *Name)
Obtain a Function value from a Module by its name.
Definition: Core.cpp:2300
void LLVMSetIsNewDbgInfoFormat(LLVMModuleRef M, LLVMBool UseNewFormat)
Soon to be deprecated.
Definition: Core.cpp:411
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:1330
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:1335
LLVMValueRef LLVMGetPreviousFunction(LLVMValueRef Fn)
Decrement a Function iterator to the previous Function.
Definition: Core.cpp:2328
char * LLVMPrintModuleToString(LLVMModuleRef M)
Return a string representation of the module.
Definition: Core.cpp:444
void LLVMGetNamedMetadataOperands(LLVMModuleRef M, const char *Name, LLVMValueRef *Dest)
Obtain the named metadata operands for a module.
Definition: Core.cpp:1373
LLVMValueRef LLVMGetNextFunction(LLVMValueRef Fn)
Advance a Function iterator to the next Function.
Definition: Core.cpp:2320
LLVMTypeRef LLVMGetInlineAsmFunctionType(LLVMValueRef InlineAsmVal)
Get the function type of the inline assembly snippet.
Definition: Core.cpp:528
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:268
void LLVMAddNamedMetadataOperand(LLVMModuleRef M, const char *Name, LLVMValueRef Val)
Add an operand to named metadata.
Definition: Core.cpp:1383
LLVMNamedMDNodeRef LLVMGetFirstNamedMetadata(LLVMModuleRef M)
Obtain an iterator to the first NamedMDNode in a Module.
Definition: Core.cpp:1298
LLVMValueRef LLVMGetOperandBundleArgAtIndex(LLVMOperandBundleRef Bundle, unsigned Index)
Obtain the operand for an operand bundle at the given index.
Definition: Core.cpp:2666
unsigned LLVMGetNumOperandBundleArgs(LLVMOperandBundleRef Bundle)
Obtain the number of operands for an operand bundle.
Definition: Core.cpp:2662
LLVMOperandBundleRef LLVMCreateOperandBundle(const char *Tag, size_t TagLen, LLVMValueRef *Args, unsigned NumArgs)
Create a new operand bundle.
Definition: Core.cpp:2645
void LLVMDisposeOperandBundle(LLVMOperandBundleRef Bundle)
Destroy an operand bundle.
Definition: Core.cpp:2652
const char * LLVMGetOperandBundleTag(LLVMOperandBundleRef Bundle, size_t *Len)
Obtain the tag of an operand bundle as a string.
Definition: Core.cpp:2656
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:4328
LLVMPassManagerRef LLVMCreateFunctionPassManager(LLVMModuleProviderRef MP)
Deprecated: Use LLVMCreateFunctionPassManagerForModule instead.
Definition: Core.cpp:4323
LLVMPassManagerRef LLVMCreatePassManager(void)
Constructs a new whole-module pass pipeline.
Definition: Core.cpp:4315
void LLVMDisposePassManager(LLVMPassManagerRef PM)
Frees the memory of a pass pipeline.
Definition: Core.cpp:4344
LLVMBool LLVMFinalizeFunctionPassManager(LLVMPassManagerRef FPM)
Finalizes all of the function passes scheduled in the function pass manager.
Definition: Core.cpp:4340
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:4336
LLVMBool LLVMInitializeFunctionPassManager(LLVMPassManagerRef FPM)
Initializes all of the function passes scheduled in the function pass manager.
Definition: Core.cpp:4332
LLVMPassManagerRef LLVMCreateFunctionPassManagerForModule(LLVMModuleRef M)
Constructs a new function-by-function pass pipeline over the module provider.
Definition: Core.cpp:4319
LLVMBool LLVMIsMultithreaded(void)
Check whether LLVM is executing in thread-safe mode or not.
Definition: Core.cpp:4357
LLVMBool LLVMStartMultithreaded(void)
Deprecated: Multi-threading can only be enabled/disabled with the compile time define LLVM_ENABLE_THR...
Definition: Core.cpp:4350
void LLVMStopMultithreaded(void)
Deprecated: Multi-threading can only be enabled/disabled with the compile time define LLVM_ENABLE_THR...
Definition: Core.cpp:4354
LLVMTypeRef LLVMFP128Type(void)
Definition: Core.cpp:730
LLVMTypeRef LLVMFP128TypeInContext(LLVMContextRef C)
Obtain a 128-bit floating point type (112-bit mantissa) from a context.
Definition: Core.cpp:702
LLVMTypeRef LLVMDoubleTypeInContext(LLVMContextRef C)
Obtain a 64-bit floating point type from a context.
Definition: Core.cpp:696
LLVMTypeRef LLVMX86FP80TypeInContext(LLVMContextRef C)
Obtain a 80-bit floating point type (X87) from a context.
Definition: Core.cpp:699
LLVMTypeRef LLVMHalfTypeInContext(LLVMContextRef C)
Obtain a 16-bit floating point type from a context.
Definition: Core.cpp:687
LLVMTypeRef LLVMBFloatTypeInContext(LLVMContextRef C)
Obtain a 16-bit brain floating point type from a context.
Definition: Core.cpp:690
LLVMTypeRef LLVMBFloatType(void)
Definition: Core.cpp:718
LLVMTypeRef LLVMFloatTypeInContext(LLVMContextRef C)
Obtain a 32-bit floating point type from a context.
Definition: Core.cpp:693
LLVMTypeRef LLVMHalfType(void)
Obtain a floating point type from the global context.
Definition: Core.cpp:715
LLVMTypeRef LLVMX86FP80Type(void)
Definition: Core.cpp:727
LLVMTypeRef LLVMPPCFP128Type(void)
Definition: Core.cpp:733
LLVMTypeRef LLVMFloatType(void)
Definition: Core.cpp:721
LLVMTypeRef LLVMDoubleType(void)
Definition: Core.cpp:724
LLVMTypeRef LLVMPPCFP128TypeInContext(LLVMContextRef C)
Obtain a 128-bit floating point type (two 64-bits) from a context.
Definition: Core.cpp:705
LLVMBool LLVMIsFunctionVarArg(LLVMTypeRef FunctionTy)
Returns whether a function type is variadic.
Definition: Core.cpp:752
unsigned LLVMCountParamTypes(LLVMTypeRef FunctionTy)
Obtain the number of parameters this function accepts.
Definition: Core.cpp:760
void LLVMGetParamTypes(LLVMTypeRef FunctionTy, LLVMTypeRef *Dest)
Obtain the types of a function's parameters.
Definition: Core.cpp:764
LLVMTypeRef LLVMFunctionType(LLVMTypeRef ReturnType, LLVMTypeRef *ParamTypes, unsigned ParamCount, LLVMBool IsVarArg)
Obtain a function type consisting of a specified signature.
Definition: Core.cpp:745
LLVMTypeRef LLVMGetReturnType(LLVMTypeRef FunctionTy)
Obtain the Type this function Type returns.
Definition: Core.cpp:756
LLVMTypeRef LLVMInt64Type(void)
Definition: Core.cpp:671
LLVMTypeRef LLVMInt64TypeInContext(LLVMContextRef C)
Definition: Core.cpp:649
LLVMTypeRef LLVMInt16TypeInContext(LLVMContextRef C)
Definition: Core.cpp:643
LLVMTypeRef LLVMIntTypeInContext(LLVMContextRef C, unsigned NumBits)
Definition: Core.cpp:655
LLVMTypeRef LLVMInt1TypeInContext(LLVMContextRef C)
Obtain an integer type from a context with specified bit width.
Definition: Core.cpp:637
LLVMTypeRef LLVMInt32Type(void)
Definition: Core.cpp:668
LLVMTypeRef LLVMInt32TypeInContext(LLVMContextRef C)
Definition: Core.cpp:646
LLVMTypeRef LLVMInt128TypeInContext(LLVMContextRef C)
Definition: Core.cpp:652
LLVMTypeRef LLVMIntType(unsigned NumBits)
Definition: Core.cpp:677
LLVMTypeRef LLVMInt8TypeInContext(LLVMContextRef C)
Definition: Core.cpp:640
LLVMTypeRef LLVMInt8Type(void)
Definition: Core.cpp:662
LLVMTypeRef LLVMInt1Type(void)
Obtain an integer type from the global context with a specified bit width.
Definition: Core.cpp:659
LLVMTypeRef LLVMInt128Type(void)
Definition: Core.cpp:674
unsigned LLVMGetIntTypeWidth(LLVMTypeRef IntegerTy)
Definition: Core.cpp:681
LLVMTypeRef LLVMInt16Type(void)
Definition: Core.cpp:665
LLVMTypeRef LLVMX86MMXTypeInContext(LLVMContextRef C)
Create a X86 MMX type in a context.
Definition: Core.cpp:708
LLVMTypeRef LLVMVoidType(void)
These are similar to the above functions except they operate on the global context.
Definition: Core.cpp:919
LLVMTypeRef LLVMX86AMXTypeInContext(LLVMContextRef C)
Create a X86 AMX type in a context.
Definition: Core.cpp:711
LLVMTypeRef LLVMMetadataTypeInContext(LLVMContextRef C)
Create a metadata type in a context.
Definition: Core.cpp:915
LLVMTypeRef LLVMTokenTypeInContext(LLVMContextRef C)
Create a token type in a context.
Definition: Core.cpp:912
LLVMTypeRef LLVMX86AMXType(void)
Definition: Core.cpp:739
LLVMTypeRef LLVMLabelTypeInContext(LLVMContextRef C)
Create a label type in a context.
Definition: Core.cpp:909
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:926
LLVMTypeRef LLVMX86MMXType(void)
Definition: Core.cpp:736
LLVMTypeRef LLVMLabelType(void)
Definition: Core.cpp:922
LLVMTypeRef LLVMVoidTypeInContext(LLVMContextRef C)
Create a void type in a context.
Definition: Core.cpp:906
unsigned LLVMGetArrayLength(LLVMTypeRef ArrayTy)
Obtain the length of an array type.
Definition: Core.cpp:884
LLVMTypeRef LLVMGetElementType(LLVMTypeRef Ty)
Obtain the element type of an array or vector type.
Definition: Core.cpp:873
unsigned LLVMGetPointerAddressSpace(LLVMTypeRef PointerTy)
Obtain the address space of a pointer type.
Definition: Core.cpp:892
uint64_t LLVMGetArrayLength2(LLVMTypeRef ArrayTy)
Obtain the length of an array type.
Definition: Core.cpp:888
LLVMTypeRef LLVMPointerType(LLVMTypeRef ElementType, unsigned AddressSpace)
Create a pointer type that points to a defined type.
Definition: Core.cpp:856
unsigned LLVMGetNumContainedTypes(LLVMTypeRef Tp)
Return the number of types in the derived type.
Definition: Core.cpp:880
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:864
LLVMBool LLVMPointerTypeIsOpaque(LLVMTypeRef Ty)
Determine whether a pointer is opaque.
Definition: Core.cpp:860
LLVMTypeRef LLVMPointerTypeInContext(LLVMContextRef C, unsigned AddressSpace)
Create an opaque pointer type in a context.
Definition: Core.cpp:902
LLVMTypeRef LLVMArrayType(LLVMTypeRef ElementType, unsigned ElementCount)
Create a fixed size array type that refers to a specific type.
Definition: Core.cpp:848
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:868
LLVMTypeRef LLVMArrayType2(LLVMTypeRef ElementType, uint64_t ElementCount)
Create a fixed size array type that refers to a specific type.
Definition: Core.cpp:852
void LLVMGetSubtypes(LLVMTypeRef Tp, LLVMTypeRef *Arr)
Returns type's subtypes.
Definition: Core.cpp:840
unsigned LLVMGetVectorSize(LLVMTypeRef VectorTy)
Obtain the (possibly scalable) number of elements in a vector type.
Definition: Core.cpp:896
void LLVMStructSetBody(LLVMTypeRef StructTy, LLVMTypeRef *ElementTypes, unsigned ElementCount, LLVMBool Packed)
Set the contents of a structure type.
Definition: Core.cpp:797
LLVMBool LLVMIsPackedStruct(LLVMTypeRef StructTy)
Determine whether a structure is packed.
Definition: Core.cpp:818
LLVMTypeRef LLVMStructGetTypeAtIndex(LLVMTypeRef StructTy, unsigned i)
Get the type of the element at a given index in the structure.
Definition: Core.cpp:813
LLVMTypeRef LLVMStructType(LLVMTypeRef *ElementTypes, unsigned ElementCount, LLVMBool Packed)
Create a new structure type in the global context.
Definition: Core.cpp:778
const char * LLVMGetStructName(LLVMTypeRef Ty)
Obtain the name of a structure.
Definition: Core.cpp:789
void LLVMGetStructElementTypes(LLVMTypeRef StructTy, LLVMTypeRef *Dest)
Get the elements within a structure.
Definition: Core.cpp:807
LLVMBool LLVMIsOpaqueStruct(LLVMTypeRef StructTy)
Determine whether a structure is opaque.
Definition: Core.cpp:822
unsigned LLVMCountStructElementTypes(LLVMTypeRef StructTy)
Get the number of elements defined inside the structure.
Definition: Core.cpp:803
LLVMTypeRef LLVMStructCreateNamed(LLVMContextRef C, const char *Name)
Create an empty structure in a context having a specified name.
Definition: Core.cpp:784
LLVMBool LLVMIsLiteralStruct(LLVMTypeRef StructTy)
Determine whether a structure is literal.
Definition: Core.cpp:826
LLVMTypeRef LLVMStructTypeInContext(LLVMContextRef C, LLVMTypeRef *ElementTypes, unsigned ElementCount, LLVMBool Packed)
Create a new structure type in a context.
Definition: Core.cpp:772
LLVMBool LLVMTypeIsSized(LLVMTypeRef Ty)
Whether the type has a known size.
Definition: Core.cpp:608
LLVMTypeKind LLVMGetTypeKind(LLVMTypeRef Ty)
Obtain the enumerated type of a Type instance.
Definition: Core.cpp:558
char * LLVMPrintTypeToString(LLVMTypeRef Val)
Return a string representation of the type.
Definition: Core.cpp:621
void LLVMDumpType(LLVMTypeRef Val)
Dump a representation of a type to stderr.
Definition: Core.cpp:617
LLVMContextRef LLVMGetTypeContext(LLVMTypeRef Ty)
Obtain the context to which this type instance is associated.
Definition: Core.cpp:613
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:2727
void LLVMAppendExistingBasicBlock(LLVMValueRef Fn, LLVMBasicBlockRef BB)
Append the given basic block to the basic block list of the given function.
Definition: Core.cpp:2756
void LLVMDeleteBasicBlock(LLVMBasicBlockRef BB)
Remove a basic block from a function and delete it.
Definition: Core.cpp:2783
LLVMBasicBlockRef LLVMGetFirstBasicBlock(LLVMValueRef Fn)
Obtain the first basic block in a function.
Definition: Core.cpp:2711
LLVMBasicBlockRef LLVMValueAsBasicBlock(LLVMValueRef Val)
Convert an LLVMValueRef to an LLVMBasicBlockRef instance.
Definition: Core.cpp:2681
LLVMBasicBlockRef LLVMCreateBasicBlockInContext(LLVMContextRef C, const char *Name)
Create a new basic block without inserting it into a function.
Definition: Core.cpp:2743
void LLVMRemoveBasicBlockFromParent(LLVMBasicBlockRef BB)
Remove a basic block from a function.
Definition: Core.cpp:2787
void LLVMMoveBasicBlockBefore(LLVMBasicBlockRef BB, LLVMBasicBlockRef MovePos)
Move a basic block to before another one.
Definition: Core.cpp:2791
LLVMValueRef LLVMBasicBlockAsValue(LLVMBasicBlockRef BB)
Convert a basic block instance to a value type.
Definition: Core.cpp:2673
void LLVMInsertExistingBasicBlockAfterInsertBlock(LLVMBuilderRef Builder, LLVMBasicBlockRef BB)
Insert the given basic block after the insertion point of the given builder.
Definition: Core.cpp:2748
void LLVMGetBasicBlocks(LLVMValueRef Fn, LLVMBasicBlockRef *BasicBlocks)
Obtain all of the basic blocks in a function.
Definition: Core.cpp:2701
LLVMBasicBlockRef LLVMAppendBasicBlock(LLVMValueRef Fn, const char *Name)
Append a basic block to the end of a function using the global context.
Definition: Core.cpp:2767
LLVMValueRef LLVMGetBasicBlockTerminator(LLVMBasicBlockRef BB)
Obtain the terminator instruction for a basic block.
Definition: Core.cpp:2693
unsigned LLVMCountBasicBlocks(LLVMValueRef Fn)
Obtain the number of basic blocks in a function.
Definition: Core.cpp:2697
void LLVMMoveBasicBlockAfter(LLVMBasicBlockRef BB, LLVMBasicBlockRef MovePos)
Move a basic block to after another one.
Definition: Core.cpp:2795
LLVMBasicBlockRef LLVMGetLastBasicBlock(LLVMValueRef Fn)
Obtain the last basic block in a function.
Definition: Core.cpp:2719
LLVMBasicBlockRef LLVMAppendBasicBlockInContext(LLVMContextRef C, LLVMValueRef Fn, const char *Name)
Append a basic block to the end of a function.
Definition: Core.cpp:2761
LLVMValueRef LLVMGetBasicBlockParent(LLVMBasicBlockRef BB)
Obtain the function to which a basic block belongs.
Definition: Core.cpp:2689
LLVMValueRef LLVMGetFirstInstruction(LLVMBasicBlockRef BB)
Obtain the first instruction in a basic block.
Definition: Core.cpp:2805
LLVMValueRef LLVMGetLastInstruction(LLVMBasicBlockRef BB)
Obtain the last instruction in a basic block.
Definition: Core.cpp:2813
LLVMBasicBlockRef LLVMInsertBasicBlockInContext(LLVMContextRef C, LLVMBasicBlockRef BB, const char *Name)
Insert a basic block in a function before another basic block.
Definition: Core.cpp:2771
LLVMBasicBlockRef LLVMInsertBasicBlock(LLVMBasicBlockRef InsertBeforeBB, const char *Name)
Insert a basic block in a function using the global context.
Definition: Core.cpp:2778
LLVMBasicBlockRef LLVMGetEntryBasicBlock(LLVMValueRef Fn)
Obtain the basic block that corresponds to the entry point of a function.
Definition: Core.cpp:2707
LLVMBool LLVMValueIsBasicBlock(LLVMValueRef Val)
Determine whether an LLVMValueRef is itself a basic block.
Definition: Core.cpp:2677
const char * LLVMGetBasicBlockName(LLVMBasicBlockRef BB)
Obtain the string name of a basic block.
Definition: Core.cpp:2685
LLVMBasicBlockRef LLVMGetPreviousBasicBlock(LLVMBasicBlockRef BB)
Go backwards in a basic block iterator.
Definition: Core.cpp:2735
LLVMValueRef LLVMConstStruct(LLVMValueRef *ConstantVals, unsigned Count, LLVMBool Packed)
Create a ConstantStruct in the global Context.
Definition: Core.cpp:1600
LLVMValueRef LLVMConstArray(LLVMTypeRef ElementTy, LLVMValueRef *ConstantVals, unsigned Length)
Create a ConstantArray from values.
Definition: Core.cpp:1580
LLVMValueRef LLVMConstArray2(LLVMTypeRef ElementTy, LLVMValueRef *ConstantVals, uint64_t Length)
Create a ConstantArray from values.
Definition: Core.cpp:1586
LLVMValueRef LLVMConstVector(LLVMValueRef *ScalarConstantVals, unsigned Size)
Create a ConstantVector from values.
Definition: Core.cpp:1615
LLVMValueRef LLVMConstStringInContext(LLVMContextRef C, const char *Str, unsigned Length, LLVMBool DontNullTerminate)
Create a ConstantDataSequential and initialize it with a string.
Definition: Core.cpp:1538
LLVMValueRef LLVMConstNamedStruct(LLVMTypeRef StructTy, LLVMValueRef *ConstantVals, unsigned Count)
Create a non-anonymous ConstantStruct from values.
Definition: Core.cpp:1606
LLVMBool LLVMIsConstantString(LLVMValueRef c)
Returns true if the specified constant is an array of i8.
Definition: Core.cpp:1570
LLVMValueRef LLVMGetAggregateElement(LLVMValueRef C, unsigned Idx)
Get element of a constant aggregate (struct, array or vector) at the specified index.
Definition: Core.cpp:1562
LLVMValueRef LLVMConstString(const char *Str, unsigned Length, LLVMBool DontNullTerminate)
Create a ConstantDataSequential with string content in the global context.
Definition: Core.cpp:1556
const char * LLVMGetAsString(LLVMValueRef c, size_t *Length)
Get the given constant data sequential as a string.
Definition: Core.cpp:1574
LLVMValueRef LLVMConstStringInContext2(LLVMContextRef C, const char *Str, size_t Length, LLVMBool DontNullTerminate)
Create a ConstantDataSequential and initialize it with a string.
Definition: Core.cpp:1547
LLVMValueRef LLVMConstStructInContext(LLVMContextRef C, LLVMValueRef *ConstantVals, unsigned Count, LLVMBool Packed)
Create an anonymous ConstantStruct with the specified values.
Definition: Core.cpp:1592
LLVMValueRef LLVMConstPointerCast(LLVMValueRef ConstantVal, LLVMTypeRef ToType)
Definition: Core.cpp:1797
LLVMValueRef LLVMConstMul(LLVMValueRef LHSConstant, LLVMValueRef RHSConstant)
Definition: Core.cpp:1707
LLVMValueRef LLVMConstTruncOrBitCast(LLVMValueRef ConstantVal, LLVMTypeRef ToType)
Definition: Core.cpp:1791
LLVMValueRef LLVMSizeOf(LLVMTypeRef Ty)
Definition: Core.cpp:1652
LLVMValueRef LLVMConstPtrToInt(LLVMValueRef ConstantVal, LLVMTypeRef ToType)
Definition: Core.cpp:1770
LLVMValueRef LLVMConstNUWSub(LLVMValueRef LHSConstant, LLVMValueRef RHSConstant)
Definition: Core.cpp:1701
LLVMValueRef LLVMConstNUWAdd(LLVMValueRef LHSConstant, LLVMValueRef RHSConstant)
Definition: Core.cpp:1684
LLVMValueRef LLVMConstIntToPtr(LLVMValueRef ConstantVal, LLVMTypeRef ToType)
Definition: Core.cpp:1775
LLVMValueRef LLVMConstTrunc(LLVMValueRef ConstantVal, LLVMTypeRef ToType)
Definition: Core.cpp:1765
LLVMValueRef LLVMConstNot(LLVMValueRef ConstantVal)
Definition: Core.cpp:1669
LLVMValueRef LLVMGetBlockAddressFunction(LLVMValueRef BlockAddr)
Gets the function associated with a given BlockAddress constant value.
Definition: Core.cpp:1839
LLVMValueRef LLVMConstNSWMul(LLVMValueRef LHSConstant, LLVMValueRef RHSConstant)
Definition: Core.cpp:1712
LLVMValueRef LLVMConstExtractElement(LLVMValueRef VectorConstant, LLVMValueRef IndexConstant)
Definition: Core.cpp:1803
LLVMValueRef LLVMConstInsertElement(LLVMValueRef VectorConstant, LLVMValueRef ElementValueConstant, LLVMValueRef IndexConstant)
Definition: Core.cpp:1809
LLVMValueRef LLVMConstInBoundsGEP2(LLVMTypeRef Ty, LLVMValueRef ConstantVal, LLVMValueRef *ConstantIndices, unsigned NumIndices)
Definition: Core.cpp:1756
LLVMValueRef LLVMConstAddrSpaceCast(LLVMValueRef ConstantVal, LLVMTypeRef ToType)
Definition: Core.cpp:1785
LLVMValueRef LLVMConstICmp(LLVMIntPredicate Predicate, LLVMValueRef LHSConstant, LLVMValueRef RHSConstant)
Definition: Core.cpp:1729
LLVMBasicBlockRef LLVMGetBlockAddressBasicBlock(LLVMValueRef BlockAddr)
Gets the basic block associated with a given BlockAddress constant value.
Definition: Core.cpp:1843
LLVMValueRef LLVMConstNSWAdd(LLVMValueRef LHSConstant, LLVMValueRef RHSConstant)
Definition: Core.cpp:1678
LLVMValueRef LLVMAlignOf(LLVMTypeRef Ty)
Definition: Core.cpp:1648
LLVMValueRef LLVMConstInlineAsm(LLVMTypeRef Ty, const char *AsmString, const char *Constraints, LLVMBool HasSideEffects, LLVMBool IsAlignStack)
Deprecated: Use LLVMGetInlineAsm instead.
Definition: Core.cpp:1827
LLVMValueRef LLVMConstXor(LLVMValueRef LHSConstant, LLVMValueRef RHSConstant)
Definition: Core.cpp:1724
LLVMValueRef LLVMConstBitCast(LLVMValueRef ConstantVal, LLVMTypeRef ToType)
Definition: Core.cpp:1780
LLVMValueRef LLVMConstNSWNeg(LLVMValueRef ConstantVal)
Definition: Core.cpp:1660
LLVMValueRef LLVMConstNUWMul(LLVMValueRef LHSConstant, LLVMValueRef RHSConstant)
Definition: Core.cpp:1718
LLVMValueRef LLVMConstShl(LLVMValueRef LHSConstant, LLVMValueRef RHSConstant)
Definition: Core.cpp:1743
LLVMValueRef LLVMConstFCmp(LLVMRealPredicate Predicate, LLVMValueRef LHSConstant, LLVMValueRef RHSConstant)
Definition: Core.cpp:1736
LLVMValueRef LLVMConstGEP2(LLVMTypeRef Ty, LLVMValueRef ConstantVal, LLVMValueRef *ConstantIndices, unsigned NumIndices)
Definition: Core.cpp:1748
LLVMValueRef LLVMConstSub(LLVMValueRef LHSConstant, LLVMValueRef RHSConstant)
Definition: Core.cpp:1690
LLVMValueRef LLVMConstAdd(LLVMValueRef LHSConstant, LLVMValueRef RHSConstant)
Definition: Core.cpp:1673
LLVMValueRef LLVMConstShuffleVector(LLVMValueRef VectorAConstant, LLVMValueRef VectorBConstant, LLVMValueRef MaskConstant)
Definition: Core.cpp:1817
LLVMValueRef LLVMConstNeg(LLVMValueRef ConstantVal)
Definition: Core.cpp:1656
LLVMValueRef LLVMBlockAddress(LLVMValueRef F, LLVMBasicBlockRef BB)
Definition: Core.cpp:1835
LLVMOpcode LLVMGetConstOpcode(LLVMValueRef ConstantVal)
Definition: Core.cpp:1644
LLVMValueRef LLVMConstNSWSub(LLVMValueRef LHSConstant, LLVMValueRef RHSConstant)
Definition: Core.cpp:1695
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:2093
unsigned LLVMValueMetadataEntriesGetKind(LLVMValueMetadataEntry *Entries, unsigned Index)
Returns the kind of a value metadata entry at a specific index.
Definition: Core.cpp:2074
void LLVMDisposeValueMetadataEntries(LLVMValueMetadataEntry *Entries)
Destroys value metadata entries.
Definition: Core.cpp:2089
void LLVMSetVisibility(LLVMValueRef Global, LLVMVisibility Viz)
Definition: Core.cpp:1966
LLVMDLLStorageClass LLVMGetDLLStorageClass(LLVMValueRef Global)
Definition: Core.cpp:1971
void LLVMSetAlignment(LLVMValueRef V, unsigned Bytes)
Set the preferred alignment of the value.
Definition: Core.cpp:2042
LLVMModuleRef LLVMGetGlobalParent(LLVMValueRef Global)
Definition: Core.cpp:1849
const char * LLVMGetSection(LLVMValueRef Global)
Definition: Core.cpp:1951
LLVMTypeRef LLVMGlobalGetValueType(LLVMValueRef Global)
Returns the "value type" of a global value.
Definition: Core.cpp:2016
LLVMBool LLVMIsDeclaration(LLVMValueRef Global)
Definition: Core.cpp:1853
LLVMVisibility LLVMGetVisibility(LLVMValueRef Global)
Definition: Core.cpp:1961
void LLVMSetDLLStorageClass(LLVMValueRef Global, LLVMDLLStorageClass Class)
Definition: Core.cpp:1976
LLVMBool LLVMHasUnnamedAddr(LLVMValueRef Global)
Deprecated: Use LLVMGetUnnamedAddress instead.
Definition: Core.cpp:2006
LLVMLinkage LLVMGetLinkage(LLVMValueRef Global)
Definition: Core.cpp:1857
LLVMUnnamedAddr LLVMGetUnnamedAddress(LLVMValueRef Global)
Definition: Core.cpp:1981
LLVMMetadataRef LLVMValueMetadataEntriesGetMetadata(LLVMValueMetadataEntry *Entries, unsigned Index)
Returns the underlying metadata node of a value metadata entry at a specific index.
Definition: Core.cpp:2082
void LLVMSetUnnamedAddress(LLVMValueRef Global, LLVMUnnamedAddr UnnamedAddr)
Definition: Core.cpp:1993
void LLVMSetLinkage(LLVMValueRef Global, LLVMLinkage Linkage)
Definition: Core.cpp:1886
void LLVMSetUnnamedAddr(LLVMValueRef Global, LLVMBool HasUnnamedAddr)
Deprecated: Use LLVMSetUnnamedAddress instead.
Definition: Core.cpp:2010
void LLVMGlobalClearMetadata(LLVMValueRef Global)
Removes all metadata attachments from this value.
Definition: Core.cpp:2102
unsigned LLVMGetAlignment(LLVMValueRef V)
Obtain the preferred alignment of the value.
Definition: Core.cpp:2022
void LLVMSetSection(LLVMValueRef Global, const char *Section)
Definition: Core.cpp:1957
void LLVMGlobalEraseMetadata(LLVMValueRef Global, unsigned Kind)
Erases a metadata attachment of the given kind if it exists.
Definition: Core.cpp:2098
LLVMValueMetadataEntry * LLVMGlobalCopyAllMetadata(LLVMValueRef Value, size_t *NumEntries)
Retrieves an array of metadata entries representing the metadata attached to this value.
Definition: Core.cpp:2062
LLVMValueRef LLVMConstInt(LLVMTypeRef IntTy, unsigned long long N, LLVMBool SignExtend)
Obtain a constant value for an integer type.
Definition: Core.cpp:1473
LLVMValueRef LLVMConstIntOfArbitraryPrecision(LLVMTypeRef IntTy, unsigned NumWords, const uint64_t Words[])
Obtain a constant value for an integer of arbitrary precision.
Definition: Core.cpp:1478
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:1502
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:1519
long long LLVMConstIntGetSExtValue(LLVMValueRef ConstantVal)
Obtain the sign extended value for an integer constant value.
Definition: Core.cpp:1515
unsigned long long LLVMConstIntGetZExtValue(LLVMValueRef ConstantVal)
Obtain the zero extended value for an integer constant value.
Definition: Core.cpp:1511
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:1498
LLVMBool LLVMIsNull(LLVMValueRef Val)
Determine whether a value instance is null.
Definition: Core.cpp:1196
LLVMValueRef LLVMGetUndef(LLVMTypeRef Ty)
Obtain a constant value referring to an undefined value of a type.
Definition: Core.cpp:1184
LLVMValueRef LLVMGetPoison(LLVMTypeRef Ty)
Obtain a constant value referring to a poison value of a type.
Definition: Core.cpp:1188
LLVMValueRef LLVMConstAllOnes(LLVMTypeRef Ty)
Obtain a constant value referring to the instance of a type consisting of all ones.
Definition: Core.cpp:1180
LLVMValueRef LLVMConstPointerNull(LLVMTypeRef Ty)
Obtain a constant that is a constant pointer pointing to NULL for a specified type.
Definition: Core.cpp:1210
LLVMValueRef LLVMConstNull(LLVMTypeRef Ty)
Obtain a constant value referring to the null instance of a type.
Definition: Core.cpp:1176
unsigned LLVMCountParams(LLVMValueRef Fn)
Obtain the number of parameters in a function.
Definition: Core.cpp:2521
LLVMValueRef LLVMGetPreviousParam(LLVMValueRef Arg)
Obtain the previous parameter to a function.
Definition: Core.cpp:2566
LLVMValueRef LLVMGetNextParam(LLVMValueRef Arg)
Obtain the next parameter to a function.
Definition: Core.cpp:2558
LLVMValueRef LLVMGetParamParent(LLVMValueRef Inst)
Obtain the function to which this argument belongs.
Definition: Core.cpp:2538
LLVMValueRef LLVMGetFirstParam(LLVMValueRef Fn)
Obtain the first parameter to a function.
Definition: Core.cpp:2542
void LLVMSetParamAlignment(LLVMValueRef Arg, unsigned Align)
Set the alignment for a function parameter.
Definition: Core.cpp:2573
LLVMValueRef LLVMGetParam(LLVMValueRef Fn, unsigned Index)
Obtain the parameter at the specified index.
Definition: Core.cpp:2533
LLVMValueRef LLVMGetLastParam(LLVMValueRef Fn)
Obtain the last parameter to a function.
Definition: Core.cpp:2550
void LLVMGetParams(LLVMValueRef Fn, LLVMValueRef *Params)
Obtain the parameters in a function.
Definition: Core.cpp:2527
void LLVMSetGC(LLVMValueRef Fn, const char *Name)
Define the garbage collector to use during code generation.
Definition: Core.cpp:2431
const char * LLVMGetGC(LLVMValueRef Fn)
Obtain the name of the garbage collector to use during code generation.
Definition: Core.cpp:2426
LLVMValueRef LLVMGetPrologueData(LLVMValueRef Fn)
Gets the prologue data associated with a function.
Definition: Core.cpp:2455
void LLVMRemoveEnumAttributeAtIndex(LLVMValueRef F, LLVMAttributeIndex Idx, unsigned KindID)
Definition: Core.cpp:2502
unsigned LLVMGetAttributeCountAtIndex(LLVMValueRef F, LLVMAttributeIndex Idx)
Definition: Core.cpp:2476
LLVMBool LLVMHasPersonalityFn(LLVMValueRef Fn)
Check whether the given function has a personality function.
Definition: Core.cpp:2340
unsigned LLVMLookupIntrinsicID(const char *Name, size_t NameLen)
Obtain the intrinsic ID number which matches the given function name.
Definition: Core.cpp:2408
const char * LLVMIntrinsicGetName(unsigned ID, size_t *NameLength)
Retrieves the name of an intrinsic.
Definition: Core.cpp:2372
unsigned LLVMGetFunctionCallConv(LLVMValueRef Fn)
Obtain the calling function of a function.
Definition: Core.cpp:2417
LLVMValueRef LLVMGetPrefixData(LLVMValueRef Fn)
Gets the prefix data associated with a function.
Definition: Core.cpp:2439
void LLVMRemoveStringAttributeAtIndex(LLVMValueRef F, LLVMAttributeIndex Idx, const char *K, unsigned KLen)
Definition: Core.cpp:2507
void LLVMSetPrefixData(LLVMValueRef Fn, LLVMValueRef prefixData)
Sets the prefix data for the function.
Definition: Core.cpp:2449
LLVMAttributeRef LLVMGetStringAttributeAtIndex(LLVMValueRef F, LLVMAttributeIndex Idx, const char *K, unsigned KLen)
Definition: Core.cpp:2495
LLVMValueRef LLVMGetPersonalityFn(LLVMValueRef Fn)
Obtain the personality function attached to the function.
Definition: Core.cpp:2344
void LLVMSetPersonalityFn(LLVMValueRef Fn, LLVMValueRef PersonalityFn)
Set the personality function attached to the function.
Definition: Core.cpp:2348
LLVMBool LLVMIntrinsicIsOverloaded(unsigned ID)
Obtain if the intrinsic identified by the given ID is overloaded.
Definition: Core.cpp:2412
void LLVMAddAttributeAtIndex(LLVMValueRef F, LLVMAttributeIndex Idx, LLVMAttributeRef A)
Add an attribute to a function.
Definition: Core.cpp:2471
void LLVMDeleteFunction(LLVMValueRef Fn)
Remove a function from its containing module and deletes it.
Definition: Core.cpp:2336
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:2397
void LLVMSetPrologueData(LLVMValueRef Fn, LLVMValueRef prologueData)
Sets the prologue data for the function.
Definition: Core.cpp:2465
const char * LLVMIntrinsicCopyOverloadedName(unsigned ID, LLVMTypeRef *ParamTypes, size_t ParamCount, size_t *NameLength)
Deprecated: Use LLVMIntrinsicCopyOverloadedName2 instead.
Definition: Core.cpp:2386
LLVMBool LLVMHasPrologueData(LLVMValueRef Fn)
Check if a given function has prologue data.
Definition: Core.cpp:2460
LLVMBool LLVMHasPrefixData(LLVMValueRef Fn)
Check if a given function has prefix data.
Definition: Core.cpp:2444
void LLVMGetAttributesAtIndex(LLVMValueRef F, LLVMAttributeIndex Idx, LLVMAttributeRef *Attrs)
Definition: Core.cpp:2481
void LLVMSetFunctionCallConv(LLVMValueRef Fn, unsigned CC)
Set the calling convention of a function.
Definition: Core.cpp:2421
LLVMValueRef LLVMGetIntrinsicDeclaration(LLVMModuleRef Mod, unsigned ID, LLVMTypeRef *ParamTypes, size_t ParamCount)
Create or insert the declaration of an intrinsic.
Definition: Core.cpp:2363
LLVMAttributeRef LLVMGetEnumAttributeAtIndex(LLVMValueRef F, LLVMAttributeIndex Idx, unsigned KindID)
Definition: Core.cpp:2488
void LLVMAddTargetDependentFunctionAttr(LLVMValueRef Fn, const char *A, const char *V)
Add a target-dependent attribute to a function.
Definition: Core.cpp:2512
LLVMTypeRef LLVMIntrinsicGetType(LLVMContextRef Ctx, unsigned ID, LLVMTypeRef *ParamTypes, size_t ParamCount)
Retrieves the type of an intrinsic.
Definition: Core.cpp:2379
unsigned LLVMGetIntrinsicID(LLVMValueRef Fn)
Obtain the ID number from a function instance.
Definition: Core.cpp:2352
LLVMValueKind LLVMGetValueKind(LLVMValueRef Val)
Obtain the enumerated type of a Value instance.
Definition: Core.cpp:945
const char * LLVMGetValueName(LLVMValueRef Val)
Deprecated: Use LLVMGetValueName2 instead.
Definition: Core.cpp:967
LLVMTypeRef LLVMTypeOf(LLVMValueRef Val)
Obtain the type of a value.
Definition: Core.cpp:941
LLVMBool LLVMIsConstant(LLVMValueRef Val)
Determine whether the specified value instance is constant.
Definition: Core.cpp:1192
void LLVMReplaceAllUsesWith(LLVMValueRef OldVal, LLVMValueRef NewVal)
Replace all uses of a value with another one.
Definition: Core.cpp:1007
const char * LLVMGetValueName2(LLVMValueRef Val, size_t *Length)
Obtain the string name of a value.
Definition: Core.cpp:957
char * LLVMPrintDbgRecordToString(LLVMDbgRecordRef Record)
Return a string representation of the DbgRecord.
Definition: Core.cpp:993
void LLVMSetValueName(LLVMValueRef Val, const char *Name)
Deprecated: Use LLVMSetValueName2 instead.
Definition: Core.cpp:971
#define LLVM_DECLARE_VALUE_CAST(name)
Convert value instances between types.
Definition: Core.h:1914
void LLVMDumpValue(LLVMValueRef Val)
Dump a representation of a value to stderr.
Definition: Core.cpp:975
LLVMBool LLVMIsUndef(LLVMValueRef Val)
Determine whether a value instance is undefined.
Definition: Core.cpp:1202
LLVMValueRef LLVMIsAMDNode(LLVMValueRef Val)
Definition: Core.cpp:1085
LLVMBool LLVMIsPoison(LLVMValueRef Val)
Determine whether a value instance is poisonous.
Definition: Core.cpp:1206
LLVMValueRef LLVMIsAMDString(LLVMValueRef Val)
Definition: Core.cpp:1100
void LLVMSetValueName2(LLVMValueRef Val, const char *Name, size_t NameLen)
Set the string name of a value.
Definition: Core.cpp:963
LLVMValueRef LLVMIsAValueAsMetadata(LLVMValueRef Val)
Definition: Core.cpp:1093
char * LLVMPrintValueToString(LLVMValueRef Val)
Return a string representation of the value.
Definition: Core.cpp:979
void LLVMEraseGlobalIFunc(LLVMValueRef IFunc)
Remove a global indirect function from its parent module and delete it.
Definition: Core.cpp:2635
void LLVMRemoveGlobalIFunc(LLVMValueRef IFunc)
Remove a global indirect function from its parent module.
Definition: Core.cpp:2639
LLVMValueRef LLVMGetNextGlobalIFunc(LLVMValueRef IFunc)
Advance a GlobalIFunc iterator to the next GlobalIFunc.
Definition: Core.cpp:2611
LLVMValueRef LLVMGetNamedGlobalIFunc(LLVMModuleRef M, const char *Name, size_t NameLen)
Obtain a GlobalIFunc value from a Module by its name.
Definition: Core.cpp:2590
LLVMValueRef LLVMGetLastGlobalIFunc(LLVMModuleRef M)
Obtain an iterator to the last GlobalIFunc in a Module.
Definition: Core.cpp:2603
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:2580
void LLVMSetGlobalIFuncResolver(LLVMValueRef IFunc, LLVMValueRef Resolver)
Sets the resolver function associated with this indirect function.
Definition: Core.cpp:2631
LLVMValueRef LLVMGetFirstGlobalIFunc(LLVMModuleRef M)
Obtain an iterator to the first GlobalIFunc in a Module.
Definition: Core.cpp:2595
LLVMValueRef LLVMGetGlobalIFuncResolver(LLVMValueRef IFunc)
Retrieves the resolver function associated with this indirect function, or NULL if it doesn't not exi...
Definition: Core.cpp:2627
LLVMValueRef LLVMGetPreviousGlobalIFunc(LLVMValueRef IFunc)
Decrement a GlobalIFunc iterator to the previous GlobalIFunc.
Definition: Core.cpp:2619
LLVMTypeRef LLVMGetAllocatedType(LLVMValueRef Alloca)
Obtain the type that is being allocated by the alloca instruction.
Definition: Core.cpp:3054
LLVMOperandBundleRef LLVMGetOperandBundleAtIndex(LLVMValueRef C, unsigned Index)
Obtain the operand bundle attached to this instruction at the given index.
Definition: Core.cpp:2966
LLVMValueRef LLVMGetCalledValue(LLVMValueRef Instr)
Obtain the pointer to the function invoked by this instruction.
Definition: Core.cpp:2954
void LLVMGetCallSiteAttributes(LLVMValueRef C, LLVMAttributeIndex Idx, LLVMAttributeRef *Attrs)
Definition: Core.cpp:2922
unsigned LLVMGetNumArgOperands(LLVMValueRef Instr)
Obtain the argument count for a call instruction.
Definition: Core.cpp:2884
void LLVMSetNormalDest(LLVMValueRef InvokeInst, LLVMBasicBlockRef B)
Set the normal destination basic block.
Definition: Core.cpp:3005
unsigned LLVMGetInstructionCallConv(LLVMValueRef Instr)
Obtain the calling convention for a call instruction.
Definition: Core.cpp:2893
LLVMTypeRef LLVMGetCalledFunctionType(LLVMValueRef C)
Obtain the function type called by this instruction.
Definition: Core.cpp:2958
unsigned LLVMGetCallSiteAttributeCount(LLVMValueRef C, LLVMAttributeIndex Idx)
Definition: Core.cpp:2915
void LLVMAddCallSiteAttribute(LLVMValueRef C, LLVMAttributeIndex Idx, LLVMAttributeRef A)
Definition: Core.cpp:2910
unsigned LLVMGetNumOperandBundles(LLVMValueRef C)
Obtain the number of operand bundles attached to this instruction.
Definition: Core.cpp:2962
void LLVMSetInstructionCallConv(LLVMValueRef Instr, unsigned CC)
Set the calling convention for a call instruction.
Definition: Core.cpp:2897
LLVMAttributeRef LLVMGetCallSiteEnumAttribute(LLVMValueRef C, LLVMAttributeIndex Idx, unsigned KindID)
Definition: Core.cpp:2930
LLVMBasicBlockRef LLVMGetNormalDest(LLVMValueRef InvokeInst)
Return the normal destination basic block.
Definition: Core.cpp:2992
void LLVMRemoveCallSiteEnumAttribute(LLVMValueRef C, LLVMAttributeIndex Idx, unsigned KindID)
Definition: Core.cpp:2944
void LLVMSetUnwindDest(LLVMValueRef InvokeInst, LLVMBasicBlockRef B)
Set the unwind destination basic block.
Definition: Core.cpp:3009
void LLVMSetTailCall(LLVMValueRef CallInst, LLVMBool IsTailCall)
Set whether a call instruction is a tail call.
Definition: Core.cpp:2978
LLVMBool LLVMIsTailCall(LLVMValueRef CallInst)
Obtain whether a call instruction is a tail call.
Definition: Core.cpp:2974
void LLVMSetInstrParamAlignment(LLVMValueRef Instr, LLVMAttributeIndex Idx, unsigned Align)
Definition: Core.cpp:2902
void LLVMRemoveCallSiteStringAttribute(LLVMValueRef C, LLVMAttributeIndex Idx, const char *K, unsigned KLen)
Definition: Core.cpp:2949
LLVMTailCallKind LLVMGetTailCallKind(LLVMValueRef CallInst)
Obtain a tail call kind of the call instruction.
Definition: Core.cpp:2982
void LLVMSetTailCallKind(LLVMValueRef CallInst, LLVMTailCallKind kind)
Set the call kind of the call instruction.
Definition: Core.cpp:2986
LLVMAttributeRef LLVMGetCallSiteStringAttribute(LLVMValueRef C, LLVMAttributeIndex Idx, const char *K, unsigned KLen)
Definition: Core.cpp:2937
LLVMBasicBlockRef LLVMGetUnwindDest(LLVMValueRef InvokeInst)
Return the unwind destination basic block.
Definition: Core.cpp:2996
LLVMTypeRef LLVMGetGEPSourceElementType(LLVMValueRef GEP)
Get the source element type of the given GEP operator.
Definition: Core.cpp:3068
LLVMBool LLVMIsInBounds(LLVMValueRef GEP)
Check whether the given GEP operator is inbounds.
Definition: Core.cpp:3060
void LLVMSetIsInBounds(LLVMValueRef GEP, LLVMBool InBounds)
Set the given GEP instruction to be inbounds or not.
Definition: Core.cpp:3064
const unsigned * LLVMGetIndices(LLVMValueRef Inst)
Obtain the indices as an array.
Definition: Core.cpp:3107
unsigned LLVMGetNumIndices(LLVMValueRef Inst)
Obtain the number of indices.
Definition: Core.cpp:3095
void LLVMAddIncoming(LLVMValueRef PhiNode, LLVMValueRef *IncomingValues, LLVMBasicBlockRef *IncomingBlocks, unsigned Count)
Add an incoming value to the end of a PHI list.
Definition: Core.cpp:3074
LLVMValueRef LLVMGetIncomingValue(LLVMValueRef PhiNode, unsigned Index)
Obtain an incoming value to a PHI node as an LLVMValueRef.
Definition: Core.cpp:3085
unsigned LLVMCountIncoming(LLVMValueRef PhiNode)
Obtain the number of incoming basic blocks to a PHI node.
Definition: Core.cpp:3081
LLVMBasicBlockRef LLVMGetIncomingBlock(LLVMValueRef PhiNode, unsigned Index)
Obtain an incoming value to a PHI node as an LLVMBasicBlockRef.
Definition: Core.cpp:3089
unsigned LLVMGetNumSuccessors(LLVMValueRef Term)
Return the number of successors that this terminator has.
Definition: Core.cpp:3020
LLVMBasicBlockRef LLVMGetSwitchDefaultDest(LLVMValueRef SwitchInstr)
Obtain the default destination basic block of a switch instruction.
Definition: Core.cpp:3048
void LLVMSetSuccessor(LLVMValueRef Term, unsigned i, LLVMBasicBlockRef block)
Update the specified successor to point at the provided block.
Definition: Core.cpp:3028
void LLVMSetCondition(LLVMValueRef Branch, LLVMValueRef Cond)
Set the condition of a branch instruction.
Definition: Core.cpp:3042
LLVMValueRef LLVMGetCondition(LLVMValueRef Branch)
Return the condition of a branch instruction.
Definition: Core.cpp:3038
LLVMBool LLVMIsConditional(LLVMValueRef Branch)
Return if a branch is conditional.
Definition: Core.cpp:3034
LLVMBasicBlockRef LLVMGetSuccessor(LLVMValueRef Term, unsigned i)
Return the specified successor.
Definition: Core.cpp:3024
LLVMValueRef LLVMInstructionClone(LLVMValueRef Inst)
Create a copy of 'this' instruction that is identical in all ways except the following:
Definition: Core.cpp:2873
LLVMValueRef LLVMGetNextInstruction(LLVMValueRef Inst)
Obtain the instruction that occurs after the one specified.
Definition: Core.cpp:2821
void LLVMDeleteInstruction(LLVMValueRef Inst)
Delete an instruction.
Definition: Core.cpp:2845
LLVMValueRef LLVMIsATerminatorInst(LLVMValueRef Inst)
Determine whether an instruction is a terminator.
Definition: Core.cpp:2879
LLVMOpcode LLVMGetInstructionOpcode(LLVMValueRef Inst)
Obtain the code opcode for an individual instruction.
Definition: Core.cpp:2867
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:1068
LLVMRealPredicate LLVMGetFCmpPredicate(LLVMValueRef Inst)
Obtain the float predicate of an instruction.
Definition: Core.cpp:2858
int LLVMHasMetadata(LLVMValueRef Val)
Determine whether an instruction has any metadata attached.
Definition: Core.cpp:1011
void LLVMInstructionEraseFromParent(LLVMValueRef Inst)
Remove and delete an instruction.
Definition: Core.cpp:2841
void LLVMInstructionRemoveFromParent(LLVMValueRef Inst)
Remove an instruction.
Definition: Core.cpp:2837
LLVMValueRef LLVMGetMetadata(LLVMValueRef Val, unsigned KindID)
Return metadata associated with an instruction value.
Definition: Core.cpp:1015
LLVMIntPredicate LLVMGetICmpPredicate(LLVMValueRef Inst)
Obtain the predicate of an instruction.
Definition: Core.cpp:2849
void LLVMSetMetadata(LLVMValueRef Val, unsigned KindID, LLVMValueRef Node)
Set metadata associated with an instruction value.
Definition: Core.cpp:1037
LLVMBasicBlockRef LLVMGetInstructionParent(LLVMValueRef Inst)
Obtain the basic block to which an instruction belongs.
Definition: Core.cpp:2801
LLVMValueRef LLVMGetPreviousInstruction(LLVMValueRef Inst)
Obtain the instruction that occurred before this one.
Definition: Core.cpp:2829
LLVMValueRef LLVMMetadataAsValue(LLVMContextRef C, LLVMMetadataRef MD)
Obtain a Metadata as a Value.
Definition: Core.cpp:1268
LLVMValueRef LLVMMDString(const char *Str, unsigned SLen)
Deprecated: Use LLVMMDStringInContext2 instead.
Definition: Core.cpp:1233
void LLVMReplaceMDNodeOperandWith(LLVMValueRef V, unsigned Index, LLVMMetadataRef Replacement)
Replace an operand at a specific index in a llvm::MDNode value.
Definition: Core.cpp:1359
LLVMMetadataRef LLVMMDStringInContext2(LLVMContextRef C, const char *Str, size_t SLen)
Create an MDString value from a given string value.
Definition: Core.cpp:1216
LLVMMetadataRef LLVMMDNodeInContext2(LLVMContextRef C, LLVMMetadataRef *MDs, size_t Count)
Create an MDNode value with the given array of operands.
Definition: Core.cpp:1221
LLVMValueRef LLVMMDStringInContext(LLVMContextRef C, const char *Str, unsigned SLen)
Deprecated: Use LLVMMDStringInContext2 instead.
Definition: Core.cpp:1226
LLVMMetadataRef LLVMValueAsMetadata(LLVMValueRef Val)
Obtain a Value as a Metadata.
Definition: Core.cpp:1272
LLVMValueRef LLVMMDNodeInContext(LLVMContextRef C, LLVMValueRef *Vals, unsigned Count)
Deprecated: Use LLVMMDNodeInContext2 instead.
Definition: Core.cpp:1237
const char * LLVMGetMDString(LLVMValueRef V, unsigned *Length)
Obtain the underlying string from a MDString value.
Definition: Core.cpp:1281
unsigned LLVMGetMDNodeNumOperands(LLVMValueRef V)
Obtain the number of operands from an MDNode value.
Definition: Core.cpp:1291
void LLVMGetMDNodeOperands(LLVMValueRef V, LLVMValueRef *Dest)
Obtain the given MDNode's operands.
Definition: Core.cpp:1346
LLVMValueRef LLVMMDNode(LLVMValueRef *Vals, unsigned Count)
Deprecated: Use LLVMMDNodeInContext2 instead.
Definition: Core.cpp:1264
int LLVMGetNumOperands(LLVMValueRef Val)
Obtain the number of operands in a llvm::User value.
Definition: Core.cpp:1166
void LLVMSetOperand(LLVMValueRef User, unsigned Index, LLVMValueRef Val)
Set an operand at a specific index in a llvm::User value.
Definition: Core.cpp:1162
LLVMUseRef LLVMGetOperandUse(LLVMValueRef Val, unsigned Index)
Obtain the use of an operand at a specific index in a llvm::User value.
Definition: Core.cpp:1157
LLVMValueRef LLVMGetOperand(LLVMValueRef Val, unsigned Index)
Obtain an operand at a specific index in a llvm::User value.
Definition: Core.cpp:1143
LLVMValueRef LLVMGetUser(LLVMUseRef U)
Obtain the user value for a user.
Definition: Core.cpp:1123
LLVMUseRef LLVMGetFirstUse(LLVMValueRef Val)
Obtain the first use of a value.
Definition: Core.cpp:1108
LLVMUseRef LLVMGetNextUse(LLVMUseRef U)
Obtain the next use of a value.
Definition: Core.cpp:1116
LLVMValueRef LLVMGetUsedValue(LLVMUseRef U)
Obtain the value this use corresponds to.
Definition: Core.cpp:1127
#define LLVM_FOR_EACH_VALUE_SUBCLASS(macro)
Definition: Core.h:1730
void LLVMShutdown(void)
Deallocate and destroy all ManagedStatic variables.
Definition: Core.cpp:58
void LLVMGetVersion(unsigned *Major, unsigned *Minor, unsigned *Patch)
Return the major, minor, and patch version of LLVM.
Definition: Core.cpp:64
void LLVMDisposeMessage(char *Message)
Definition: Core.cpp:79
char * LLVMCreateMessage(const char *Message)
Definition: Core.cpp:75
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:2288
LLVMValueRef LLVMGetLastGlobalAlias(LLVMModuleRef M)
Obtain an iterator to the last GlobalAlias in a Module.
Definition: Core.cpp:2260
LLVMValueRef LLVMGetNextGlobalAlias(LLVMValueRef GA)
Advance a GlobalAlias iterator to the next GlobalAlias.
Definition: Core.cpp:2268
LLVMValueRef LLVMAliasGetAliasee(LLVMValueRef Alias)
Retrieve the target value of an alias.
Definition: Core.cpp:2284
LLVMValueRef LLVMGetPreviousGlobalAlias(LLVMValueRef GA)
Decrement a GlobalAlias iterator to the previous GlobalAlias.
Definition: Core.cpp:2276
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:2239
LLVMValueRef LLVMGetFirstGlobalAlias(LLVMModuleRef M)
Obtain an iterator to the first GlobalAlias in a Module.
Definition: Core.cpp:2252
LLVMValueRef LLVMGetNamedGlobalAlias(LLVMModuleRef M, const char *Name, size_t NameLen)
Obtain a GlobalAlias value from a Module by its name.
Definition: Core.cpp:2247
void LLVMSetGlobalConstant(LLVMValueRef GlobalVar, LLVMBool IsConstant)
Definition: Core.cpp:2186
void LLVMSetThreadLocalMode(LLVMValueRef GlobalVar, LLVMThreadLocalMode Mode)
Definition: Core.cpp:2207
LLVMThreadLocalMode LLVMGetThreadLocalMode(LLVMValueRef GlobalVar)
Definition: Core.cpp:2190
LLVMValueRef LLVMGetFirstGlobal(LLVMModuleRef M)
Definition: Core.cpp:2126
LLVMValueRef LLVMGetNextGlobal(LLVMValueRef GlobalVar)
Definition: Core.cpp:2142
LLVMBool LLVMIsExternallyInitialized(LLVMValueRef GlobalVar)
Definition: Core.cpp:2229
LLVMValueRef LLVMAddGlobal(LLVMModuleRef M, LLVMTypeRef Ty, const char *Name)
Definition: Core.cpp:2108
LLVMValueRef LLVMGetLastGlobal(LLVMModuleRef M)
Definition: Core.cpp:2134
void LLVMSetExternallyInitialized(LLVMValueRef GlobalVar, LLVMBool IsExtInit)
Definition: Core.cpp:2233
LLVMValueRef LLVMGetPreviousGlobal(LLVMValueRef GlobalVar)
Definition: Core.cpp:2150
void LLVMSetThreadLocal(LLVMValueRef GlobalVar, LLVMBool IsThreadLocal)
Definition: Core.cpp:2178
LLVMValueRef LLVMGetInitializer(LLVMValueRef GlobalVar)
Definition: Core.cpp:2162
void LLVMDeleteGlobal(LLVMValueRef GlobalVar)
Definition: Core.cpp:2158
LLVMBool LLVMIsThreadLocal(LLVMValueRef GlobalVar)
Definition: Core.cpp:2174
LLVMBool LLVMIsGlobalConstant(LLVMValueRef GlobalVar)
Definition: Core.cpp:2182
LLVMValueRef LLVMAddGlobalInAddressSpace(LLVMModuleRef M, LLVMTypeRef Ty, const char *Name, unsigned AddressSpace)
Definition: Core.cpp:2113
void LLVMSetInitializer(LLVMValueRef GlobalVar, LLVMValueRef ConstantVal)
Definition: Core.cpp:2169
LLVMValueRef LLVMGetNamedGlobal(LLVMModuleRef M, const char *Name)
Definition: Core.cpp:2122
#define N