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