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