1/*===-- llvm-c/Core.h - Core Library C Interface ------------------*- C -*-===*\ 3|* Part of the LLVM Project, under the Apache License v2.0 with LLVM *| 5|* See https://llvm.org/LICENSE.txt for license information. *| 6|* SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception *| 8|*===----------------------------------------------------------------------===*| 10|* This header declares the C interface to libLLVMCore.a, which implements *| 11|* the LLVM intermediate representation. *| 13\*===----------------------------------------------------------------------===*/ 27 * @defgroup LLVMC LLVM-C: C interface to LLVM 29 * This module exposes parts of the LLVM library as a C API. 35 * @defgroup LLVMCTransforms Transforms 39 * @defgroup LLVMCCore Core 41 * This modules provide an interface to libLLVMCore, which implements 42 * the LLVM intermediate representation as well as other related types 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. 53 * @defgroup LLVMCCoreTypes Types and Enumerations 58/// External users depend on the following values being stable. It is not safe 61/* Terminator Instructions */ 67/* removed 6 due to API changes */ 71/* Standard Unary Operators */ 74/* Standard Binary Operators */ 88/* Logical Operators */ 133/* Atomic operators */ 138/* Exception Handling Operators */ 164/* 15 previously used by LLVMX86_MMXTypeKind */ 340 somewhat sane results, lock free. */ 342 operations affecting a specific address, 343 a consistent ordering exists */ 345 necessary to acquire a lock to access other 346 memory with normal loads and stores. */ 348 a barrier of the sort necessary to release 351 Release barrier (for fences and 352 operations which both read and write 355 for loads and Release 356 semantics for stores. 357 Additionally, it guarantees 358 that a total ordering exists 360 SequentiallyConsistent 373 original using a signed comparison and return 376 original using a signed comparison and return 379 original using an unsigned comparison and return 382 original using an unsigned comparison and return 389 original using an floating point comparison and 390 return the old one */ 392 original using an floating point comparison and 393 return the old one */ 395 when incremented above input value */ 397 the input value when decremented below zero */ 417 * Emits an error if two values disagree, otherwise the resulting value is 418 * that of the operands. 420 * @see Module::ModFlagBehavior::Error 424 * Emits a warning if two values disagree. The result value will be the 425 * operand for the flag from the first module being linked. 427 * @see Module::ModFlagBehavior::Warning 431 * Adds a requirement that another module flag be present and have a 432 * specified value after linking is performed. The value must be a metadata 433 * pair, where the first element of the pair is the ID of the module flag 434 * to be restricted, and the second element of the pair is the value the 435 * module flag should be restricted to. This behavior can be used to 436 * restrict the allowable results (via triggering of an error) of linking 437 * IDs with the **Override** behavior. 439 * @see Module::ModFlagBehavior::Require 443 * Uses the specified value, regardless of the behavior or value of the 444 * other module. If both modules specify **Override**, but the values 445 * differ, an error will be emitted. 447 * @see Module::ModFlagBehavior::Override 451 * Appends the two values, which are required to be metadata nodes. 453 * @see Module::ModFlagBehavior::Append 457 * Appends the two values, which are required to be metadata 458 * nodes. However, duplicate entries in the second list are dropped 459 * during the append operation. 461 * @see Module::ModFlagBehavior::AppendUnique 467 * Attribute index are either LLVMAttributeReturnIndex, 468 * LLVMAttributeFunctionIndex or a parameter number from 1 to N. 472// ISO C restricts enumerator values to range of 'int' 473// (4294967295 is too large) 474// LLVMAttributeFunctionIndex = ~0U, 481 * Tail call kind for LLVMSetTailCallKind and LLVMGetTailCallKind. 483 * Note that 'musttail' implies 'tail'. 485 * @see CallInst::TailCallKind 510 * Flags to indicate what fast-math-style optimizations are allowed 513 * See https://llvm.org/docs/LangRef.html#fast-math-flags 524 * Flags that constrain the allowed wrap semantics of a getelementptr 527 * See https://llvm.org/docs/LangRef.html#getelementptr-instruction 535/** Deallocate and destroy all ManagedStatic variables. 536 @see llvm::llvm_shutdown 537 @see ManagedStatic */ 540/*===-- Version query -----------------------------------------------------===*/ 543 * Return the major, minor, and patch version of LLVM 545 * The version components are returned via the function's three output 546 * parameters or skipped if a NULL pointer was supplied. 548voidLLVMGetVersion(
unsigned *Major,
unsigned *Minor,
unsigned *Patch);
550/*===-- Error handling ----------------------------------------------------===*/ 556 * @defgroup LLVMCCoreContext Contexts 558 * Contexts are execution states for the core LLVM IR system. 560 * Most types are tied to a context instance. Multiple contexts can 561 * exist simultaneously. A single context is not thread safe. However, 562 * different contexts can execute on different threads simultaneously. 571 * Create a new context. 573 * Every call to this function should be paired with a call to 574 * LLVMContextDispose() or the context will leak memory. 579 * Obtain the global context instance. 584 * Set the diagnostic handler for this context. 588void *DiagnosticContext);
591 * Get the diagnostic handler of this context. 596 * Get the diagnostic context of this context. 601 * Set the yield callback function for this context. 603 * @see LLVMContext::setYieldCallback() 609 * Retrieve whether the given context is set to discard all value names. 611 * @see LLVMContext::shouldDiscardValueNames() 616 * Set whether the given context discards all value names. 618 * If true, only the names of GlobalValue objects will be available in the IR. 619 * This can be used to save memory and runtime, especially in release mode. 621 * @see LLVMContext::setDiscardValueNames() 626 * Destroy a context instance. 628 * This should be called for every call to LLVMContextCreate() or memory 634 * Return a string representation of the DiagnosticInfo. Use 635 * LLVMDisposeMessage to free the string. 637 * @see DiagnosticInfo::print() 642 * Return an enum LLVMDiagnosticSeverity. 644 * @see DiagnosticInfo::getSeverity() 653 * Maps a synchronization scope name to a ID unique within this context. 658 * Return an unique id given the name of a enum attribute, 659 * or 0 if no attribute by that name exists. 661 * See http://llvm.org/docs/LangRef.html#parameter-attributes 662 * and http://llvm.org/docs/LangRef.html#function-attributes 663 * for the list of available attributes. 665 * NB: Attribute names and/or id are subject to change without 666 * going through the C API deprecation cycle. 672 * Create an enum attribute. 678 * Get the unique id corresponding to the enum attribute 679 * passed as argument. 684 * Get the enum attribute's value. 0 is returned if none exists. 689 * Create a type attribute 695 * Get the type attribute's value. 700 * Create a ConstantRange attribute. 702 * LowerWords and UpperWords need to be NumBits divided by 64 rounded up 712 * Create a string attribute. 715constchar *K,
unsigned KLength,
716constchar *V,
unsigned VLength);
719 * Get the string attribute's kind. 724 * Get the string attribute's value. 729 * Check for the different types of attributes. 736 * Obtain a Type from a context by its registered name. 745 * @defgroup LLVMCCoreModule Modules 747 * Modules represent the top-level structure in an LLVM program. An LLVM 748 * module is effectively a translation unit or a collection of 749 * translation units merged together. 755 * Create a new, empty module in the global context. 757 * This is equivalent to calling LLVMModuleCreateWithNameInContext with 758 * LLVMGetGlobalContext() as the context parameter. 760 * Every invocation should be paired with LLVMDisposeModule() or memory 766 * Create a new, empty module in a specific context. 768 * Every invocation should be paired with LLVMDisposeModule() or memory 774 * Return an exact copy of the specified module. 779 * Destroy a module instance. 781 * This must be called for every created module or memory will be 787 * Soon to be deprecated. 788 * See https://llvm.org/docs/RemoveDIsDebugInfo.html#c-api-changes 790 * Returns true if the module is in the new debug info mode which uses 791 * non-instruction debug records instead of debug intrinsics for variable 797 * Soon to be deprecated. 798 * See https://llvm.org/docs/RemoveDIsDebugInfo.html#c-api-changes 800 * Convert module into desired debug info format. 805 * Obtain the identifier of a module. 807 * @param M Module to obtain identifier of 808 * @param Len Out parameter which holds the length of the returned string. 809 * @return The identifier of M. 810 * @see Module::getModuleIdentifier() 815 * Set the identifier of a module to a string Ident with length Len. 817 * @param M The module to set identifier 818 * @param Ident The string to set M's identifier to 819 * @param Len Length of Ident 820 * @see Module::setModuleIdentifier() 825 * Obtain the module's original source file name. 827 * @param M Module to obtain the name of 828 * @param Len Out parameter which holds the length of the returned string 829 * @return The original source file name of M 830 * @see Module::getSourceFileName() 835 * Set the original source file name of a module to a string Name with length 838 * @param M The module to set the source file name of 839 * @param Name The string to set M's source file name to 840 * @param Len Length of Name 841 * @see Module::setSourceFileName() 846 * Obtain the data layout for a module. 848 * @see Module::getDataLayoutStr() 850 * LLVMGetDataLayout is DEPRECATED, as the name is not only incorrect, 851 * but match the name of another method on the module. Prefer the use 852 * of LLVMGetDataLayoutStr, which is not ambiguous. 858 * Set the data layout for a module. 860 * @see Module::setDataLayout() 865 * Obtain the target triple for a module. 867 * @see Module::getTargetTriple() 872 * Set the target triple for a module. 874 * @see Module::setTargetTriple() 879 * Returns the module flags as an array of flag-key-value triples. The caller 880 * is responsible for freeing this array by calling 881 * \c LLVMDisposeModuleFlagsMetadata. 883 * @see Module::getModuleFlagsMetadata() 888 * Destroys module flags metadata entries. 893 * Returns the flag behavior for a module flag entry at a specific index. 895 * @see Module::ModuleFlagEntry::Behavior 902 * Returns the key for a module flag entry at a specific index. 904 * @see Module::ModuleFlagEntry::Key 907unsignedIndex,
size_t *Len);
910 * Returns the metadata for a module flag entry at a specific index. 912 * @see Module::ModuleFlagEntry::Val 918 * Add a module-level flag to the module-level flags metadata if it doesn't 921 * @see Module::getModuleFlag() 924constchar *Key,
size_t KeyLen);
927 * Add a module-level flag to the module-level flags metadata if it doesn't 930 * @see Module::addModuleFlag() 933constchar *Key,
size_t KeyLen,
937 * Dump a representation of a module to stderr. 939 * @see Module::dump() 944 * Print a representation of a module to a file. The ErrorMessage needs to be 945 * disposed with LLVMDisposeMessage. Returns 0 on success, 1 otherwise. 947 * @see Module::print() 953 * Return a string representation of the module. Use 954 * LLVMDisposeMessage to free the string. 956 * @see Module::print() 961 * Get inline assembly for a module. 963 * @see Module::getModuleInlineAsm() 968 * Set inline assembly for a module. 970 * @see Module::setModuleInlineAsm() 975 * Append inline assembly to a module. 977 * @see Module::appendModuleInlineAsm() 982 * Create the specified uniqued inline asm string. 984 * @see InlineAsm::get() 987size_t AsmStringSize,
constchar *Constraints,
988size_t ConstraintsSize,
LLVMBool HasSideEffects,
993 * Get the template string used for an inline assembly snippet 999 * Get the raw constraint string for an inline assembly snippet 1006 * Get the dialect used by the inline asm snippet 1012 * Get the function type of the inline assembly snippet. The same type that 1013 * was passed into LLVMGetInlineAsm originally 1015 * @see LLVMGetInlineAsm 1021 * Get if the inline asm snippet has side effects 1027 * Get if the inline asm snippet needs an aligned stack 1033 * Get if the inline asm snippet may unwind the stack 1039 * Obtain the context to which this module is associated. 1041 * @see Module::getContext() 1045/** Deprecated: Use LLVMGetTypeByName2 instead. */ 1049 * Obtain an iterator to the first NamedMDNode in a Module. 1051 * @see llvm::Module::named_metadata_begin() 1056 * Obtain an iterator to the last NamedMDNode in a Module. 1058 * @see llvm::Module::named_metadata_end() 1063 * Advance a NamedMDNode iterator to the next NamedMDNode. 1065 * Returns NULL if the iterator was already at the end and there are no more 1066 * named metadata nodes. 1071 * Decrement a NamedMDNode iterator to the previous NamedMDNode. 1073 * Returns NULL if the iterator was already at the beginning and there are 1074 * no previous named metadata nodes. 1079 * Retrieve a NamedMDNode with the given name, returning NULL if no such 1082 * @see llvm::Module::getNamedMetadata() 1085constchar *
Name,
size_t NameLen);
1088 * Retrieve a NamedMDNode with the given name, creating a new node if no such 1091 * @see llvm::Module::getOrInsertNamedMetadata() 1098 * Retrieve the name of a NamedMDNode. 1100 * @see llvm::NamedMDNode::getName() 1106 * Obtain the number of operands for named metadata in a module. 1108 * @see llvm::Module::getNamedMetadata() 1113 * Obtain the named metadata operands for a module. 1115 * The passed LLVMValueRef pointer should refer to an array of 1116 * LLVMValueRef at least LLVMGetNamedMetadataNumOperands long. This 1117 * array will be populated with the LLVMValueRef instances. Each 1118 * instance corresponds to a llvm::MDNode. 1120 * @see llvm::Module::getNamedMetadata() 1121 * @see llvm::MDNode::getOperand() 1127 * Add an operand to named metadata. 1129 * @see llvm::Module::getNamedMetadata() 1130 * @see llvm::MDNode::addOperand() 1136 * Return the directory of the debug location for this value, which must be 1137 * an llvm::Instruction, llvm::GlobalVariable, or llvm::Function. 1139 * @see llvm::Instruction::getDebugLoc() 1140 * @see llvm::GlobalVariable::getDebugInfo() 1141 * @see llvm::Function::getSubprogram() 1146 * Return the filename of the debug location for this value, which must be 1147 * an llvm::Instruction, llvm::GlobalVariable, or llvm::Function. 1149 * @see llvm::Instruction::getDebugLoc() 1150 * @see llvm::GlobalVariable::getDebugInfo() 1151 * @see llvm::Function::getSubprogram() 1156 * Return the line number of the debug location for this value, which must be 1157 * an llvm::Instruction, llvm::GlobalVariable, or llvm::Function. 1159 * @see llvm::Instruction::getDebugLoc() 1160 * @see llvm::GlobalVariable::getDebugInfo() 1161 * @see llvm::Function::getSubprogram() 1166 * Return the column number of the debug location for this value, which must be 1167 * an llvm::Instruction. 1169 * @see llvm::Instruction::getDebugLoc() 1174 * Add a function to a module under a specified name. 1176 * @see llvm::Function::Create() 1182 * Obtain a Function value from a Module by its name. 1184 * The returned value corresponds to a llvm::Function value. 1186 * @see llvm::Module::getFunction() 1191 * Obtain a Function value from a Module by its name. 1193 * The returned value corresponds to a llvm::Function value. 1195 * @see llvm::Module::getFunction() 1201 * Obtain an iterator to the first Function in a Module. 1203 * @see llvm::Module::begin() 1208 * Obtain an iterator to the last Function in a Module. 1210 * @see llvm::Module::end() 1215 * Advance a Function iterator to the next Function. 1217 * Returns NULL if the iterator was already at the end and there are no more 1223 * Decrement a Function iterator to the previous Function. 1225 * Returns NULL if the iterator was already at the beginning and there are 1226 * no previous functions. 1230/** Deprecated: Use LLVMSetModuleInlineAsm2 instead. */ 1238 * @defgroup LLVMCCoreType Types 1240 * Types represent the type of a value. 1242 * Types are associated with a context instance. The context internally 1243 * deduplicates types so there is only 1 instance of a specific type 1244 * alive at a time. In other words, a unique type is shared among all 1245 * consumers within a context. 1247 * A Type in the C API corresponds to llvm::Type. 1249 * Types have the following hierarchy: 1267 * Obtain the enumerated type of a Type instance. 1269 * @see llvm::Type:getTypeID() 1274 * Whether the type has a known size. 1276 * Things that don't have a size are abstract types, labels, and void.a 1278 * @see llvm::Type::isSized() 1283 * Obtain the context to which this type instance is associated. 1285 * @see llvm::Type::getContext() 1290 * Dump a representation of a type to stderr. 1292 * @see llvm::Type::dump() 1297 * Return a string representation of the type. Use 1298 * LLVMDisposeMessage to free the string. 1300 * @see llvm::Type::print() 1305 * @defgroup LLVMCCoreTypeInt Integer Types 1307 * Functions in this section operate on integer types. 1313 * Obtain an integer type from a context with specified bit width. 1324 * Obtain an integer type from the global context with a specified bit 1341 * @defgroup LLVMCCoreTypeFloat Floating Point Types 1347 * Obtain a 16-bit floating point type from a context. 1352 * Obtain a 16-bit brain floating point type from a context. 1357 * Obtain a 32-bit floating point type from a context. 1362 * Obtain a 64-bit floating point type from a context. 1367 * Obtain a 80-bit floating point type (X87) from a context. 1372 * Obtain a 128-bit floating point type (112-bit mantissa) from a 1378 * Obtain a 128-bit floating point type (two 64-bits) from a context. 1383 * Obtain a floating point type from the global context. 1385 * These map to the functions in this group of the same name. 1400 * @defgroup LLVMCCoreTypeFunction Function Types 1406 * Obtain a function type consisting of a specified signature. 1408 * The function is defined as a tuple of a return Type, a list of 1409 * parameter types, and whether the function is variadic. 1416 * Returns whether a function type is variadic. 1421 * Obtain the Type this function Type returns. 1426 * Obtain the number of parameters this function accepts. 1431 * Obtain the types of a function's parameters. 1433 * The Dest parameter should point to a pre-allocated array of 1434 * LLVMTypeRef at least LLVMCountParamTypes() large. On return, the 1435 * first LLVMCountParamTypes() entries in the array will be populated 1436 * with LLVMTypeRef instances. 1438 * @param FunctionTy The function type to operate on. 1439 * @param Dest Memory address of an array to be filled with result. 1448 * @defgroup LLVMCCoreTypeStruct Structure Types 1450 * These functions relate to LLVMTypeRef instances. 1452 * @see llvm::StructType 1458 * Create a new structure type in a context. 1460 * A structure is specified by a list of inner elements/types and 1461 * whether these can be packed together. 1463 * @see llvm::StructType::create() 1466unsigned ElementCount,
LLVMBool Packed);
1469 * Create a new structure type in the global context. 1471 * @see llvm::StructType::create() 1477 * Create an empty structure in a context having a specified name. 1479 * @see llvm::StructType::create() 1484 * Obtain the name of a structure. 1486 * @see llvm::StructType::getName() 1491 * Set the contents of a structure type. 1493 * @see llvm::StructType::setBody() 1496unsigned ElementCount,
LLVMBool Packed);
1499 * Get the number of elements defined inside the structure. 1501 * @see llvm::StructType::getNumElements() 1506 * Get the elements within a structure. 1508 * The function is passed the address of a pre-allocated array of 1509 * LLVMTypeRef at least LLVMCountStructElementTypes() long. After 1510 * invocation, this array will be populated with the structure's 1511 * elements. The objects in the destination array will have a lifetime 1512 * of the structure type itself, which is the lifetime of the context it 1518 * Get the type of the element at a given index in the structure. 1520 * @see llvm::StructType::getTypeAtIndex() 1525 * Determine whether a structure is packed. 1527 * @see llvm::StructType::isPacked() 1532 * Determine whether a structure is opaque. 1534 * @see llvm::StructType::isOpaque() 1539 * Determine whether a structure is literal. 1541 * @see llvm::StructType::isLiteral() 1550 * @defgroup LLVMCCoreTypeSequential Sequential Types 1552 * Sequential types represents "arrays" of types. This is a super class 1553 * for array, vector, and pointer types. 1559 * Obtain the element type of an array or vector type. 1561 * @see llvm::SequentialType::getElementType() 1566 * Returns type's subtypes 1568 * @see llvm::Type::subtypes() 1573 * Return the number of types in the derived type. 1575 * @see llvm::Type::getNumContainedTypes() 1580 * Create a fixed size array type that refers to a specific type. 1582 * The created type will exist in the context that its element type 1585 * @deprecated LLVMArrayType is deprecated in favor of the API accurate 1587 * @see llvm::ArrayType::get() 1592 * Create a fixed size array type that refers to a specific type. 1594 * The created type will exist in the context that its element type 1597 * @see llvm::ArrayType::get() 1602 * Obtain the length of an array type. 1604 * This only works on types that represent arrays. 1606 * @deprecated LLVMGetArrayLength is deprecated in favor of the API accurate 1607 * LLVMGetArrayLength2 1608 * @see llvm::ArrayType::getNumElements() 1613 * Obtain the length of an array type. 1615 * This only works on types that represent arrays. 1617 * @see llvm::ArrayType::getNumElements() 1622 * Create a pointer type that points to a defined type. 1624 * The created type will exist in the context that its pointee type 1627 * @see llvm::PointerType::get() 1632 * Determine whether a pointer is opaque. 1634 * True if this is an instance of an opaque PointerType. 1636 * @see llvm::Type::isOpaquePointerTy() 1641 * Create an opaque pointer type in a context. 1643 * @see llvm::PointerType::get() 1648 * Obtain the address space of a pointer type. 1650 * This only works on types that represent pointers. 1652 * @see llvm::PointerType::getAddressSpace() 1657 * Create a vector type that contains a defined type and has a specific 1658 * number of elements. 1660 * The created type will exist in the context thats its element type 1663 * @see llvm::VectorType::get() 1668 * Create a vector type that contains a defined type and has a scalable 1669 * number of elements. 1671 * The created type will exist in the context thats its element type 1674 * @see llvm::ScalableVectorType::get() 1677unsigned ElementCount);
1680 * Obtain the (possibly scalable) number of elements in a vector type. 1682 * This only works on types that represent vectors (fixed or scalable). 1684 * @see llvm::VectorType::getNumElements() 1689 * Get the pointer value for the associated ConstantPtrAuth constant. 1691 * @see llvm::ConstantPtrAuth::getPointer 1696 * Get the key value for the associated ConstantPtrAuth constant. 1698 * @see llvm::ConstantPtrAuth::getKey 1703 * Get the discriminator value for the associated ConstantPtrAuth constant. 1705 * @see llvm::ConstantPtrAuth::getDiscriminator 1710 * Get the address discriminator value for the associated ConstantPtrAuth 1713 * @see llvm::ConstantPtrAuth::getAddrDiscriminator 1722 * @defgroup LLVMCCoreTypeOther Other Types 1728 * Create a void type in a context. 1733 * Create a label type in a context. 1738 * Create a X86 AMX type in a context. 1743 * Create a token type in a context. 1748 * Create a metadata type in a context. 1753 * These are similar to the above functions except they operate on the 1761 * Create a target extension type in LLVM context. 1765unsigned TypeParamCount,
1767unsigned IntParamCount);
1770 * Obtain the name for this target extension type. 1772 * @see llvm::TargetExtType::getName() 1777 * Obtain the number of type parameters for this target extension type. 1779 * @see llvm::TargetExtType::getNumTypeParameters() 1784 * Get the type parameter at the given index for the target extension type. 1786 * @see llvm::TargetExtType::getTypeParameter() 1792 * Obtain the number of int parameters for this target extension type. 1794 * @see llvm::TargetExtType::getNumIntParameters() 1799 * Get the int parameter at the given index for the target extension type. 1801 * @see llvm::TargetExtType::getIntParameter() 1814 * @defgroup LLVMCCoreValues Values 1816 * The bulk of LLVM's object model consists of values, which comprise a very 1817 * rich type hierarchy. 1819 * LLVMValueRef essentially represents llvm::Value. There is a rich 1820 * hierarchy of classes within this type. Depending on the instance 1821 * obtained, not all APIs are available. 1823 * Callers can determine the type of an LLVMValueRef by calling the 1824 * LLVMIsA* family of functions (e.g. LLVMIsAArgument()). These 1825 * functions are defined by a macro, so it isn't obvious which are 1826 * available by looking at the Doxygen source code. Instead, look at the 1827 * source definition of LLVM_FOR_EACH_VALUE_SUBCLASS and note the list 1828 * of value names given. These value names also correspond to classes in 1829 * the llvm::Value hierarchy. 1834// Currently, clang-format tries to format the LLVM_FOR_EACH_VALUE_SUBCLASS 1835// macro in a progressively-indented fashion, which is not desired 1838#define LLVM_FOR_EACH_VALUE_SUBCLASS(macro) \ 1844 macro(BlockAddress) \ 1845 macro(ConstantAggregateZero) \ 1846 macro(ConstantArray) \ 1847 macro(ConstantDataSequential) \ 1848 macro(ConstantDataArray) \ 1849 macro(ConstantDataVector) \ 1850 macro(ConstantExpr) \ 1852 macro(ConstantInt) \ 1853 macro(ConstantPointerNull) \ 1854 macro(ConstantStruct) \ 1855 macro(ConstantTokenNone) \ 1856 macro(ConstantVector) \ 1857 macro(ConstantPtrAuth) \ 1858 macro(GlobalValue) \ 1859 macro(GlobalAlias) \ 1860 macro(GlobalObject) \ 1862 macro(GlobalVariable) \ 1863 macro(GlobalIFunc) \ 1865 macro(PoisonValue) \ 1866 macro(Instruction) \ 1867 macro(UnaryOperator) \ 1868 macro(BinaryOperator) \ 1870 macro(IntrinsicInst) \ 1871 macro(DbgInfoIntrinsic) \ 1872 macro(DbgVariableIntrinsic) \ 1873 macro(DbgDeclareInst) \ 1874 macro(DbgLabelInst) \ 1875 macro(MemIntrinsic) \ 1877 macro(MemMoveInst) \ 1882 macro(ExtractElementInst) \ 1883 macro(GetElementPtrInst) \ 1884 macro(InsertElementInst) \ 1885 macro(InsertValueInst) \ 1886 macro(LandingPadInst) \ 1889 macro(ShuffleVectorInst) \ 1892 macro(IndirectBrInst) \ 1896 macro(UnreachableInst) \ 1898 macro(CleanupReturnInst) \ 1899 macro(CatchReturnInst) \ 1900 macro(CatchSwitchInst) \ 1902 macro(FuncletPadInst) \ 1903 macro(CatchPadInst) \ 1904 macro(CleanupPadInst) \ 1905 macro(UnaryInstruction) \ 1908 macro(AddrSpaceCastInst) \ 1909 macro(BitCastInst) \ 1913 macro(FPTruncInst) \ 1914 macro(IntToPtrInst) \ 1915 macro(PtrToIntInst) \ 1921 macro(ExtractValueInst) \ 1925 macro(AtomicCmpXchgInst) \ 1926 macro(AtomicRMWInst) \ 1932 * @defgroup LLVMCCoreValueGeneral General APIs 1934 * Functions in this section work on all LLVMValueRef instances, 1935 * regardless of their sub-type. They correspond to functions available 1942 * Obtain the type of a value. 1944 * @see llvm::Value::getType() 1949 * Obtain the enumerated type of a Value instance. 1951 * @see llvm::Value::getValueID() 1956 * Obtain the string name of a value. 1958 * @see llvm::Value::getName() 1963 * Set the string name of a value. 1965 * @see llvm::Value::setName() 1970 * Dump a representation of a value to stderr. 1972 * @see llvm::Value::dump() 1977 * Return a string representation of the value. Use 1978 * LLVMDisposeMessage to free the string. 1980 * @see llvm::Value::print() 1985 * Obtain the context to which this value is associated. 1987 * @see llvm::Value::getContext() 1992 * Return a string representation of the DbgRecord. Use 1993 * LLVMDisposeMessage to free the string. 1995 * @see llvm::DbgRecord::print() 2000 * Replace all uses of a value with another one. 2002 * @see llvm::Value::replaceAllUsesWith() 2007 * Determine whether the specified value instance is constant. 2012 * Determine whether a value instance is undefined. 2017 * Determine whether a value instance is poisonous. 2022 * Convert value instances between types. 2024 * Internally, an LLVMValueRef is "pinned" to a specific type. This 2025 * series of functions allows you to cast an instance to a specific 2028 * If the cast is not valid for the specified type, NULL is returned. 2030 * @see llvm::dyn_cast_or_null<> 2032#define LLVM_DECLARE_VALUE_CAST(name) \ 2033 LLVMValueRef LLVMIsA##name(LLVMValueRef Val); 2040/** Deprecated: Use LLVMGetValueName2 instead. */ 2042/** Deprecated: Use LLVMSetValueName2 instead. */ 2050 * @defgroup LLVMCCoreValueUses Usage 2052 * This module defines functions that allow you to inspect the uses of a 2055 * It is possible to obtain an LLVMUseRef for any LLVMValueRef instance. 2056 * Each LLVMUseRef (which corresponds to a llvm::Use instance) holds a 2057 * llvm::User and llvm::Value. 2063 * Obtain the first use of a value. 2065 * Uses are obtained in an iterator fashion. First, call this function 2066 * to obtain a reference to the first use. Then, call LLVMGetNextUse() 2067 * on that instance and all subsequently obtained instances until 2068 * LLVMGetNextUse() returns NULL. 2070 * @see llvm::Value::use_begin() 2075 * Obtain the next use of a value. 2077 * This effectively advances the iterator. It returns NULL if you are on 2078 * the final use and no more are available. 2083 * Obtain the user value for a user. 2085 * The returned value corresponds to a llvm::User type. 2087 * @see llvm::Use::getUser() 2092 * Obtain the value this use corresponds to. 2094 * @see llvm::Use::get(). 2103 * @defgroup LLVMCCoreValueUser User value 2105 * Function in this group pertain to LLVMValueRef instances that descent 2106 * from llvm::User. This includes constants, instructions, and 2113 * Obtain an operand at a specific index in a llvm::User value. 2115 * @see llvm::User::getOperand() 2120 * Obtain the use of an operand at a specific index in a llvm::User value. 2122 * @see llvm::User::getOperandUse() 2127 * Set an operand at a specific index in a llvm::User value. 2129 * @see llvm::User::setOperand() 2134 * Obtain the number of operands in a llvm::User value. 2136 * @see llvm::User::getNumOperands() 2145 * @defgroup LLVMCCoreValueConstant Constants 2147 * This section contains APIs for interacting with LLVMValueRef that 2148 * correspond to llvm::Constant instances. 2150 * These functions will work for any LLVMValueRef in the llvm::Constant 2157 * Obtain a constant value referring to the null instance of a type. 2159 * @see llvm::Constant::getNullValue() 2164 * Obtain a constant value referring to the instance of a type 2165 * consisting of all ones. 2167 * This is only valid for integer types. 2169 * @see llvm::Constant::getAllOnesValue() 2174 * Obtain a constant value referring to an undefined value of a type. 2176 * @see llvm::UndefValue::get() 2181 * Obtain a constant value referring to a poison value of a type. 2183 * @see llvm::PoisonValue::get() 2188 * Determine whether a value instance is null. 2190 * @see llvm::Constant::isNullValue() 2195 * Obtain a constant that is a constant pointer pointing to NULL for a 2201 * @defgroup LLVMCCoreValueConstantScalar Scalar constants 2203 * Functions in this group model LLVMValueRef instances that correspond 2204 * to constants referring to scalar types. 2206 * For integer types, the LLVMTypeRef parameter should correspond to a 2207 * llvm::IntegerType instance and the returned LLVMValueRef will 2208 * correspond to a llvm::ConstantInt. 2210 * For floating point types, the LLVMTypeRef returned corresponds to a 2217 * Obtain a constant value for an integer type. 2219 * The returned value corresponds to a llvm::ConstantInt. 2221 * @see llvm::ConstantInt::get() 2223 * @param IntTy Integer type to obtain value of. 2224 * @param N The value the returned instance should refer to. 2225 * @param SignExtend Whether to sign extend the produced value. 2231 * Obtain a constant value for an integer of arbitrary precision. 2233 * @see llvm::ConstantInt::get() 2240 * Obtain a constant value for an integer parsed from a string. 2242 * A similar API, LLVMConstIntOfStringAndSize is also available. If the 2243 * string's length is available, it is preferred to call that function 2246 * @see llvm::ConstantInt::get() 2252 * Obtain a constant value for an integer parsed from a string with 2255 * @see llvm::ConstantInt::get() 2261 * Obtain a constant value referring to a double floating point value. 2266 * Obtain a constant for a floating point value parsed from a string. 2268 * A similar API, LLVMConstRealOfStringAndSize is also available. It 2269 * should be used if the input string's length is known. 2274 * Obtain a constant for a floating point value parsed from a string. 2280 * Obtain the zero extended value for an integer constant value. 2282 * @see llvm::ConstantInt::getZExtValue() 2287 * Obtain the sign extended value for an integer constant value. 2289 * @see llvm::ConstantInt::getSExtValue() 2294 * Obtain the double value for an floating point constant value. 2295 * losesInfo indicates if some precision was lost in the conversion. 2297 * @see llvm::ConstantFP::getDoubleValue 2306 * @defgroup LLVMCCoreValueConstantComposite Composite Constants 2308 * Functions in this group operate on composite constants. 2314 * Create a ConstantDataSequential and initialize it with a string. 2316 * @deprecated LLVMConstStringInContext is deprecated in favor of the API 2317 * accurate LLVMConstStringInContext2 2318 * @see llvm::ConstantDataArray::getString() 2321unsigned Length,
LLVMBool DontNullTerminate);
2324 * Create a ConstantDataSequential and initialize it with a string. 2326 * @see llvm::ConstantDataArray::getString() 2333 * Create a ConstantDataSequential with string content in the global context. 2335 * This is the same as LLVMConstStringInContext except it operates on the 2338 * @see LLVMConstStringInContext() 2339 * @see llvm::ConstantDataArray::getString() 2345 * Returns true if the specified constant is an array of i8. 2347 * @see ConstantDataSequential::getAsString() 2352 * Get the given constant data sequential as a string. 2354 * @see ConstantDataSequential::getAsString() 2359 * Create an anonymous ConstantStruct with the specified values. 2361 * @see llvm::ConstantStruct::getAnon() 2368 * Create a ConstantStruct in the global Context. 2370 * This is the same as LLVMConstStructInContext except it operates on the 2373 * @see LLVMConstStructInContext() 2379 * Create a ConstantArray from values. 2381 * @deprecated LLVMConstArray is deprecated in favor of the API accurate 2383 * @see llvm::ConstantArray::get() 2389 * Create a ConstantArray from values. 2391 * @see llvm::ConstantArray::get() 2397 * Create a non-anonymous ConstantStruct from values. 2399 * @see llvm::ConstantStruct::get() 2406 * Get element of a constant aggregate (struct, array or vector) at the 2407 * specified index. Returns null if the index is out of range, or it's not 2408 * possible to determine the element (e.g., because the constant is a 2409 * constant expression.) 2411 * @see llvm::Constant::getAggregateElement() 2416 * Get an element at specified index as a constant. 2418 * @see ConstantDataSequential::getElementAsConstant() 2422"Use LLVMGetAggregateElement instead");
2425 * Create a ConstantVector from values. 2427 * @see llvm::ConstantVector::get() 2432 * Create a ConstantPtrAuth constant with the given values. 2434 * @see llvm::ConstantPtrAuth::get() 2444 * @defgroup LLVMCCoreValueConstantExpressions Constant Expressions 2446 * Functions in this group correspond to APIs on llvm::ConstantExpr. 2448 * @see llvm::ConstantExpr. 2459"Use LLVMConstNull instead.");
2475unsigned NumIndices);
2477 * Creates a constant GetElementPtr expression. Similar to LLVMConstGEP2, but 2478 * allows specifying the no-wrap flags. 2480 * @see llvm::ConstantExpr::getGetElementPtr() 2507 * Gets the function associated with a given BlockAddress constant value. 2512 * Gets the basic block associated with a given BlockAddress constant value. 2516/** Deprecated: Use LLVMGetInlineAsm instead. */ 2518constchar *AsmString,
constchar *Constraints,
2526 * @defgroup LLVMCCoreValueConstantGlobals Global Values 2528 * This group contains functions that operate on global values. Functions in 2529 * this group relate to functions in the llvm::GlobalValue class tree. 2531 * @see llvm::GlobalValue 2550 * Returns the "value type" of a global value. This differs from the formal 2551 * type of a global value which is always a pointer type. 2553 * @see llvm::GlobalValue::getValueType() 2557/** Deprecated: Use LLVMGetUnnamedAddress instead. */ 2559/** Deprecated: Use LLVMSetUnnamedAddress instead. */ 2563 * @defgroup LLVMCCoreValueWithAlignment Values with alignment 2565 * Functions in this group only apply to values with alignment, i.e. 2566 * global variables, load and store instructions. 2570 * Obtain the preferred alignment of the value. 2571 * @see llvm::AllocaInst::getAlignment() 2572 * @see llvm::LoadInst::getAlignment() 2573 * @see llvm::StoreInst::getAlignment() 2574 * @see llvm::AtomicRMWInst::setAlignment() 2575 * @see llvm::AtomicCmpXchgInst::setAlignment() 2576 * @see llvm::GlobalValue::getAlignment() 2581 * Set the preferred alignment of the value. 2582 * @see llvm::AllocaInst::setAlignment() 2583 * @see llvm::LoadInst::setAlignment() 2584 * @see llvm::StoreInst::setAlignment() 2585 * @see llvm::AtomicRMWInst::setAlignment() 2586 * @see llvm::AtomicCmpXchgInst::setAlignment() 2587 * @see llvm::GlobalValue::setAlignment() 2592 * Sets a metadata attachment, erasing the existing metadata attachment if 2593 * it already exists for the given kind. 2595 * @see llvm::GlobalObject::setMetadata() 2601 * Erases a metadata attachment of the given kind if it exists. 2603 * @see llvm::GlobalObject::eraseMetadata() 2608 * Removes all metadata attachments from this value. 2610 * @see llvm::GlobalObject::clearMetadata() 2615 * Retrieves an array of metadata entries representing the metadata attached to 2616 * this value. The caller is responsible for freeing this array by calling 2617 * \c LLVMDisposeValueMetadataEntries. 2619 * @see llvm::GlobalObject::getAllMetadata() 2625 * Destroys value metadata entries. 2630 * Returns the kind of a value metadata entry at a specific index. 2636 * Returns the underlying metadata node of a value metadata entry at a 2648 * @defgroup LLVMCoreValueConstantGlobalVariable Global Variables 2650 * This group contains functions that operate on global variable values. 2652 * @see llvm::GlobalVariable 2659unsigned AddressSpace);
2684 * @defgroup LLVMCoreValueConstantGlobalAlias Global Aliases 2686 * This group contains function that operate on global alias values. 2688 * @see llvm::GlobalAlias 2694 * Add a GlobalAlias with the given value type, address space and aliasee. 2696 * @see llvm::GlobalAlias::create() 2703 * Obtain a GlobalAlias value from a Module by its name. 2705 * The returned value corresponds to a llvm::GlobalAlias value. 2707 * @see llvm::Module::getNamedAlias() 2710constchar *
Name,
size_t NameLen);
2713 * Obtain an iterator to the first GlobalAlias in a Module. 2715 * @see llvm::Module::alias_begin() 2720 * Obtain an iterator to the last GlobalAlias in a Module. 2722 * @see llvm::Module::alias_end() 2727 * Advance a GlobalAlias iterator to the next GlobalAlias. 2729 * Returns NULL if the iterator was already at the end and there are no more 2735 * Decrement a GlobalAlias iterator to the previous GlobalAlias. 2737 * Returns NULL if the iterator was already at the beginning and there are 2738 * no previous global aliases. 2743 * Retrieve the target value of an alias. 2748 * Set the target value of an alias. 2757 * @defgroup LLVMCCoreValueFunction Function values 2759 * Functions in this group operate on LLVMValueRef instances that 2760 * correspond to llvm::Function instances. 2762 * @see llvm::Function 2768 * Remove a function from its containing module and deletes it. 2770 * @see llvm::Function::eraseFromParent() 2775 * Check whether the given function has a personality function. 2777 * @see llvm::Function::hasPersonalityFn() 2782 * Obtain the personality function attached to the function. 2784 * @see llvm::Function::getPersonalityFn() 2789 * Set the personality function attached to the function. 2791 * @see llvm::Function::setPersonalityFn() 2796 * Obtain the intrinsic ID number which matches the given function name. 2798 * @see llvm::Intrinsic::lookupIntrinsicID() 2803 * Obtain the ID number from a function instance. 2805 * @see llvm::Function::getIntrinsicID() 2810 * Get or insert the declaration of an intrinsic. For overloaded intrinsics, 2811 * parameter types must be provided to uniquely identify an overload. 2813 * @see llvm::Intrinsic::getOrInsertDeclaration() 2821 * Retrieves the type of an intrinsic. For overloaded intrinsics, parameter 2822 * types must be provided to uniquely identify an overload. 2824 * @see llvm::Intrinsic::getType() 2830 * Retrieves the name of an intrinsic. 2832 * @see llvm::Intrinsic::getName() 2836/** Deprecated: Use LLVMIntrinsicCopyOverloadedName2 instead. */ 2838size_t ParamCount,
size_t *NameLength);
2841 * Copies the name of an overloaded intrinsic identified by a given list of 2844 * Unlike LLVMIntrinsicGetName, the caller is responsible for freeing the 2847 * This version also supports unnamed types. 2849 * @see llvm::Intrinsic::getName() 2853size_t ParamCount,
size_t *NameLength);
2856 * Obtain if the intrinsic identified by the given ID is overloaded. 2858 * @see llvm::Intrinsic::isOverloaded() 2863 * Obtain the calling function of a function. 2865 * The returned value corresponds to the LLVMCallConv enumeration. 2867 * @see llvm::Function::getCallingConv() 2872 * Set the calling convention of a function. 2874 * @see llvm::Function::setCallingConv() 2876 * @param Fn Function to operate on 2877 * @param CC LLVMCallConv to set calling convention to 2882 * Obtain the name of the garbage collector to use during code 2885 * @see llvm::Function::getGC() 2890 * Define the garbage collector to use during code generation. 2892 * @see llvm::Function::setGC() 2897 * Gets the prefix data associated with a function. Only valid on functions, and 2898 * only if LLVMHasPrefixData returns true. 2899 * See https://llvm.org/docs/LangRef.html#prefix-data 2904 * Check if a given function has prefix data. Only valid on functions. 2905 * See https://llvm.org/docs/LangRef.html#prefix-data 2910 * Sets the prefix data for the function. Only valid on functions. 2911 * See https://llvm.org/docs/LangRef.html#prefix-data 2916 * Gets the prologue data associated with a function. Only valid on functions, 2917 * and only if LLVMHasPrologueData returns true. 2918 * See https://llvm.org/docs/LangRef.html#prologue-data 2923 * Check if a given function has prologue data. Only valid on functions. 2924 * See https://llvm.org/docs/LangRef.html#prologue-data 2929 * Sets the prologue data for the function. Only valid on functions. 2930 * See https://llvm.org/docs/LangRef.html#prologue-data 2935 * Add an attribute to a function. 2937 * @see llvm::Function::addAttribute() 2949constchar *K,
unsigned KLen);
2953constchar *K,
unsigned KLen);
2956 * Add a target-dependent attribute to a function 2957 * @see llvm::AttrBuilder::addAttribute() 2963 * @defgroup LLVMCCoreValueFunctionParameters Function Parameters 2965 * Functions in this group relate to arguments/parameters on functions. 2967 * Functions in this group expect LLVMValueRef instances that correspond 2968 * to llvm::Function instances. 2974 * Obtain the number of parameters in a function. 2976 * @see llvm::Function::arg_size() 2981 * Obtain the parameters in a function. 2983 * The takes a pointer to a pre-allocated array of LLVMValueRef that is 2984 * at least LLVMCountParams() long. This array will be filled with 2985 * LLVMValueRef instances which correspond to the parameters the 2986 * function receives. Each LLVMValueRef corresponds to a llvm::Argument 2989 * @see llvm::Function::arg_begin() 2994 * Obtain the parameter at the specified index. 2996 * Parameters are indexed from 0. 2998 * @see llvm::Function::arg_begin() 3003 * Obtain the function to which this argument belongs. 3005 * Unlike other functions in this group, this one takes an LLVMValueRef 3006 * that corresponds to a llvm::Attribute. 3008 * The returned LLVMValueRef is the llvm::Function to which this 3014 * Obtain the first parameter to a function. 3016 * @see llvm::Function::arg_begin() 3021 * Obtain the last parameter to a function. 3023 * @see llvm::Function::arg_end() 3028 * Obtain the next parameter to a function. 3030 * This takes an LLVMValueRef obtained from LLVMGetFirstParam() (which is 3031 * actually a wrapped iterator) and obtains the next parameter from the 3032 * underlying iterator. 3037 * Obtain the previous parameter to a function. 3039 * This is the opposite of LLVMGetNextParam(). 3044 * Set the alignment for a function parameter. 3046 * @see llvm::Argument::addAttr() 3047 * @see llvm::AttrBuilder::addAlignmentAttr() 3056 * @defgroup LLVMCCoreValueGlobalIFunc IFuncs 3058 * Functions in this group relate to indirect functions. 3060 * Functions in this group expect LLVMValueRef instances that correspond 3061 * to llvm::GlobalIFunc instances. 3067 * Add a global indirect function to a module under a specified name. 3069 * @see llvm::GlobalIFunc::create() 3072constchar *
Name,
size_t NameLen,
3077 * Obtain a GlobalIFunc value from a Module by its name. 3079 * The returned value corresponds to a llvm::GlobalIFunc value. 3081 * @see llvm::Module::getNamedIFunc() 3084constchar *
Name,
size_t NameLen);
3087 * Obtain an iterator to the first GlobalIFunc in a Module. 3089 * @see llvm::Module::ifunc_begin() 3094 * Obtain an iterator to the last GlobalIFunc in a Module. 3096 * @see llvm::Module::ifunc_end() 3101 * Advance a GlobalIFunc iterator to the next GlobalIFunc. 3103 * Returns NULL if the iterator was already at the end and there are no more 3109 * Decrement a GlobalIFunc iterator to the previous GlobalIFunc. 3111 * Returns NULL if the iterator was already at the beginning and there are 3112 * no previous global aliases. 3117 * Retrieves the resolver function associated with this indirect function, or 3118 * NULL if it doesn't not exist. 3120 * @see llvm::GlobalIFunc::getResolver() 3125 * Sets the resolver function associated with this indirect function. 3127 * @see llvm::GlobalIFunc::setResolver() 3132 * Remove a global indirect function from its parent module and delete it. 3134 * @see llvm::GlobalIFunc::eraseFromParent() 3139 * Remove a global indirect function from its parent module. 3141 * This unlinks the global indirect function from its containing module but 3144 * @see llvm::GlobalIFunc::removeFromParent() 3165 * @defgroup LLVMCCoreValueMetadata Metadata 3171 * Create an MDString value from a given string value. 3173 * The MDString value does not take ownership of the given string, it remains 3174 * the responsibility of the caller to free it. 3176 * @see llvm::MDString::get() 3182 * Create an MDNode value with the given array of operands. 3184 * @see llvm::MDNode::get() 3190 * Obtain a Metadata as a Value. 3195 * Obtain a Value as a Metadata. 3200 * Obtain the underlying string from a MDString value. 3202 * @param V Instance to obtain string from. 3203 * @param Length Memory address which will hold length of returned string. 3204 * @return String data in MDString. 3209 * Obtain the number of operands from an MDNode value. 3211 * @param V MDNode to get number of operands from. 3212 * @return Number of operands of the MDNode. 3217 * Obtain the given MDNode's operands. 3219 * The passed LLVMValueRef pointer should point to enough memory to hold all of 3220 * the operands of the given MDNode (see LLVMGetMDNodeNumOperands) as 3221 * LLVMValueRefs. This memory will be populated with the LLVMValueRefs of the 3222 * MDNode's operands. 3224 * @param V MDNode to get the operands from. 3225 * @param Dest Destination array for operands. 3230 * Replace an operand at a specific index in a llvm::MDNode value. 3232 * @see llvm::MDNode::replaceOperandWith() 3237/** Deprecated: Use LLVMMDStringInContext2 instead. */ 3240/** Deprecated: Use LLVMMDStringInContext2 instead. */ 3242/** Deprecated: Use LLVMMDNodeInContext2 instead. */ 3245/** Deprecated: Use LLVMMDNodeInContext2 instead. */ 3253 * @defgroup LLVMCCoreOperandBundle Operand Bundles 3255 * Functions in this group operate on LLVMOperandBundleRef instances that 3256 * correspond to llvm::OperandBundleDef instances. 3258 * @see llvm::OperandBundleDef 3264 * Create a new operand bundle. 3266 * Every invocation should be paired with LLVMDisposeOperandBundle() or memory 3269 * @param Tag Tag name of the operand bundle 3270 * @param TagLen Length of Tag 3271 * @param Args Memory address of an array of bundle operands 3272 * @param NumArgs Length of Args 3279 * Destroy an operand bundle. 3281 * This must be called for every created operand bundle or memory will be 3287 * Obtain the tag of an operand bundle as a string. 3289 * @param Bundle Operand bundle to obtain tag of. 3290 * @param Len Out parameter which holds the length of the returned string. 3291 * @return The tag name of Bundle. 3292 * @see OperandBundleDef::getTag() 3297 * Obtain the number of operands for an operand bundle. 3299 * @param Bundle Operand bundle to obtain operand count of. 3300 * @return The number of operands. 3301 * @see OperandBundleDef::input_size() 3306 * Obtain the operand for an operand bundle at the given index. 3308 * @param Bundle Operand bundle to obtain operand of. 3309 * @param Index An operand index, must be less than 3310 * LLVMGetNumOperandBundleArgs(). 3311 * @return The operand. 3321 * @defgroup LLVMCCoreValueBasicBlock Basic Block 3323 * A basic block represents a single entry single exit section of code. 3324 * Basic blocks contain a list of instructions which form the body of 3327 * Basic blocks belong to functions. They have the type of label. 3329 * Basic blocks are themselves values. However, the C API models them as 3330 * LLVMBasicBlockRef. 3332 * @see llvm::BasicBlock 3338 * Convert a basic block instance to a value type. 3343 * Determine whether an LLVMValueRef is itself a basic block. 3348 * Convert an LLVMValueRef to an LLVMBasicBlockRef instance. 3353 * Obtain the string name of a basic block. 3358 * Obtain the function to which a basic block belongs. 3360 * @see llvm::BasicBlock::getParent() 3365 * Obtain the terminator instruction for a basic block. 3367 * If the basic block does not have a terminator (it is not well-formed 3368 * if it doesn't), then NULL is returned. 3370 * The returned LLVMValueRef corresponds to an llvm::Instruction. 3372 * @see llvm::BasicBlock::getTerminator() 3377 * Obtain the number of basic blocks in a function. 3379 * @param Fn Function value to operate on. 3384 * Obtain all of the basic blocks in a function. 3386 * This operates on a function value. The BasicBlocks parameter is a 3387 * pointer to a pre-allocated array of LLVMBasicBlockRef of at least 3388 * LLVMCountBasicBlocks() in length. This array is populated with 3389 * LLVMBasicBlockRef instances. 3394 * Obtain the first basic block in a function. 3396 * The returned basic block can be used as an iterator. You will likely 3397 * eventually call into LLVMGetNextBasicBlock() with it. 3399 * @see llvm::Function::begin() 3404 * Obtain the last basic block in a function. 3406 * @see llvm::Function::end() 3411 * Advance a basic block iterator. 3416 * Go backwards in a basic block iterator. 3421 * Obtain the basic block that corresponds to the entry point of a 3424 * @see llvm::Function::getEntryBlock() 3429 * Insert the given basic block after the insertion point of the given builder. 3431 * The insertion point must be valid. 3433 * @see llvm::Function::BasicBlockListType::insertAfter() 3439 * Append the given basic block to the basic block list of the given function. 3441 * @see llvm::Function::BasicBlockListType::push_back() 3447 * Create a new basic block without inserting it into a function. 3449 * @see llvm::BasicBlock::Create() 3455 * Append a basic block to the end of a function. 3457 * @see llvm::BasicBlock::Create() 3464 * Append a basic block to the end of a function using the global 3467 * @see llvm::BasicBlock::Create() 3472 * Insert a basic block in a function before another basic block. 3474 * The function to add to is determined by the function of the 3475 * passed basic block. 3477 * @see llvm::BasicBlock::Create() 3484 * Insert a basic block in a function using the global context. 3486 * @see llvm::BasicBlock::Create() 3492 * Remove a basic block from a function and delete it. 3494 * This deletes the basic block from its containing function and deletes 3495 * the basic block itself. 3497 * @see llvm::BasicBlock::eraseFromParent() 3502 * Remove a basic block from a function. 3504 * This deletes the basic block from its containing function but keep 3505 * the basic block alive. 3507 * @see llvm::BasicBlock::removeFromParent() 3512 * Move a basic block to before another one. 3514 * @see llvm::BasicBlock::moveBefore() 3519 * Move a basic block to after another one. 3521 * @see llvm::BasicBlock::moveAfter() 3526 * Obtain the first instruction in a basic block. 3528 * The returned LLVMValueRef corresponds to a llvm::Instruction 3534 * Obtain the last instruction in a basic block. 3536 * The returned LLVMValueRef corresponds to an LLVM:Instruction. 3545 * @defgroup LLVMCCoreValueInstruction Instructions 3547 * Functions in this group relate to the inspection and manipulation of 3548 * individual instructions. 3550 * In the C++ API, an instruction is modeled by llvm::Instruction. This 3551 * class has a large number of descendents. llvm::Instruction is a 3552 * llvm::Value and in the C API, instructions are modeled by 3555 * This group also contains sub-groups which operate on specific 3556 * llvm::Instruction types, e.g. llvm::CallInst. 3562 * Determine whether an instruction has any metadata attached. 3567 * Return metadata associated with an instruction value. 3572 * Set metadata associated with an instruction value. 3577 * Returns the metadata associated with an instruction value, but filters out 3578 * all the debug locations. 3580 * @see llvm::Instruction::getAllMetadataOtherThanDebugLoc() 3587 * Obtain the basic block to which an instruction belongs. 3589 * @see llvm::Instruction::getParent() 3594 * Obtain the instruction that occurs after the one specified. 3596 * The next instruction will be from the same basic block. 3598 * If this is the last instruction in a basic block, NULL will be 3604 * Obtain the instruction that occurred before this one. 3606 * If the instruction is the first instruction in a basic block, NULL 3612 * Remove an instruction. 3614 * The instruction specified is removed from its containing building 3615 * block but is kept alive. 3617 * @see llvm::Instruction::removeFromParent() 3622 * Remove and delete an instruction. 3624 * The instruction specified is removed from its containing building 3625 * block and then deleted. 3627 * @see llvm::Instruction::eraseFromParent() 3632 * Delete an instruction. 3634 * The instruction specified is deleted. It must have previously been 3635 * removed from its containing building block. 3637 * @see llvm::Value::deleteValue() 3642 * Obtain the code opcode for an individual instruction. 3644 * @see llvm::Instruction::getOpCode() 3649 * Obtain the predicate of an instruction. 3651 * This is only valid for instructions that correspond to llvm::ICmpInst. 3653 * @see llvm::ICmpInst::getPredicate() 3658 * Obtain the float predicate of an instruction. 3660 * This is only valid for instructions that correspond to llvm::FCmpInst. 3662 * @see llvm::FCmpInst::getPredicate() 3667 * Create a copy of 'this' instruction that is identical in all ways 3668 * except the following: 3669 * * The instruction has no parent 3670 * * The instruction has no name 3672 * @see llvm::Instruction::clone() 3677 * Determine whether an instruction is a terminator. This routine is named to 3678 * be compatible with historical functions that did this by querying the 3679 * underlying C++ type. 3681 * @see llvm::Instruction::isTerminator() 3686 * Obtain the first debug record attached to an instruction. 3688 * Use LLVMGetNextDbgRecord() and LLVMGetPreviousDbgRecord() to traverse the 3689 * sequence of DbgRecords. 3691 * Return the first DbgRecord attached to Inst or NULL if there are none. 3693 * @see llvm::Instruction::getDbgRecordRange() 3698 * Obtain the last debug record attached to an instruction. 3700 * Return the last DbgRecord attached to Inst or NULL if there are none. 3702 * @see llvm::Instruction::getDbgRecordRange() 3707 * Obtain the next DbgRecord in the sequence or NULL if there are no more. 3709 * @see llvm::Instruction::getDbgRecordRange() 3714 * Obtain the previous DbgRecord in the sequence or NULL if there are no more. 3716 * @see llvm::Instruction::getDbgRecordRange() 3721 * @defgroup LLVMCCoreValueInstructionCall Call Sites and Invocations 3723 * Functions in this group apply to instructions that refer to call 3724 * sites and invocations. These correspond to C++ types in the 3725 * llvm::CallInst class tree. 3731 * Obtain the argument count for a call instruction. 3733 * This expects an LLVMValueRef that corresponds to a llvm::CallInst, 3734 * llvm::InvokeInst, or llvm:FuncletPadInst. 3736 * @see llvm::CallInst::getNumArgOperands() 3737 * @see llvm::InvokeInst::getNumArgOperands() 3738 * @see llvm::FuncletPadInst::getNumArgOperands() 3743 * Set the calling convention for a call instruction. 3745 * This expects an LLVMValueRef that corresponds to a llvm::CallInst or 3748 * @see llvm::CallInst::setCallingConv() 3749 * @see llvm::InvokeInst::setCallingConv() 3754 * Obtain the calling convention for a call instruction. 3756 * This is the opposite of LLVMSetInstructionCallConv(). Reads its 3759 * @see LLVMSetInstructionCallConv() 3776constchar *K,
unsigned KLen);
3780constchar *K,
unsigned KLen);
3783 * Obtain the function type called by this instruction. 3785 * @see llvm::CallBase::getFunctionType() 3790 * Obtain the pointer to the function invoked by this instruction. 3792 * This expects an LLVMValueRef that corresponds to a llvm::CallInst or 3795 * @see llvm::CallInst::getCalledOperand() 3796 * @see llvm::InvokeInst::getCalledOperand() 3801 * Obtain the number of operand bundles attached to this instruction. 3803 * This only works on llvm::CallInst and llvm::InvokeInst instructions. 3805 * @see llvm::CallBase::getNumOperandBundles() 3810 * Obtain the operand bundle attached to this instruction at the given index. 3811 * Use LLVMDisposeOperandBundle to free the operand bundle. 3813 * This only works on llvm::CallInst and llvm::InvokeInst instructions. 3819 * Obtain whether a call instruction is a tail call. 3821 * This only works on llvm::CallInst instructions. 3823 * @see llvm::CallInst::isTailCall() 3828 * Set whether a call instruction is a tail call. 3830 * This only works on llvm::CallInst instructions. 3832 * @see llvm::CallInst::setTailCall() 3837 * Obtain a tail call kind of the call instruction. 3839 * @see llvm::CallInst::setTailCallKind() 3844 * Set the call kind of the call instruction. 3846 * @see llvm::CallInst::getTailCallKind() 3851 * Return the normal destination basic block. 3853 * This only works on llvm::InvokeInst instructions. 3855 * @see llvm::InvokeInst::getNormalDest() 3860 * Return the unwind destination basic block. 3862 * Works on llvm::InvokeInst, llvm::CleanupReturnInst, and 3863 * llvm::CatchSwitchInst instructions. 3865 * @see llvm::InvokeInst::getUnwindDest() 3866 * @see llvm::CleanupReturnInst::getUnwindDest() 3867 * @see llvm::CatchSwitchInst::getUnwindDest() 3872 * Set the normal destination basic block. 3874 * This only works on llvm::InvokeInst instructions. 3876 * @see llvm::InvokeInst::setNormalDest() 3881 * Set the unwind destination basic block. 3883 * Works on llvm::InvokeInst, llvm::CleanupReturnInst, and 3884 * llvm::CatchSwitchInst instructions. 3886 * @see llvm::InvokeInst::setUnwindDest() 3887 * @see llvm::CleanupReturnInst::setUnwindDest() 3888 * @see llvm::CatchSwitchInst::setUnwindDest() 3893 * Get the default destination of a CallBr instruction. 3895 * @see llvm::CallBrInst::getDefaultDest() 3900 * Get the number of indirect destinations of a CallBr instruction. 3902 * @see llvm::CallBrInst::getNumIndirectDests() 3908 * Get the indirect destination of a CallBr instruction at the given index. 3910 * @see llvm::CallBrInst::getIndirectDest() 3919 * @defgroup LLVMCCoreValueInstructionTerminator Terminators 3921 * Functions in this group only apply to instructions for which 3922 * LLVMIsATerminatorInst returns true. 3928 * Return the number of successors that this terminator has. 3930 * @see llvm::Instruction::getNumSuccessors 3935 * Return the specified successor. 3937 * @see llvm::Instruction::getSuccessor 3942 * Update the specified successor to point at the provided block. 3944 * @see llvm::Instruction::setSuccessor 3949 * Return if a branch is conditional. 3951 * This only works on llvm::BranchInst instructions. 3953 * @see llvm::BranchInst::isConditional 3958 * Return the condition of a branch instruction. 3960 * This only works on llvm::BranchInst instructions. 3962 * @see llvm::BranchInst::getCondition 3967 * Set the condition of a branch instruction. 3969 * This only works on llvm::BranchInst instructions. 3971 * @see llvm::BranchInst::setCondition 3976 * Obtain the default destination basic block of a switch instruction. 3978 * This only works on llvm::SwitchInst instructions. 3980 * @see llvm::SwitchInst::getDefaultDest() 3989 * @defgroup LLVMCCoreValueInstructionAlloca Allocas 3991 * Functions in this group only apply to instructions that map to 3992 * llvm::AllocaInst instances. 3998 * Obtain the type that is being allocated by the alloca instruction. 4007 * @defgroup LLVMCCoreValueInstructionGetElementPointer GEPs 4009 * Functions in this group only apply to instructions that map to 4010 * llvm::GetElementPtrInst instances. 4016 * Check whether the given GEP operator is inbounds. 4021 * Set the given GEP instruction to be inbounds or not. 4026 * Get the source element type of the given GEP operator. 4031 * Get the no-wrap related flags for the given GEP instruction. 4033 * @see llvm::GetElementPtrInst::getNoWrapFlags 4038 * Set the no-wrap related flags for the given GEP instruction. 4040 * @see llvm::GetElementPtrInst::setNoWrapFlags 4049 * @defgroup LLVMCCoreValueInstructionPHINode PHI Nodes 4051 * Functions in this group only apply to instructions that map to 4052 * llvm::PHINode instances. 4058 * Add an incoming value to the end of a PHI list. 4064 * Obtain the number of incoming basic blocks to a PHI node. 4069 * Obtain an incoming value to a PHI node as an LLVMValueRef. 4074 * Obtain an incoming value to a PHI node as an LLVMBasicBlockRef. 4083 * @defgroup LLVMCCoreValueInstructionExtractValue ExtractValue 4084 * @defgroup LLVMCCoreValueInstructionInsertValue InsertValue 4086 * Functions in this group only apply to instructions that map to 4087 * llvm::ExtractValue and llvm::InsertValue instances. 4093 * Obtain the number of indices. 4094 * NB: This also works on GEP operators. 4099 * Obtain the indices as an array. 4116 * @defgroup LLVMCCoreInstructionBuilder Instruction Builders 4118 * An instruction builder represents a point within a basic block and is 4119 * the exclusive means of building instructions using the C interface. 4127 * Set the builder position before Instr but after any attached debug records, 4128 * or if Instr is null set the position to the end of Block. 4133 * Set the builder position before Instr and any attached debug records, 4134 * or if Instr is null set the position to the end of Block. 4140 * Set the builder position before Instr but after any attached debug records. 4144 * Set the builder position before Instr and any attached debug records. 4159 * Get location information used by debugging information. 4161 * @see llvm::IRBuilder::getCurrentDebugLocation() 4166 * Set location information used by debugging information. 4168 * To clear the location metadata of the given instruction, pass NULL to \p Loc. 4170 * @see llvm::IRBuilder::SetCurrentDebugLocation() 4175 * Attempts to set the debug location for the given instruction using the 4176 * current debug location for the given builder. If the builder has no current 4177 * debug location, this function is a no-op. 4179 * @deprecated LLVMSetInstDebugLocation is deprecated in favor of the more general 4180 * LLVMAddMetadataToInst. 4182 * @see llvm::IRBuilder::SetInstDebugLocation() 4187 * Adds the metadata registered with the given builder to the given instruction. 4189 * @see llvm::IRBuilder::AddMetadataToInst() 4194 * Get the dafult floating-point math metadata for a given builder. 4196 * @see llvm::IRBuilder::getDefaultFPMathTag() 4201 * Set the default floating-point math metadata for the given builder. 4203 * To clear the metadata, pass NULL to \p FPMathTag. 4205 * @see llvm::IRBuilder::setDefaultFPMathTag() 4211 * Obtain the context to which this builder is associated. 4213 * @see llvm::IRBuilder::getContext() 4218 * Deprecated: Passing the NULL location will crash. 4219 * Use LLVMGetCurrentDebugLocation2 instead. 4223 * Deprecated: Returning the NULL location will crash. 4224 * Use LLVMGetCurrentDebugLocation2 instead. 4245unsigned NumBundles,
constchar *
Name);
4256/* Exception Handling */ 4273unsigned NumHandlers,
constchar *
Name);
4275/* Add a case to the switch instruction */ 4279/* Add a destination to the indirectbr instruction */ 4282/* Get the number of clauses on the landingpad instruction */ 4285/* Get the value of the clause at index Idx on the landingpad instruction */ 4288/* Add a catch or filter clause to the landingpad instruction */ 4291/* Get the 'cleanup' flag in the landingpad instruction */ 4294/* Set the 'cleanup' flag in the landingpad instruction */ 4297/* Add a destination to the catchswitch instruction */ 4300/* Get the number of handlers on the catchswitch instruction */ 4304 * Obtain the basic blocks acting as handlers for a catchswitch instruction. 4306 * The Handlers parameter should point to a pre-allocated array of 4307 * LLVMBasicBlockRefs at least LLVMGetNumHandlers() large. On return, the 4308 * first LLVMGetNumHandlers() entries in the array will be populated 4309 * with LLVMBasicBlockRef instances. 4311 * @param CatchSwitch The catchswitch instruction to operate on. 4312 * @param Handlers Memory address of an array to be filled with basic blocks. 4318/* Get the number of funcletpad arguments. */ 4321/* Set a funcletpad argument at the given index. */ 4325 * Get the parent catchswitch instruction of a catchpad instruction. 4327 * This only works on llvm::CatchPadInst instructions. 4329 * @see llvm::CatchPadInst::getCatchSwitch() 4334 * Set the parent catchswitch instruction of a catchpad instruction. 4336 * This only works on llvm::CatchPadInst instructions. 4338 * @see llvm::CatchPadInst::setCatchSwitch() 4404"Use LLVMBuildNeg + LLVMSetNUW instead.");
4416 * Gets if the instruction has the non-negative flag set. 4417 * Only valid for zext instructions. 4421 * Sets the non-negative flag for the instruction. 4422 * Only valid for zext instructions. 4427 * Get the flags for which fast-math-style optimizations are allowed for this 4430 * Only valid on floating point instructions. 4431 * @see LLVMCanValueUseFastMathFlags 4436 * Sets the flags for which fast-math-style optimizations are allowed for this 4439 * Only valid on floating point instructions. 4440 * @see LLVMCanValueUseFastMathFlags 4445 * Check if a given value can potentially have fast math flags. 4447 * Will return true for floating point arithmetic instructions, and for select, 4448 * phi, and call instructions whose type is a floating point type, or a vector 4449 * or array thereof. See https://llvm.org/docs/LangRef.html#fast-math-flags 4454 * Gets whether the instruction has the disjoint flag set. 4455 * Only valid for or instructions. 4459 * Sets the disjoint flag for the instruction. 4460 * Only valid for or instructions. 4470 * Creates and inserts a memset to the specified pointer and the 4473 * @see llvm::IRRBuilder::CreateMemSet() 4479 * Creates and inserts a memcpy between the specified pointers. 4481 * @see llvm::IRRBuilder::CreateMemCpy() 4488 * Creates and inserts a memmove between the specified pointers. 4490 * @see llvm::IRRBuilder::CreateMemMove() 4506unsigned NumIndices,
constchar *
Name);
4509unsigned NumIndices,
constchar *
Name);
4511 * Creates a GetElementPtr instruction. Similar to LLVMBuildGEP2, but allows 4512 * specifying the no-wrap flags. 4514 * @see llvm::IRBuilder::CreateGEP() 4519unsigned NumIndices,
constchar *
Name,
4527 * Deprecated: Use LLVMBuildGlobalString instead, which has identical behavior. 4583/** Deprecated: This cast is always signed. Use LLVMBuildIntCast2 instead. */ 4598/* Miscellaneous instructions */ 4607unsigned NumBundles,
constchar *
Name);
4662 * Get the number of elements in the mask of a ShuffleVector instruction. 4667 * \returns a constant that specifies that the result of a \c ShuffleVectorInst 4673 * Get the mask value at position Elt in the mask of a ShuffleVector 4676 * \Returns the result of \c LLVMGetUndefMaskElem() if the mask value is 4677 * poison at that position. 4685 * Returns whether an instruction is an atomic instruction, e.g., atomicrmw, 4686 * cmpxchg, fence, or loads and stores with atomic ordering. 4691 * Returns the synchronization scope ID of an atomic instruction. 4696 * Sets the synchronization scope ID of an atomic instruction. 4712 * @defgroup LLVMCCoreModuleProvider Module Providers 4718 * Changes the type of M so it can be passed to FunctionPassManagers and the 4719 * JIT. They take ModuleProviders for historical reasons. 4725 * Destroys the module M. 4734 * @defgroup LLVMCCoreMemoryBuffers Memory Buffers 4745size_t InputDataLength,
4746constchar *BufferName,
4749size_t InputDataLength,
4750constchar *BufferName);
4760 * @defgroup LLVMCCorePassManagers Pass Managers 4761 * @ingroup LLVMCCore 4766/** Constructs a new whole-module pass pipeline. This type of pipeline is 4767 suitable for link-time optimization and whole-module transformations. 4768 @see llvm::PassManager::PassManager */ 4771/** Constructs a new function-by-function pass pipeline over the module 4772 provider. It does not take ownership of the module provider. This type of 4773 pipeline is suitable for code generation and JIT compilation tasks. 4774 @see llvm::FunctionPassManager::FunctionPassManager */ 4777/** Deprecated: Use LLVMCreateFunctionPassManagerForModule instead. */ 4780/** Initializes, executes on the provided module, and finalizes all of the 4781 passes scheduled in the pass manager. Returns 1 if any of the passes 4782 modified the module, 0 otherwise. 4783 @see llvm::PassManager::run(Module&) */ 4786/** Initializes all of the function passes scheduled in the function pass 4787 manager. Returns 1 if any of the passes modified the module, 0 otherwise. 4788 @see llvm::FunctionPassManager::doInitialization */ 4791/** Executes all of the function passes scheduled in the function pass manager 4792 on the provided function. Returns 1 if any of the passes modified the 4793 function, false otherwise. 4794 @see llvm::FunctionPassManager::run(Function&) */ 4797/** Finalizes all of the function passes scheduled in the function pass 4798 manager. Returns 1 if any of the passes modified the module, 0 otherwise. 4799 @see llvm::FunctionPassManager::doFinalization */ 4802/** Frees the memory of a pass pipeline. For function pipelines, does not free 4803 the module provider. 4804 @see llvm::PassManagerBase::~PassManagerBase. */ 4812 * @defgroup LLVMCCoreThreading Threading 4814 * Handle the structures needed to make LLVM safe for multithreading. 4819/** Deprecated: Multi-threading can only be enabled/disabled with the compile 4820 time define LLVM_ENABLE_THREADS. This function always returns 4821 LLVMIsMultithreaded(). */ 4824/** Deprecated: Multi-threading can only be enabled/disabled with the compile 4825 time define LLVM_ENABLE_THREADS. */ 4828/** Check whether LLVM is executing in thread-safe mode or not. 4829 @see llvm::llvm_is_multithreaded */ 4846#endif/* LLVM_C_CORE_H */ static GCRegistry::Add< OcamlGC > B("ocaml", "ocaml 3.10-compatible GC")
static GCRegistry::Add< ErlangGC > A("erlang", "erlang-compatible garbage collector")
static GCRegistry::Add< ShadowStackGC > C("shadow-stack", "Very portable GC for uncooperative code generators")
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)
#define LLVM_C_EXTERN_C_BEGIN
#define LLVM_C_EXTERN_C_END
LLVMValueRef LLVMGetElementAsConstant(LLVMValueRef C, unsigned idx)
LLVMValueRef LLVMBuildNUWNeg(LLVMBuilderRef B, LLVMValueRef V, const char *Name)
LLVMValueRef LLVMConstNUWNeg(LLVMValueRef ConstantVal)
static cl::opt< bool > SingleThread("licm-force-thread-model-single", cl::Hidden, cl::init(false), cl::desc("Force thread model single in LICM pass"))
if(auto Err=PB.parsePassPipeline(MPM, Passes)) return wrap(std MPM run * Mod
const SmallVectorImpl< MachineOperand > & Cond
static cl::opt< RegAllocEvictionAdvisorAnalysis::AdvisorMode > Mode("regalloc-enable-advisor", cl::Hidden, cl::init(RegAllocEvictionAdvisorAnalysis::AdvisorMode::Default), cl::desc("Enable regalloc advisor mode"), cl::values(clEnumValN(RegAllocEvictionAdvisorAnalysis::AdvisorMode::Default, "default", "Default"), clEnumValN(RegAllocEvictionAdvisorAnalysis::AdvisorMode::Release, "release", "precompiled"), clEnumValN(RegAllocEvictionAdvisorAnalysis::AdvisorMode::Development, "development", "for training")))
unify loop Fixup each natural loop to have a single exit block
LLVMContextRef LLVMGetGlobalContext(void)
Obtain the global context instance.
unsigned LLVMGetEnumAttributeKind(LLVMAttributeRef A)
Get the unique id corresponding to the enum attribute passed as argument.
void LLVMContextSetDiscardValueNames(LLVMContextRef C, LLVMBool Discard)
Set whether the given context discards all value names.
uint64_t LLVMGetEnumAttributeValue(LLVMAttributeRef A)
Get the enum attribute's value.
LLVMTypeRef LLVMGetTypeAttributeValue(LLVMAttributeRef A)
Get the type attribute's value.
unsigned LLVMGetMDKindIDInContext(LLVMContextRef C, const char *Name, unsigned SLen)
LLVMDiagnosticSeverity LLVMGetDiagInfoSeverity(LLVMDiagnosticInfoRef DI)
Return an enum LLVMDiagnosticSeverity.
char * LLVMGetDiagInfoDescription(LLVMDiagnosticInfoRef DI)
Return a string representation of the DiagnosticInfo.
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.
unsigned LLVMGetSyncScopeID(LLVMContextRef C, const char *Name, size_t SLen)
Maps a synchronization scope name to a ID unique within this context.
LLVMDiagnosticHandler LLVMContextGetDiagnosticHandler(LLVMContextRef C)
Get the diagnostic handler of this context.
LLVMBool LLVMContextShouldDiscardValueNames(LLVMContextRef C)
Retrieve whether the given context is set to discard all value names.
LLVMAttributeRef LLVMCreateTypeAttribute(LLVMContextRef C, unsigned KindID, LLVMTypeRef type_ref)
Create a type attribute.
LLVMAttributeRef LLVMCreateStringAttribute(LLVMContextRef C, const char *K, unsigned KLength, const char *V, unsigned VLength)
Create a string attribute.
LLVMAttributeRef LLVMCreateConstantRangeAttribute(LLVMContextRef C, unsigned KindID, unsigned NumBits, const uint64_t LowerWords[], const uint64_t UpperWords[])
Create a ConstantRange attribute.
void LLVMContextDispose(LLVMContextRef C)
Destroy a context instance.
LLVMAttributeRef LLVMCreateEnumAttribute(LLVMContextRef C, unsigned KindID, uint64_t Val)
Create an enum attribute.
const char * LLVMGetStringAttributeKind(LLVMAttributeRef A, unsigned *Length)
Get the string attribute's kind.
LLVMTypeRef LLVMGetTypeByName2(LLVMContextRef C, const char *Name)
Obtain a Type from a context by its registered name.
LLVMContextRef LLVMContextCreate(void)
Create a new context.
void(* LLVMYieldCallback)(LLVMContextRef, void *)
unsigned LLVMGetLastEnumAttributeKind(void)
LLVMBool LLVMIsStringAttribute(LLVMAttributeRef A)
LLVMBool LLVMIsTypeAttribute(LLVMAttributeRef A)
const char * LLVMGetStringAttributeValue(LLVMAttributeRef A, unsigned *Length)
Get the string attribute's value.
void LLVMContextSetYieldCallback(LLVMContextRef C, LLVMYieldCallback Callback, void *OpaqueHandle)
Set the yield callback function for this context.
unsigned LLVMGetMDKindID(const char *Name, unsigned SLen)
void LLVMContextSetDiagnosticHandler(LLVMContextRef C, LLVMDiagnosticHandler Handler, void *DiagnosticContext)
Set the diagnostic handler for this context.
void(* LLVMDiagnosticHandler)(LLVMDiagnosticInfoRef, void *)
void * LLVMContextGetDiagnosticContext(LLVMContextRef C)
Get the diagnostic context of this context.
LLVMBool LLVMIsEnumAttribute(LLVMAttributeRef A)
Check for the different types of attributes.
LLVMValueRef LLVMBuildLoad2(LLVMBuilderRef, LLVMTypeRef Ty, LLVMValueRef PointerVal, const char *Name)
LLVMValueRef LLVMBuildGlobalStringPtr(LLVMBuilderRef B, const char *Str, const char *Name)
Deprecated: Use LLVMBuildGlobalString instead, which has identical behavior.
LLVMValueRef LLVMBuildFence(LLVMBuilderRef B, LLVMAtomicOrdering ordering, LLVMBool singleThread, const char *Name)
LLVMValueRef LLVMBuildAtomicRMW(LLVMBuilderRef B, LLVMAtomicRMWBinOp op, LLVMValueRef PTR, LLVMValueRef Val, LLVMAtomicOrdering ordering, LLVMBool singleThread)
LLVMBool LLVMGetIsDisjoint(LLVMValueRef Inst)
Gets whether the instruction has the disjoint flag set.
LLVMValueRef LLVMBuildNot(LLVMBuilderRef, LLVMValueRef V, const char *Name)
void LLVMSetAtomicSyncScopeID(LLVMValueRef AtomicInst, unsigned SSID)
Sets the synchronization scope ID of an atomic instruction.
LLVMValueRef LLVMBuildInvokeWithOperandBundles(LLVMBuilderRef, LLVMTypeRef Ty, LLVMValueRef Fn, LLVMValueRef *Args, unsigned NumArgs, LLVMBasicBlockRef Then, LLVMBasicBlockRef Catch, LLVMOperandBundleRef *Bundles, unsigned NumBundles, const char *Name)
LLVMValueRef LLVMBuildNSWSub(LLVMBuilderRef, LLVMValueRef LHS, LLVMValueRef RHS, const char *Name)
LLVMValueRef LLVMBuildAnd(LLVMBuilderRef, LLVMValueRef LHS, LLVMValueRef RHS, const char *Name)
LLVMValueRef LLVMBuildFPExt(LLVMBuilderRef, LLVMValueRef Val, LLVMTypeRef DestTy, const char *Name)
void LLVMClearInsertionPosition(LLVMBuilderRef Builder)
LLVMValueRef LLVMBuildFDiv(LLVMBuilderRef, LLVMValueRef LHS, LLVMValueRef RHS, const char *Name)
void LLVMSetWeak(LLVMValueRef CmpXchgInst, LLVMBool IsWeak)
void LLVMSetNSW(LLVMValueRef ArithInst, LLVMBool HasNSW)
LLVMValueRef LLVMBuildFreeze(LLVMBuilderRef, LLVMValueRef Val, const char *Name)
LLVMValueRef LLVMBuildFAdd(LLVMBuilderRef, LLVMValueRef LHS, LLVMValueRef RHS, const char *Name)
LLVMValueRef LLVMBuildFMul(LLVMBuilderRef, LLVMValueRef LHS, LLVMValueRef RHS, const char *Name)
LLVMValueRef LLVMBuildZExt(LLVMBuilderRef, LLVMValueRef Val, LLVMTypeRef DestTy, const char *Name)
LLVMValueRef LLVMBuildSExt(LLVMBuilderRef, LLVMValueRef Val, LLVMTypeRef DestTy, const char *Name)
LLVMValueRef LLVMBuildTruncOrBitCast(LLVMBuilderRef, LLVMValueRef Val, LLVMTypeRef DestTy, const char *Name)
LLVMValueRef LLVMBuildSExtOrBitCast(LLVMBuilderRef, LLVMValueRef Val, LLVMTypeRef DestTy, const char *Name)
LLVMValueRef LLVMBuildBitCast(LLVMBuilderRef, LLVMValueRef Val, LLVMTypeRef DestTy, const char *Name)
void LLVMBuilderSetDefaultFPMathTag(LLVMBuilderRef Builder, LLVMMetadataRef FPMathTag)
Set the default floating-point math metadata for the given builder.
LLVMValueRef LLVMBuildExtractValue(LLVMBuilderRef, LLVMValueRef AggVal, unsigned Index, const char *Name)
LLVMValueRef LLVMBuildFCmp(LLVMBuilderRef, LLVMRealPredicate Op, LLVMValueRef LHS, LLVMValueRef RHS, const char *Name)
void LLVMSetCmpXchgFailureOrdering(LLVMValueRef CmpXchgInst, LLVMAtomicOrdering Ordering)
LLVMValueRef LLVMBuildAtomicCmpXchgSyncScope(LLVMBuilderRef B, LLVMValueRef Ptr, LLVMValueRef Cmp, LLVMValueRef New, LLVMAtomicOrdering SuccessOrdering, LLVMAtomicOrdering FailureOrdering, unsigned SSID)
LLVMValueRef LLVMBuildFPTrunc(LLVMBuilderRef, LLVMValueRef Val, LLVMTypeRef DestTy, const char *Name)
LLVMAtomicOrdering LLVMGetCmpXchgFailureOrdering(LLVMValueRef CmpXchgInst)
LLVMOpcode LLVMGetCastOpcode(LLVMValueRef Src, LLVMBool SrcIsSigned, LLVMTypeRef DestTy, LLVMBool DestIsSigned)
LLVMAtomicRMWBinOp LLVMGetAtomicRMWBinOp(LLVMValueRef AtomicRMWInst)
void LLVMSetNUW(LLVMValueRef ArithInst, LLVMBool HasNUW)
LLVMValueRef LLVMBuildSIToFP(LLVMBuilderRef, LLVMValueRef Val, LLVMTypeRef DestTy, const char *Name)
LLVMValueRef LLVMBuildShl(LLVMBuilderRef, LLVMValueRef LHS, LLVMValueRef RHS, const char *Name)
void LLVMSetCurrentDebugLocation2(LLVMBuilderRef Builder, LLVMMetadataRef Loc)
Set location information used by debugging information.
int LLVMGetUndefMaskElem(void)
LLVMBool LLVMGetWeak(LLVMValueRef CmpXchgInst)
LLVMValueRef LLVMBuildFRem(LLVMBuilderRef, LLVMValueRef LHS, LLVMValueRef RHS, const char *Name)
LLVMValueRef LLVMBuildAlloca(LLVMBuilderRef, LLVMTypeRef Ty, const char *Name)
LLVMValueRef LLVMBuildSelect(LLVMBuilderRef, LLVMValueRef If, LLVMValueRef Then, LLVMValueRef Else, const char *Name)
LLVMValueRef LLVMBuildCatchPad(LLVMBuilderRef B, LLVMValueRef ParentPad, LLVMValueRef *Args, unsigned NumArgs, const char *Name)
void LLVMSetIsDisjoint(LLVMValueRef Inst, LLVMBool IsDisjoint)
Sets the disjoint flag for the instruction.
LLVMValueRef LLVMBuildMul(LLVMBuilderRef, LLVMValueRef LHS, LLVMValueRef RHS, const char *Name)
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...
LLVMValueRef LLVMBuildExactSDiv(LLVMBuilderRef, LLVMValueRef LHS, LLVMValueRef RHS, const char *Name)
LLVMValueRef LLVMBuildNUWSub(LLVMBuilderRef, LLVMValueRef LHS, LLVMValueRef RHS, const char *Name)
LLVMValueRef LLVMBuildMalloc(LLVMBuilderRef, LLVMTypeRef Ty, const char *Name)
LLVMValueRef LLVMBuildIsNull(LLVMBuilderRef, LLVMValueRef Val, const char *Name)
LLVMValueRef LLVMBuildLandingPad(LLVMBuilderRef B, LLVMTypeRef Ty, LLVMValueRef PersFn, unsigned NumClauses, const char *Name)
LLVMValueRef LLVMBuildAggregateRet(LLVMBuilderRef, LLVMValueRef *RetVals, unsigned N)
LLVMValueRef LLVMBuildAShr(LLVMBuilderRef, LLVMValueRef LHS, LLVMValueRef RHS, const char *Name)
LLVMValueRef LLVMBuildInvoke2(LLVMBuilderRef, LLVMTypeRef Ty, LLVMValueRef Fn, LLVMValueRef *Args, unsigned NumArgs, LLVMBasicBlockRef Then, LLVMBasicBlockRef Catch, const char *Name)
LLVMValueRef LLVMBuildCallWithOperandBundles(LLVMBuilderRef, LLVMTypeRef, LLVMValueRef Fn, LLVMValueRef *Args, unsigned NumArgs, LLVMOperandBundleRef *Bundles, unsigned NumBundles, const char *Name)
LLVMValueRef LLVMBuildExactUDiv(LLVMBuilderRef, LLVMValueRef LHS, LLVMValueRef RHS, const char *Name)
void LLVMSetOrdering(LLVMValueRef MemoryAccessInst, LLVMAtomicOrdering Ordering)
void LLVMSetCleanup(LLVMValueRef LandingPad, LLVMBool Val)
LLVMValueRef LLVMGetArgOperand(LLVMValueRef Funclet, unsigned i)
unsigned LLVMGetAtomicSyncScopeID(LLVMValueRef AtomicInst)
Returns the synchronization scope ID of an atomic instruction.
LLVMValueRef LLVMBuildInsertValue(LLVMBuilderRef, LLVMValueRef AggVal, LLVMValueRef EltVal, unsigned Index, const char *Name)
LLVMValueRef LLVMBuildAdd(LLVMBuilderRef, LLVMValueRef LHS, LLVMValueRef RHS, const char *Name)
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.
LLVMValueRef LLVMBuildBr(LLVMBuilderRef, LLVMBasicBlockRef Dest)
LLVMValueRef LLVMBuildNSWMul(LLVMBuilderRef, LLVMValueRef LHS, LLVMValueRef RHS, const char *Name)
LLVMValueRef LLVMBuildBinOp(LLVMBuilderRef B, LLVMOpcode Op, LLVMValueRef LHS, LLVMValueRef RHS, const char *Name)
LLVMValueRef LLVMBuildSRem(LLVMBuilderRef, LLVMValueRef LHS, LLVMValueRef RHS, const char *Name)
void LLVMDisposeBuilder(LLVMBuilderRef Builder)
int LLVMGetMaskValue(LLVMValueRef ShuffleVectorInst, unsigned Elt)
Get the mask value at position Elt in the mask of a ShuffleVector instruction.
LLVMValueRef LLVMBuildFSub(LLVMBuilderRef, LLVMValueRef LHS, LLVMValueRef RHS, const char *Name)
LLVMValueRef LLVMGetClause(LLVMValueRef LandingPad, unsigned Idx)
LLVMMetadataRef LLVMGetCurrentDebugLocation2(LLVMBuilderRef Builder)
Get location information used by debugging information.
LLVMValueRef LLVMBuildArrayAlloca(LLVMBuilderRef, LLVMTypeRef Ty, LLVMValueRef Val, const char *Name)
LLVMValueRef LLVMBuildVAArg(LLVMBuilderRef, LLVMValueRef List, LLVMTypeRef Ty, const char *Name)
LLVMBuilderRef LLVMCreateBuilderInContext(LLVMContextRef C)
LLVMValueRef LLVMBuildAtomicCmpXchg(LLVMBuilderRef B, LLVMValueRef Ptr, LLVMValueRef Cmp, LLVMValueRef New, LLVMAtomicOrdering SuccessOrdering, LLVMAtomicOrdering FailureOrdering, LLVMBool SingleThread)
LLVMValueRef LLVMBuildICmp(LLVMBuilderRef, LLVMIntPredicate Op, LLVMValueRef LHS, LLVMValueRef RHS, const char *Name)
LLVMValueRef LLVMBuildPointerCast(LLVMBuilderRef, LLVMValueRef Val, LLVMTypeRef DestTy, const char *Name)
LLVMValueRef LLVMGetParentCatchSwitch(LLVMValueRef CatchPad)
Get the parent catchswitch instruction of a catchpad instruction.
void LLVMSetAtomicSingleThread(LLVMValueRef AtomicInst, LLVMBool SingleThread)
LLVMValueRef LLVMBuildCast(LLVMBuilderRef B, LLVMOpcode Op, LLVMValueRef Val, LLVMTypeRef DestTy, const char *Name)
LLVMValueRef LLVMBuildTrunc(LLVMBuilderRef, LLVMValueRef Val, LLVMTypeRef DestTy, const char *Name)
LLVMValueRef LLVMBuildURem(LLVMBuilderRef, LLVMValueRef LHS, LLVMValueRef RHS, const char *Name)
void LLVMSetAtomicRMWBinOp(LLVMValueRef AtomicRMWInst, LLVMAtomicRMWBinOp BinOp)
LLVMValueRef LLVMBuildCall2(LLVMBuilderRef, LLVMTypeRef, LLVMValueRef Fn, LLVMValueRef *Args, unsigned NumArgs, const char *Name)
void LLVMAddClause(LLVMValueRef LandingPad, LLVMValueRef ClauseVal)
LLVMValueRef LLVMBuildOr(LLVMBuilderRef, LLVMValueRef LHS, LLVMValueRef RHS, const char *Name)
LLVMBool LLVMGetNUW(LLVMValueRef ArithInst)
LLVMValueRef LLVMBuildAddrSpaceCast(LLVMBuilderRef, LLVMValueRef Val, LLVMTypeRef DestTy, const char *Name)
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)
LLVMValueRef LLVMBuildFPToUI(LLVMBuilderRef, LLVMValueRef Val, LLVMTypeRef DestTy, const char *Name)
void LLVMSetCurrentDebugLocation(LLVMBuilderRef Builder, LLVMValueRef L)
Deprecated: Passing the NULL location will crash.
LLVMValueRef LLVMBuildFPToSI(LLVMBuilderRef, LLVMValueRef Val, LLVMTypeRef DestTy, const char *Name)
LLVMBool LLVMIsAtomic(LLVMValueRef Inst)
Returns whether an instruction is an atomic instruction, e.g., atomicrmw, cmpxchg,...
LLVMValueRef LLVMBuildIntCast2(LLVMBuilderRef, LLVMValueRef Val, LLVMTypeRef DestTy, LLVMBool IsSigned, const char *Name)
LLVMValueRef LLVMBuildNSWAdd(LLVMBuilderRef, LLVMValueRef LHS, LLVMValueRef RHS, const char *Name)
LLVMValueRef LLVMBuildFNeg(LLVMBuilderRef, LLVMValueRef V, const char *Name)
LLVMMetadataRef LLVMBuilderGetDefaultFPMathTag(LLVMBuilderRef Builder)
Get the dafult floating-point math metadata for a given builder.
LLVMValueRef LLVMBuildAtomicRMWSyncScope(LLVMBuilderRef B, LLVMAtomicRMWBinOp op, LLVMValueRef PTR, LLVMValueRef Val, LLVMAtomicOrdering ordering, unsigned SSID)
LLVMValueRef LLVMBuildUDiv(LLVMBuilderRef, LLVMValueRef LHS, LLVMValueRef RHS, const char *Name)
void LLVMSetParentCatchSwitch(LLVMValueRef CatchPad, LLVMValueRef CatchSwitch)
Set the parent catchswitch instruction of a catchpad instruction.
LLVMValueRef LLVMBuildCatchRet(LLVMBuilderRef B, LLVMValueRef CatchPad, LLVMBasicBlockRef BB)
LLVMValueRef LLVMBuildStructGEP2(LLVMBuilderRef B, LLVMTypeRef Ty, LLVMValueRef Pointer, unsigned Idx, const char *Name)
unsigned LLVMGetNumClauses(LLVMValueRef LandingPad)
LLVMBool LLVMGetNNeg(LLVMValueRef NonNegInst)
Gets if the instruction has the non-negative flag set.
LLVMValueRef LLVMBuildSDiv(LLVMBuilderRef, LLVMValueRef LHS, LLVMValueRef RHS, const char *Name)
LLVMValueRef LLVMBuildStore(LLVMBuilderRef, LLVMValueRef Val, LLVMValueRef Ptr)
LLVMValueRef LLVMBuildCatchSwitch(LLVMBuilderRef B, LLVMValueRef ParentPad, LLVMBasicBlockRef UnwindBB, unsigned NumHandlers, const char *Name)
LLVMValueRef LLVMBuildFenceSyncScope(LLVMBuilderRef B, LLVMAtomicOrdering ordering, unsigned SSID, const char *Name)
LLVMValueRef LLVMBuildIntCast(LLVMBuilderRef, LLVMValueRef Val, LLVMTypeRef DestTy, const char *Name)
Deprecated: This cast is always signed.
LLVMValueRef LLVMBuildArrayMalloc(LLVMBuilderRef, LLVMTypeRef Ty, LLVMValueRef Val, const char *Name)
LLVMValueRef LLVMBuildZExtOrBitCast(LLVMBuilderRef, LLVMValueRef Val, LLVMTypeRef DestTy, const char *Name)
LLVMValueRef LLVMBuildInBoundsGEP2(LLVMBuilderRef B, LLVMTypeRef Ty, LLVMValueRef Pointer, LLVMValueRef *Indices, unsigned NumIndices, const char *Name)
void LLVMGetHandlers(LLVMValueRef CatchSwitch, LLVMBasicBlockRef *Handlers)
Obtain the basic blocks acting as handlers for a catchswitch instruction.
LLVMAtomicOrdering LLVMGetOrdering(LLVMValueRef MemoryAccessInst)
LLVMValueRef LLVMBuildUIToFP(LLVMBuilderRef, LLVMValueRef Val, LLVMTypeRef DestTy, const char *Name)
LLVMValueRef LLVMBuildIntToPtr(LLVMBuilderRef, LLVMValueRef Val, LLVMTypeRef DestTy, const char *Name)
LLVMValueRef LLVMBuildCondBr(LLVMBuilderRef, LLVMValueRef If, LLVMBasicBlockRef Then, LLVMBasicBlockRef Else)
LLVMValueRef LLVMBuildIndirectBr(LLVMBuilderRef B, LLVMValueRef Addr, unsigned NumDests)
void LLVMAddDestination(LLVMValueRef IndirectBr, LLVMBasicBlockRef Dest)
LLVMValueRef LLVMBuildNSWNeg(LLVMBuilderRef B, LLVMValueRef V, const char *Name)
LLVMValueRef LLVMBuildXor(LLVMBuilderRef, LLVMValueRef LHS, LLVMValueRef RHS, const char *Name)
LLVMValueRef LLVMBuildGlobalString(LLVMBuilderRef B, const char *Str, const char *Name)
LLVMBool LLVMGetExact(LLVMValueRef DivOrShrInst)
LLVMValueRef LLVMBuildIsNotNull(LLVMBuilderRef, LLVMValueRef Val, const char *Name)
void LLVMSetArgOperand(LLVMValueRef Funclet, unsigned i, LLVMValueRef value)
LLVMValueRef LLVMBuildMemCpy(LLVMBuilderRef B, LLVMValueRef Dst, unsigned DstAlign, LLVMValueRef Src, unsigned SrcAlign, LLVMValueRef Size)
Creates and inserts a memcpy between the specified pointers.
LLVMValueRef LLVMBuildPtrDiff2(LLVMBuilderRef, LLVMTypeRef ElemTy, LLVMValueRef LHS, LLVMValueRef RHS, const char *Name)
void LLVMSetInstDebugLocation(LLVMBuilderRef Builder, LLVMValueRef Inst)
Attempts to set the debug location for the given instruction using the current debug location for the...
void LLVMAddMetadataToInst(LLVMBuilderRef Builder, LLVMValueRef Inst)
Adds the metadata registered with the given builder to the given instruction.
LLVMValueRef LLVMBuildSub(LLVMBuilderRef, LLVMValueRef LHS, LLVMValueRef RHS, const char *Name)
LLVMValueRef LLVMBuildNUWAdd(LLVMBuilderRef, LLVMValueRef LHS, LLVMValueRef RHS, const char *Name)
LLVMValueRef LLVMBuildUnreachable(LLVMBuilderRef)
LLVMValueRef LLVMBuildShuffleVector(LLVMBuilderRef, LLVMValueRef V1, LLVMValueRef V2, LLVMValueRef Mask, const char *Name)
void LLVMSetVolatile(LLVMValueRef MemoryAccessInst, LLVMBool IsVolatile)
LLVMValueRef LLVMBuildFree(LLVMBuilderRef, LLVMValueRef PointerVal)
LLVMValueRef LLVMBuildGEP2(LLVMBuilderRef B, LLVMTypeRef Ty, LLVMValueRef Pointer, LLVMValueRef *Indices, unsigned NumIndices, const char *Name)
unsigned LLVMGetNumHandlers(LLVMValueRef CatchSwitch)
LLVMValueRef LLVMBuildFPCast(LLVMBuilderRef, LLVMValueRef Val, LLVMTypeRef DestTy, const char *Name)
LLVMBuilderRef LLVMCreateBuilder(void)
void LLVMSetCmpXchgSuccessOrdering(LLVMValueRef CmpXchgInst, LLVMAtomicOrdering Ordering)
LLVMValueRef LLVMBuildPhi(LLVMBuilderRef, LLVMTypeRef Ty, const char *Name)
LLVMBool LLVMCanValueUseFastMathFlags(LLVMValueRef Inst)
Check if a given value can potentially have fast math flags.
void LLVMAddCase(LLVMValueRef Switch, LLVMValueRef OnVal, LLVMBasicBlockRef Dest)
LLVMBool LLVMIsAtomicSingleThread(LLVMValueRef AtomicInst)
LLVMValueRef LLVMBuildResume(LLVMBuilderRef B, LLVMValueRef Exn)
LLVMValueRef LLVMBuildSwitch(LLVMBuilderRef, LLVMValueRef V, LLVMBasicBlockRef Else, unsigned NumCases)
void LLVMInsertIntoBuilder(LLVMBuilderRef Builder, LLVMValueRef Instr)
LLVMValueRef LLVMBuildPtrToInt(LLVMBuilderRef, LLVMValueRef Val, LLVMTypeRef DestTy, const char *Name)
LLVMBool LLVMIsCleanup(LLVMValueRef LandingPad)
LLVMBool LLVMGetNSW(LLVMValueRef ArithInst)
LLVMValueRef LLVMBuildMemMove(LLVMBuilderRef B, LLVMValueRef Dst, unsigned DstAlign, LLVMValueRef Src, unsigned SrcAlign, LLVMValueRef Size)
Creates and inserts a memmove between the specified pointers.
LLVMValueRef LLVMBuildLShr(LLVMBuilderRef, LLVMValueRef LHS, LLVMValueRef RHS, const char *Name)
unsigned LLVMGetNumMaskElements(LLVMValueRef ShuffleVectorInst)
Get the number of elements in the mask of a ShuffleVector instruction.
LLVMValueRef LLVMBuildRetVoid(LLVMBuilderRef)
LLVMValueRef LLVMBuildRet(LLVMBuilderRef, LLVMValueRef V)
void LLVMAddHandler(LLVMValueRef CatchSwitch, LLVMBasicBlockRef Dest)
void LLVMPositionBuilderBeforeInstrAndDbgRecords(LLVMBuilderRef Builder, LLVMValueRef Instr)
Set the builder position before Instr and any attached debug records.
LLVMValueRef LLVMBuildExtractElement(LLVMBuilderRef, LLVMValueRef VecVal, LLVMValueRef Index, const char *Name)
void LLVMPositionBuilderBefore(LLVMBuilderRef Builder, LLVMValueRef Instr)
Set the builder position before Instr but after any attached debug records.
LLVMValueRef LLVMGetCurrentDebugLocation(LLVMBuilderRef Builder)
Deprecated: Returning the NULL location will crash.
LLVMAtomicOrdering LLVMGetCmpXchgSuccessOrdering(LLVMValueRef CmpXchgInst)
void LLVMSetNNeg(LLVMValueRef NonNegInst, LLVMBool IsNonNeg)
Sets the non-negative flag for the instruction.
LLVMContextRef LLVMGetBuilderContext(LLVMBuilderRef Builder)
Obtain the context to which this builder is associated.
void LLVMSetExact(LLVMValueRef DivOrShrInst, LLVMBool IsExact)
LLVMBasicBlockRef LLVMGetInsertBlock(LLVMBuilderRef Builder)
LLVMValueRef LLVMBuildCleanupPad(LLVMBuilderRef B, LLVMValueRef ParentPad, LLVMValueRef *Args, unsigned NumArgs, const char *Name)
void LLVMInsertIntoBuilderWithName(LLVMBuilderRef Builder, LLVMValueRef Instr, const char *Name)
void LLVMSetFastMathFlags(LLVMValueRef FPMathInst, LLVMFastMathFlags FMF)
Sets the flags for which fast-math-style optimizations are allowed for this value.
LLVMValueRef LLVMBuildGEPWithNoWrapFlags(LLVMBuilderRef B, LLVMTypeRef Ty, LLVMValueRef Pointer, LLVMValueRef *Indices, unsigned NumIndices, const char *Name, LLVMGEPNoWrapFlags NoWrapFlags)
Creates a GetElementPtr instruction.
LLVMFastMathFlags LLVMGetFastMathFlags(LLVMValueRef FPMathInst)
Get the flags for which fast-math-style optimizations are allowed for this value.
LLVMValueRef LLVMBuildNeg(LLVMBuilderRef, LLVMValueRef V, const char *Name)
LLVMBool LLVMGetVolatile(LLVMValueRef MemoryAccessInst)
LLVMValueRef LLVMBuildNUWMul(LLVMBuilderRef, LLVMValueRef LHS, LLVMValueRef RHS, const char *Name)
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...
void LLVMPositionBuilderAtEnd(LLVMBuilderRef Builder, LLVMBasicBlockRef Block)
LLVMValueRef LLVMBuildInsertElement(LLVMBuilderRef, LLVMValueRef VecVal, LLVMValueRef EltVal, LLVMValueRef Index, const char *Name)
LLVMValueRef LLVMBuildCleanupRet(LLVMBuilderRef B, LLVMValueRef CatchPad, LLVMBasicBlockRef BB)
void LLVMDisposeMemoryBuffer(LLVMMemoryBufferRef MemBuf)
size_t LLVMGetBufferSize(LLVMMemoryBufferRef MemBuf)
LLVMBool LLVMCreateMemoryBufferWithSTDIN(LLVMMemoryBufferRef *OutMemBuf, char **OutMessage)
LLVMMemoryBufferRef LLVMCreateMemoryBufferWithMemoryRange(const char *InputData, size_t InputDataLength, const char *BufferName, LLVMBool RequiresNullTerminator)
LLVMBool LLVMCreateMemoryBufferWithContentsOfFile(const char *Path, LLVMMemoryBufferRef *OutMemBuf, char **OutMessage)
const char * LLVMGetBufferStart(LLVMMemoryBufferRef MemBuf)
LLVMMemoryBufferRef LLVMCreateMemoryBufferWithMemoryRangeCopy(const char *InputData, size_t InputDataLength, const char *BufferName)
LLVMModuleProviderRef LLVMCreateModuleProviderForExistingModule(LLVMModuleRef M)
Changes the type of M so it can be passed to FunctionPassManagers and the JIT.
void LLVMDisposeModuleProvider(LLVMModuleProviderRef M)
Destroys the module M.
const char * LLVMGetModuleIdentifier(LLVMModuleRef M, size_t *Len)
Obtain the identifier of a module.
void LLVMSetDataLayout(LLVMModuleRef M, const char *DataLayoutStr)
Set the data layout for a module.
LLVMValueRef LLVMAddFunction(LLVMModuleRef M, const char *Name, LLVMTypeRef FunctionTy)
Add a function to a module under a specified name.
LLVMBool LLVMIsNewDbgInfoFormat(LLVMModuleRef M)
Soon to be deprecated.
LLVMNamedMDNodeRef LLVMGetPreviousNamedMetadata(LLVMNamedMDNodeRef NamedMDNode)
Decrement a NamedMDNode iterator to the previous NamedMDNode.
LLVMValueRef LLVMGetNamedFunctionWithLength(LLVMModuleRef M, const char *Name, size_t Length)
Obtain a Function value from a Module by its name.
LLVMTypeRef LLVMGetTypeByName(LLVMModuleRef M, const char *Name)
Deprecated: Use LLVMGetTypeByName2 instead.
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.
void LLVMDumpModule(LLVMModuleRef M)
Dump a representation of a module to stderr.
void LLVMAppendModuleInlineAsm(LLVMModuleRef M, const char *Asm, size_t Len)
Append inline assembly to a module.
LLVMValueRef LLVMGetFirstFunction(LLVMModuleRef M)
Obtain an iterator to the first Function in a Module.
const char * LLVMGetDebugLocFilename(LLVMValueRef Val, unsigned *Length)
Return the filename of the debug location for this value, which must be an llvm::Instruction,...
LLVMBool LLVMPrintModuleToFile(LLVMModuleRef M, const char *Filename, char **ErrorMessage)
Print a representation of a module to a file.
void LLVMDisposeModule(LLVMModuleRef M)
Destroy a module instance.
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.
const char * LLVMGetDebugLocDirectory(LLVMValueRef Val, unsigned *Length)
Return the directory of the debug location for this value, which must be an llvm::Instruction,...
const char * LLVMGetModuleInlineAsm(LLVMModuleRef M, size_t *Len)
Get inline assembly for a module.
const char * LLVMGetSourceFileName(LLVMModuleRef M, size_t *Len)
Obtain the module's original source file name.
const char * LLVMGetNamedMetadataName(LLVMNamedMDNodeRef NamedMD, size_t *NameLen)
Retrieve the name of a NamedMDNode.
LLVMContextRef LLVMGetModuleContext(LLVMModuleRef M)
Obtain the context to which this module is associated.
const char * LLVMGetInlineAsmConstraintString(LLVMValueRef InlineAsmVal, size_t *Len)
Get the raw constraint string for an inline assembly snippet.
LLVMModuleRef LLVMModuleCreateWithNameInContext(const char *ModuleID, LLVMContextRef C)
Create a new, empty module in a specific context.
LLVMMetadataRef LLVMModuleFlagEntriesGetMetadata(LLVMModuleFlagEntry *Entries, unsigned Index)
Returns the metadata for a module flag entry at a specific index.
const char * LLVMModuleFlagEntriesGetKey(LLVMModuleFlagEntry *Entries, unsigned Index, size_t *Len)
Returns the key for a module flag entry at a specific index.
LLVMValueRef LLVMGetLastFunction(LLVMModuleRef M)
Obtain an iterator to the last Function in a Module.
void LLVMSetTarget(LLVMModuleRef M, const char *Triple)
Set the target triple for a module.
const char * LLVMGetDataLayoutStr(LLVMModuleRef M)
Obtain the data layout for a module.
const char * LLVMGetInlineAsmAsmString(LLVMValueRef InlineAsmVal, size_t *Len)
Get the template string used for an inline assembly snippet.
LLVMModuleFlagBehavior LLVMModuleFlagEntriesGetFlagBehavior(LLVMModuleFlagEntry *Entries, unsigned Index)
Returns the flag behavior for a module flag entry at a specific index.
unsigned LLVMGetDebugLocColumn(LLVMValueRef Val)
Return the column number of the debug location for this value, which must be an llvm::Instruction.
unsigned LLVMGetDebugLocLine(LLVMValueRef Val)
Return the line number of the debug location for this value, which must be an llvm::Instruction,...
LLVMBool LLVMGetInlineAsmNeedsAlignedStack(LLVMValueRef InlineAsmVal)
Get if the inline asm snippet needs an aligned stack.
LLVMModuleRef LLVMModuleCreateWithName(const char *ModuleID)
Create a new, empty module in the global context.
LLVMModuleFlagEntry * LLVMCopyModuleFlagsMetadata(LLVMModuleRef M, size_t *Len)
Returns the module flags as an array of flag-key-value triples.
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.
void LLVMSetModuleInlineAsm(LLVMModuleRef M, const char *Asm)
Deprecated: Use LLVMSetModuleInlineAsm2 instead.
LLVMBool LLVMGetInlineAsmHasSideEffects(LLVMValueRef InlineAsmVal)
Get if the inline asm snippet has side effects.
void LLVMDisposeModuleFlagsMetadata(LLVMModuleFlagEntry *Entries)
Destroys module flags metadata entries.
LLVMInlineAsmDialect LLVMGetInlineAsmDialect(LLVMValueRef InlineAsmVal)
Get the dialect used by the inline asm snippet.
unsigned LLVMGetNamedMetadataNumOperands(LLVMModuleRef M, const char *Name)
Obtain the number of operands for named metadata in a module.
const char * LLVMGetTarget(LLVMModuleRef M)
Obtain the target triple for a module.
LLVMNamedMDNodeRef LLVMGetNextNamedMetadata(LLVMNamedMDNodeRef NamedMDNode)
Advance a NamedMDNode iterator to the next NamedMDNode.
void LLVMSetModuleInlineAsm2(LLVMModuleRef M, const char *Asm, size_t Len)
Set inline assembly for a module.
LLVMNamedMDNodeRef LLVMGetLastNamedMetadata(LLVMModuleRef M)
Obtain an iterator to the last NamedMDNode in a Module.
LLVMBool LLVMGetInlineAsmCanUnwind(LLVMValueRef InlineAsmVal)
Get if the inline asm snippet may unwind the stack.
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.
LLVMModuleRef LLVMCloneModule(LLVMModuleRef M)
Return an exact copy of the specified module.
const char * LLVMGetDataLayout(LLVMModuleRef M)
LLVMValueRef LLVMGetNamedFunction(LLVMModuleRef M, const char *Name)
Obtain a Function value from a Module by its name.
void LLVMSetIsNewDbgInfoFormat(LLVMModuleRef M, LLVMBool UseNewFormat)
Soon to be deprecated.
LLVMNamedMDNodeRef LLVMGetNamedMetadata(LLVMModuleRef M, const char *Name, size_t NameLen)
Retrieve a NamedMDNode with the given name, returning NULL if no such node exists.
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.
LLVMValueRef LLVMGetPreviousFunction(LLVMValueRef Fn)
Decrement a Function iterator to the previous Function.
char * LLVMPrintModuleToString(LLVMModuleRef M)
Return a string representation of the module.
void LLVMGetNamedMetadataOperands(LLVMModuleRef M, const char *Name, LLVMValueRef *Dest)
Obtain the named metadata operands for a module.
LLVMValueRef LLVMGetNextFunction(LLVMValueRef Fn)
Advance a Function iterator to the next Function.
LLVMTypeRef LLVMGetInlineAsmFunctionType(LLVMValueRef InlineAsmVal)
Get the function type of the inline assembly snippet.
void LLVMSetModuleIdentifier(LLVMModuleRef M, const char *Ident, size_t Len)
Set the identifier of a module to a string Ident with length Len.
void LLVMAddNamedMetadataOperand(LLVMModuleRef M, const char *Name, LLVMValueRef Val)
Add an operand to named metadata.
LLVMNamedMDNodeRef LLVMGetFirstNamedMetadata(LLVMModuleRef M)
Obtain an iterator to the first NamedMDNode in a Module.
LLVMValueRef LLVMGetOperandBundleArgAtIndex(LLVMOperandBundleRef Bundle, unsigned Index)
Obtain the operand for an operand bundle at the given index.
unsigned LLVMGetNumOperandBundleArgs(LLVMOperandBundleRef Bundle)
Obtain the number of operands for an operand bundle.
LLVMOperandBundleRef LLVMCreateOperandBundle(const char *Tag, size_t TagLen, LLVMValueRef *Args, unsigned NumArgs)
Create a new operand bundle.
void LLVMDisposeOperandBundle(LLVMOperandBundleRef Bundle)
Destroy an operand bundle.
const char * LLVMGetOperandBundleTag(LLVMOperandBundleRef Bundle, size_t *Len)
Obtain the tag of an operand bundle as a string.
LLVMBool LLVMRunPassManager(LLVMPassManagerRef PM, LLVMModuleRef M)
Initializes, executes on the provided module, and finalizes all of the passes scheduled in the pass m...
LLVMPassManagerRef LLVMCreateFunctionPassManager(LLVMModuleProviderRef MP)
Deprecated: Use LLVMCreateFunctionPassManagerForModule instead.
LLVMPassManagerRef LLVMCreatePassManager(void)
Constructs a new whole-module pass pipeline.
void LLVMDisposePassManager(LLVMPassManagerRef PM)
Frees the memory of a pass pipeline.
LLVMBool LLVMFinalizeFunctionPassManager(LLVMPassManagerRef FPM)
Finalizes all of the function passes scheduled in the function pass manager.
LLVMBool LLVMRunFunctionPassManager(LLVMPassManagerRef FPM, LLVMValueRef F)
Executes all of the function passes scheduled in the function pass manager on the provided function.
LLVMBool LLVMInitializeFunctionPassManager(LLVMPassManagerRef FPM)
Initializes all of the function passes scheduled in the function pass manager.
LLVMPassManagerRef LLVMCreateFunctionPassManagerForModule(LLVMModuleRef M)
Constructs a new function-by-function pass pipeline over the module provider.
LLVMBool LLVMIsMultithreaded(void)
Check whether LLVM is executing in thread-safe mode or not.
LLVMBool LLVMStartMultithreaded(void)
Deprecated: Multi-threading can only be enabled/disabled with the compile time define LLVM_ENABLE_THR...
void LLVMStopMultithreaded(void)
Deprecated: Multi-threading can only be enabled/disabled with the compile time define LLVM_ENABLE_THR...
LLVMTypeRef LLVMFP128Type(void)
LLVMTypeRef LLVMFP128TypeInContext(LLVMContextRef C)
Obtain a 128-bit floating point type (112-bit mantissa) from a context.
LLVMTypeRef LLVMDoubleTypeInContext(LLVMContextRef C)
Obtain a 64-bit floating point type from a context.
LLVMTypeRef LLVMX86FP80TypeInContext(LLVMContextRef C)
Obtain a 80-bit floating point type (X87) from a context.
LLVMTypeRef LLVMHalfTypeInContext(LLVMContextRef C)
Obtain a 16-bit floating point type from a context.
LLVMTypeRef LLVMBFloatTypeInContext(LLVMContextRef C)
Obtain a 16-bit brain floating point type from a context.
LLVMTypeRef LLVMBFloatType(void)
LLVMTypeRef LLVMFloatTypeInContext(LLVMContextRef C)
Obtain a 32-bit floating point type from a context.
LLVMTypeRef LLVMHalfType(void)
Obtain a floating point type from the global context.
LLVMTypeRef LLVMX86FP80Type(void)
LLVMTypeRef LLVMPPCFP128Type(void)
LLVMTypeRef LLVMFloatType(void)
LLVMTypeRef LLVMDoubleType(void)
LLVMTypeRef LLVMPPCFP128TypeInContext(LLVMContextRef C)
Obtain a 128-bit floating point type (two 64-bits) from a context.
LLVMBool LLVMIsFunctionVarArg(LLVMTypeRef FunctionTy)
Returns whether a function type is variadic.
unsigned LLVMCountParamTypes(LLVMTypeRef FunctionTy)
Obtain the number of parameters this function accepts.
void LLVMGetParamTypes(LLVMTypeRef FunctionTy, LLVMTypeRef *Dest)
Obtain the types of a function's parameters.
LLVMTypeRef LLVMFunctionType(LLVMTypeRef ReturnType, LLVMTypeRef *ParamTypes, unsigned ParamCount, LLVMBool IsVarArg)
Obtain a function type consisting of a specified signature.
LLVMTypeRef LLVMGetReturnType(LLVMTypeRef FunctionTy)
Obtain the Type this function Type returns.
LLVMTypeRef LLVMInt64Type(void)
LLVMTypeRef LLVMInt64TypeInContext(LLVMContextRef C)
LLVMTypeRef LLVMInt16TypeInContext(LLVMContextRef C)
LLVMTypeRef LLVMIntTypeInContext(LLVMContextRef C, unsigned NumBits)
LLVMTypeRef LLVMInt1TypeInContext(LLVMContextRef C)
Obtain an integer type from a context with specified bit width.
LLVMTypeRef LLVMInt32Type(void)
LLVMTypeRef LLVMInt32TypeInContext(LLVMContextRef C)
LLVMTypeRef LLVMInt128TypeInContext(LLVMContextRef C)
LLVMTypeRef LLVMIntType(unsigned NumBits)
LLVMTypeRef LLVMInt8TypeInContext(LLVMContextRef C)
LLVMTypeRef LLVMInt8Type(void)
LLVMTypeRef LLVMInt1Type(void)
Obtain an integer type from the global context with a specified bit width.
LLVMTypeRef LLVMInt128Type(void)
unsigned LLVMGetIntTypeWidth(LLVMTypeRef IntegerTy)
LLVMTypeRef LLVMInt16Type(void)
LLVMTypeRef LLVMVoidType(void)
These are similar to the above functions except they operate on the global context.
const char * LLVMGetTargetExtTypeName(LLVMTypeRef TargetExtTy)
Obtain the name for this target extension type.
LLVMTypeRef LLVMGetTargetExtTypeTypeParam(LLVMTypeRef TargetExtTy, unsigned Idx)
Get the type parameter at the given index for the target extension type.
unsigned LLVMGetTargetExtTypeNumTypeParams(LLVMTypeRef TargetExtTy)
Obtain the number of type parameters for this target extension type.
LLVMTypeRef LLVMX86AMXTypeInContext(LLVMContextRef C)
Create a X86 AMX type in a context.
LLVMTypeRef LLVMMetadataTypeInContext(LLVMContextRef C)
Create a metadata type in a context.
LLVMTypeRef LLVMTokenTypeInContext(LLVMContextRef C)
Create a token type in a context.
LLVMTypeRef LLVMX86AMXType(void)
LLVMTypeRef LLVMLabelTypeInContext(LLVMContextRef C)
Create a label type in a context.
LLVMTypeRef LLVMTargetExtTypeInContext(LLVMContextRef C, const char *Name, LLVMTypeRef *TypeParams, unsigned TypeParamCount, unsigned *IntParams, unsigned IntParamCount)
Create a target extension type in LLVM context.
unsigned LLVMGetTargetExtTypeNumIntParams(LLVMTypeRef TargetExtTy)
Obtain the number of int parameters for this target extension type.
unsigned LLVMGetTargetExtTypeIntParam(LLVMTypeRef TargetExtTy, unsigned Idx)
Get the int parameter at the given index for the target extension type.
LLVMTypeRef LLVMLabelType(void)
LLVMTypeRef LLVMVoidTypeInContext(LLVMContextRef C)
Create a void type in a context.
unsigned LLVMGetArrayLength(LLVMTypeRef ArrayTy)
Obtain the length of an array type.
LLVMTypeRef LLVMGetElementType(LLVMTypeRef Ty)
Obtain the element type of an array or vector type.
unsigned LLVMGetPointerAddressSpace(LLVMTypeRef PointerTy)
Obtain the address space of a pointer type.
uint64_t LLVMGetArrayLength2(LLVMTypeRef ArrayTy)
Obtain the length of an array type.
LLVMValueRef LLVMGetConstantPtrAuthPointer(LLVMValueRef PtrAuth)
Get the pointer value for the associated ConstantPtrAuth constant.
LLVMTypeRef LLVMPointerType(LLVMTypeRef ElementType, unsigned AddressSpace)
Create a pointer type that points to a defined type.
unsigned LLVMGetNumContainedTypes(LLVMTypeRef Tp)
Return the number of types in the derived type.
LLVMValueRef LLVMGetConstantPtrAuthDiscriminator(LLVMValueRef PtrAuth)
Get the discriminator value for the associated ConstantPtrAuth constant.
LLVMTypeRef LLVMVectorType(LLVMTypeRef ElementType, unsigned ElementCount)
Create a vector type that contains a defined type and has a specific number of elements.
LLVMBool LLVMPointerTypeIsOpaque(LLVMTypeRef Ty)
Determine whether a pointer is opaque.
LLVMTypeRef LLVMPointerTypeInContext(LLVMContextRef C, unsigned AddressSpace)
Create an opaque pointer type in a context.
LLVMValueRef LLVMGetConstantPtrAuthKey(LLVMValueRef PtrAuth)
Get the key value for the associated ConstantPtrAuth constant.
LLVMTypeRef LLVMArrayType(LLVMTypeRef ElementType, unsigned ElementCount)
Create a fixed size array type that refers to a specific type.
LLVMTypeRef LLVMScalableVectorType(LLVMTypeRef ElementType, unsigned ElementCount)
Create a vector type that contains a defined type and has a scalable number of elements.
LLVMTypeRef LLVMArrayType2(LLVMTypeRef ElementType, uint64_t ElementCount)
Create a fixed size array type that refers to a specific type.
void LLVMGetSubtypes(LLVMTypeRef Tp, LLVMTypeRef *Arr)
Returns type's subtypes.
LLVMValueRef LLVMGetConstantPtrAuthAddrDiscriminator(LLVMValueRef PtrAuth)
Get the address discriminator value for the associated ConstantPtrAuth constant.
unsigned LLVMGetVectorSize(LLVMTypeRef VectorTy)
Obtain the (possibly scalable) number of elements in a vector type.
void LLVMStructSetBody(LLVMTypeRef StructTy, LLVMTypeRef *ElementTypes, unsigned ElementCount, LLVMBool Packed)
Set the contents of a structure type.
LLVMBool LLVMIsPackedStruct(LLVMTypeRef StructTy)
Determine whether a structure is packed.
LLVMTypeRef LLVMStructGetTypeAtIndex(LLVMTypeRef StructTy, unsigned i)
Get the type of the element at a given index in the structure.
LLVMTypeRef LLVMStructType(LLVMTypeRef *ElementTypes, unsigned ElementCount, LLVMBool Packed)
Create a new structure type in the global context.
const char * LLVMGetStructName(LLVMTypeRef Ty)
Obtain the name of a structure.
void LLVMGetStructElementTypes(LLVMTypeRef StructTy, LLVMTypeRef *Dest)
Get the elements within a structure.
LLVMBool LLVMIsOpaqueStruct(LLVMTypeRef StructTy)
Determine whether a structure is opaque.
unsigned LLVMCountStructElementTypes(LLVMTypeRef StructTy)
Get the number of elements defined inside the structure.
LLVMTypeRef LLVMStructCreateNamed(LLVMContextRef C, const char *Name)
Create an empty structure in a context having a specified name.
LLVMBool LLVMIsLiteralStruct(LLVMTypeRef StructTy)
Determine whether a structure is literal.
LLVMTypeRef LLVMStructTypeInContext(LLVMContextRef C, LLVMTypeRef *ElementTypes, unsigned ElementCount, LLVMBool Packed)
Create a new structure type in a context.
LLVMBool LLVMTypeIsSized(LLVMTypeRef Ty)
Whether the type has a known size.
LLVMTypeKind LLVMGetTypeKind(LLVMTypeRef Ty)
Obtain the enumerated type of a Type instance.
char * LLVMPrintTypeToString(LLVMTypeRef Val)
Return a string representation of the type.
void LLVMDumpType(LLVMTypeRef Val)
Dump a representation of a type to stderr.
LLVMContextRef LLVMGetTypeContext(LLVMTypeRef Ty)
Obtain the context to which this type instance is associated.
LLVMTailCallKind
Tail call kind for LLVMSetTailCallKind and LLVMGetTailCallKind.
LLVMOpcode
External users depend on the following values being stable.
unsigned LLVMAttributeIndex
unsigned LLVMFastMathFlags
Flags to indicate what fast-math-style optimizations are allowed on operations.
unsigned LLVMGEPNoWrapFlags
Flags that constrain the allowed wrap semantics of a getelementptr instruction.
@ LLVMAttributeReturnIndex
@ LLVMAttributeFunctionIndex
@ LLVMTailCallKindMustTail
@ LLVMDLLImportLinkage
Obsolete.
@ LLVMInternalLinkage
Rename collisions when linking (static functions)
@ LLVMLinkOnceAnyLinkage
Keep one copy of function when linking (inline)
@ LLVMExternalLinkage
Externally visible function.
@ LLVMExternalWeakLinkage
ExternalWeak linkage description.
@ LLVMLinkOnceODRLinkage
Same, but only replaced by something equivalent.
@ LLVMPrivateLinkage
Like Internal, but omit from symbol table.
@ LLVMDLLExportLinkage
Obsolete.
@ LLVMLinkerPrivateLinkage
Like Private, but linker removes.
@ LLVMWeakODRLinkage
Same, but only replaced by something equivalent.
@ LLVMGhostLinkage
Obsolete.
@ LLVMWeakAnyLinkage
Keep one copy of function when linking (weak)
@ LLVMAppendingLinkage
Special purpose, only applies to global arrays.
@ LLVMCommonLinkage
Tentative definitions.
@ LLVMLinkOnceODRAutoHideLinkage
Obsolete.
@ LLVMLinkerPrivateWeakLinkage
Like LinkerPrivate, but is weak.
@ LLVMAvailableExternallyLinkage
@ LLVMRealUNE
True if unordered or not equal.
@ LLVMRealUGT
True if unordered or greater than.
@ LLVMRealULE
True if unordered, less than, or equal.
@ LLVMRealOLE
True if ordered and less than or equal.
@ LLVMRealOGE
True if ordered and greater than or equal.
@ LLVMRealULT
True if unordered or less than.
@ LLVMRealPredicateFalse
Always false (always folded)
@ LLVMRealPredicateTrue
Always true (always folded)
@ LLVMRealUNO
True if unordered: isnan(X) | isnan(Y)
@ LLVMRealOEQ
True if ordered and equal.
@ LLVMRealOLT
True if ordered and less than.
@ LLVMRealUEQ
True if unordered or equal.
@ LLVMRealORD
True if ordered (no nans)
@ LLVMRealOGT
True if ordered and greater than.
@ LLVMRealUGE
True if unordered, greater than, or equal.
@ LLVMRealONE
True if ordered and operands are unequal.
@ LLVMHalfTypeKind
16 bit floating point type
@ LLVMFP128TypeKind
128 bit floating point type (112-bit mantissa)
@ LLVMIntegerTypeKind
Arbitrary bit width integers.
@ LLVMPointerTypeKind
Pointers.
@ LLVMX86_FP80TypeKind
80 bit floating point type (X87)
@ LLVMX86_AMXTypeKind
X86 AMX.
@ LLVMMetadataTypeKind
Metadata.
@ LLVMScalableVectorTypeKind
Scalable SIMD vector type.
@ LLVMArrayTypeKind
Arrays.
@ LLVMBFloatTypeKind
16 bit brain floating point type
@ LLVMStructTypeKind
Structures.
@ LLVMLabelTypeKind
Labels.
@ LLVMDoubleTypeKind
64 bit floating point type
@ LLVMVoidTypeKind
type with no size
@ LLVMTokenTypeKind
Tokens.
@ LLVMFloatTypeKind
32 bit floating point type
@ LLVMFunctionTypeKind
Functions.
@ LLVMVectorTypeKind
Fixed width SIMD vector type.
@ LLVMPPC_FP128TypeKind
128 bit floating point type (two 64-bits)
@ LLVMTargetExtTypeKind
Target extension type.
@ LLVMDefaultStorageClass
@ LLVMDLLExportStorageClass
Function to be accessible from DLL.
@ LLVMDLLImportStorageClass
Function to be imported from DLL.
@ LLVMConstantDataVectorValueKind
@ LLVMConstantIntValueKind
@ LLVMConstantDataArrayValueKind
@ LLVMUndefValueValueKind
@ LLVMConstantVectorValueKind
@ LLVMConstantTokenNoneValueKind
@ LLVMConstantAggregateZeroValueKind
@ LLVMGlobalAliasValueKind
@ LLVMMetadataAsValueValueKind
@ LLVMConstantTargetNoneValueKind
@ LLVMConstantStructValueKind
@ LLVMInstructionValueKind
@ LLVMConstantArrayValueKind
@ LLVMConstantPtrAuthValueKind
@ LLVMConstantPointerNullValueKind
@ LLVMBasicBlockValueKind
@ LLVMBlockAddressValueKind
@ LLVMConstantExprValueKind
@ LLVMPoisonValueValueKind
@ LLVMGlobalVariableValueKind
@ LLVMGlobalIFuncValueKind
@ LLVMConstantFPValueKind
@ LLVMX86VectorCallCallConv
@ LLVMPreserveAllCallConv
@ LLVMX86ThisCallCallConv
@ LLVMPreserveMostCallConv
@ LLVMMSP430BUILTINCallConv
@ LLVMAMDGPUKERNELCallConv
@ LLVMX86FastcallCallConv
@ LLVMARMAAPCSVFPCallConv
@ LLVMIntSGT
signed greater than
@ LLVMIntULE
unsigned less or equal
@ LLVMIntUGE
unsigned greater or equal
@ LLVMIntSGE
signed greater or equal
@ LLVMIntULT
unsigned less than
@ LLVMIntUGT
unsigned greater than
@ LLVMIntSLE
signed less or equal
@ LLVMIntSLT
signed less than
@ LLVMGlobalUnnamedAddr
Address of the GV is globally insignificant.
@ LLVMLocalUnnamedAddr
Address of the GV is locally insignificant.
@ LLVMNoUnnamedAddr
Address of the GV is significant.
@ LLVMModuleFlagBehaviorRequire
Adds a requirement that another module flag be present and have a specified value after linking is pe...
@ LLVMModuleFlagBehaviorWarning
Emits a warning if two values disagree.
@ LLVMModuleFlagBehaviorOverride
Uses the specified value, regardless of the behavior or value of the other module.
@ LLVMModuleFlagBehaviorAppendUnique
Appends the two values, which are required to be metadata nodes.
@ LLVMModuleFlagBehaviorAppend
Appends the two values, which are required to be metadata nodes.
@ LLVMModuleFlagBehaviorError
Emits an error if two values disagree, otherwise the resulting value is that of the operands.
@ LLVMProtectedVisibility
The GV is protected.
@ LLVMDefaultVisibility
The GV is visible.
@ LLVMHiddenVisibility
The GV is hidden.
@ LLVMLandingPadCatch
A catch clause
@ LLVMLandingPadFilter
A filter clause
@ LLVMAtomicRMWBinOpXor
Xor a value and return the old one.
@ LLVMAtomicRMWBinOpXchg
Set the new value and return the one old.
@ LLVMAtomicRMWBinOpSub
Subtract a value and return the old one.
@ LLVMAtomicRMWBinOpUMax
Sets the value if it's greater than the original using an unsigned comparison and return the old one.
@ LLVMAtomicRMWBinOpUSubSat
Subtracts the value, clamping to zero.
@ LLVMAtomicRMWBinOpAnd
And a value and return the old one.
@ LLVMAtomicRMWBinOpUDecWrap
Decrements the value, wrapping back to the input value when decremented below zero.
@ LLVMAtomicRMWBinOpFMax
Sets the value if it's greater than the original using an floating point comparison and return the ol...
@ LLVMAtomicRMWBinOpMin
Sets the value if it's Smaller than the original using a signed comparison and return the old one.
@ LLVMAtomicRMWBinOpOr
OR a value and return the old one.
@ LLVMAtomicRMWBinOpFMin
Sets the value if it's smaller than the original using an floating point comparison and return the ol...
@ LLVMAtomicRMWBinOpMax
Sets the value if it's greater than the original using a signed comparison and return the old one.
@ LLVMAtomicRMWBinOpUIncWrap
Increments the value, wrapping back to zero when incremented above input value.
@ LLVMAtomicRMWBinOpFAdd
Add a floating point value and return the old one.
@ LLVMAtomicRMWBinOpFSub
Subtract a floating point value and return the old one.
@ LLVMAtomicRMWBinOpAdd
Add a value and return the old one.
@ LLVMAtomicRMWBinOpUMin
Sets the value if it's greater than the original using an unsigned comparison and return the old one.
@ LLVMAtomicRMWBinOpNand
Not-And a value and return the old one.
@ LLVMAtomicRMWBinOpUSubCond
Subtracts the value only if no unsigned overflow.
@ LLVMFastMathAllowReassoc
@ LLVMFastMathNoSignedZeros
@ LLVMFastMathAllowContract
@ LLVMFastMathAllowReciprocal
@ LLVMGeneralDynamicTLSModel
@ LLVMLocalDynamicTLSModel
@ LLVMInitialExecTLSModel
@ LLVMAtomicOrderingAcquireRelease
provides both an Acquire and a Release barrier (for fences and operations which both read and write m...
@ LLVMAtomicOrderingRelease
Release is similar to Acquire, but with a barrier of the sort necessary to release a lock.
@ LLVMAtomicOrderingAcquire
Acquire provides a barrier of the sort necessary to acquire a lock to access other memory with normal...
@ LLVMAtomicOrderingMonotonic
guarantees that if you take all the operations affecting a specific address, a consistent ordering ex...
@ LLVMAtomicOrderingSequentiallyConsistent
provides Acquire semantics for loads and Release semantics for stores.
@ LLVMAtomicOrderingNotAtomic
A load or store which is not atomic.
@ LLVMAtomicOrderingUnordered
Lowest level of atomicity, guarantees somewhat sane results, lock free.
@ LLVMInlineAsmDialectATT
@ LLVMInlineAsmDialectIntel
LLVMBasicBlockRef LLVMGetNextBasicBlock(LLVMBasicBlockRef BB)
Advance a basic block iterator.
void LLVMAppendExistingBasicBlock(LLVMValueRef Fn, LLVMBasicBlockRef BB)
Append the given basic block to the basic block list of the given function.
void LLVMDeleteBasicBlock(LLVMBasicBlockRef BB)
Remove a basic block from a function and delete it.
LLVMBasicBlockRef LLVMGetFirstBasicBlock(LLVMValueRef Fn)
Obtain the first basic block in a function.
LLVMBasicBlockRef LLVMValueAsBasicBlock(LLVMValueRef Val)
Convert an LLVMValueRef to an LLVMBasicBlockRef instance.
LLVMBasicBlockRef LLVMCreateBasicBlockInContext(LLVMContextRef C, const char *Name)
Create a new basic block without inserting it into a function.
void LLVMRemoveBasicBlockFromParent(LLVMBasicBlockRef BB)
Remove a basic block from a function.
void LLVMMoveBasicBlockBefore(LLVMBasicBlockRef BB, LLVMBasicBlockRef MovePos)
Move a basic block to before another one.
LLVMValueRef LLVMBasicBlockAsValue(LLVMBasicBlockRef BB)
Convert a basic block instance to a value type.
void LLVMInsertExistingBasicBlockAfterInsertBlock(LLVMBuilderRef Builder, LLVMBasicBlockRef BB)
Insert the given basic block after the insertion point of the given builder.
void LLVMGetBasicBlocks(LLVMValueRef Fn, LLVMBasicBlockRef *BasicBlocks)
Obtain all of the basic blocks in a function.
LLVMBasicBlockRef LLVMAppendBasicBlock(LLVMValueRef Fn, const char *Name)
Append a basic block to the end of a function using the global context.
LLVMValueRef LLVMGetBasicBlockTerminator(LLVMBasicBlockRef BB)
Obtain the terminator instruction for a basic block.
unsigned LLVMCountBasicBlocks(LLVMValueRef Fn)
Obtain the number of basic blocks in a function.
void LLVMMoveBasicBlockAfter(LLVMBasicBlockRef BB, LLVMBasicBlockRef MovePos)
Move a basic block to after another one.
LLVMBasicBlockRef LLVMGetLastBasicBlock(LLVMValueRef Fn)
Obtain the last basic block in a function.
LLVMBasicBlockRef LLVMAppendBasicBlockInContext(LLVMContextRef C, LLVMValueRef Fn, const char *Name)
Append a basic block to the end of a function.
LLVMValueRef LLVMGetBasicBlockParent(LLVMBasicBlockRef BB)
Obtain the function to which a basic block belongs.
LLVMValueRef LLVMGetFirstInstruction(LLVMBasicBlockRef BB)
Obtain the first instruction in a basic block.
LLVMValueRef LLVMGetLastInstruction(LLVMBasicBlockRef BB)
Obtain the last instruction in a basic block.
LLVMBasicBlockRef LLVMInsertBasicBlockInContext(LLVMContextRef C, LLVMBasicBlockRef BB, const char *Name)
Insert a basic block in a function before another basic block.
LLVMBasicBlockRef LLVMInsertBasicBlock(LLVMBasicBlockRef InsertBeforeBB, const char *Name)
Insert a basic block in a function using the global context.
LLVMBasicBlockRef LLVMGetEntryBasicBlock(LLVMValueRef Fn)
Obtain the basic block that corresponds to the entry point of a function.
LLVMBool LLVMValueIsBasicBlock(LLVMValueRef Val)
Determine whether an LLVMValueRef is itself a basic block.
const char * LLVMGetBasicBlockName(LLVMBasicBlockRef BB)
Obtain the string name of a basic block.
LLVMBasicBlockRef LLVMGetPreviousBasicBlock(LLVMBasicBlockRef BB)
Go backwards in a basic block iterator.
LLVMValueRef LLVMConstStruct(LLVMValueRef *ConstantVals, unsigned Count, LLVMBool Packed)
Create a ConstantStruct in the global Context.
LLVMValueRef LLVMConstArray(LLVMTypeRef ElementTy, LLVMValueRef *ConstantVals, unsigned Length)
Create a ConstantArray from values.
LLVMValueRef LLVMConstArray2(LLVMTypeRef ElementTy, LLVMValueRef *ConstantVals, uint64_t Length)
Create a ConstantArray from values.
LLVMValueRef LLVMConstVector(LLVMValueRef *ScalarConstantVals, unsigned Size)
Create a ConstantVector from values.
LLVMValueRef LLVMConstStringInContext(LLVMContextRef C, const char *Str, unsigned Length, LLVMBool DontNullTerminate)
Create a ConstantDataSequential and initialize it with a string.
LLVMValueRef LLVMConstNamedStruct(LLVMTypeRef StructTy, LLVMValueRef *ConstantVals, unsigned Count)
Create a non-anonymous ConstantStruct from values.
LLVMBool LLVMIsConstantString(LLVMValueRef c)
Returns true if the specified constant is an array of i8.
LLVMValueRef LLVMConstantPtrAuth(LLVMValueRef Ptr, LLVMValueRef Key, LLVMValueRef Disc, LLVMValueRef AddrDisc)
Create a ConstantPtrAuth constant with the given values.
LLVMValueRef LLVMGetAggregateElement(LLVMValueRef C, unsigned Idx)
Get element of a constant aggregate (struct, array or vector) at the specified index.
LLVMValueRef LLVMConstString(const char *Str, unsigned Length, LLVMBool DontNullTerminate)
Create a ConstantDataSequential with string content in the global context.
const char * LLVMGetAsString(LLVMValueRef c, size_t *Length)
Get the given constant data sequential as a string.
LLVMValueRef LLVMConstStringInContext2(LLVMContextRef C, const char *Str, size_t Length, LLVMBool DontNullTerminate)
Create a ConstantDataSequential and initialize it with a string.
LLVMValueRef LLVMConstStructInContext(LLVMContextRef C, LLVMValueRef *ConstantVals, unsigned Count, LLVMBool Packed)
Create an anonymous ConstantStruct with the specified values.
LLVMValueRef LLVMConstPointerCast(LLVMValueRef ConstantVal, LLVMTypeRef ToType)
LLVMValueRef LLVMConstMul(LLVMValueRef LHSConstant, LLVMValueRef RHSConstant)
LLVMValueRef LLVMConstTruncOrBitCast(LLVMValueRef ConstantVal, LLVMTypeRef ToType)
LLVMValueRef LLVMSizeOf(LLVMTypeRef Ty)
LLVMValueRef LLVMConstPtrToInt(LLVMValueRef ConstantVal, LLVMTypeRef ToType)
LLVMValueRef LLVMConstNUWSub(LLVMValueRef LHSConstant, LLVMValueRef RHSConstant)
LLVMValueRef LLVMConstNUWAdd(LLVMValueRef LHSConstant, LLVMValueRef RHSConstant)
LLVMValueRef LLVMConstIntToPtr(LLVMValueRef ConstantVal, LLVMTypeRef ToType)
LLVMValueRef LLVMConstTrunc(LLVMValueRef ConstantVal, LLVMTypeRef ToType)
LLVMValueRef LLVMConstNot(LLVMValueRef ConstantVal)
LLVMValueRef LLVMGetBlockAddressFunction(LLVMValueRef BlockAddr)
Gets the function associated with a given BlockAddress constant value.
LLVMValueRef LLVMConstNSWMul(LLVMValueRef LHSConstant, LLVMValueRef RHSConstant)
LLVMValueRef LLVMConstExtractElement(LLVMValueRef VectorConstant, LLVMValueRef IndexConstant)
LLVMValueRef LLVMConstInsertElement(LLVMValueRef VectorConstant, LLVMValueRef ElementValueConstant, LLVMValueRef IndexConstant)
LLVMValueRef LLVMConstInBoundsGEP2(LLVMTypeRef Ty, LLVMValueRef ConstantVal, LLVMValueRef *ConstantIndices, unsigned NumIndices)
LLVMValueRef LLVMConstAddrSpaceCast(LLVMValueRef ConstantVal, LLVMTypeRef ToType)
LLVMBasicBlockRef LLVMGetBlockAddressBasicBlock(LLVMValueRef BlockAddr)
Gets the basic block associated with a given BlockAddress constant value.
LLVMValueRef LLVMConstNSWAdd(LLVMValueRef LHSConstant, LLVMValueRef RHSConstant)
LLVMValueRef LLVMAlignOf(LLVMTypeRef Ty)
LLVMValueRef LLVMConstInlineAsm(LLVMTypeRef Ty, const char *AsmString, const char *Constraints, LLVMBool HasSideEffects, LLVMBool IsAlignStack)
Deprecated: Use LLVMGetInlineAsm instead.
LLVMValueRef LLVMConstXor(LLVMValueRef LHSConstant, LLVMValueRef RHSConstant)
LLVMValueRef LLVMConstBitCast(LLVMValueRef ConstantVal, LLVMTypeRef ToType)
LLVMValueRef LLVMConstNSWNeg(LLVMValueRef ConstantVal)
LLVMValueRef LLVMConstNUWMul(LLVMValueRef LHSConstant, LLVMValueRef RHSConstant)
LLVMValueRef LLVMConstGEPWithNoWrapFlags(LLVMTypeRef Ty, LLVMValueRef ConstantVal, LLVMValueRef *ConstantIndices, unsigned NumIndices, LLVMGEPNoWrapFlags NoWrapFlags)
Creates a constant GetElementPtr expression.
LLVMValueRef LLVMConstGEP2(LLVMTypeRef Ty, LLVMValueRef ConstantVal, LLVMValueRef *ConstantIndices, unsigned NumIndices)
LLVMValueRef LLVMConstSub(LLVMValueRef LHSConstant, LLVMValueRef RHSConstant)
LLVMValueRef LLVMConstAdd(LLVMValueRef LHSConstant, LLVMValueRef RHSConstant)
LLVMValueRef LLVMConstShuffleVector(LLVMValueRef VectorAConstant, LLVMValueRef VectorBConstant, LLVMValueRef MaskConstant)
LLVMValueRef LLVMConstNeg(LLVMValueRef ConstantVal)
LLVMValueRef LLVMBlockAddress(LLVMValueRef F, LLVMBasicBlockRef BB)
LLVMOpcode LLVMGetConstOpcode(LLVMValueRef ConstantVal)
LLVMValueRef LLVMConstNSWSub(LLVMValueRef LHSConstant, LLVMValueRef RHSConstant)
void LLVMGlobalSetMetadata(LLVMValueRef Global, unsigned Kind, LLVMMetadataRef MD)
Sets a metadata attachment, erasing the existing metadata attachment if it already exists for the giv...
unsigned LLVMValueMetadataEntriesGetKind(LLVMValueMetadataEntry *Entries, unsigned Index)
Returns the kind of a value metadata entry at a specific index.
void LLVMDisposeValueMetadataEntries(LLVMValueMetadataEntry *Entries)
Destroys value metadata entries.
void LLVMSetVisibility(LLVMValueRef Global, LLVMVisibility Viz)
LLVMDLLStorageClass LLVMGetDLLStorageClass(LLVMValueRef Global)
void LLVMSetAlignment(LLVMValueRef V, unsigned Bytes)
Set the preferred alignment of the value.
LLVMModuleRef LLVMGetGlobalParent(LLVMValueRef Global)
const char * LLVMGetSection(LLVMValueRef Global)
LLVMTypeRef LLVMGlobalGetValueType(LLVMValueRef Global)
Returns the "value type" of a global value.
LLVMBool LLVMIsDeclaration(LLVMValueRef Global)
LLVMVisibility LLVMGetVisibility(LLVMValueRef Global)
void LLVMSetDLLStorageClass(LLVMValueRef Global, LLVMDLLStorageClass Class)
LLVMBool LLVMHasUnnamedAddr(LLVMValueRef Global)
Deprecated: Use LLVMGetUnnamedAddress instead.
LLVMLinkage LLVMGetLinkage(LLVMValueRef Global)
LLVMUnnamedAddr LLVMGetUnnamedAddress(LLVMValueRef Global)
LLVMMetadataRef LLVMValueMetadataEntriesGetMetadata(LLVMValueMetadataEntry *Entries, unsigned Index)
Returns the underlying metadata node of a value metadata entry at a specific index.
void LLVMSetUnnamedAddress(LLVMValueRef Global, LLVMUnnamedAddr UnnamedAddr)
void LLVMSetLinkage(LLVMValueRef Global, LLVMLinkage Linkage)
void LLVMSetUnnamedAddr(LLVMValueRef Global, LLVMBool HasUnnamedAddr)
Deprecated: Use LLVMSetUnnamedAddress instead.
void LLVMGlobalClearMetadata(LLVMValueRef Global)
Removes all metadata attachments from this value.
unsigned LLVMGetAlignment(LLVMValueRef V)
Obtain the preferred alignment of the value.
void LLVMSetSection(LLVMValueRef Global, const char *Section)
void LLVMGlobalEraseMetadata(LLVMValueRef Global, unsigned Kind)
Erases a metadata attachment of the given kind if it exists.
LLVMValueMetadataEntry * LLVMGlobalCopyAllMetadata(LLVMValueRef Value, size_t *NumEntries)
Retrieves an array of metadata entries representing the metadata attached to this value.
LLVMValueRef LLVMConstInt(LLVMTypeRef IntTy, unsigned long long N, LLVMBool SignExtend)
Obtain a constant value for an integer type.
LLVMValueRef LLVMConstIntOfArbitraryPrecision(LLVMTypeRef IntTy, unsigned NumWords, const uint64_t Words[])
Obtain a constant value for an integer of arbitrary precision.
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.
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.
long long LLVMConstIntGetSExtValue(LLVMValueRef ConstantVal)
Obtain the sign extended value for an integer constant value.
unsigned long long LLVMConstIntGetZExtValue(LLVMValueRef ConstantVal)
Obtain the zero extended value for an integer constant value.
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.
LLVMBool LLVMIsNull(LLVMValueRef Val)
Determine whether a value instance is null.
LLVMValueRef LLVMGetUndef(LLVMTypeRef Ty)
Obtain a constant value referring to an undefined value of a type.
LLVMValueRef LLVMGetPoison(LLVMTypeRef Ty)
Obtain a constant value referring to a poison value of a type.
LLVMValueRef LLVMConstAllOnes(LLVMTypeRef Ty)
Obtain a constant value referring to the instance of a type consisting of all ones.
LLVMValueRef LLVMConstPointerNull(LLVMTypeRef Ty)
Obtain a constant that is a constant pointer pointing to NULL for a specified type.
LLVMValueRef LLVMConstNull(LLVMTypeRef Ty)
Obtain a constant value referring to the null instance of a type.
unsigned LLVMCountParams(LLVMValueRef Fn)
Obtain the number of parameters in a function.
LLVMValueRef LLVMGetPreviousParam(LLVMValueRef Arg)
Obtain the previous parameter to a function.
LLVMValueRef LLVMGetNextParam(LLVMValueRef Arg)
Obtain the next parameter to a function.
LLVMValueRef LLVMGetParamParent(LLVMValueRef Inst)
Obtain the function to which this argument belongs.
LLVMValueRef LLVMGetFirstParam(LLVMValueRef Fn)
Obtain the first parameter to a function.
void LLVMSetParamAlignment(LLVMValueRef Arg, unsigned Align)
Set the alignment for a function parameter.
LLVMValueRef LLVMGetParam(LLVMValueRef Fn, unsigned Index)
Obtain the parameter at the specified index.
LLVMValueRef LLVMGetLastParam(LLVMValueRef Fn)
Obtain the last parameter to a function.
void LLVMGetParams(LLVMValueRef Fn, LLVMValueRef *Params)
Obtain the parameters in a function.
void LLVMSetGC(LLVMValueRef Fn, const char *Name)
Define the garbage collector to use during code generation.
const char * LLVMGetGC(LLVMValueRef Fn)
Obtain the name of the garbage collector to use during code generation.
LLVMValueRef LLVMGetPrologueData(LLVMValueRef Fn)
Gets the prologue data associated with a function.
void LLVMRemoveEnumAttributeAtIndex(LLVMValueRef F, LLVMAttributeIndex Idx, unsigned KindID)
unsigned LLVMGetAttributeCountAtIndex(LLVMValueRef F, LLVMAttributeIndex Idx)
LLVMBool LLVMHasPersonalityFn(LLVMValueRef Fn)
Check whether the given function has a personality function.
unsigned LLVMLookupIntrinsicID(const char *Name, size_t NameLen)
Obtain the intrinsic ID number which matches the given function name.
const char * LLVMIntrinsicGetName(unsigned ID, size_t *NameLength)
Retrieves the name of an intrinsic.
unsigned LLVMGetFunctionCallConv(LLVMValueRef Fn)
Obtain the calling function of a function.
LLVMValueRef LLVMGetPrefixData(LLVMValueRef Fn)
Gets the prefix data associated with a function.
void LLVMRemoveStringAttributeAtIndex(LLVMValueRef F, LLVMAttributeIndex Idx, const char *K, unsigned KLen)
void LLVMSetPrefixData(LLVMValueRef Fn, LLVMValueRef prefixData)
Sets the prefix data for the function.
char * LLVMIntrinsicCopyOverloadedName(unsigned ID, LLVMTypeRef *ParamTypes, size_t ParamCount, size_t *NameLength)
Deprecated: Use LLVMIntrinsicCopyOverloadedName2 instead.
LLVMAttributeRef LLVMGetStringAttributeAtIndex(LLVMValueRef F, LLVMAttributeIndex Idx, const char *K, unsigned KLen)
LLVMValueRef LLVMGetPersonalityFn(LLVMValueRef Fn)
Obtain the personality function attached to the function.
void LLVMSetPersonalityFn(LLVMValueRef Fn, LLVMValueRef PersonalityFn)
Set the personality function attached to the function.
LLVMBool LLVMIntrinsicIsOverloaded(unsigned ID)
Obtain if the intrinsic identified by the given ID is overloaded.
void LLVMAddAttributeAtIndex(LLVMValueRef F, LLVMAttributeIndex Idx, LLVMAttributeRef A)
Add an attribute to a function.
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.
void LLVMDeleteFunction(LLVMValueRef Fn)
Remove a function from its containing module and deletes it.
void LLVMSetPrologueData(LLVMValueRef Fn, LLVMValueRef prologueData)
Sets the prologue data for the function.
LLVMBool LLVMHasPrologueData(LLVMValueRef Fn)
Check if a given function has prologue data.
LLVMBool LLVMHasPrefixData(LLVMValueRef Fn)
Check if a given function has prefix data.
void LLVMGetAttributesAtIndex(LLVMValueRef F, LLVMAttributeIndex Idx, LLVMAttributeRef *Attrs)
void LLVMSetFunctionCallConv(LLVMValueRef Fn, unsigned CC)
Set the calling convention of a function.
LLVMValueRef LLVMGetIntrinsicDeclaration(LLVMModuleRef Mod, unsigned ID, LLVMTypeRef *ParamTypes, size_t ParamCount)
Get or insert the declaration of an intrinsic.
LLVMAttributeRef LLVMGetEnumAttributeAtIndex(LLVMValueRef F, LLVMAttributeIndex Idx, unsigned KindID)
void LLVMAddTargetDependentFunctionAttr(LLVMValueRef Fn, const char *A, const char *V)
Add a target-dependent attribute to a function.
LLVMTypeRef LLVMIntrinsicGetType(LLVMContextRef Ctx, unsigned ID, LLVMTypeRef *ParamTypes, size_t ParamCount)
Retrieves the type of an intrinsic.
unsigned LLVMGetIntrinsicID(LLVMValueRef Fn)
Obtain the ID number from a function instance.
LLVMValueKind LLVMGetValueKind(LLVMValueRef Val)
Obtain the enumerated type of a Value instance.
const char * LLVMGetValueName(LLVMValueRef Val)
Deprecated: Use LLVMGetValueName2 instead.
LLVMTypeRef LLVMTypeOf(LLVMValueRef Val)
Obtain the type of a value.
LLVMBool LLVMIsConstant(LLVMValueRef Val)
Determine whether the specified value instance is constant.
void LLVMReplaceAllUsesWith(LLVMValueRef OldVal, LLVMValueRef NewVal)
Replace all uses of a value with another one.
const char * LLVMGetValueName2(LLVMValueRef Val, size_t *Length)
Obtain the string name of a value.
LLVMContextRef LLVMGetValueContext(LLVMValueRef Val)
Obtain the context to which this value is associated.
char * LLVMPrintDbgRecordToString(LLVMDbgRecordRef Record)
Return a string representation of the DbgRecord.
void LLVMSetValueName(LLVMValueRef Val, const char *Name)
Deprecated: Use LLVMSetValueName2 instead.
#define LLVM_DECLARE_VALUE_CAST(name)
Convert value instances between types.
void LLVMDumpValue(LLVMValueRef Val)
Dump a representation of a value to stderr.
LLVMBool LLVMIsUndef(LLVMValueRef Val)
Determine whether a value instance is undefined.
LLVMValueRef LLVMIsAMDNode(LLVMValueRef Val)
LLVMBool LLVMIsPoison(LLVMValueRef Val)
Determine whether a value instance is poisonous.
LLVMValueRef LLVMIsAMDString(LLVMValueRef Val)
void LLVMSetValueName2(LLVMValueRef Val, const char *Name, size_t NameLen)
Set the string name of a value.
LLVMValueRef LLVMIsAValueAsMetadata(LLVMValueRef Val)
char * LLVMPrintValueToString(LLVMValueRef Val)
Return a string representation of the value.
void LLVMEraseGlobalIFunc(LLVMValueRef IFunc)
Remove a global indirect function from its parent module and delete it.
void LLVMRemoveGlobalIFunc(LLVMValueRef IFunc)
Remove a global indirect function from its parent module.
LLVMValueRef LLVMGetNextGlobalIFunc(LLVMValueRef IFunc)
Advance a GlobalIFunc iterator to the next GlobalIFunc.
LLVMValueRef LLVMGetNamedGlobalIFunc(LLVMModuleRef M, const char *Name, size_t NameLen)
Obtain a GlobalIFunc value from a Module by its name.
LLVMValueRef LLVMGetLastGlobalIFunc(LLVMModuleRef M)
Obtain an iterator to the last GlobalIFunc in a Module.
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.
void LLVMSetGlobalIFuncResolver(LLVMValueRef IFunc, LLVMValueRef Resolver)
Sets the resolver function associated with this indirect function.
LLVMValueRef LLVMGetFirstGlobalIFunc(LLVMModuleRef M)
Obtain an iterator to the first GlobalIFunc in a Module.
LLVMValueRef LLVMGetGlobalIFuncResolver(LLVMValueRef IFunc)
Retrieves the resolver function associated with this indirect function, or NULL if it doesn't not exi...
LLVMValueRef LLVMGetPreviousGlobalIFunc(LLVMValueRef IFunc)
Decrement a GlobalIFunc iterator to the previous GlobalIFunc.
LLVMTypeRef LLVMGetAllocatedType(LLVMValueRef Alloca)
Obtain the type that is being allocated by the alloca instruction.
LLVMOperandBundleRef LLVMGetOperandBundleAtIndex(LLVMValueRef C, unsigned Index)
Obtain the operand bundle attached to this instruction at the given index.
LLVMValueRef LLVMGetCalledValue(LLVMValueRef Instr)
Obtain the pointer to the function invoked by this instruction.
void LLVMGetCallSiteAttributes(LLVMValueRef C, LLVMAttributeIndex Idx, LLVMAttributeRef *Attrs)
unsigned LLVMGetNumArgOperands(LLVMValueRef Instr)
Obtain the argument count for a call instruction.
void LLVMSetNormalDest(LLVMValueRef InvokeInst, LLVMBasicBlockRef B)
Set the normal destination basic block.
unsigned LLVMGetInstructionCallConv(LLVMValueRef Instr)
Obtain the calling convention for a call instruction.
LLVMTypeRef LLVMGetCalledFunctionType(LLVMValueRef C)
Obtain the function type called by this instruction.
unsigned LLVMGetCallSiteAttributeCount(LLVMValueRef C, LLVMAttributeIndex Idx)
void LLVMAddCallSiteAttribute(LLVMValueRef C, LLVMAttributeIndex Idx, LLVMAttributeRef A)
unsigned LLVMGetNumOperandBundles(LLVMValueRef C)
Obtain the number of operand bundles attached to this instruction.
LLVMBasicBlockRef LLVMGetCallBrIndirectDest(LLVMValueRef CallBr, unsigned Idx)
Get the indirect destination of a CallBr instruction at the given index.
void LLVMSetInstructionCallConv(LLVMValueRef Instr, unsigned CC)
Set the calling convention for a call instruction.
LLVMAttributeRef LLVMGetCallSiteEnumAttribute(LLVMValueRef C, LLVMAttributeIndex Idx, unsigned KindID)
LLVMBasicBlockRef LLVMGetNormalDest(LLVMValueRef InvokeInst)
Return the normal destination basic block.
void LLVMRemoveCallSiteEnumAttribute(LLVMValueRef C, LLVMAttributeIndex Idx, unsigned KindID)
unsigned LLVMGetCallBrNumIndirectDests(LLVMValueRef CallBr)
Get the number of indirect destinations of a CallBr instruction.
void LLVMSetUnwindDest(LLVMValueRef InvokeInst, LLVMBasicBlockRef B)
Set the unwind destination basic block.
void LLVMSetTailCall(LLVMValueRef CallInst, LLVMBool IsTailCall)
Set whether a call instruction is a tail call.
LLVMBool LLVMIsTailCall(LLVMValueRef CallInst)
Obtain whether a call instruction is a tail call.
void LLVMSetInstrParamAlignment(LLVMValueRef Instr, LLVMAttributeIndex Idx, unsigned Align)
LLVMBasicBlockRef LLVMGetCallBrDefaultDest(LLVMValueRef CallBr)
Get the default destination of a CallBr instruction.
void LLVMRemoveCallSiteStringAttribute(LLVMValueRef C, LLVMAttributeIndex Idx, const char *K, unsigned KLen)
LLVMTailCallKind LLVMGetTailCallKind(LLVMValueRef CallInst)
Obtain a tail call kind of the call instruction.
void LLVMSetTailCallKind(LLVMValueRef CallInst, LLVMTailCallKind kind)
Set the call kind of the call instruction.
LLVMAttributeRef LLVMGetCallSiteStringAttribute(LLVMValueRef C, LLVMAttributeIndex Idx, const char *K, unsigned KLen)
LLVMBasicBlockRef LLVMGetUnwindDest(LLVMValueRef InvokeInst)
Return the unwind destination basic block.
LLVMTypeRef LLVMGetGEPSourceElementType(LLVMValueRef GEP)
Get the source element type of the given GEP operator.
LLVMBool LLVMIsInBounds(LLVMValueRef GEP)
Check whether the given GEP operator is inbounds.
void LLVMSetIsInBounds(LLVMValueRef GEP, LLVMBool InBounds)
Set the given GEP instruction to be inbounds or not.
void LLVMGEPSetNoWrapFlags(LLVMValueRef GEP, LLVMGEPNoWrapFlags NoWrapFlags)
Set the no-wrap related flags for the given GEP instruction.
LLVMGEPNoWrapFlags LLVMGEPGetNoWrapFlags(LLVMValueRef GEP)
Get the no-wrap related flags for the given GEP instruction.
const unsigned * LLVMGetIndices(LLVMValueRef Inst)
Obtain the indices as an array.
unsigned LLVMGetNumIndices(LLVMValueRef Inst)
Obtain the number of indices.
void LLVMAddIncoming(LLVMValueRef PhiNode, LLVMValueRef *IncomingValues, LLVMBasicBlockRef *IncomingBlocks, unsigned Count)
Add an incoming value to the end of a PHI list.
LLVMValueRef LLVMGetIncomingValue(LLVMValueRef PhiNode, unsigned Index)
Obtain an incoming value to a PHI node as an LLVMValueRef.
unsigned LLVMCountIncoming(LLVMValueRef PhiNode)
Obtain the number of incoming basic blocks to a PHI node.
LLVMBasicBlockRef LLVMGetIncomingBlock(LLVMValueRef PhiNode, unsigned Index)
Obtain an incoming value to a PHI node as an LLVMBasicBlockRef.
unsigned LLVMGetNumSuccessors(LLVMValueRef Term)
Return the number of successors that this terminator has.
LLVMBasicBlockRef LLVMGetSwitchDefaultDest(LLVMValueRef SwitchInstr)
Obtain the default destination basic block of a switch instruction.
void LLVMSetSuccessor(LLVMValueRef Term, unsigned i, LLVMBasicBlockRef block)
Update the specified successor to point at the provided block.
void LLVMSetCondition(LLVMValueRef Branch, LLVMValueRef Cond)
Set the condition of a branch instruction.
LLVMValueRef LLVMGetCondition(LLVMValueRef Branch)
Return the condition of a branch instruction.
LLVMBool LLVMIsConditional(LLVMValueRef Branch)
Return if a branch is conditional.
LLVMBasicBlockRef LLVMGetSuccessor(LLVMValueRef Term, unsigned i)
Return the specified successor.
LLVMDbgRecordRef LLVMGetPreviousDbgRecord(LLVMDbgRecordRef DbgRecord)
Obtain the previous DbgRecord in the sequence or NULL if there are no more.
LLVMValueRef LLVMInstructionClone(LLVMValueRef Inst)
Create a copy of 'this' instruction that is identical in all ways except the following:
LLVMValueRef LLVMGetNextInstruction(LLVMValueRef Inst)
Obtain the instruction that occurs after the one specified.
void LLVMDeleteInstruction(LLVMValueRef Inst)
Delete an instruction.
LLVMValueRef LLVMIsATerminatorInst(LLVMValueRef Inst)
Determine whether an instruction is a terminator.
LLVMOpcode LLVMGetInstructionOpcode(LLVMValueRef Inst)
Obtain the code opcode for an individual instruction.
LLVMValueMetadataEntry * LLVMInstructionGetAllMetadataOtherThanDebugLoc(LLVMValueRef Instr, size_t *NumEntries)
Returns the metadata associated with an instruction value, but filters out all the debug locations.
LLVMDbgRecordRef LLVMGetFirstDbgRecord(LLVMValueRef Inst)
Obtain the first debug record attached to an instruction.
LLVMRealPredicate LLVMGetFCmpPredicate(LLVMValueRef Inst)
Obtain the float predicate of an instruction.
int LLVMHasMetadata(LLVMValueRef Val)
Determine whether an instruction has any metadata attached.
void LLVMInstructionEraseFromParent(LLVMValueRef Inst)
Remove and delete an instruction.
void LLVMInstructionRemoveFromParent(LLVMValueRef Inst)
Remove an instruction.
LLVMDbgRecordRef LLVMGetNextDbgRecord(LLVMDbgRecordRef DbgRecord)
Obtain the next DbgRecord in the sequence or NULL if there are no more.
LLVMValueRef LLVMGetMetadata(LLVMValueRef Val, unsigned KindID)
Return metadata associated with an instruction value.
LLVMDbgRecordRef LLVMGetLastDbgRecord(LLVMValueRef Inst)
Obtain the last debug record attached to an instruction.
LLVMIntPredicate LLVMGetICmpPredicate(LLVMValueRef Inst)
Obtain the predicate of an instruction.
void LLVMSetMetadata(LLVMValueRef Val, unsigned KindID, LLVMValueRef Node)
Set metadata associated with an instruction value.
LLVMBasicBlockRef LLVMGetInstructionParent(LLVMValueRef Inst)
Obtain the basic block to which an instruction belongs.
LLVMValueRef LLVMGetPreviousInstruction(LLVMValueRef Inst)
Obtain the instruction that occurred before this one.
LLVMValueRef LLVMMetadataAsValue(LLVMContextRef C, LLVMMetadataRef MD)
Obtain a Metadata as a Value.
LLVMValueRef LLVMMDString(const char *Str, unsigned SLen)
Deprecated: Use LLVMMDStringInContext2 instead.
void LLVMReplaceMDNodeOperandWith(LLVMValueRef V, unsigned Index, LLVMMetadataRef Replacement)
Replace an operand at a specific index in a llvm::MDNode value.
LLVMMetadataRef LLVMMDStringInContext2(LLVMContextRef C, const char *Str, size_t SLen)
Create an MDString value from a given string value.
LLVMMetadataRef LLVMMDNodeInContext2(LLVMContextRef C, LLVMMetadataRef *MDs, size_t Count)
Create an MDNode value with the given array of operands.
LLVMValueRef LLVMMDStringInContext(LLVMContextRef C, const char *Str, unsigned SLen)
Deprecated: Use LLVMMDStringInContext2 instead.
LLVMMetadataRef LLVMValueAsMetadata(LLVMValueRef Val)
Obtain a Value as a Metadata.
LLVMValueRef LLVMMDNodeInContext(LLVMContextRef C, LLVMValueRef *Vals, unsigned Count)
Deprecated: Use LLVMMDNodeInContext2 instead.
const char * LLVMGetMDString(LLVMValueRef V, unsigned *Length)
Obtain the underlying string from a MDString value.
unsigned LLVMGetMDNodeNumOperands(LLVMValueRef V)
Obtain the number of operands from an MDNode value.
void LLVMGetMDNodeOperands(LLVMValueRef V, LLVMValueRef *Dest)
Obtain the given MDNode's operands.
LLVMValueRef LLVMMDNode(LLVMValueRef *Vals, unsigned Count)
Deprecated: Use LLVMMDNodeInContext2 instead.
int LLVMGetNumOperands(LLVMValueRef Val)
Obtain the number of operands in a llvm::User value.
void LLVMSetOperand(LLVMValueRef User, unsigned Index, LLVMValueRef Val)
Set an operand at a specific index in a llvm::User value.
LLVMUseRef LLVMGetOperandUse(LLVMValueRef Val, unsigned Index)
Obtain the use of an operand at a specific index in a llvm::User value.
LLVMValueRef LLVMGetOperand(LLVMValueRef Val, unsigned Index)
Obtain an operand at a specific index in a llvm::User value.
LLVMValueRef LLVMGetUser(LLVMUseRef U)
Obtain the user value for a user.
LLVMUseRef LLVMGetFirstUse(LLVMValueRef Val)
Obtain the first use of a value.
LLVMUseRef LLVMGetNextUse(LLVMUseRef U)
Obtain the next use of a value.
LLVMValueRef LLVMGetUsedValue(LLVMUseRef U)
Obtain the value this use corresponds to.
#define LLVM_FOR_EACH_VALUE_SUBCLASS(macro)
void LLVMShutdown(void)
Deallocate and destroy all ManagedStatic variables.
void LLVMGetVersion(unsigned *Major, unsigned *Minor, unsigned *Patch)
Return the major, minor, and patch version of LLVM.
void LLVMDisposeMessage(char *Message)
char * LLVMCreateMessage(const char *Message)
struct LLVMOpaqueValue * LLVMValueRef
Represents an individual value in LLVM IR.
struct LLVMOpaqueAttributeRef * LLVMAttributeRef
Used to represent an attributes.
struct LLVMOpaqueNamedMDNode * LLVMNamedMDNodeRef
Represents an LLVM Named Metadata Node.
struct LLVMOpaquePassManager * LLVMPassManagerRef
struct LLVMOpaqueDbgRecord * LLVMDbgRecordRef
struct LLVMOpaqueDiagnosticInfo * LLVMDiagnosticInfoRef
struct LLVMOpaqueMemoryBuffer * LLVMMemoryBufferRef
LLVM uses a polymorphic type hierarchy which C cannot represent, therefore parameters must be passed ...
struct LLVMOpaqueContext * LLVMContextRef
The top-level container for all LLVM global data.
struct LLVMOpaqueBuilder * LLVMBuilderRef
Represents an LLVM basic block builder.
struct LLVMOpaqueUse * LLVMUseRef
Used to get the users and usees of a Value.
struct LLVMOpaqueBasicBlock * LLVMBasicBlockRef
Represents a basic block of instructions in LLVM IR.
struct LLVMOpaqueType * LLVMTypeRef
Each value in the LLVM IR has a type, an LLVMTypeRef.
struct LLVMOpaqueMetadata * LLVMMetadataRef
Represents an LLVM Metadata.
struct LLVMOpaqueModule * LLVMModuleRef
The top-level container for all other LLVM Intermediate Representation (IR) objects.
struct LLVMOpaqueModuleProvider * LLVMModuleProviderRef
Interface used to provide a module to JIT or interpreter.
struct LLVMOpaqueOperandBundle * LLVMOperandBundleRef
void LLVMAliasSetAliasee(LLVMValueRef Alias, LLVMValueRef Aliasee)
Set the target value of an alias.
LLVMValueRef LLVMGetLastGlobalAlias(LLVMModuleRef M)
Obtain an iterator to the last GlobalAlias in a Module.
LLVMValueRef LLVMGetNextGlobalAlias(LLVMValueRef GA)
Advance a GlobalAlias iterator to the next GlobalAlias.
LLVMValueRef LLVMAliasGetAliasee(LLVMValueRef Alias)
Retrieve the target value of an alias.
LLVMValueRef LLVMGetPreviousGlobalAlias(LLVMValueRef GA)
Decrement a GlobalAlias iterator to the previous GlobalAlias.
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.
LLVMValueRef LLVMGetFirstGlobalAlias(LLVMModuleRef M)
Obtain an iterator to the first GlobalAlias in a Module.
LLVMValueRef LLVMGetNamedGlobalAlias(LLVMModuleRef M, const char *Name, size_t NameLen)
Obtain a GlobalAlias value from a Module by its name.
void LLVMSetGlobalConstant(LLVMValueRef GlobalVar, LLVMBool IsConstant)
void LLVMSetThreadLocalMode(LLVMValueRef GlobalVar, LLVMThreadLocalMode Mode)
LLVMThreadLocalMode LLVMGetThreadLocalMode(LLVMValueRef GlobalVar)
LLVMValueRef LLVMGetNamedGlobalWithLength(LLVMModuleRef M, const char *Name, size_t Length)
LLVMValueRef LLVMGetFirstGlobal(LLVMModuleRef M)
LLVMValueRef LLVMGetNextGlobal(LLVMValueRef GlobalVar)
LLVMBool LLVMIsExternallyInitialized(LLVMValueRef GlobalVar)
LLVMValueRef LLVMAddGlobal(LLVMModuleRef M, LLVMTypeRef Ty, const char *Name)
LLVMValueRef LLVMGetLastGlobal(LLVMModuleRef M)
void LLVMSetExternallyInitialized(LLVMValueRef GlobalVar, LLVMBool IsExtInit)
LLVMValueRef LLVMGetPreviousGlobal(LLVMValueRef GlobalVar)
void LLVMSetThreadLocal(LLVMValueRef GlobalVar, LLVMBool IsThreadLocal)
LLVMValueRef LLVMGetInitializer(LLVMValueRef GlobalVar)
void LLVMDeleteGlobal(LLVMValueRef GlobalVar)
LLVMBool LLVMIsThreadLocal(LLVMValueRef GlobalVar)
LLVMBool LLVMIsGlobalConstant(LLVMValueRef GlobalVar)
LLVMValueRef LLVMAddGlobalInAddressSpace(LLVMModuleRef M, LLVMTypeRef Ty, const char *Name, unsigned AddressSpace)
void LLVMSetInitializer(LLVMValueRef GlobalVar, LLVMValueRef ConstantVal)
LLVMValueRef LLVMGetNamedGlobal(LLVMModuleRef M, const char *Name)