LLVM  7.0.0svn
Core.h
Go to the documentation of this file.
1 /*===-- llvm-c/Core.h - Core Library C Interface ------------------*- C -*-===*\
2 |* *|
3 |* The LLVM Compiler Infrastructure *|
4 |* *|
5 |* This file is distributed under the University of Illinois Open Source *|
6 |* License. See LICENSE.TXT for details. *|
7 |* *|
8 |*===----------------------------------------------------------------------===*|
9 |* *|
10 |* This header declares the C interface to libLLVMCore.a, which implements *|
11 |* the LLVM intermediate representation. *|
12 |* *|
13 \*===----------------------------------------------------------------------===*/
14 
15 #ifndef LLVM_C_CORE_H
16 #define LLVM_C_CORE_H
17 
18 #include "llvm-c/ErrorHandling.h"
19 #include "llvm-c/Types.h"
20 
21 #ifdef __cplusplus
22 extern "C" {
23 #endif
24 
25 /**
26  * @defgroup LLVMC LLVM-C: C interface to LLVM
27  *
28  * This module exposes parts of the LLVM library as a C API.
29  *
30  * @{
31  */
32 
33 /**
34  * @defgroup LLVMCTransforms Transforms
35  */
36 
37 /**
38  * @defgroup LLVMCCore Core
39  *
40  * This modules provide an interface to libLLVMCore, which implements
41  * the LLVM intermediate representation as well as other related types
42  * and utilities.
43  *
44  * Many exotic languages can interoperate with C code but have a harder time
45  * with C++ due to name mangling. So in addition to C, this interface enables
46  * tools written in such languages.
47  *
48  * @{
49  */
50 
51 /**
52  * @defgroup LLVMCCoreTypes Types and Enumerations
53  *
54  * @{
55  */
56 
57 typedef enum {
58  /* Terminator Instructions */
59  LLVMRet = 1,
60  LLVMBr = 2,
64  /* removed 6 due to API changes */
66 
67  /* Standard Binary Operators */
68  LLVMAdd = 8,
69  LLVMFAdd = 9,
70  LLVMSub = 10,
71  LLVMFSub = 11,
72  LLVMMul = 12,
73  LLVMFMul = 13,
74  LLVMUDiv = 14,
75  LLVMSDiv = 15,
76  LLVMFDiv = 16,
77  LLVMURem = 17,
78  LLVMSRem = 18,
79  LLVMFRem = 19,
80 
81  /* Logical Operators */
82  LLVMShl = 20,
83  LLVMLShr = 21,
84  LLVMAShr = 22,
85  LLVMAnd = 23,
86  LLVMOr = 24,
87  LLVMXor = 25,
88 
89  /* Memory Operators */
90  LLVMAlloca = 26,
91  LLVMLoad = 27,
92  LLVMStore = 28,
94 
95  /* Cast Operators */
96  LLVMTrunc = 30,
97  LLVMZExt = 31,
98  LLVMSExt = 32,
99  LLVMFPToUI = 33,
104  LLVMFPExt = 38,
109 
110  /* Other Operators */
111  LLVMICmp = 42,
112  LLVMFCmp = 43,
113  LLVMPHI = 44,
114  LLVMCall = 45,
118  LLVMVAArg = 49,
124 
125  /* Atomic operators */
126  LLVMFence = 55,
129 
130  /* Exception Handling Operators */
138 } LLVMOpcode;
139 
140 typedef enum {
141  LLVMVoidTypeKind, /**< type with no size */
142  LLVMHalfTypeKind, /**< 16 bit floating point type */
143  LLVMFloatTypeKind, /**< 32 bit floating point type */
144  LLVMDoubleTypeKind, /**< 64 bit floating point type */
145  LLVMX86_FP80TypeKind, /**< 80 bit floating point type (X87) */
146  LLVMFP128TypeKind, /**< 128 bit floating point type (112-bit mantissa)*/
147  LLVMPPC_FP128TypeKind, /**< 128 bit floating point type (two 64-bits) */
148  LLVMLabelTypeKind, /**< Labels */
149  LLVMIntegerTypeKind, /**< Arbitrary bit width integers */
150  LLVMFunctionTypeKind, /**< Functions */
151  LLVMStructTypeKind, /**< Structures */
152  LLVMArrayTypeKind, /**< Arrays */
153  LLVMPointerTypeKind, /**< Pointers */
154  LLVMVectorTypeKind, /**< SIMD 'packed' format, or other vector type */
155  LLVMMetadataTypeKind, /**< Metadata */
156  LLVMX86_MMXTypeKind, /**< X86 MMX */
157  LLVMTokenTypeKind /**< Tokens */
158 } LLVMTypeKind;
159 
160 typedef enum {
161  LLVMExternalLinkage, /**< Externally visible function */
163  LLVMLinkOnceAnyLinkage, /**< Keep one copy of function when linking (inline)*/
164  LLVMLinkOnceODRLinkage, /**< Same, but only replaced by something
165  equivalent. */
167  LLVMWeakAnyLinkage, /**< Keep one copy of function when linking (weak) */
168  LLVMWeakODRLinkage, /**< Same, but only replaced by something
169  equivalent. */
170  LLVMAppendingLinkage, /**< Special purpose, only applies to global arrays */
171  LLVMInternalLinkage, /**< Rename collisions when linking (static
172  functions) */
173  LLVMPrivateLinkage, /**< Like Internal, but omit from symbol table */
174  LLVMDLLImportLinkage, /**< Obsolete */
175  LLVMDLLExportLinkage, /**< Obsolete */
176  LLVMExternalWeakLinkage,/**< ExternalWeak linkage description */
177  LLVMGhostLinkage, /**< Obsolete */
178  LLVMCommonLinkage, /**< Tentative definitions */
179  LLVMLinkerPrivateLinkage, /**< Like Private, but linker removes. */
180  LLVMLinkerPrivateWeakLinkage /**< Like LinkerPrivate, but is weak. */
181 } LLVMLinkage;
182 
183 typedef enum {
184  LLVMDefaultVisibility, /**< The GV is visible */
185  LLVMHiddenVisibility, /**< The GV is hidden */
186  LLVMProtectedVisibility /**< The GV is protected */
188 
189 typedef enum {
191  LLVMDLLImportStorageClass = 1, /**< Function to be imported from DLL. */
192  LLVMDLLExportStorageClass = 2 /**< Function to be accessible from DLL. */
194 
195 typedef enum {
203 } LLVMCallConv;
204 
205 typedef enum {
211 
221 
230 
233 
235 } LLVMValueKind;
236 
237 typedef enum {
238  LLVMIntEQ = 32, /**< equal */
239  LLVMIntNE, /**< not equal */
240  LLVMIntUGT, /**< unsigned greater than */
241  LLVMIntUGE, /**< unsigned greater or equal */
242  LLVMIntULT, /**< unsigned less than */
243  LLVMIntULE, /**< unsigned less or equal */
244  LLVMIntSGT, /**< signed greater than */
245  LLVMIntSGE, /**< signed greater or equal */
246  LLVMIntSLT, /**< signed less than */
247  LLVMIntSLE /**< signed less or equal */
249 
250 typedef enum {
251  LLVMRealPredicateFalse, /**< Always false (always folded) */
252  LLVMRealOEQ, /**< True if ordered and equal */
253  LLVMRealOGT, /**< True if ordered and greater than */
254  LLVMRealOGE, /**< True if ordered and greater than or equal */
255  LLVMRealOLT, /**< True if ordered and less than */
256  LLVMRealOLE, /**< True if ordered and less than or equal */
257  LLVMRealONE, /**< True if ordered and operands are unequal */
258  LLVMRealORD, /**< True if ordered (no nans) */
259  LLVMRealUNO, /**< True if unordered: isnan(X) | isnan(Y) */
260  LLVMRealUEQ, /**< True if unordered or equal */
261  LLVMRealUGT, /**< True if unordered or greater than */
262  LLVMRealUGE, /**< True if unordered, greater than, or equal */
263  LLVMRealULT, /**< True if unordered or less than */
264  LLVMRealULE, /**< True if unordered, less than, or equal */
265  LLVMRealUNE, /**< True if unordered or not equal */
266  LLVMRealPredicateTrue /**< Always true (always folded) */
268 
269 typedef enum {
270  LLVMLandingPadCatch, /**< A catch clause */
271  LLVMLandingPadFilter /**< A filter clause */
273 
274 typedef enum {
281 
282 typedef enum {
283  LLVMAtomicOrderingNotAtomic = 0, /**< A load or store which is not atomic */
284  LLVMAtomicOrderingUnordered = 1, /**< Lowest level of atomicity, guarantees
285  somewhat sane results, lock free. */
286  LLVMAtomicOrderingMonotonic = 2, /**< guarantees that if you take all the
287  operations affecting a specific address,
288  a consistent ordering exists */
289  LLVMAtomicOrderingAcquire = 4, /**< Acquire provides a barrier of the sort
290  necessary to acquire a lock to access other
291  memory with normal loads and stores. */
292  LLVMAtomicOrderingRelease = 5, /**< Release is similar to Acquire, but with
293  a barrier of the sort necessary to release
294  a lock. */
295  LLVMAtomicOrderingAcquireRelease = 6, /**< provides both an Acquire and a
296  Release barrier (for fences and
297  operations which both read and write
298  memory). */
299  LLVMAtomicOrderingSequentiallyConsistent = 7 /**< provides Acquire semantics
300  for loads and Release
301  semantics for stores.
302  Additionally, it guarantees
303  that a total ordering exists
304  between all
305  SequentiallyConsistent
306  operations. */
308 
309 typedef enum {
310  LLVMAtomicRMWBinOpXchg, /**< Set the new value and return the one old */
311  LLVMAtomicRMWBinOpAdd, /**< Add a value and return the old one */
312  LLVMAtomicRMWBinOpSub, /**< Subtract a value and return the old one */
313  LLVMAtomicRMWBinOpAnd, /**< And a value and return the old one */
314  LLVMAtomicRMWBinOpNand, /**< Not-And a value and return the old one */
315  LLVMAtomicRMWBinOpOr, /**< OR a value and return the old one */
316  LLVMAtomicRMWBinOpXor, /**< Xor a value and return the old one */
317  LLVMAtomicRMWBinOpMax, /**< Sets the value if it's greater than the
318  original using a signed comparison and return
319  the old one */
320  LLVMAtomicRMWBinOpMin, /**< Sets the value if it's Smaller than the
321  original using a signed comparison and return
322  the old one */
323  LLVMAtomicRMWBinOpUMax, /**< Sets the value if it's greater than the
324  original using an unsigned comparison and return
325  the old one */
326  LLVMAtomicRMWBinOpUMin /**< Sets the value if it's greater than the
327  original using an unsigned comparison and return
328  the old one */
330 
331 typedef enum {
337 
338 /**
339  * Attribute index are either LLVMAttributeReturnIndex,
340  * LLVMAttributeFunctionIndex or a parameter number from 1 to N.
341  */
342 enum {
344  // ISO C restricts enumerator values to range of 'int'
345  // (4294967295 is too large)
346  // LLVMAttributeFunctionIndex = ~0U,
348 };
349 
350 typedef unsigned LLVMAttributeIndex;
351 
352 /**
353  * @}
354  */
355 
357 
358 /** Deallocate and destroy all ManagedStatic variables.
359  @see llvm::llvm_shutdown
360  @see ManagedStatic */
361 void LLVMShutdown(void);
362 
363 /*===-- Error handling ----------------------------------------------------===*/
364 
365 char *LLVMCreateMessage(const char *Message);
366 void LLVMDisposeMessage(char *Message);
367 
368 /**
369  * @defgroup LLVMCCoreContext Contexts
370  *
371  * Contexts are execution states for the core LLVM IR system.
372  *
373  * Most types are tied to a context instance. Multiple contexts can
374  * exist simultaneously. A single context is not thread safe. However,
375  * different contexts can execute on different threads simultaneously.
376  *
377  * @{
378  */
379 
381 typedef void (*LLVMYieldCallback)(LLVMContextRef, void *);
382 
383 /**
384  * Create a new context.
385  *
386  * Every call to this function should be paired with a call to
387  * LLVMContextDispose() or the context will leak memory.
388  */
389 LLVMContextRef LLVMContextCreate(void);
390 
391 /**
392  * Obtain the global context instance.
393  */
394 LLVMContextRef LLVMGetGlobalContext(void);
395 
396 /**
397  * Set the diagnostic handler for this context.
398  */
399 void LLVMContextSetDiagnosticHandler(LLVMContextRef C,
400  LLVMDiagnosticHandler Handler,
401  void *DiagnosticContext);
402 
403 /**
404  * Get the diagnostic handler of this context.
405  */
407 
408 /**
409  * Get the diagnostic context of this context.
410  */
411 void *LLVMContextGetDiagnosticContext(LLVMContextRef C);
412 
413 /**
414  * Set the yield callback function for this context.
415  *
416  * @see LLVMContext::setYieldCallback()
417  */
418 void LLVMContextSetYieldCallback(LLVMContextRef C, LLVMYieldCallback Callback,
419  void *OpaqueHandle);
420 
421 /**
422  * Destroy a context instance.
423  *
424  * This should be called for every call to LLVMContextCreate() or memory
425  * will be leaked.
426  */
427 void LLVMContextDispose(LLVMContextRef C);
428 
429 /**
430  * Return a string representation of the DiagnosticInfo. Use
431  * LLVMDisposeMessage to free the string.
432  *
433  * @see DiagnosticInfo::print()
434  */
435 char *LLVMGetDiagInfoDescription(LLVMDiagnosticInfoRef DI);
436 
437 /**
438  * Return an enum LLVMDiagnosticSeverity.
439  *
440  * @see DiagnosticInfo::getSeverity()
441  */
442 LLVMDiagnosticSeverity LLVMGetDiagInfoSeverity(LLVMDiagnosticInfoRef DI);
443 
444 unsigned LLVMGetMDKindIDInContext(LLVMContextRef C, const char *Name,
445  unsigned SLen);
446 unsigned LLVMGetMDKindID(const char *Name, unsigned SLen);
447 
448 /**
449  * Return an unique id given the name of a enum attribute,
450  * or 0 if no attribute by that name exists.
451  *
452  * See http://llvm.org/docs/LangRef.html#parameter-attributes
453  * and http://llvm.org/docs/LangRef.html#function-attributes
454  * for the list of available attributes.
455  *
456  * NB: Attribute names and/or id are subject to change without
457  * going through the C API deprecation cycle.
458  */
459 unsigned LLVMGetEnumAttributeKindForName(const char *Name, size_t SLen);
460 unsigned LLVMGetLastEnumAttributeKind(void);
461 
462 /**
463  * Create an enum attribute.
464  */
465 LLVMAttributeRef LLVMCreateEnumAttribute(LLVMContextRef C, unsigned KindID,
466  uint64_t Val);
467 
468 /**
469  * Get the unique id corresponding to the enum attribute
470  * passed as argument.
471  */
473 
474 /**
475  * Get the enum attribute's value. 0 is returned if none exists.
476  */
478 
479 /**
480  * Create a string attribute.
481  */
483  const char *K, unsigned KLength,
484  const char *V, unsigned VLength);
485 
486 /**
487  * Get the string attribute's kind.
488  */
489 const char *LLVMGetStringAttributeKind(LLVMAttributeRef A, unsigned *Length);
490 
491 /**
492  * Get the string attribute's value.
493  */
494 const char *LLVMGetStringAttributeValue(LLVMAttributeRef A, unsigned *Length);
495 
496 /**
497  * Check for the different types of attributes.
498  */
501 
502 /**
503  * @}
504  */
505 
506 /**
507  * @defgroup LLVMCCoreModule Modules
508  *
509  * Modules represent the top-level structure in an LLVM program. An LLVM
510  * module is effectively a translation unit or a collection of
511  * translation units merged together.
512  *
513  * @{
514  */
515 
516 /**
517  * Create a new, empty module in the global context.
518  *
519  * This is equivalent to calling LLVMModuleCreateWithNameInContext with
520  * LLVMGetGlobalContext() as the context parameter.
521  *
522  * Every invocation should be paired with LLVMDisposeModule() or memory
523  * will be leaked.
524  */
525 LLVMModuleRef LLVMModuleCreateWithName(const char *ModuleID);
526 
527 /**
528  * Create a new, empty module in a specific context.
529  *
530  * Every invocation should be paired with LLVMDisposeModule() or memory
531  * will be leaked.
532  */
534  LLVMContextRef C);
535 /**
536  * Return an exact copy of the specified module.
537  */
539 
540 /**
541  * Destroy a module instance.
542  *
543  * This must be called for every created module or memory will be
544  * leaked.
545  */
547 
548 /**
549  * Obtain the identifier of a module.
550  *
551  * @param M Module to obtain identifier of
552  * @param Len Out parameter which holds the length of the returned string.
553  * @return The identifier of M.
554  * @see Module::getModuleIdentifier()
555  */
556 const char *LLVMGetModuleIdentifier(LLVMModuleRef M, size_t *Len);
557 
558 /**
559  * Set the identifier of a module to a string Ident with length Len.
560  *
561  * @param M The module to set identifier
562  * @param Ident The string to set M's identifier to
563  * @param Len Length of Ident
564  * @see Module::setModuleIdentifier()
565  */
566 void LLVMSetModuleIdentifier(LLVMModuleRef M, const char *Ident, size_t Len);
567 
568 /**
569  * Obtain the data layout for a module.
570  *
571  * @see Module::getDataLayoutStr()
572  *
573  * LLVMGetDataLayout is DEPRECATED, as the name is not only incorrect,
574  * but match the name of another method on the module. Prefer the use
575  * of LLVMGetDataLayoutStr, which is not ambiguous.
576  */
577 const char *LLVMGetDataLayoutStr(LLVMModuleRef M);
578 const char *LLVMGetDataLayout(LLVMModuleRef M);
579 
580 /**
581  * Set the data layout for a module.
582  *
583  * @see Module::setDataLayout()
584  */
585 void LLVMSetDataLayout(LLVMModuleRef M, const char *DataLayoutStr);
586 
587 /**
588  * Obtain the target triple for a module.
589  *
590  * @see Module::getTargetTriple()
591  */
592 const char *LLVMGetTarget(LLVMModuleRef M);
593 
594 /**
595  * Set the target triple for a module.
596  *
597  * @see Module::setTargetTriple()
598  */
599 void LLVMSetTarget(LLVMModuleRef M, const char *Triple);
600 
601 /**
602  * Dump a representation of a module to stderr.
603  *
604  * @see Module::dump()
605  */
607 
608 /**
609  * Print a representation of a module to a file. The ErrorMessage needs to be
610  * disposed with LLVMDisposeMessage. Returns 0 on success, 1 otherwise.
611  *
612  * @see Module::print()
613  */
614 LLVMBool LLVMPrintModuleToFile(LLVMModuleRef M, const char *Filename,
615  char **ErrorMessage);
616 
617 /**
618  * Return a string representation of the module. Use
619  * LLVMDisposeMessage to free the string.
620  *
621  * @see Module::print()
622  */
624 
625 /**
626  * Set inline assembly for a module.
627  *
628  * @see Module::setModuleInlineAsm()
629  */
630 void LLVMSetModuleInlineAsm(LLVMModuleRef M, const char *Asm);
631 
632 /**
633  * Obtain the context to which this module is associated.
634  *
635  * @see Module::getContext()
636  */
637 LLVMContextRef LLVMGetModuleContext(LLVMModuleRef M);
638 
639 /**
640  * Obtain a Type from a module by its registered name.
641  */
643 
644 /**
645  * Obtain the number of operands for named metadata in a module.
646  *
647  * @see llvm::Module::getNamedMetadata()
648  */
649 unsigned LLVMGetNamedMetadataNumOperands(LLVMModuleRef M, const char *Name);
650 
651 /**
652  * Obtain the named metadata operands for a module.
653  *
654  * The passed LLVMValueRef pointer should refer to an array of
655  * LLVMValueRef at least LLVMGetNamedMetadataNumOperands long. This
656  * array will be populated with the LLVMValueRef instances. Each
657  * instance corresponds to a llvm::MDNode.
658  *
659  * @see llvm::Module::getNamedMetadata()
660  * @see llvm::MDNode::getOperand()
661  */
663  LLVMValueRef *Dest);
664 
665 /**
666  * Add an operand to named metadata.
667  *
668  * @see llvm::Module::getNamedMetadata()
669  * @see llvm::MDNode::addOperand()
670  */
672  LLVMValueRef Val);
673 
674 /**
675  * Add a function to a module under a specified name.
676  *
677  * @see llvm::Function::Create()
678  */
680  LLVMTypeRef FunctionTy);
681 
682 /**
683  * Obtain a Function value from a Module by its name.
684  *
685  * The returned value corresponds to a llvm::Function value.
686  *
687  * @see llvm::Module::getFunction()
688  */
690 
691 /**
692  * Obtain an iterator to the first Function in a Module.
693  *
694  * @see llvm::Module::begin()
695  */
697 
698 /**
699  * Obtain an iterator to the last Function in a Module.
700  *
701  * @see llvm::Module::end()
702  */
704 
705 /**
706  * Advance a Function iterator to the next Function.
707  *
708  * Returns NULL if the iterator was already at the end and there are no more
709  * functions.
710  */
712 
713 /**
714  * Decrement a Function iterator to the previous Function.
715  *
716  * Returns NULL if the iterator was already at the beginning and there are
717  * no previous functions.
718  */
720 
721 /**
722  * @}
723  */
724 
725 /**
726  * @defgroup LLVMCCoreType Types
727  *
728  * Types represent the type of a value.
729  *
730  * Types are associated with a context instance. The context internally
731  * deduplicates types so there is only 1 instance of a specific type
732  * alive at a time. In other words, a unique type is shared among all
733  * consumers within a context.
734  *
735  * A Type in the C API corresponds to llvm::Type.
736  *
737  * Types have the following hierarchy:
738  *
739  * types:
740  * integer type
741  * real type
742  * function type
743  * sequence types:
744  * array type
745  * pointer type
746  * vector type
747  * void type
748  * label type
749  * opaque type
750  *
751  * @{
752  */
753 
754 /**
755  * Obtain the enumerated type of a Type instance.
756  *
757  * @see llvm::Type:getTypeID()
758  */
759 LLVMTypeKind LLVMGetTypeKind(LLVMTypeRef Ty);
760 
761 /**
762  * Whether the type has a known size.
763  *
764  * Things that don't have a size are abstract types, labels, and void.a
765  *
766  * @see llvm::Type::isSized()
767  */
769 
770 /**
771  * Obtain the context to which this type instance is associated.
772  *
773  * @see llvm::Type::getContext()
774  */
775 LLVMContextRef LLVMGetTypeContext(LLVMTypeRef Ty);
776 
777 /**
778  * Dump a representation of a type to stderr.
779  *
780  * @see llvm::Type::dump()
781  */
782 void LLVMDumpType(LLVMTypeRef Val);
783 
784 /**
785  * Return a string representation of the type. Use
786  * LLVMDisposeMessage to free the string.
787  *
788  * @see llvm::Type::print()
789  */
791 
792 /**
793  * @defgroup LLVMCCoreTypeInt Integer Types
794  *
795  * Functions in this section operate on integer types.
796  *
797  * @{
798  */
799 
800 /**
801  * Obtain an integer type from a context with specified bit width.
802  */
803 LLVMTypeRef LLVMInt1TypeInContext(LLVMContextRef C);
804 LLVMTypeRef LLVMInt8TypeInContext(LLVMContextRef C);
805 LLVMTypeRef LLVMInt16TypeInContext(LLVMContextRef C);
806 LLVMTypeRef LLVMInt32TypeInContext(LLVMContextRef C);
807 LLVMTypeRef LLVMInt64TypeInContext(LLVMContextRef C);
808 LLVMTypeRef LLVMInt128TypeInContext(LLVMContextRef C);
809 LLVMTypeRef LLVMIntTypeInContext(LLVMContextRef C, unsigned NumBits);
810 
811 /**
812  * Obtain an integer type from the global context with a specified bit
813  * width.
814  */
821 LLVMTypeRef LLVMIntType(unsigned NumBits);
822 unsigned LLVMGetIntTypeWidth(LLVMTypeRef IntegerTy);
823 
824 /**
825  * @}
826  */
827 
828 /**
829  * @defgroup LLVMCCoreTypeFloat Floating Point Types
830  *
831  * @{
832  */
833 
834 /**
835  * Obtain a 16-bit floating point type from a context.
836  */
837 LLVMTypeRef LLVMHalfTypeInContext(LLVMContextRef C);
838 
839 /**
840  * Obtain a 32-bit floating point type from a context.
841  */
842 LLVMTypeRef LLVMFloatTypeInContext(LLVMContextRef C);
843 
844 /**
845  * Obtain a 64-bit floating point type from a context.
846  */
847 LLVMTypeRef LLVMDoubleTypeInContext(LLVMContextRef C);
848 
849 /**
850  * Obtain a 80-bit floating point type (X87) from a context.
851  */
852 LLVMTypeRef LLVMX86FP80TypeInContext(LLVMContextRef C);
853 
854 /**
855  * Obtain a 128-bit floating point type (112-bit mantissa) from a
856  * context.
857  */
858 LLVMTypeRef LLVMFP128TypeInContext(LLVMContextRef C);
859 
860 /**
861  * Obtain a 128-bit floating point type (two 64-bits) from a context.
862  */
863 LLVMTypeRef LLVMPPCFP128TypeInContext(LLVMContextRef C);
864 
865 /**
866  * Obtain a floating point type from the global context.
867  *
868  * These map to the functions in this group of the same name.
869  */
876 
877 /**
878  * @}
879  */
880 
881 /**
882  * @defgroup LLVMCCoreTypeFunction Function Types
883  *
884  * @{
885  */
886 
887 /**
888  * Obtain a function type consisting of a specified signature.
889  *
890  * The function is defined as a tuple of a return Type, a list of
891  * parameter types, and whether the function is variadic.
892  */
894  LLVMTypeRef *ParamTypes, unsigned ParamCount,
895  LLVMBool IsVarArg);
896 
897 /**
898  * Returns whether a function type is variadic.
899  */
901 
902 /**
903  * Obtain the Type this function Type returns.
904  */
906 
907 /**
908  * Obtain the number of parameters this function accepts.
909  */
910 unsigned LLVMCountParamTypes(LLVMTypeRef FunctionTy);
911 
912 /**
913  * Obtain the types of a function's parameters.
914  *
915  * The Dest parameter should point to a pre-allocated array of
916  * LLVMTypeRef at least LLVMCountParamTypes() large. On return, the
917  * first LLVMCountParamTypes() entries in the array will be populated
918  * with LLVMTypeRef instances.
919  *
920  * @param FunctionTy The function type to operate on.
921  * @param Dest Memory address of an array to be filled with result.
922  */
923 void LLVMGetParamTypes(LLVMTypeRef FunctionTy, LLVMTypeRef *Dest);
924 
925 /**
926  * @}
927  */
928 
929 /**
930  * @defgroup LLVMCCoreTypeStruct Structure Types
931  *
932  * These functions relate to LLVMTypeRef instances.
933  *
934  * @see llvm::StructType
935  *
936  * @{
937  */
938 
939 /**
940  * Create a new structure type in a context.
941  *
942  * A structure is specified by a list of inner elements/types and
943  * whether these can be packed together.
944  *
945  * @see llvm::StructType::create()
946  */
947 LLVMTypeRef LLVMStructTypeInContext(LLVMContextRef C, LLVMTypeRef *ElementTypes,
948  unsigned ElementCount, LLVMBool Packed);
949 
950 /**
951  * Create a new structure type in the global context.
952  *
953  * @see llvm::StructType::create()
954  */
955 LLVMTypeRef LLVMStructType(LLVMTypeRef *ElementTypes, unsigned ElementCount,
956  LLVMBool Packed);
957 
958 /**
959  * Create an empty structure in a context having a specified name.
960  *
961  * @see llvm::StructType::create()
962  */
963 LLVMTypeRef LLVMStructCreateNamed(LLVMContextRef C, const char *Name);
964 
965 /**
966  * Obtain the name of a structure.
967  *
968  * @see llvm::StructType::getName()
969  */
970 const char *LLVMGetStructName(LLVMTypeRef Ty);
971 
972 /**
973  * Set the contents of a structure type.
974  *
975  * @see llvm::StructType::setBody()
976  */
977 void LLVMStructSetBody(LLVMTypeRef StructTy, LLVMTypeRef *ElementTypes,
978  unsigned ElementCount, LLVMBool Packed);
979 
980 /**
981  * Get the number of elements defined inside the structure.
982  *
983  * @see llvm::StructType::getNumElements()
984  */
985 unsigned LLVMCountStructElementTypes(LLVMTypeRef StructTy);
986 
987 /**
988  * Get the elements within a structure.
989  *
990  * The function is passed the address of a pre-allocated array of
991  * LLVMTypeRef at least LLVMCountStructElementTypes() long. After
992  * invocation, this array will be populated with the structure's
993  * elements. The objects in the destination array will have a lifetime
994  * of the structure type itself, which is the lifetime of the context it
995  * is contained in.
996  */
998 
999 /**
1000  * Get the type of the element at a given index in the structure.
1001  *
1002  * @see llvm::StructType::getTypeAtIndex()
1003  */
1004 LLVMTypeRef LLVMStructGetTypeAtIndex(LLVMTypeRef StructTy, unsigned i);
1005 
1006 /**
1007  * Determine whether a structure is packed.
1008  *
1009  * @see llvm::StructType::isPacked()
1010  */
1012 
1013 /**
1014  * Determine whether a structure is opaque.
1015  *
1016  * @see llvm::StructType::isOpaque()
1017  */
1019 
1020 /**
1021  * @}
1022  */
1023 
1024 /**
1025  * @defgroup LLVMCCoreTypeSequential Sequential Types
1026  *
1027  * Sequential types represents "arrays" of types. This is a super class
1028  * for array, vector, and pointer types.
1029  *
1030  * @{
1031  */
1032 
1033 /**
1034  * Obtain the type of elements within a sequential type.
1035  *
1036  * This works on array, vector, and pointer types.
1037  *
1038  * @see llvm::SequentialType::getElementType()
1039  */
1041 
1042 /**
1043  * Returns type's subtypes
1044  *
1045  * @see llvm::Type::subtypes()
1046  */
1047 void LLVMGetSubtypes(LLVMTypeRef Tp, LLVMTypeRef *Arr);
1048 
1049 /**
1050  * Return the number of types in the derived type.
1051  *
1052  * @see llvm::Type::getNumContainedTypes()
1053  */
1055 
1056 /**
1057  * Create a fixed size array type that refers to a specific type.
1058  *
1059  * The created type will exist in the context that its element type
1060  * exists in.
1061  *
1062  * @see llvm::ArrayType::get()
1063  */
1064 LLVMTypeRef LLVMArrayType(LLVMTypeRef ElementType, unsigned ElementCount);
1065 
1066 /**
1067  * Obtain the length of an array type.
1068  *
1069  * This only works on types that represent arrays.
1070  *
1071  * @see llvm::ArrayType::getNumElements()
1072  */
1073 unsigned LLVMGetArrayLength(LLVMTypeRef ArrayTy);
1074 
1075 /**
1076  * Create a pointer type that points to a defined type.
1077  *
1078  * The created type will exist in the context that its pointee type
1079  * exists in.
1080  *
1081  * @see llvm::PointerType::get()
1082  */
1083 LLVMTypeRef LLVMPointerType(LLVMTypeRef ElementType, unsigned AddressSpace);
1084 
1085 /**
1086  * Obtain the address space of a pointer type.
1087  *
1088  * This only works on types that represent pointers.
1089  *
1090  * @see llvm::PointerType::getAddressSpace()
1091  */
1093 
1094 /**
1095  * Create a vector type that contains a defined type and has a specific
1096  * number of elements.
1097  *
1098  * The created type will exist in the context thats its element type
1099  * exists in.
1100  *
1101  * @see llvm::VectorType::get()
1102  */
1103 LLVMTypeRef LLVMVectorType(LLVMTypeRef ElementType, unsigned ElementCount);
1104 
1105 /**
1106  * Obtain the number of elements in a vector type.
1107  *
1108  * This only works on types that represent vectors.
1109  *
1110  * @see llvm::VectorType::getNumElements()
1111  */
1112 unsigned LLVMGetVectorSize(LLVMTypeRef VectorTy);
1113 
1114 /**
1115  * @}
1116  */
1117 
1118 /**
1119  * @defgroup LLVMCCoreTypeOther Other Types
1120  *
1121  * @{
1122  */
1123 
1124 /**
1125  * Create a void type in a context.
1126  */
1127 LLVMTypeRef LLVMVoidTypeInContext(LLVMContextRef C);
1128 
1129 /**
1130  * Create a label type in a context.
1131  */
1132 LLVMTypeRef LLVMLabelTypeInContext(LLVMContextRef C);
1133 
1134 /**
1135  * Create a X86 MMX type in a context.
1136  */
1137 LLVMTypeRef LLVMX86MMXTypeInContext(LLVMContextRef C);
1138 
1139 /**
1140  * Create a token type in a context.
1141  */
1142 LLVMTypeRef LLVMTokenTypeInContext(LLVMContextRef C);
1143 
1144 /**
1145  * Create a metadata type in a context.
1146  */
1147 LLVMTypeRef LLVMMetadataTypeInContext(LLVMContextRef C);
1148 
1149 /**
1150  * These are similar to the above functions except they operate on the
1151  * global context.
1152  */
1156 
1157 /**
1158  * @}
1159  */
1160 
1161 /**
1162  * @}
1163  */
1164 
1165 /**
1166  * @defgroup LLVMCCoreValues Values
1167  *
1168  * The bulk of LLVM's object model consists of values, which comprise a very
1169  * rich type hierarchy.
1170  *
1171  * LLVMValueRef essentially represents llvm::Value. There is a rich
1172  * hierarchy of classes within this type. Depending on the instance
1173  * obtained, not all APIs are available.
1174  *
1175  * Callers can determine the type of an LLVMValueRef by calling the
1176  * LLVMIsA* family of functions (e.g. LLVMIsAArgument()). These
1177  * functions are defined by a macro, so it isn't obvious which are
1178  * available by looking at the Doxygen source code. Instead, look at the
1179  * source definition of LLVM_FOR_EACH_VALUE_SUBCLASS and note the list
1180  * of value names given. These value names also correspond to classes in
1181  * the llvm::Value hierarchy.
1182  *
1183  * @{
1184  */
1185 
1186 #define LLVM_FOR_EACH_VALUE_SUBCLASS(macro) \
1187  macro(Argument) \
1188  macro(BasicBlock) \
1189  macro(InlineAsm) \
1190  macro(User) \
1191  macro(Constant) \
1192  macro(BlockAddress) \
1193  macro(ConstantAggregateZero) \
1194  macro(ConstantArray) \
1195  macro(ConstantDataSequential) \
1196  macro(ConstantDataArray) \
1197  macro(ConstantDataVector) \
1198  macro(ConstantExpr) \
1199  macro(ConstantFP) \
1200  macro(ConstantInt) \
1201  macro(ConstantPointerNull) \
1202  macro(ConstantStruct) \
1203  macro(ConstantTokenNone) \
1204  macro(ConstantVector) \
1205  macro(GlobalValue) \
1206  macro(GlobalAlias) \
1207  macro(GlobalObject) \
1208  macro(Function) \
1209  macro(GlobalVariable) \
1210  macro(UndefValue) \
1211  macro(Instruction) \
1212  macro(BinaryOperator) \
1213  macro(CallInst) \
1214  macro(IntrinsicInst) \
1215  macro(DbgInfoIntrinsic) \
1216  macro(DbgDeclareInst) \
1217  macro(MemIntrinsic) \
1218  macro(MemCpyInst) \
1219  macro(MemMoveInst) \
1220  macro(MemSetInst) \
1221  macro(CmpInst) \
1222  macro(FCmpInst) \
1223  macro(ICmpInst) \
1224  macro(ExtractElementInst) \
1225  macro(GetElementPtrInst) \
1226  macro(InsertElementInst) \
1227  macro(InsertValueInst) \
1228  macro(LandingPadInst) \
1229  macro(PHINode) \
1230  macro(SelectInst) \
1231  macro(ShuffleVectorInst) \
1232  macro(StoreInst) \
1233  macro(TerminatorInst) \
1234  macro(BranchInst) \
1235  macro(IndirectBrInst) \
1236  macro(InvokeInst) \
1237  macro(ReturnInst) \
1238  macro(SwitchInst) \
1239  macro(UnreachableInst) \
1240  macro(ResumeInst) \
1241  macro(CleanupReturnInst) \
1242  macro(CatchReturnInst) \
1243  macro(FuncletPadInst) \
1244  macro(CatchPadInst) \
1245  macro(CleanupPadInst) \
1246  macro(UnaryInstruction) \
1247  macro(AllocaInst) \
1248  macro(CastInst) \
1249  macro(AddrSpaceCastInst) \
1250  macro(BitCastInst) \
1251  macro(FPExtInst) \
1252  macro(FPToSIInst) \
1253  macro(FPToUIInst) \
1254  macro(FPTruncInst) \
1255  macro(IntToPtrInst) \
1256  macro(PtrToIntInst) \
1257  macro(SExtInst) \
1258  macro(SIToFPInst) \
1259  macro(TruncInst) \
1260  macro(UIToFPInst) \
1261  macro(ZExtInst) \
1262  macro(ExtractValueInst) \
1263  macro(LoadInst) \
1264  macro(VAArgInst)
1265 
1266 /**
1267  * @defgroup LLVMCCoreValueGeneral General APIs
1268  *
1269  * Functions in this section work on all LLVMValueRef instances,
1270  * regardless of their sub-type. They correspond to functions available
1271  * on llvm::Value.
1272  *
1273  * @{
1274  */
1275 
1276 /**
1277  * Obtain the type of a value.
1278  *
1279  * @see llvm::Value::getType()
1280  */
1282 
1283 /**
1284  * Obtain the enumerated type of a Value instance.
1285  *
1286  * @see llvm::Value::getValueID()
1287  */
1288 LLVMValueKind LLVMGetValueKind(LLVMValueRef Val);
1289 
1290 /**
1291  * Obtain the string name of a value.
1292  *
1293  * @see llvm::Value::getName()
1294  */
1295 const char *LLVMGetValueName(LLVMValueRef Val);
1296 
1297 /**
1298  * Set the string name of a value.
1299  *
1300  * @see llvm::Value::setName()
1301  */
1302 void LLVMSetValueName(LLVMValueRef Val, const char *Name);
1303 
1304 /**
1305  * Dump a representation of a value to stderr.
1306  *
1307  * @see llvm::Value::dump()
1308  */
1309 void LLVMDumpValue(LLVMValueRef Val);
1310 
1311 /**
1312  * Return a string representation of the value. Use
1313  * LLVMDisposeMessage to free the string.
1314  *
1315  * @see llvm::Value::print()
1316  */
1318 
1319 /**
1320  * Replace all uses of a value with another one.
1321  *
1322  * @see llvm::Value::replaceAllUsesWith()
1323  */
1324 void LLVMReplaceAllUsesWith(LLVMValueRef OldVal, LLVMValueRef NewVal);
1325 
1326 /**
1327  * Determine whether the specified value instance is constant.
1328  */
1330 
1331 /**
1332  * Determine whether a value instance is undefined.
1333  */
1335 
1336 /**
1337  * Convert value instances between types.
1338  *
1339  * Internally, an LLVMValueRef is "pinned" to a specific type. This
1340  * series of functions allows you to cast an instance to a specific
1341  * type.
1342  *
1343  * If the cast is not valid for the specified type, NULL is returned.
1344  *
1345  * @see llvm::dyn_cast_or_null<>
1346  */
1347 #define LLVM_DECLARE_VALUE_CAST(name) \
1348  LLVMValueRef LLVMIsA##name(LLVMValueRef Val);
1350 
1353 
1354 /**
1355  * @}
1356  */
1357 
1358 /**
1359  * @defgroup LLVMCCoreValueUses Usage
1360  *
1361  * This module defines functions that allow you to inspect the uses of a
1362  * LLVMValueRef.
1363  *
1364  * It is possible to obtain an LLVMUseRef for any LLVMValueRef instance.
1365  * Each LLVMUseRef (which corresponds to a llvm::Use instance) holds a
1366  * llvm::User and llvm::Value.
1367  *
1368  * @{
1369  */
1370 
1371 /**
1372  * Obtain the first use of a value.
1373  *
1374  * Uses are obtained in an iterator fashion. First, call this function
1375  * to obtain a reference to the first use. Then, call LLVMGetNextUse()
1376  * on that instance and all subsequently obtained instances until
1377  * LLVMGetNextUse() returns NULL.
1378  *
1379  * @see llvm::Value::use_begin()
1380  */
1382 
1383 /**
1384  * Obtain the next use of a value.
1385  *
1386  * This effectively advances the iterator. It returns NULL if you are on
1387  * the final use and no more are available.
1388  */
1390 
1391 /**
1392  * Obtain the user value for a user.
1393  *
1394  * The returned value corresponds to a llvm::User type.
1395  *
1396  * @see llvm::Use::getUser()
1397  */
1399 
1400 /**
1401  * Obtain the value this use corresponds to.
1402  *
1403  * @see llvm::Use::get().
1404  */
1406 
1407 /**
1408  * @}
1409  */
1410 
1411 /**
1412  * @defgroup LLVMCCoreValueUser User value
1413  *
1414  * Function in this group pertain to LLVMValueRef instances that descent
1415  * from llvm::User. This includes constants, instructions, and
1416  * operators.
1417  *
1418  * @{
1419  */
1420 
1421 /**
1422  * Obtain an operand at a specific index in a llvm::User value.
1423  *
1424  * @see llvm::User::getOperand()
1425  */
1426 LLVMValueRef LLVMGetOperand(LLVMValueRef Val, unsigned Index);
1427 
1428 /**
1429  * Obtain the use of an operand at a specific index in a llvm::User value.
1430  *
1431  * @see llvm::User::getOperandUse()
1432  */
1433 LLVMUseRef LLVMGetOperandUse(LLVMValueRef Val, unsigned Index);
1434 
1435 /**
1436  * Set an operand at a specific index in a llvm::User value.
1437  *
1438  * @see llvm::User::setOperand()
1439  */
1440 void LLVMSetOperand(LLVMValueRef User, unsigned Index, LLVMValueRef Val);
1441 
1442 /**
1443  * Obtain the number of operands in a llvm::User value.
1444  *
1445  * @see llvm::User::getNumOperands()
1446  */
1448 
1449 /**
1450  * @}
1451  */
1452 
1453 /**
1454  * @defgroup LLVMCCoreValueConstant Constants
1455  *
1456  * This section contains APIs for interacting with LLVMValueRef that
1457  * correspond to llvm::Constant instances.
1458  *
1459  * These functions will work for any LLVMValueRef in the llvm::Constant
1460  * class hierarchy.
1461  *
1462  * @{
1463  */
1464 
1465 /**
1466  * Obtain a constant value referring to the null instance of a type.
1467  *
1468  * @see llvm::Constant::getNullValue()
1469  */
1470 LLVMValueRef LLVMConstNull(LLVMTypeRef Ty); /* all zeroes */
1471 
1472 /**
1473  * Obtain a constant value referring to the instance of a type
1474  * consisting of all ones.
1475  *
1476  * This is only valid for integer types.
1477  *
1478  * @see llvm::Constant::getAllOnesValue()
1479  */
1481 
1482 /**
1483  * Obtain a constant value referring to an undefined value of a type.
1484  *
1485  * @see llvm::UndefValue::get()
1486  */
1488 
1489 /**
1490  * Determine whether a value instance is null.
1491  *
1492  * @see llvm::Constant::isNullValue()
1493  */
1495 
1496 /**
1497  * Obtain a constant that is a constant pointer pointing to NULL for a
1498  * specified type.
1499  */
1501 
1502 /**
1503  * @defgroup LLVMCCoreValueConstantScalar Scalar constants
1504  *
1505  * Functions in this group model LLVMValueRef instances that correspond
1506  * to constants referring to scalar types.
1507  *
1508  * For integer types, the LLVMTypeRef parameter should correspond to a
1509  * llvm::IntegerType instance and the returned LLVMValueRef will
1510  * correspond to a llvm::ConstantInt.
1511  *
1512  * For floating point types, the LLVMTypeRef returned corresponds to a
1513  * llvm::ConstantFP.
1514  *
1515  * @{
1516  */
1517 
1518 /**
1519  * Obtain a constant value for an integer type.
1520  *
1521  * The returned value corresponds to a llvm::ConstantInt.
1522  *
1523  * @see llvm::ConstantInt::get()
1524  *
1525  * @param IntTy Integer type to obtain value of.
1526  * @param N The value the returned instance should refer to.
1527  * @param SignExtend Whether to sign extend the produced value.
1528  */
1529 LLVMValueRef LLVMConstInt(LLVMTypeRef IntTy, unsigned long long N,
1530  LLVMBool SignExtend);
1531 
1532 /**
1533  * Obtain a constant value for an integer of arbitrary precision.
1534  *
1535  * @see llvm::ConstantInt::get()
1536  */
1538  unsigned NumWords,
1539  const uint64_t Words[]);
1540 
1541 /**
1542  * Obtain a constant value for an integer parsed from a string.
1543  *
1544  * A similar API, LLVMConstIntOfStringAndSize is also available. If the
1545  * string's length is available, it is preferred to call that function
1546  * instead.
1547  *
1548  * @see llvm::ConstantInt::get()
1549  */
1550 LLVMValueRef LLVMConstIntOfString(LLVMTypeRef IntTy, const char *Text,
1551  uint8_t Radix);
1552 
1553 /**
1554  * Obtain a constant value for an integer parsed from a string with
1555  * specified length.
1556  *
1557  * @see llvm::ConstantInt::get()
1558  */
1559 LLVMValueRef LLVMConstIntOfStringAndSize(LLVMTypeRef IntTy, const char *Text,
1560  unsigned SLen, uint8_t Radix);
1561 
1562 /**
1563  * Obtain a constant value referring to a double floating point value.
1564  */
1565 LLVMValueRef LLVMConstReal(LLVMTypeRef RealTy, double N);
1566 
1567 /**
1568  * Obtain a constant for a floating point value parsed from a string.
1569  *
1570  * A similar API, LLVMConstRealOfStringAndSize is also available. It
1571  * should be used if the input string's length is known.
1572  */
1573 LLVMValueRef LLVMConstRealOfString(LLVMTypeRef RealTy, const char *Text);
1574 
1575 /**
1576  * Obtain a constant for a floating point value parsed from a string.
1577  */
1578 LLVMValueRef LLVMConstRealOfStringAndSize(LLVMTypeRef RealTy, const char *Text,
1579  unsigned SLen);
1580 
1581 /**
1582  * Obtain the zero extended value for an integer constant value.
1583  *
1584  * @see llvm::ConstantInt::getZExtValue()
1585  */
1586 unsigned long long LLVMConstIntGetZExtValue(LLVMValueRef ConstantVal);
1587 
1588 /**
1589  * Obtain the sign extended value for an integer constant value.
1590  *
1591  * @see llvm::ConstantInt::getSExtValue()
1592  */
1593 long long LLVMConstIntGetSExtValue(LLVMValueRef ConstantVal);
1594 
1595 /**
1596  * Obtain the double value for an floating point constant value.
1597  * losesInfo indicates if some precision was lost in the conversion.
1598  *
1599  * @see llvm::ConstantFP::getDoubleValue
1600  */
1601 double LLVMConstRealGetDouble(LLVMValueRef ConstantVal, LLVMBool *losesInfo);
1602 
1603 /**
1604  * @}
1605  */
1606 
1607 /**
1608  * @defgroup LLVMCCoreValueConstantComposite Composite Constants
1609  *
1610  * Functions in this group operate on composite constants.
1611  *
1612  * @{
1613  */
1614 
1615 /**
1616  * Create a ConstantDataSequential and initialize it with a string.
1617  *
1618  * @see llvm::ConstantDataArray::getString()
1619  */
1620 LLVMValueRef LLVMConstStringInContext(LLVMContextRef C, const char *Str,
1621  unsigned Length, LLVMBool DontNullTerminate);
1622 
1623 /**
1624  * Create a ConstantDataSequential with string content in the global context.
1625  *
1626  * This is the same as LLVMConstStringInContext except it operates on the
1627  * global context.
1628  *
1629  * @see LLVMConstStringInContext()
1630  * @see llvm::ConstantDataArray::getString()
1631  */
1632 LLVMValueRef LLVMConstString(const char *Str, unsigned Length,
1633  LLVMBool DontNullTerminate);
1634 
1635 /**
1636  * Returns true if the specified constant is an array of i8.
1637  *
1638  * @see ConstantDataSequential::getAsString()
1639  */
1641 
1642 /**
1643  * Get the given constant data sequential as a string.
1644  *
1645  * @see ConstantDataSequential::getAsString()
1646  */
1647 const char *LLVMGetAsString(LLVMValueRef c, size_t *Length);
1648 
1649 /**
1650  * Create an anonymous ConstantStruct with the specified values.
1651  *
1652  * @see llvm::ConstantStruct::getAnon()
1653  */
1654 LLVMValueRef LLVMConstStructInContext(LLVMContextRef C,
1655  LLVMValueRef *ConstantVals,
1656  unsigned Count, LLVMBool Packed);
1657 
1658 /**
1659  * Create a ConstantStruct in the global Context.
1660  *
1661  * This is the same as LLVMConstStructInContext except it operates on the
1662  * global Context.
1663  *
1664  * @see LLVMConstStructInContext()
1665  */
1666 LLVMValueRef LLVMConstStruct(LLVMValueRef *ConstantVals, unsigned Count,
1667  LLVMBool Packed);
1668 
1669 /**
1670  * Create a ConstantArray from values.
1671  *
1672  * @see llvm::ConstantArray::get()
1673  */
1675  LLVMValueRef *ConstantVals, unsigned Length);
1676 
1677 /**
1678  * Create a non-anonymous ConstantStruct from values.
1679  *
1680  * @see llvm::ConstantStruct::get()
1681  */
1683  LLVMValueRef *ConstantVals,
1684  unsigned Count);
1685 
1686 /**
1687  * Get an element at specified index as a constant.
1688  *
1689  * @see ConstantDataSequential::getElementAsConstant()
1690  */
1692 
1693 /**
1694  * Create a ConstantVector from values.
1695  *
1696  * @see llvm::ConstantVector::get()
1697  */
1698 LLVMValueRef LLVMConstVector(LLVMValueRef *ScalarConstantVals, unsigned Size);
1699 
1700 /**
1701  * @}
1702  */
1703 
1704 /**
1705  * @defgroup LLVMCCoreValueConstantExpressions Constant Expressions
1706  *
1707  * Functions in this group correspond to APIs on llvm::ConstantExpr.
1708  *
1709  * @see llvm::ConstantExpr.
1710  *
1711  * @{
1712  */
1721 LLVMValueRef LLVMConstAdd(LLVMValueRef LHSConstant, LLVMValueRef RHSConstant);
1722 LLVMValueRef LLVMConstNSWAdd(LLVMValueRef LHSConstant, LLVMValueRef RHSConstant);
1723 LLVMValueRef LLVMConstNUWAdd(LLVMValueRef LHSConstant, LLVMValueRef RHSConstant);
1724 LLVMValueRef LLVMConstFAdd(LLVMValueRef LHSConstant, LLVMValueRef RHSConstant);
1725 LLVMValueRef LLVMConstSub(LLVMValueRef LHSConstant, LLVMValueRef RHSConstant);
1726 LLVMValueRef LLVMConstNSWSub(LLVMValueRef LHSConstant, LLVMValueRef RHSConstant);
1727 LLVMValueRef LLVMConstNUWSub(LLVMValueRef LHSConstant, LLVMValueRef RHSConstant);
1728 LLVMValueRef LLVMConstFSub(LLVMValueRef LHSConstant, LLVMValueRef RHSConstant);
1729 LLVMValueRef LLVMConstMul(LLVMValueRef LHSConstant, LLVMValueRef RHSConstant);
1730 LLVMValueRef LLVMConstNSWMul(LLVMValueRef LHSConstant, LLVMValueRef RHSConstant);
1731 LLVMValueRef LLVMConstNUWMul(LLVMValueRef LHSConstant, LLVMValueRef RHSConstant);
1732 LLVMValueRef LLVMConstFMul(LLVMValueRef LHSConstant, LLVMValueRef RHSConstant);
1733 LLVMValueRef LLVMConstUDiv(LLVMValueRef LHSConstant, LLVMValueRef RHSConstant);
1734 LLVMValueRef LLVMConstExactUDiv(LLVMValueRef LHSConstant, LLVMValueRef RHSConstant);
1735 LLVMValueRef LLVMConstSDiv(LLVMValueRef LHSConstant, LLVMValueRef RHSConstant);
1736 LLVMValueRef LLVMConstExactSDiv(LLVMValueRef LHSConstant, LLVMValueRef RHSConstant);
1737 LLVMValueRef LLVMConstFDiv(LLVMValueRef LHSConstant, LLVMValueRef RHSConstant);
1738 LLVMValueRef LLVMConstURem(LLVMValueRef LHSConstant, LLVMValueRef RHSConstant);
1739 LLVMValueRef LLVMConstSRem(LLVMValueRef LHSConstant, LLVMValueRef RHSConstant);
1740 LLVMValueRef LLVMConstFRem(LLVMValueRef LHSConstant, LLVMValueRef RHSConstant);
1741 LLVMValueRef LLVMConstAnd(LLVMValueRef LHSConstant, LLVMValueRef RHSConstant);
1742 LLVMValueRef LLVMConstOr(LLVMValueRef LHSConstant, LLVMValueRef RHSConstant);
1743 LLVMValueRef LLVMConstXor(LLVMValueRef LHSConstant, LLVMValueRef RHSConstant);
1744 LLVMValueRef LLVMConstICmp(LLVMIntPredicate Predicate,
1745  LLVMValueRef LHSConstant, LLVMValueRef RHSConstant);
1746 LLVMValueRef LLVMConstFCmp(LLVMRealPredicate Predicate,
1747  LLVMValueRef LHSConstant, LLVMValueRef RHSConstant);
1748 LLVMValueRef LLVMConstShl(LLVMValueRef LHSConstant, LLVMValueRef RHSConstant);
1749 LLVMValueRef LLVMConstLShr(LLVMValueRef LHSConstant, LLVMValueRef RHSConstant);
1750 LLVMValueRef LLVMConstAShr(LLVMValueRef LHSConstant, LLVMValueRef RHSConstant);
1752  LLVMValueRef *ConstantIndices, unsigned NumIndices);
1754  LLVMValueRef *ConstantIndices,
1755  unsigned NumIndices);
1757 LLVMValueRef LLVMConstSExt(LLVMValueRef ConstantVal, LLVMTypeRef ToType);
1758 LLVMValueRef LLVMConstZExt(LLVMValueRef ConstantVal, LLVMTypeRef ToType);
1770  LLVMTypeRef ToType);
1772  LLVMTypeRef ToType);
1774  LLVMTypeRef ToType);
1776  LLVMTypeRef ToType);
1778  LLVMBool isSigned);
1780 LLVMValueRef LLVMConstSelect(LLVMValueRef ConstantCondition,
1781  LLVMValueRef ConstantIfTrue,
1782  LLVMValueRef ConstantIfFalse);
1784  LLVMValueRef IndexConstant);
1786  LLVMValueRef ElementValueConstant,
1787  LLVMValueRef IndexConstant);
1789  LLVMValueRef VectorBConstant,
1790  LLVMValueRef MaskConstant);
1791 LLVMValueRef LLVMConstExtractValue(LLVMValueRef AggConstant, unsigned *IdxList,
1792  unsigned NumIdx);
1794  LLVMValueRef ElementValueConstant,
1795  unsigned *IdxList, unsigned NumIdx);
1797  const char *AsmString, const char *Constraints,
1798  LLVMBool HasSideEffects, LLVMBool IsAlignStack);
1800 
1801 /**
1802  * @}
1803  */
1804 
1805 /**
1806  * @defgroup LLVMCCoreValueConstantGlobals Global Values
1807  *
1808  * This group contains functions that operate on global values. Functions in
1809  * this group relate to functions in the llvm::GlobalValue class tree.
1810  *
1811  * @see llvm::GlobalValue
1812  *
1813  * @{
1814  */
1815 
1818 LLVMLinkage LLVMGetLinkage(LLVMValueRef Global);
1819 void LLVMSetLinkage(LLVMValueRef Global, LLVMLinkage Linkage);
1820 const char *LLVMGetSection(LLVMValueRef Global);
1821 void LLVMSetSection(LLVMValueRef Global, const char *Section);
1822 LLVMVisibility LLVMGetVisibility(LLVMValueRef Global);
1823 void LLVMSetVisibility(LLVMValueRef Global, LLVMVisibility Viz);
1827 void LLVMSetUnnamedAddr(LLVMValueRef Global, LLVMBool HasUnnamedAddr);
1828 
1829 /**
1830  * @defgroup LLVMCCoreValueWithAlignment Values with alignment
1831  *
1832  * Functions in this group only apply to values with alignment, i.e.
1833  * global variables, load and store instructions.
1834  */
1835 
1836 /**
1837  * Obtain the preferred alignment of the value.
1838  * @see llvm::AllocaInst::getAlignment()
1839  * @see llvm::LoadInst::getAlignment()
1840  * @see llvm::StoreInst::getAlignment()
1841  * @see llvm::GlobalValue::getAlignment()
1842  */
1843 unsigned LLVMGetAlignment(LLVMValueRef V);
1844 
1845 /**
1846  * Set the preferred alignment of the value.
1847  * @see llvm::AllocaInst::setAlignment()
1848  * @see llvm::LoadInst::setAlignment()
1849  * @see llvm::StoreInst::setAlignment()
1850  * @see llvm::GlobalValue::setAlignment()
1851  */
1852 void LLVMSetAlignment(LLVMValueRef V, unsigned Bytes);
1853 
1854 /**
1855  * @}
1856  */
1857 
1858 /**
1859  * @defgroup LLVMCoreValueConstantGlobalVariable Global Variables
1860  *
1861  * This group contains functions that operate on global variable values.
1862  *
1863  * @see llvm::GlobalVariable
1864  *
1865  * @{
1866  */
1869  const char *Name,
1870  unsigned AddressSpace);
1880 void LLVMSetThreadLocal(LLVMValueRef GlobalVar, LLVMBool IsThreadLocal);
1883 LLVMThreadLocalMode LLVMGetThreadLocalMode(LLVMValueRef GlobalVar);
1884 void LLVMSetThreadLocalMode(LLVMValueRef GlobalVar, LLVMThreadLocalMode Mode);
1887 
1888 /**
1889  * @}
1890  */
1891 
1892 /**
1893  * @defgroup LLVMCoreValueConstantGlobalAlias Global Aliases
1894  *
1895  * This group contains function that operate on global alias values.
1896  *
1897  * @see llvm::GlobalAlias
1898  *
1899  * @{
1900  */
1902  const char *Name);
1903 
1904 /**
1905  * @}
1906  */
1907 
1908 /**
1909  * @defgroup LLVMCCoreValueFunction Function values
1910  *
1911  * Functions in this group operate on LLVMValueRef instances that
1912  * correspond to llvm::Function instances.
1913  *
1914  * @see llvm::Function
1915  *
1916  * @{
1917  */
1918 
1919 /**
1920  * Remove a function from its containing module and deletes it.
1921  *
1922  * @see llvm::Function::eraseFromParent()
1923  */
1925 
1926 /**
1927  * Check whether the given function has a personality function.
1928  *
1929  * @see llvm::Function::hasPersonalityFn()
1930  */
1932 
1933 /**
1934  * Obtain the personality function attached to the function.
1935  *
1936  * @see llvm::Function::getPersonalityFn()
1937  */
1939 
1940 /**
1941  * Set the personality function attached to the function.
1942  *
1943  * @see llvm::Function::setPersonalityFn()
1944  */
1945 void LLVMSetPersonalityFn(LLVMValueRef Fn, LLVMValueRef PersonalityFn);
1946 
1947 /**
1948  * Obtain the ID number from a function instance.
1949  *
1950  * @see llvm::Function::getIntrinsicID()
1951  */
1952 unsigned LLVMGetIntrinsicID(LLVMValueRef Fn);
1953 
1954 /**
1955  * Obtain the calling function of a function.
1956  *
1957  * The returned value corresponds to the LLVMCallConv enumeration.
1958  *
1959  * @see llvm::Function::getCallingConv()
1960  */
1962 
1963 /**
1964  * Set the calling convention of a function.
1965  *
1966  * @see llvm::Function::setCallingConv()
1967  *
1968  * @param Fn Function to operate on
1969  * @param CC LLVMCallConv to set calling convention to
1970  */
1971 void LLVMSetFunctionCallConv(LLVMValueRef Fn, unsigned CC);
1972 
1973 /**
1974  * Obtain the name of the garbage collector to use during code
1975  * generation.
1976  *
1977  * @see llvm::Function::getGC()
1978  */
1979 const char *LLVMGetGC(LLVMValueRef Fn);
1980 
1981 /**
1982  * Define the garbage collector to use during code generation.
1983  *
1984  * @see llvm::Function::setGC()
1985  */
1986 void LLVMSetGC(LLVMValueRef Fn, const char *Name);
1987 
1988 /**
1989  * Add an attribute to a function.
1990  *
1991  * @see llvm::Function::addAttribute()
1992  */
1993 void LLVMAddAttributeAtIndex(LLVMValueRef F, LLVMAttributeIndex Idx,
1995 unsigned LLVMGetAttributeCountAtIndex(LLVMValueRef F, LLVMAttributeIndex Idx);
1996 void LLVMGetAttributesAtIndex(LLVMValueRef F, LLVMAttributeIndex Idx,
1999  LLVMAttributeIndex Idx,
2000  unsigned KindID);
2002  LLVMAttributeIndex Idx,
2003  const char *K, unsigned KLen);
2004 void LLVMRemoveEnumAttributeAtIndex(LLVMValueRef F, LLVMAttributeIndex Idx,
2005  unsigned KindID);
2006 void LLVMRemoveStringAttributeAtIndex(LLVMValueRef F, LLVMAttributeIndex Idx,
2007  const char *K, unsigned KLen);
2008 
2009 /**
2010  * Add a target-dependent attribute to a function
2011  * @see llvm::AttrBuilder::addAttribute()
2012  */
2014  const char *V);
2015 
2016 /**
2017  * @defgroup LLVMCCoreValueFunctionParameters Function Parameters
2018  *
2019  * Functions in this group relate to arguments/parameters on functions.
2020  *
2021  * Functions in this group expect LLVMValueRef instances that correspond
2022  * to llvm::Function instances.
2023  *
2024  * @{
2025  */
2026 
2027 /**
2028  * Obtain the number of parameters in a function.
2029  *
2030  * @see llvm::Function::arg_size()
2031  */
2032 unsigned LLVMCountParams(LLVMValueRef Fn);
2033 
2034 /**
2035  * Obtain the parameters in a function.
2036  *
2037  * The takes a pointer to a pre-allocated array of LLVMValueRef that is
2038  * at least LLVMCountParams() long. This array will be filled with
2039  * LLVMValueRef instances which correspond to the parameters the
2040  * function receives. Each LLVMValueRef corresponds to a llvm::Argument
2041  * instance.
2042  *
2043  * @see llvm::Function::arg_begin()
2044  */
2045 void LLVMGetParams(LLVMValueRef Fn, LLVMValueRef *Params);
2046 
2047 /**
2048  * Obtain the parameter at the specified index.
2049  *
2050  * Parameters are indexed from 0.
2051  *
2052  * @see llvm::Function::arg_begin()
2053  */
2054 LLVMValueRef LLVMGetParam(LLVMValueRef Fn, unsigned Index);
2055 
2056 /**
2057  * Obtain the function to which this argument belongs.
2058  *
2059  * Unlike other functions in this group, this one takes an LLVMValueRef
2060  * that corresponds to a llvm::Attribute.
2061  *
2062  * The returned LLVMValueRef is the llvm::Function to which this
2063  * argument belongs.
2064  */
2066 
2067 /**
2068  * Obtain the first parameter to a function.
2069  *
2070  * @see llvm::Function::arg_begin()
2071  */
2073 
2074 /**
2075  * Obtain the last parameter to a function.
2076  *
2077  * @see llvm::Function::arg_end()
2078  */
2080 
2081 /**
2082  * Obtain the next parameter to a function.
2083  *
2084  * This takes an LLVMValueRef obtained from LLVMGetFirstParam() (which is
2085  * actually a wrapped iterator) and obtains the next parameter from the
2086  * underlying iterator.
2087  */
2089 
2090 /**
2091  * Obtain the previous parameter to a function.
2092  *
2093  * This is the opposite of LLVMGetNextParam().
2094  */
2096 
2097 /**
2098  * Set the alignment for a function parameter.
2099  *
2100  * @see llvm::Argument::addAttr()
2101  * @see llvm::AttrBuilder::addAlignmentAttr()
2102  */
2104 
2105 /**
2106  * @}
2107  */
2108 
2109 /**
2110  * @}
2111  */
2112 
2113 /**
2114  * @}
2115  */
2116 
2117 /**
2118  * @}
2119  */
2120 
2121 /**
2122  * @defgroup LLVMCCoreValueMetadata Metadata
2123  *
2124  * @{
2125  */
2126 
2127 /**
2128  * Obtain a MDString value from a context.
2129  *
2130  * The returned instance corresponds to the llvm::MDString class.
2131  *
2132  * The instance is specified by string data of a specified length. The
2133  * string content is copied, so the backing memory can be freed after
2134  * this function returns.
2135  */
2136 LLVMValueRef LLVMMDStringInContext(LLVMContextRef C, const char *Str,
2137  unsigned SLen);
2138 
2139 /**
2140  * Obtain a MDString value from the global context.
2141  */
2142 LLVMValueRef LLVMMDString(const char *Str, unsigned SLen);
2143 
2144 /**
2145  * Obtain a MDNode value from a context.
2146  *
2147  * The returned value corresponds to the llvm::MDNode class.
2148  */
2149 LLVMValueRef LLVMMDNodeInContext(LLVMContextRef C, LLVMValueRef *Vals,
2150  unsigned Count);
2151 
2152 /**
2153  * Obtain a MDNode value from the global context.
2154  */
2155 LLVMValueRef LLVMMDNode(LLVMValueRef *Vals, unsigned Count);
2156 
2157 /**
2158  * Obtain a Metadata as a Value.
2159  */
2161 
2162 /**
2163  * Obtain a Value as a Metadata.
2164  */
2166 
2167 /**
2168  * Obtain the underlying string from a MDString value.
2169  *
2170  * @param V Instance to obtain string from.
2171  * @param Length Memory address which will hold length of returned string.
2172  * @return String data in MDString.
2173  */
2174 const char *LLVMGetMDString(LLVMValueRef V, unsigned *Length);
2175 
2176 /**
2177  * Obtain the number of operands from an MDNode value.
2178  *
2179  * @param V MDNode to get number of operands from.
2180  * @return Number of operands of the MDNode.
2181  */
2183 
2184 /**
2185  * Obtain the given MDNode's operands.
2186  *
2187  * The passed LLVMValueRef pointer should point to enough memory to hold all of
2188  * the operands of the given MDNode (see LLVMGetMDNodeNumOperands) as
2189  * LLVMValueRefs. This memory will be populated with the LLVMValueRefs of the
2190  * MDNode's operands.
2191  *
2192  * @param V MDNode to get the operands from.
2193  * @param Dest Destination array for operands.
2194  */
2196 
2197 /**
2198  * @}
2199  */
2200 
2201 /**
2202  * @defgroup LLVMCCoreValueBasicBlock Basic Block
2203  *
2204  * A basic block represents a single entry single exit section of code.
2205  * Basic blocks contain a list of instructions which form the body of
2206  * the block.
2207  *
2208  * Basic blocks belong to functions. They have the type of label.
2209  *
2210  * Basic blocks are themselves values. However, the C API models them as
2211  * LLVMBasicBlockRef.
2212  *
2213  * @see llvm::BasicBlock
2214  *
2215  * @{
2216  */
2217 
2218 /**
2219  * Convert a basic block instance to a value type.
2220  */
2222 
2223 /**
2224  * Determine whether an LLVMValueRef is itself a basic block.
2225  */
2227 
2228 /**
2229  * Convert an LLVMValueRef to an LLVMBasicBlockRef instance.
2230  */
2232 
2233 /**
2234  * Obtain the string name of a basic block.
2235  */
2237 
2238 /**
2239  * Obtain the function to which a basic block belongs.
2240  *
2241  * @see llvm::BasicBlock::getParent()
2242  */
2244 
2245 /**
2246  * Obtain the terminator instruction for a basic block.
2247  *
2248  * If the basic block does not have a terminator (it is not well-formed
2249  * if it doesn't), then NULL is returned.
2250  *
2251  * The returned LLVMValueRef corresponds to a llvm::TerminatorInst.
2252  *
2253  * @see llvm::BasicBlock::getTerminator()
2254  */
2256 
2257 /**
2258  * Obtain the number of basic blocks in a function.
2259  *
2260  * @param Fn Function value to operate on.
2261  */
2262 unsigned LLVMCountBasicBlocks(LLVMValueRef Fn);
2263 
2264 /**
2265  * Obtain all of the basic blocks in a function.
2266  *
2267  * This operates on a function value. The BasicBlocks parameter is a
2268  * pointer to a pre-allocated array of LLVMBasicBlockRef of at least
2269  * LLVMCountBasicBlocks() in length. This array is populated with
2270  * LLVMBasicBlockRef instances.
2271  */
2272 void LLVMGetBasicBlocks(LLVMValueRef Fn, LLVMBasicBlockRef *BasicBlocks);
2273 
2274 /**
2275  * Obtain the first basic block in a function.
2276  *
2277  * The returned basic block can be used as an iterator. You will likely
2278  * eventually call into LLVMGetNextBasicBlock() with it.
2279  *
2280  * @see llvm::Function::begin()
2281  */
2283 
2284 /**
2285  * Obtain the last basic block in a function.
2286  *
2287  * @see llvm::Function::end()
2288  */
2290 
2291 /**
2292  * Advance a basic block iterator.
2293  */
2295 
2296 /**
2297  * Go backwards in a basic block iterator.
2298  */
2300 
2301 /**
2302  * Obtain the basic block that corresponds to the entry point of a
2303  * function.
2304  *
2305  * @see llvm::Function::getEntryBlock()
2306  */
2308 
2309 /**
2310  * Append a basic block to the end of a function.
2311  *
2312  * @see llvm::BasicBlock::Create()
2313  */
2315  LLVMValueRef Fn,
2316  const char *Name);
2317 
2318 /**
2319  * Append a basic block to the end of a function using the global
2320  * context.
2321  *
2322  * @see llvm::BasicBlock::Create()
2323  */
2325 
2326 /**
2327  * Insert a basic block in a function before another basic block.
2328  *
2329  * The function to add to is determined by the function of the
2330  * passed basic block.
2331  *
2332  * @see llvm::BasicBlock::Create()
2333  */
2335  LLVMBasicBlockRef BB,
2336  const char *Name);
2337 
2338 /**
2339  * Insert a basic block in a function using the global context.
2340  *
2341  * @see llvm::BasicBlock::Create()
2342  */
2344  const char *Name);
2345 
2346 /**
2347  * Remove a basic block from a function and delete it.
2348  *
2349  * This deletes the basic block from its containing function and deletes
2350  * the basic block itself.
2351  *
2352  * @see llvm::BasicBlock::eraseFromParent()
2353  */
2355 
2356 /**
2357  * Remove a basic block from a function.
2358  *
2359  * This deletes the basic block from its containing function but keep
2360  * the basic block alive.
2361  *
2362  * @see llvm::BasicBlock::removeFromParent()
2363  */
2365 
2366 /**
2367  * Move a basic block to before another one.
2368  *
2369  * @see llvm::BasicBlock::moveBefore()
2370  */
2372 
2373 /**
2374  * Move a basic block to after another one.
2375  *
2376  * @see llvm::BasicBlock::moveAfter()
2377  */
2379 
2380 /**
2381  * Obtain the first instruction in a basic block.
2382  *
2383  * The returned LLVMValueRef corresponds to a llvm::Instruction
2384  * instance.
2385  */
2387 
2388 /**
2389  * Obtain the last instruction in a basic block.
2390  *
2391  * The returned LLVMValueRef corresponds to an LLVM:Instruction.
2392  */
2394 
2395 /**
2396  * @}
2397  */
2398 
2399 /**
2400  * @defgroup LLVMCCoreValueInstruction Instructions
2401  *
2402  * Functions in this group relate to the inspection and manipulation of
2403  * individual instructions.
2404  *
2405  * In the C++ API, an instruction is modeled by llvm::Instruction. This
2406  * class has a large number of descendents. llvm::Instruction is a
2407  * llvm::Value and in the C API, instructions are modeled by
2408  * LLVMValueRef.
2409  *
2410  * This group also contains sub-groups which operate on specific
2411  * llvm::Instruction types, e.g. llvm::CallInst.
2412  *
2413  * @{
2414  */
2415 
2416 /**
2417  * Determine whether an instruction has any metadata attached.
2418  */
2419 int LLVMHasMetadata(LLVMValueRef Val);
2420 
2421 /**
2422  * Return metadata associated with an instruction value.
2423  */
2424 LLVMValueRef LLVMGetMetadata(LLVMValueRef Val, unsigned KindID);
2425 
2426 /**
2427  * Set metadata associated with an instruction value.
2428  */
2429 void LLVMSetMetadata(LLVMValueRef Val, unsigned KindID, LLVMValueRef Node);
2430 
2431 /**
2432  * Obtain the basic block to which an instruction belongs.
2433  *
2434  * @see llvm::Instruction::getParent()
2435  */
2437 
2438 /**
2439  * Obtain the instruction that occurs after the one specified.
2440  *
2441  * The next instruction will be from the same basic block.
2442  *
2443  * If this is the last instruction in a basic block, NULL will be
2444  * returned.
2445  */
2447 
2448 /**
2449  * Obtain the instruction that occurred before this one.
2450  *
2451  * If the instruction is the first instruction in a basic block, NULL
2452  * will be returned.
2453  */
2455 
2456 /**
2457  * Remove and delete an instruction.
2458  *
2459  * The instruction specified is removed from its containing building
2460  * block but is kept alive.
2461  *
2462  * @see llvm::Instruction::removeFromParent()
2463  */
2465 
2466 /**
2467  * Remove and delete an instruction.
2468  *
2469  * The instruction specified is removed from its containing building
2470  * block and then deleted.
2471  *
2472  * @see llvm::Instruction::eraseFromParent()
2473  */
2475 
2476 /**
2477  * Obtain the code opcode for an individual instruction.
2478  *
2479  * @see llvm::Instruction::getOpCode()
2480  */
2482 
2483 /**
2484  * Obtain the predicate of an instruction.
2485  *
2486  * This is only valid for instructions that correspond to llvm::ICmpInst
2487  * or llvm::ConstantExpr whose opcode is llvm::Instruction::ICmp.
2488  *
2489  * @see llvm::ICmpInst::getPredicate()
2490  */
2491 LLVMIntPredicate LLVMGetICmpPredicate(LLVMValueRef Inst);
2492 
2493 /**
2494  * Obtain the float predicate of an instruction.
2495  *
2496  * This is only valid for instructions that correspond to llvm::FCmpInst
2497  * or llvm::ConstantExpr whose opcode is llvm::Instruction::FCmp.
2498  *
2499  * @see llvm::FCmpInst::getPredicate()
2500  */
2501 LLVMRealPredicate LLVMGetFCmpPredicate(LLVMValueRef Inst);
2502 
2503 /**
2504  * Create a copy of 'this' instruction that is identical in all ways
2505  * except the following:
2506  * * The instruction has no parent
2507  * * The instruction has no name
2508  *
2509  * @see llvm::Instruction::clone()
2510  */
2512 
2513 /**
2514  * @defgroup LLVMCCoreValueInstructionCall Call Sites and Invocations
2515  *
2516  * Functions in this group apply to instructions that refer to call
2517  * sites and invocations. These correspond to C++ types in the
2518  * llvm::CallInst class tree.
2519  *
2520  * @{
2521  */
2522 
2523 /**
2524  * Obtain the argument count for a call instruction.
2525  *
2526  * This expects an LLVMValueRef that corresponds to a llvm::CallInst or
2527  * llvm::InvokeInst.
2528  *
2529  * @see llvm::CallInst::getNumArgOperands()
2530  * @see llvm::InvokeInst::getNumArgOperands()
2531  */
2532 unsigned LLVMGetNumArgOperands(LLVMValueRef Instr);
2533 
2534 /**
2535  * Set the calling convention for a call instruction.
2536  *
2537  * This expects an LLVMValueRef that corresponds to a llvm::CallInst or
2538  * llvm::InvokeInst.
2539  *
2540  * @see llvm::CallInst::setCallingConv()
2541  * @see llvm::InvokeInst::setCallingConv()
2542  */
2543 void LLVMSetInstructionCallConv(LLVMValueRef Instr, unsigned CC);
2544 
2545 /**
2546  * Obtain the calling convention for a call instruction.
2547  *
2548  * This is the opposite of LLVMSetInstructionCallConv(). Reads its
2549  * usage.
2550  *
2551  * @see LLVMSetInstructionCallConv()
2552  */
2554 
2555 void LLVMSetInstrParamAlignment(LLVMValueRef Instr, unsigned index,
2556  unsigned Align);
2557 
2558 void LLVMAddCallSiteAttribute(LLVMValueRef C, LLVMAttributeIndex Idx,
2560 unsigned LLVMGetCallSiteAttributeCount(LLVMValueRef C, LLVMAttributeIndex Idx);
2561 void LLVMGetCallSiteAttributes(LLVMValueRef C, LLVMAttributeIndex Idx,
2564  LLVMAttributeIndex Idx,
2565  unsigned KindID);
2567  LLVMAttributeIndex Idx,
2568  const char *K, unsigned KLen);
2569 void LLVMRemoveCallSiteEnumAttribute(LLVMValueRef C, LLVMAttributeIndex Idx,
2570  unsigned KindID);
2571 void LLVMRemoveCallSiteStringAttribute(LLVMValueRef C, LLVMAttributeIndex Idx,
2572  const char *K, unsigned KLen);
2573 
2574 /**
2575  * Obtain the pointer to the function invoked by this instruction.
2576  *
2577  * This expects an LLVMValueRef that corresponds to a llvm::CallInst or
2578  * llvm::InvokeInst.
2579  *
2580  * @see llvm::CallInst::getCalledValue()
2581  * @see llvm::InvokeInst::getCalledValue()
2582  */
2584 
2585 /**
2586  * Obtain whether a call instruction is a tail call.
2587  *
2588  * This only works on llvm::CallInst instructions.
2589  *
2590  * @see llvm::CallInst::isTailCall()
2591  */
2593 
2594 /**
2595  * Set whether a call instruction is a tail call.
2596  *
2597  * This only works on llvm::CallInst instructions.
2598  *
2599  * @see llvm::CallInst::setTailCall()
2600  */
2601 void LLVMSetTailCall(LLVMValueRef CallInst, LLVMBool IsTailCall);
2602 
2603 /**
2604  * Return the normal destination basic block.
2605  *
2606  * This only works on llvm::InvokeInst instructions.
2607  *
2608  * @see llvm::InvokeInst::getNormalDest()
2609  */
2611 
2612 /**
2613  * Return the unwind destination basic block.
2614  *
2615  * This only works on llvm::InvokeInst instructions.
2616  *
2617  * @see llvm::InvokeInst::getUnwindDest()
2618  */
2620 
2621 /**
2622  * Set the normal destination basic block.
2623  *
2624  * This only works on llvm::InvokeInst instructions.
2625  *
2626  * @see llvm::InvokeInst::setNormalDest()
2627  */
2629 
2630 /**
2631  * Set the unwind destination basic block.
2632  *
2633  * This only works on llvm::InvokeInst instructions.
2634  *
2635  * @see llvm::InvokeInst::setUnwindDest()
2636  */
2638 
2639 /**
2640  * @}
2641  */
2642 
2643 /**
2644  * @defgroup LLVMCCoreValueInstructionTerminator Terminators
2645  *
2646  * Functions in this group only apply to instructions that map to
2647  * llvm::TerminatorInst instances.
2648  *
2649  * @{
2650  */
2651 
2652 /**
2653  * Return the number of successors that this terminator has.
2654  *
2655  * @see llvm::TerminatorInst::getNumSuccessors
2656  */
2657 unsigned LLVMGetNumSuccessors(LLVMValueRef Term);
2658 
2659 /**
2660  * Return the specified successor.
2661  *
2662  * @see llvm::TerminatorInst::getSuccessor
2663  */
2665 
2666 /**
2667  * Update the specified successor to point at the provided block.
2668  *
2669  * @see llvm::TerminatorInst::setSuccessor
2670  */
2671 void LLVMSetSuccessor(LLVMValueRef Term, unsigned i, LLVMBasicBlockRef block);
2672 
2673 /**
2674  * Return if a branch is conditional.
2675  *
2676  * This only works on llvm::BranchInst instructions.
2677  *
2678  * @see llvm::BranchInst::isConditional
2679  */
2681 
2682 /**
2683  * Return the condition of a branch instruction.
2684  *
2685  * This only works on llvm::BranchInst instructions.
2686  *
2687  * @see llvm::BranchInst::getCondition
2688  */
2690 
2691 /**
2692  * Set the condition of a branch instruction.
2693  *
2694  * This only works on llvm::BranchInst instructions.
2695  *
2696  * @see llvm::BranchInst::setCondition
2697  */
2699 
2700 /**
2701  * Obtain the default destination basic block of a switch instruction.
2702  *
2703  * This only works on llvm::SwitchInst instructions.
2704  *
2705  * @see llvm::SwitchInst::getDefaultDest()
2706  */
2708 
2709 /**
2710  * @}
2711  */
2712 
2713 /**
2714  * @defgroup LLVMCCoreValueInstructionAlloca Allocas
2715  *
2716  * Functions in this group only apply to instructions that map to
2717  * llvm::AllocaInst instances.
2718  *
2719  * @{
2720  */
2721 
2722 /**
2723  * Obtain the type that is being allocated by the alloca instruction.
2724  */
2726 
2727 /**
2728  * @}
2729  */
2730 
2731 /**
2732  * @defgroup LLVMCCoreValueInstructionGetElementPointer GEPs
2733  *
2734  * Functions in this group only apply to instructions that map to
2735  * llvm::GetElementPtrInst instances.
2736  *
2737  * @{
2738  */
2739 
2740 /**
2741  * Check whether the given GEP instruction is inbounds.
2742  */
2744 
2745 /**
2746  * Set the given GEP instruction to be inbounds or not.
2747  */
2748 void LLVMSetIsInBounds(LLVMValueRef GEP, LLVMBool InBounds);
2749 
2750 /**
2751  * @}
2752  */
2753 
2754 /**
2755  * @defgroup LLVMCCoreValueInstructionPHINode PHI Nodes
2756  *
2757  * Functions in this group only apply to instructions that map to
2758  * llvm::PHINode instances.
2759  *
2760  * @{
2761  */
2762 
2763 /**
2764  * Add an incoming value to the end of a PHI list.
2765  */
2766 void LLVMAddIncoming(LLVMValueRef PhiNode, LLVMValueRef *IncomingValues,
2767  LLVMBasicBlockRef *IncomingBlocks, unsigned Count);
2768 
2769 /**
2770  * Obtain the number of incoming basic blocks to a PHI node.
2771  */
2772 unsigned LLVMCountIncoming(LLVMValueRef PhiNode);
2773 
2774 /**
2775  * Obtain an incoming value to a PHI node as an LLVMValueRef.
2776  */
2777 LLVMValueRef LLVMGetIncomingValue(LLVMValueRef PhiNode, unsigned Index);
2778 
2779 /**
2780  * Obtain an incoming value to a PHI node as an LLVMBasicBlockRef.
2781  */
2782 LLVMBasicBlockRef LLVMGetIncomingBlock(LLVMValueRef PhiNode, unsigned Index);
2783 
2784 /**
2785  * @}
2786  */
2787 
2788 /**
2789  * @defgroup LLVMCCoreValueInstructionExtractValue ExtractValue
2790  * @defgroup LLVMCCoreValueInstructionInsertValue InsertValue
2791  *
2792  * Functions in this group only apply to instructions that map to
2793  * llvm::ExtractValue and llvm::InsertValue instances.
2794  *
2795  * @{
2796  */
2797 
2798 /**
2799  * Obtain the number of indices.
2800  * NB: This also works on GEP.
2801  */
2802 unsigned LLVMGetNumIndices(LLVMValueRef Inst);
2803 
2804 /**
2805  * Obtain the indices as an array.
2806  */
2807 const unsigned *LLVMGetIndices(LLVMValueRef Inst);
2808 
2809 /**
2810  * @}
2811  */
2812 
2813 /**
2814  * @}
2815  */
2816 
2817 /**
2818  * @}
2819  */
2820 
2821 /**
2822  * @defgroup LLVMCCoreInstructionBuilder Instruction Builders
2823  *
2824  * An instruction builder represents a point within a basic block and is
2825  * the exclusive means of building instructions using the C interface.
2826  *
2827  * @{
2828  */
2829 
2833  LLVMValueRef Instr);
2840  const char *Name);
2841 void LLVMDisposeBuilder(LLVMBuilderRef Builder);
2842 
2843 /* Metadata */
2847 
2848 /* Terminators */
2852  unsigned N);
2857  LLVMBasicBlockRef Else, unsigned NumCases);
2859  unsigned NumDests);
2861  LLVMValueRef *Args, unsigned NumArgs,
2863  const char *Name);
2865  LLVMValueRef PersFn, unsigned NumClauses,
2866  const char *Name);
2869 
2870 /* Add a case to the switch instruction */
2871 void LLVMAddCase(LLVMValueRef Switch, LLVMValueRef OnVal,
2872  LLVMBasicBlockRef Dest);
2873 
2874 /* Add a destination to the indirectbr instruction */
2875 void LLVMAddDestination(LLVMValueRef IndirectBr, LLVMBasicBlockRef Dest);
2876 
2877 /* Get the number of clauses on the landingpad instruction */
2878 unsigned LLVMGetNumClauses(LLVMValueRef LandingPad);
2879 
2880 /* Get the value of the clause at idnex Idx on the landingpad instruction */
2881 LLVMValueRef LLVMGetClause(LLVMValueRef LandingPad, unsigned Idx);
2882 
2883 /* Add a catch or filter clause to the landingpad instruction */
2884 void LLVMAddClause(LLVMValueRef LandingPad, LLVMValueRef ClauseVal);
2885 
2886 /* Get the 'cleanup' flag in the landingpad instruction */
2887 LLVMBool LLVMIsCleanup(LLVMValueRef LandingPad);
2888 
2889 /* Set the 'cleanup' flag in the landingpad instruction */
2890 void LLVMSetCleanup(LLVMValueRef LandingPad, LLVMBool Val);
2891 
2892 /* Arithmetic */
2894  const char *Name);
2896  const char *Name);
2898  const char *Name);
2900  const char *Name);
2902  const char *Name);
2904  const char *Name);
2906  const char *Name);
2908  const char *Name);
2910  const char *Name);
2912  const char *Name);
2914  const char *Name);
2916  const char *Name);
2918  const char *Name);
2920  const char *Name);
2922  const char *Name);
2924  const char *Name);
2926  const char *Name);
2928  const char *Name);
2930  const char *Name);
2932  const char *Name);
2934  const char *Name);
2936  const char *Name);
2938  const char *Name);
2940  const char *Name);
2942  const char *Name);
2944  const char *Name);
2946  LLVMValueRef LHS, LLVMValueRef RHS,
2947  const char *Name);
2950  const char *Name);
2952  const char *Name);
2955 
2956 /* Memory */
2959  LLVMValueRef Val, const char *Name);
2962  LLVMValueRef Val, const char *Name);
2965  const char *Name);
2968  LLVMValueRef *Indices, unsigned NumIndices,
2969  const char *Name);
2971  LLVMValueRef *Indices, unsigned NumIndices,
2972  const char *Name);
2974  unsigned Idx, const char *Name);
2976  const char *Name);
2978  const char *Name);
2979 LLVMBool LLVMGetVolatile(LLVMValueRef MemoryAccessInst);
2980 void LLVMSetVolatile(LLVMValueRef MemoryAccessInst, LLVMBool IsVolatile);
2982 void LLVMSetOrdering(LLVMValueRef MemoryAccessInst, LLVMAtomicOrdering Ordering);
2983 
2984 /* Casts */
2986  LLVMTypeRef DestTy, const char *Name);
2988  LLVMTypeRef DestTy, const char *Name);
2990  LLVMTypeRef DestTy, const char *Name);
2992  LLVMTypeRef DestTy, const char *Name);
2994  LLVMTypeRef DestTy, const char *Name);
2996  LLVMTypeRef DestTy, const char *Name);
2998  LLVMTypeRef DestTy, const char *Name);
3000  LLVMTypeRef DestTy, const char *Name);
3002  LLVMTypeRef DestTy, const char *Name);
3004  LLVMTypeRef DestTy, const char *Name);
3006  LLVMTypeRef DestTy, const char *Name);
3008  LLVMTypeRef DestTy, const char *Name);
3010  LLVMTypeRef DestTy, const char *Name);
3012  LLVMTypeRef DestTy, const char *Name);
3014  LLVMTypeRef DestTy, const char *Name);
3016  LLVMTypeRef DestTy, const char *Name);
3018  LLVMTypeRef DestTy, const char *Name);
3020  LLVMTypeRef DestTy, const char *Name);
3022  LLVMTypeRef DestTy, const char *Name);
3024  LLVMTypeRef DestTy, const char *Name);
3025 
3026 /* Comparisons */
3027 LLVMValueRef LLVMBuildICmp(LLVMBuilderRef, LLVMIntPredicate Op,
3028  LLVMValueRef LHS, LLVMValueRef RHS,
3029  const char *Name);
3030 LLVMValueRef LLVMBuildFCmp(LLVMBuilderRef, LLVMRealPredicate Op,
3031  LLVMValueRef LHS, LLVMValueRef RHS,
3032  const char *Name);
3033 
3034 /* Miscellaneous instructions */
3037  LLVMValueRef *Args, unsigned NumArgs,
3038  const char *Name);
3040  LLVMValueRef Then, LLVMValueRef Else,
3041  const char *Name);
3043  const char *Name);
3045  LLVMValueRef Index, const char *Name);
3047  LLVMValueRef EltVal, LLVMValueRef Index,
3048  const char *Name);
3051  const char *Name);
3053  unsigned Index, const char *Name);
3055  LLVMValueRef EltVal, unsigned Index,
3056  const char *Name);
3057 
3059  const char *Name);
3061  const char *Name);
3063  LLVMValueRef RHS, const char *Name);
3065  LLVMBool singleThread, const char *Name);
3066 LLVMValueRef LLVMBuildAtomicRMW(LLVMBuilderRef B, LLVMAtomicRMWBinOp op,
3067  LLVMValueRef PTR, LLVMValueRef Val,
3068  LLVMAtomicOrdering ordering,
3069  LLVMBool singleThread);
3071  LLVMValueRef Cmp, LLVMValueRef New,
3072  LLVMAtomicOrdering SuccessOrdering,
3073  LLVMAtomicOrdering FailureOrdering,
3075 
3078 
3081  LLVMAtomicOrdering Ordering);
3084  LLVMAtomicOrdering Ordering);
3085 
3086 /**
3087  * @}
3088  */
3089 
3090 /**
3091  * @defgroup LLVMCCoreModuleProvider Module Providers
3092  *
3093  * @{
3094  */
3095 
3096 /**
3097  * Changes the type of M so it can be passed to FunctionPassManagers and the
3098  * JIT. They take ModuleProviders for historical reasons.
3099  */
3102 
3103 /**
3104  * Destroys the module M.
3105  */
3107 
3108 /**
3109  * @}
3110  */
3111 
3112 /**
3113  * @defgroup LLVMCCoreMemoryBuffers Memory Buffers
3114  *
3115  * @{
3116  */
3117 
3119  LLVMMemoryBufferRef *OutMemBuf,
3120  char **OutMessage);
3122  char **OutMessage);
3124  size_t InputDataLength,
3125  const char *BufferName,
3126  LLVMBool RequiresNullTerminator);
3128  size_t InputDataLength,
3129  const char *BufferName);
3130 const char *LLVMGetBufferStart(LLVMMemoryBufferRef MemBuf);
3131 size_t LLVMGetBufferSize(LLVMMemoryBufferRef MemBuf);
3133 
3134 /**
3135  * @}
3136  */
3137 
3138 /**
3139  * @defgroup LLVMCCorePassRegistry Pass Registry
3140  *
3141  * @{
3142  */
3143 
3144 /** Return the global pass registry, for use with initialization functions.
3145  @see llvm::PassRegistry::getPassRegistry */
3147 
3148 /**
3149  * @}
3150  */
3151 
3152 /**
3153  * @defgroup LLVMCCorePassManagers Pass Managers
3154  *
3155  * @{
3156  */
3157 
3158 /** Constructs a new whole-module pass pipeline. This type of pipeline is
3159  suitable for link-time optimization and whole-module transformations.
3160  @see llvm::PassManager::PassManager */
3162 
3163 /** Constructs a new function-by-function pass pipeline over the module
3164  provider. It does not take ownership of the module provider. This type of
3165  pipeline is suitable for code generation and JIT compilation tasks.
3166  @see llvm::FunctionPassManager::FunctionPassManager */
3168 
3169 /** Deprecated: Use LLVMCreateFunctionPassManagerForModule instead. */
3171 
3172 /** Initializes, executes on the provided module, and finalizes all of the
3173  passes scheduled in the pass manager. Returns 1 if any of the passes
3174  modified the module, 0 otherwise.
3175  @see llvm::PassManager::run(Module&) */
3177 
3178 /** Initializes all of the function passes scheduled in the function pass
3179  manager. Returns 1 if any of the passes modified the module, 0 otherwise.
3180  @see llvm::FunctionPassManager::doInitialization */
3182 
3183 /** Executes all of the function passes scheduled in the function pass manager
3184  on the provided function. Returns 1 if any of the passes modified the
3185  function, false otherwise.
3186  @see llvm::FunctionPassManager::run(Function&) */
3188 
3189 /** Finalizes all of the function passes scheduled in in the function pass
3190  manager. Returns 1 if any of the passes modified the module, 0 otherwise.
3191  @see llvm::FunctionPassManager::doFinalization */
3193 
3194 /** Frees the memory of a pass pipeline. For function pipelines, does not free
3195  the module provider.
3196  @see llvm::PassManagerBase::~PassManagerBase. */
3198 
3199 /**
3200  * @}
3201  */
3202 
3203 /**
3204  * @defgroup LLVMCCoreThreading Threading
3205  *
3206  * Handle the structures needed to make LLVM safe for multithreading.
3207  *
3208  * @{
3209  */
3210 
3211 /** Deprecated: Multi-threading can only be enabled/disabled with the compile
3212  time define LLVM_ENABLE_THREADS. This function always returns
3213  LLVMIsMultithreaded(). */
3215 
3216 /** Deprecated: Multi-threading can only be enabled/disabled with the compile
3217  time define LLVM_ENABLE_THREADS. */
3218 void LLVMStopMultithreaded(void);
3219 
3220 /** Check whether LLVM is executing in thread-safe mode or not.
3221  @see llvm::llvm_is_multithreaded */
3223 
3224 /**
3225  * @}
3226  */
3227 
3228 /**
3229  * @}
3230  */
3231 
3232 /**
3233  * @}
3234  */
3235 
3236 #ifdef __cplusplus
3237 }
3238 #endif
3239 
3240 #endif /* LLVM_C_CORE_H */
True if unordered or equal.
Definition: Core.h:260
LLVMValueRef LLVMConstExactSDiv(LLVMValueRef LHSConstant, LLVMValueRef RHSConstant)
Definition: Core.cpp:1226
LLVMValueRef LLVMConstInlineAsm(LLVMTypeRef Ty, const char *AsmString, const char *Constraints, LLVMBool HasSideEffects, LLVMBool IsAlignStack)
Definition: Core.cpp:1458
Subtract a value and return the old one.
Definition: Core.h:312
const char * LLVMGetBufferStart(LLVMMemoryBufferRef MemBuf)
Definition: Core.cpp:3172
void LLVMDisposeBuilder(LLVMBuilderRef Builder)
Definition: Core.cpp:2404
uint64_t CallInst * C
unsigned LLVMGetMDNodeNumOperands(LLVMValueRef V)
Obtain the number of operands from an MDNode value.
Definition: Core.cpp:905
X86 MMX.
Definition: Core.h:156
LLVMValueRef LLVMConstNamedStruct(LLVMTypeRef StructTy, LLVMValueRef *ConstantVals, unsigned Count)
Create a non-anonymous ConstantStruct from values.
Definition: Core.cpp:1073
LLVMValueRef LLVMInstructionClone(LLVMValueRef Inst)
Create a copy of &#39;this&#39; instruction that is identical in all ways except the following: ...
Definition: Core.cpp:2159
LLVMRealPredicate LLVMGetFCmpPredicate(LLVMValueRef Inst)
Obtain the float predicate of an instruction.
Definition: Core.cpp:2144
constexpr char Align[]
Key for Kernel::Arg::Metadata::mAlign.
equal
Definition: Core.h:238
Definition: Core.h:69
LLVMBasicBlockRef LLVMInsertBasicBlockInContext(LLVMContextRef C, LLVMBasicBlockRef BB, const char *Name)
Insert a basic block in a function before another basic block.
Definition: Core.cpp:2061
void LLVMGetStructElementTypes(LLVMTypeRef StructTy, LLVMTypeRef *Dest)
Get the elements within a structure.
Definition: Core.cpp:543
void LLVMGetParams(LLVMValueRef Fn, LLVMValueRef *Params)
Obtain the parameters in a function.
Definition: Core.cpp:1927
LLVMValueRef LLVMGetInitializer(LLVMValueRef GlobalVar)
Definition: Core.cpp:1699
LLVMValueRef LLVMBuildICmp(LLVMBuilderRef, LLVMIntPredicate Op, LLVMValueRef LHS, LLVMValueRef RHS, const char *Name)
Definition: Core.cpp:2945
void LLVMSetCmpXchgFailureOrdering(LLVMValueRef CmpXchgInst, LLVMAtomicOrdering Ordering)
Definition: Core.cpp:3104
unsigned LLVMGetPointerAddressSpace(LLVMTypeRef PointerTy)
Obtain the address space of a pointer type.
Definition: Core.cpp:604
LLVMBool LLVMHasPersonalityFn(LLVMValueRef Fn)
Check whether the given function has a personality function.
Definition: Core.cpp:1832
The GV is protected.
Definition: Core.h:186
LLVMValueRef LLVMBuildArrayAlloca(LLVMBuilderRef, LLVMTypeRef Ty, LLVMValueRef Val, const char *Name)
Definition: Core.cpp:2710
LLVMValueRef LLVMConstXor(LLVMValueRef LHSConstant, LLVMValueRef RHSConstant)
Definition: Core.cpp:1262
LLVMValueRef LLVMBuildZExt(LLVMBuilderRef, LLVMValueRef Val, LLVMTypeRef DestTy, const char *Name)
Definition: Core.cpp:2843
LLVMBasicBlockRef LLVMGetEntryBasicBlock(LLVMValueRef Fn)
Obtain the basic block that corresponds to the entry point of a function.
Definition: Core.cpp:2015
LLVMValueRef LLVMGetLastFunction(LLVMModuleRef M)
Obtain an iterator to the last Function in a Module.
Definition: Core.cpp:1804
LLVMValueRef LLVMConstBitCast(LLVMValueRef ConstantVal, LLVMTypeRef ToType)
Definition: Core.cpp:1368
Definition: Core.h:91
Not-And a value and return the old one.
Definition: Core.h:314
LLVMValueRef LLVMBuildAtomicCmpXchg(LLVMBuilderRef B, LLVMValueRef Ptr, LLVMValueRef Cmp, LLVMValueRef New, LLVMAtomicOrdering SuccessOrdering, LLVMAtomicOrdering FailureOrdering, LLVMBool SingleThread)
Definition: Core.cpp:3055
LLVMValueRef LLVMConstUDiv(LLVMValueRef LHSConstant, LLVMValueRef RHSConstant)
Definition: Core.cpp:1210
Externally visible function.
Definition: Core.h:161
SI Whole Quad Mode
LLVMBool LLVMTypeIsSized(LLVMTypeRef Ty)
Whether the type has a known size.
Definition: Core.cpp:353
LLVMValueRef LLVMConstSDiv(LLVMValueRef LHSConstant, LLVMValueRef RHSConstant)
Definition: Core.cpp:1221
void LLVMSetSection(LLVMValueRef Global, const char *Section)
Definition: Core.cpp:1577
True if unordered, less than, or equal.
Definition: Core.h:264
unsigned LLVMAttributeIndex
Definition: Core.h:350
The GV is visible.
Definition: Core.h:184
True if unordered or less than.
Definition: Core.h:263
struct LLVMOpaqueModule * LLVMModuleRef
The top-level container for all other LLVM Intermediate Representation (IR) objects.
Definition: Types.h:62
LLVMMemoryBufferRef LLVMCreateMemoryBufferWithMemoryRangeCopy(const char *InputData, size_t InputDataLength, const char *BufferName)
Definition: Core.cpp:3162
LLVMValueRef LLVMMDNode(LLVMValueRef *Vals, unsigned Count)
Obtain a MDNode value from the global context.
Definition: Core.cpp:878
provides both an Acquire and a Release barrier (for fences and operations which both read and write m...
Definition: Core.h:295
const char * LLVMGetAsString(LLVMValueRef c, size_t *Length)
Get the given constant data sequential as a string.
Definition: Core.cpp:1047
LLVMValueRef LLVMGetIncomingValue(LLVMValueRef PhiNode, unsigned Index)
Obtain an incoming value to a PHI node as an LLVMValueRef.
Definition: Core.cpp:2327
Definition: Core.h:60
LLVMValueRef LLVMConstIntOfString(LLVMTypeRef IntTy, const char *Text, uint8_t Radix)
Obtain a constant value for an integer parsed from a string.
struct LLVMOpaqueMemoryBuffer * LLVMMemoryBufferRef
LLVM uses a polymorphic type hierarchy which C cannot represent, therefore parameters must be passed ...
Definition: Types.h:49
void LLVMSetSuccessor(LLVMValueRef Term, unsigned i, LLVMBasicBlockRef block)
Update the specified successor to point at the provided block.
Definition: Core.cpp:2274
LLVMValueRef LLVMBuildAdd(LLVMBuilderRef, LLVMValueRef LHS, LLVMValueRef RHS, const char *Name)
Definition: Core.cpp:2522
LLVMBuilderRef LLVMCreateBuilder(void)
Definition: Core.cpp:2366
Obsolete.
Definition: Core.h:174
LLVMValueRef LLVMGetNextParam(LLVMValueRef Arg)
Obtain the next parameter to a function.
Definition: Core.cpp:1959
constexpr char IsVolatile[]
Key for Kernel::Arg::Metadata::mIsVolatile.
unsigned greater or equal
Definition: Core.h:241
LLVMValueRef LLVMBuildNUWAdd(LLVMBuilderRef, LLVMValueRef LHS, LLVMValueRef RHS, const char *Name)
Definition: Core.cpp:2532
LLVMValueRef LLVMBuildStructGEP(LLVMBuilderRef B, LLVMValueRef Pointer, unsigned Idx, const char *Name)
Definition: Core.cpp:2788
LLVMAttributeRef LLVMGetEnumAttributeAtIndex(LLVMValueRef F, LLVMAttributeIndex Idx, unsigned KindID)
Definition: Core.cpp:1889
LLVMValueRef LLVMGetNamedGlobal(LLVMModuleRef M, const char *Name)
Definition: Core.cpp:1659
LLVMBool LLVMIsOpaqueStruct(LLVMTypeRef StructTy)
Determine whether a structure is opaque.
Definition: Core.cpp:559
LLVMMemoryBufferRef LLVMCreateMemoryBufferWithMemoryRange(const char *InputData, size_t InputDataLength, const char *BufferName, LLVMBool RequiresNullTerminator)
Definition: Core.cpp:3151
LLVMValueRef LLVMGetFirstParam(LLVMValueRef Fn)
Obtain the first parameter to a function.
Definition: Core.cpp:1943
LLVMValueRef LLVMBuildSExt(LLVMBuilderRef, LLVMValueRef Val, LLVMTypeRef DestTy, const char *Name)
Definition: Core.cpp:2848
LLVMValueRef LLVMAddAlias(LLVMModuleRef M, LLVMTypeRef Ty, LLVMValueRef Aliasee, const char *Name)
Definition: Core.cpp:1776
LLVMAttributeRef LLVMCreateStringAttribute(LLVMContextRef C, const char *K, unsigned KLength, const char *V, unsigned VLength)
Create a string attribute.
Definition: Core.cpp:150
LLVMValueRef LLVMAlignOf(LLVMTypeRef Ty)
Definition: Core.cpp:1115
LLVMBool LLVMHasUnnamedAddr(LLVMValueRef Global)
Definition: Core.cpp:1601
void LLVMStopMultithreaded(void)
Deprecated: Multi-threading can only be enabled/disabled with the compile time define LLVM_ENABLE_THR...
Definition: Core.cpp:3231
LLVMOpcode
Definition: Core.h:57
A catch clause.
Definition: Core.h:270
void LLVMSetValueName(LLVMValueRef Val, const char *Name)
Set the string name of a value.
Definition: Core.cpp:657
True if unordered or not equal.
Definition: Core.h:265
LLVMValueRef LLVMConstFPToUI(LLVMValueRef ConstantVal, LLVMTypeRef ToType)
Definition: Core.cpp:1348
const char * LLVMGetGC(LLVMValueRef Fn)
Obtain the name of the garbage collector to use during code generation.
Definition: Core.cpp:1859
LLVMPassManagerRef LLVMCreateFunctionPassManager(LLVMModuleProviderRef MP)
Deprecated: Use LLVMCreateFunctionPassManagerForModule instead.
Definition: Core.cpp:3200
LLVMValueRef LLVMAddGlobal(LLVMModuleRef M, LLVMTypeRef Ty, const char *Name)
Definition: Core.cpp:1645
LLVMTypeRef LLVMGetAllocatedType(LLVMValueRef Alloca)
Obtain the type that is being allocated by the alloca instruction.
Definition: Core.cpp:2300
LLVMTypeRef LLVMHalfType(void)
Obtain a floating point type from the global context.
Definition: Core.cpp:456
LLVMValueRef LLVMBuildRet(LLVMBuilderRef, LLVMValueRef V)
Definition: Core.cpp:2433
LLVMAttributeRef LLVMCreateEnumAttribute(LLVMContextRef C, unsigned KindID, uint64_t Val)
Create an enum attribute.
Definition: Core.cpp:134
LLVMBasicBlockRef LLVMGetNextBasicBlock(LLVMBasicBlockRef BB)
Advance a basic block iterator.
Definition: Core.cpp:2035
LLVMBool LLVMCreateMemoryBufferWithContentsOfFile(const char *Path, LLVMMemoryBufferRef *OutMemBuf, char **OutMessage)
Definition: Core.cpp:3126
char * LLVMCreateMessage(const char *Message)
Definition: Core.cpp:66
LLVMPassManagerRef LLVMCreatePassManager(void)
Constructs a new whole-module pass pipeline.
Definition: Core.cpp:3192
LLVMTypeRef LLVMFP128Type(void)
Definition: Core.cpp:468
LLVMValueRef LLVMGetClause(LLVMValueRef LandingPad, unsigned Idx)
Definition: Core.cpp:2503
True if ordered and greater than or equal.
Definition: Core.h:254
LLVMValueRef LLVMBuildFPToUI(LLVMBuilderRef, LLVMValueRef Val, LLVMTypeRef DestTy, const char *Name)
Definition: Core.cpp:2853
#define LLVM_FOR_EACH_VALUE_SUBCLASS(macro)
Definition: Core.h:1186
unsigned LLVMGetVectorSize(LLVMTypeRef VectorTy)
Obtain the number of elements in a vector type.
Definition: Core.cpp:608
LLVMDiagnosticSeverity LLVMGetDiagInfoSeverity(LLVMDiagnosticInfoRef DI)
Return an enum LLVMDiagnosticSeverity.
Definition: Core.cpp:191
Definition: Core.h:82
LLVMBool LLVMIsAtomicSingleThread(LLVMValueRef AtomicInst)
Definition: Core.cpp:3068
const char * LLVMGetDataLayoutStr(LLVMModuleRef M)
Obtain the data layout for a module.
Definition: Core.cpp:239
LLVMValueRef LLVMBuildCondBr(LLVMBuilderRef, LLVMValueRef If, LLVMBasicBlockRef Then, LLVMBasicBlockRef Else)
Definition: Core.cpp:2446
Definition: Core.h:111
LLVMTypeRef LLVMX86MMXType(void)
Definition: Core.cpp:474
Definition: Core.h:98
LLVMValueRef LLVMBuildFNeg(LLVMBuilderRef, LLVMValueRef V, const char *Name)
Definition: Core.cpp:2673
LLVMValueRef LLVMBuildTruncOrBitCast(LLVMBuilderRef, LLVMValueRef Val, LLVMTypeRef DestTy, const char *Name)
Definition: Core.cpp:2915
struct LLVMOpaquePassRegistry * LLVMPassRegistryRef
Definition: Types.h:117
unsigned LLVMGetNumArgOperands(LLVMValueRef Instr)
Obtain the argument count for a call instruction.
Definition: Core.cpp:2167
struct LLVMOpaqueBuilder * LLVMBuilderRef
Represents an LLVM basic block builder.
Definition: Types.h:97
LLVMValueRef LLVMBuildSDiv(LLVMBuilderRef, LLVMValueRef LHS, LLVMValueRef RHS, const char *Name)
Definition: Core.cpp:2592
unsigned LLVMGetLastEnumAttributeKind(void)
Definition: Core.cpp:130
LLVMTypeRef LLVMX86FP80Type(void)
Definition: Core.cpp:465
LLVMUseRef LLVMGetFirstUse(LLVMValueRef Val)
Obtain the first use of a value.
Definition: Core.cpp:740
LLVMValueRef LLVMConstRealOfStringAndSize(LLVMTypeRef RealTy, const char *Text, unsigned SLen)
Obtain a constant for a floating point value parsed from a string.
void LLVMClearInsertionPosition(LLVMBuilderRef Builder)
Definition: Core.cpp:2391
LLVMValueRef LLVMGetNextGlobal(LLVMValueRef GlobalVar)
Definition: Core.cpp:1679
F(f)
LLVMTypeRef LLVMVectorType(LLVMTypeRef ElementType, unsigned ElementCount)
Create a vector type that contains a defined type and has a specific number of elements.
Definition: Core.cpp:585
LLVMValueRef LLVMConstAnd(LLVMValueRef LHSConstant, LLVMValueRef RHSConstant)
Definition: Core.cpp:1252
unsigned LLVMGetMDKindIDInContext(LLVMContextRef C, const char *Name, unsigned SLen)
Definition: Core.cpp:114
LLVMPassRegistryRef LLVMGetGlobalPassRegistry(void)
Return the global pass registry, for use with initialization functions.
Definition: Core.cpp:3186
LLVMValueRef LLVMBuildCast(LLVMBuilderRef B, LLVMOpcode Op, LLVMValueRef Val, LLVMTypeRef DestTy, const char *Name)
Definition: Core.cpp:2921
LLVMValueRef LLVMBuildFRem(LLVMBuilderRef, LLVMValueRef LHS, LLVMValueRef RHS, const char *Name)
Definition: Core.cpp:2617
LLVMValueRef LLVMConstSelect(LLVMValueRef ConstantCondition, LLVMValueRef ConstantIfTrue, LLVMValueRef ConstantIfFalse)
Definition: Core.cpp:1414
LLVMValueRef LLVMConstTrunc(LLVMValueRef ConstantVal, LLVMTypeRef ToType)
Definition: Core.cpp:1313
LLVMBool LLVMValueIsBasicBlock(LLVMValueRef Val)
Determine whether an LLVMValueRef is itself a basic block.
Definition: Core.cpp:1985
LLVMTypeRef LLVMStructTypeInContext(LLVMContextRef C, LLVMTypeRef *ElementTypes, unsigned ElementCount, LLVMBool Packed)
Create a new structure type in a context.
Definition: Core.cpp:508
Hexagon Common GEP
LLVMBasicBlockRef LLVMInsertBasicBlock(LLVMBasicBlockRef InsertBeforeBB, const char *Name)
Insert a basic block in a function using the global context.
Definition: Core.cpp:2068
int LLVMHasMetadata(LLVMValueRef Val)
Determine whether an instruction has any metadata attached.
Definition: Core.cpp:683
const char * LLVMGetSection(LLVMValueRef Global)
Definition: Core.cpp:1571
LLVMTypeRef LLVMInt16TypeInContext(LLVMContextRef C)
Definition: Core.cpp:390
LLVMValueRef LLVMMDNodeInContext(LLVMContextRef C, LLVMValueRef *Vals, unsigned Count)
Obtain a MDNode value from a context.
Definition: Core.cpp:851
LLVMTypeRef LLVMTokenTypeInContext(LLVMContextRef C)
Create a token type in a context.
Definition: Core.cpp:620
#define op(i)
LLVMValueRef LLVMBuildFence(LLVMBuilderRef B, LLVMAtomicOrdering ordering, LLVMBool singleThread, const char *Name)
Definition: Core.cpp:2764
LLVMAttributeRef LLVMGetStringAttributeAtIndex(LLVMValueRef F, LLVMAttributeIndex Idx, const char *K, unsigned KLen)
Definition: Core.cpp:1896
LLVMAtomicRMWBinOp
Definition: Core.h:309
LLVMValueRef LLVMConstAddrSpaceCast(LLVMValueRef ConstantVal, LLVMTypeRef ToType)
Definition: Core.cpp:1373
Lowest level of atomicity, guarantees somewhat sane results, lock free.
Definition: Core.h:284
void LLVMContextDispose(LLVMContextRef C)
Destroy a context instance.
Definition: Core.cpp:110
128 bit floating point type (112-bit mantissa)
Definition: Core.h:146
Definition: Core.h:85
void LLVMSetGlobalConstant(LLVMValueRef GlobalVar, LLVMBool IsConstant)
Definition: Core.cpp:1723
void LLVMSetThreadLocal(LLVMValueRef GlobalVar, LLVMBool IsThreadLocal)
Definition: Core.cpp:1715
void LLVMSetModuleIdentifier(LLVMModuleRef M, const char *Ident, size_t Len)
Set the identifier of a module to a string Ident with length Len.
Definition: Core.cpp:233
ExternalWeak linkage description.
Definition: Core.h:176
LLVMValueRef LLVMConstNull(LLVMTypeRef Ty)
Obtain a constant value referring to the null instance of a type.
Definition: Core.cpp:808
LLVMLandingPadClauseTy
Definition: Core.h:269
LLVMValueRef LLVMConstReal(LLVMTypeRef RealTy, double N)
Obtain a constant value referring to a double floating point value.
Definition: Core.cpp:980
LLVMValueRef LLVMBuildPointerCast(LLVMBuilderRef, LLVMValueRef Val, LLVMTypeRef DestTy, const char *Name)
Definition: Core.cpp:2927
LLVMBool LLVMInitializeFunctionPassManager(LLVMPassManagerRef FPM)
Initializes all of the function passes scheduled in the function pass manager.
Definition: Core.cpp:3209
void LLVMRemoveCallSiteStringAttribute(LLVMValueRef C, LLVMAttributeIndex Idx, const char *K, unsigned KLen)
Definition: Core.cpp:2227
void LLVMSetOperand(LLVMValueRef User, unsigned Index, LLVMValueRef Val)
Set an operand at a specific index in a llvm::User value.
Definition: Core.cpp:794
long long LLVMConstIntGetSExtValue(LLVMValueRef ConstantVal)
Obtain the sign extended value for an integer constant value.
Definition: Core.cpp:997
void(* LLVMYieldCallback)(LLVMContextRef, void *)
Definition: Core.h:381
void LLVMSetInstrParamAlignment(LLVMValueRef Instr, unsigned index, unsigned Align)
Definition: Core.cpp:2180
LLVMTypeRef LLVMStructGetTypeAtIndex(LLVMTypeRef StructTy, unsigned i)
Get the type of the element at a given index in the structure.
Definition: Core.cpp:550
LLVMOpcode LLVMGetInstructionOpcode(LLVMValueRef Inst)
Obtain the code opcode for an individual instruction.
Definition: Core.cpp:2153
LLVMTypeRef LLVMFP128TypeInContext(LLVMContextRef C)
Obtain a 128-bit floating point type (112-bit mantissa) from a context.
Definition: Core.cpp:446
const char * LLVMGetStructName(LLVMTypeRef Ty)
Obtain the name of a structure.
Definition: Core.cpp:525
LLVMBasicBlockRef LLVMGetLastBasicBlock(LLVMValueRef Fn)
Obtain the last basic block in a function.
Definition: Core.cpp:2027
Same, but only replaced by something equivalent.
Definition: Core.h:168
void * PointerTy
Definition: GenericValue.h:22
LLVMValueRef LLVMBasicBlockAsValue(LLVMBasicBlockRef BB)
Convert a basic block instance to a value type.
Definition: Core.cpp:1981
LLVMTypeRef LLVMLabelTypeInContext(LLVMContextRef C)
Create a label type in a context.
Definition: Core.cpp:617
LLVMMetadataRef LLVMValueAsMetadata(LLVMValueRef Val)
Obtain a Value as a Metadata.
Definition: Core.cpp:886
LLVMTypeRef LLVMDoubleTypeInContext(LLVMContextRef C)
Obtain a 64-bit floating point type from a context.
Definition: Core.cpp:440
LLVMValueRef LLVMConstVector(LLVMValueRef *ScalarConstantVals, unsigned Size)
Create a ConstantVector from values.
Definition: Core.cpp:1082
Set the new value and return the one old.
Definition: Core.h:310
LLVMValueRef LLVMBuildExactSDiv(LLVMBuilderRef, LLVMValueRef LHS, LLVMValueRef RHS, const char *Name)
Definition: Core.cpp:2597
LLVMValueRef LLVMSizeOf(LLVMTypeRef Ty)
Definition: Core.cpp:1119
LLVMBool LLVMIsNull(LLVMValueRef Val)
Determine whether a value instance is null.
Definition: Core.cpp:824
LLVMValueRef LLVMConstShuffleVector(LLVMValueRef VectorAConstant, LLVMValueRef VectorBConstant, LLVMValueRef MaskConstant)
Definition: Core.cpp:1436
LLVMBasicBlockRef LLVMGetSwitchDefaultDest(LLVMValueRef SwitchInstr)
Obtain the default destination basic block of a switch instruction.
Definition: Core.cpp:2294
LLVMValueRef LLVMConstRealOfString(LLVMTypeRef RealTy, const char *Text)
Obtain a constant for a floating point value parsed from a string.
Definition: Core.cpp:984
LLVMValueRef LLVMBuildAggregateRet(LLVMBuilderRef, LLVMValueRef *RetVals, unsigned N)
Definition: Core.cpp:2437
Sets the value if it&#39;s greater than the original using an unsigned comparison and return the old one...
Definition: Core.h:323
Add a value and return the old one.
Definition: Core.h:311
void LLVMPositionBuilder(LLVMBuilderRef Builder, LLVMBasicBlockRef Block, LLVMValueRef Instr)
Definition: Core.cpp:2370
LLVMTypeRef LLVMInt8TypeInContext(LLVMContextRef C)
Definition: Core.cpp:387
unsigned LLVMGetFunctionCallConv(LLVMValueRef Fn)
Obtain the calling function of a function.
Definition: Core.cpp:1850
LLVMValueRef LLVMConstIntCast(LLVMValueRef ConstantVal, LLVMTypeRef ToType, LLVMBool isSigned)
Definition: Core.cpp:1403
LLVMValueRef LLVMConstNUWAdd(LLVMValueRef LHSConstant, LLVMValueRef RHSConstant)
Definition: Core.cpp:1155
void LLVMSetDataLayout(LLVMModuleRef M, const char *DataLayoutStr)
Set the data layout for a module.
Definition: Core.cpp:247
LLVMValueRef LLVMConstFSub(LLVMValueRef LHSConstant, LLVMValueRef RHSConstant)
Definition: Core.cpp:1183
unsigned LLVMGetIntTypeWidth(LLVMTypeRef IntegerTy)
Definition: Core.cpp:428
LLVMBool LLVMIsExternallyInitialized(LLVMValueRef GlobalVar)
Definition: Core.cpp:1766
Pointers.
Definition: Core.h:153
LLVMValueRef LLVMConstAShr(LLVMValueRef LHSConstant, LLVMValueRef RHSConstant)
Definition: Core.cpp:1291
LLVMValueRef LLVMGetBasicBlockParent(LLVMBasicBlockRef BB)
Obtain the function to which a basic block belongs.
Definition: Core.cpp:1997
void LLVMSetCondition(LLVMValueRef Branch, LLVMValueRef Cond)
Set the condition of a branch instruction.
Definition: Core.cpp:2288
LLVMValueRef LLVMGetLastParam(LLVMValueRef Fn)
Obtain the last parameter to a function.
Definition: Core.cpp:1951
LLVMValueRef LLVMConstICmp(LLVMIntPredicate Predicate, LLVMValueRef LHSConstant, LLVMValueRef RHSConstant)
Definition: Core.cpp:1267
LLVMValueRef LLVMGetUndef(LLVMTypeRef Ty)
Obtain a constant value referring to an undefined value of a type.
Definition: Core.cpp:816
Rename collisions when linking (static functions)
Definition: Core.h:171
uint64_t LLVMGetEnumAttributeValue(LLVMAttributeRef A)
Get the enum attribute&#39;s value.
Definition: Core.cpp:143
LLVMBool LLVMIsCleanup(LLVMValueRef LandingPad)
Definition: Core.cpp:2512
void LLVMGetSubtypes(LLVMTypeRef Tp, LLVMTypeRef *Arr)
Returns type&#39;s subtypes.
Definition: Core.cpp:569
not equal
Definition: Core.h:239
Arrays.
Definition: Core.h:152
void LLVMSetVisibility(LLVMValueRef Global, LLVMVisibility Viz)
Definition: Core.cpp:1586
void LLVMSetNormalDest(LLVMValueRef InvokeInst, LLVMBasicBlockRef B)
Set the normal destination basic block.
Definition: Core.cpp:2256
LLVMValueRef LLVMConstSExt(LLVMValueRef ConstantVal, LLVMTypeRef ToType)
Definition: Core.cpp:1318
void LLVMContextSetDiagnosticHandler(LLVMContextRef C, LLVMDiagnosticHandler Handler, void *DiagnosticContext)
Set the diagnostic handler for this context.
Definition: Core.cpp:85
LLVMValueRef LLVMGetPreviousGlobal(LLVMValueRef GlobalVar)
Definition: Core.cpp:1687
LLVMValueRef LLVMBuildNSWAdd(LLVMBuilderRef, LLVMValueRef LHS, LLVMValueRef RHS, const char *Name)
Definition: Core.cpp:2527
LLVMBool LLVMIsStringAttribute(LLVMAttributeRef A)
Definition: Core.cpp:176
SIMD &#39;packed&#39; format, or other vector type.
Definition: Core.h:154
LLVMValueRef LLVMGetFirstInstruction(LLVMBasicBlockRef BB)
Obtain the first instruction in a basic block.
Definition: Core.cpp:2095
LLVMTypeRef LLVMFloatType(void)
Definition: Core.cpp:459
void LLVMDisposeMessage(char *Message)
Definition: Core.cpp:70
A load or store which is not atomic.
Definition: Core.h:283
LLVMValueRef LLVMConstFPCast(LLVMValueRef ConstantVal, LLVMTypeRef ToType)
Definition: Core.cpp:1409
LLVMValueRef LLVMBuildSRem(LLVMBuilderRef, LLVMValueRef LHS, LLVMValueRef RHS, const char *Name)
Definition: Core.cpp:2612
struct LLVMOpaqueType * LLVMTypeRef
Each value in the LLVM IR has a type, an LLVMTypeRef.
Definition: Types.h:69
True if ordered and operands are unequal.
Definition: Core.h:257
LLVMValueRef LLVMGetPreviousInstruction(LLVMValueRef Inst)
Obtain the instruction that occurred before this one.
Definition: Core.cpp:2119
True if ordered and equal.
Definition: Core.h:252
void LLVMContextSetYieldCallback(LLVMContextRef C, LLVMYieldCallback Callback, void *OpaqueHandle)
Set the yield callback function for this context.
Definition: Core.cpp:103
signed greater than
Definition: Core.h:244
void LLVMMoveBasicBlockBefore(LLVMBasicBlockRef BB, LLVMBasicBlockRef MovePos)
Move a basic block to before another one.
Definition: Core.cpp:2081
LLVMValueRef LLVMConstInsertElement(LLVMValueRef VectorConstant, LLVMValueRef ElementValueConstant, LLVMValueRef IndexConstant)
Definition: Core.cpp:1428
void LLVMGetParamTypes(LLVMTypeRef FunctionTy, LLVMTypeRef *Dest)
Obtain the types of a function&#39;s parameters.
Definition: Core.cpp:499
char * LLVMPrintModuleToString(LLVMModuleRef M)
Return a string representation of the module.
Definition: Core.cpp:287
LLVMValueRef LLVMMetadataAsValue(LLVMContextRef C, LLVMMetadataRef MD)
Obtain a Metadata as a Value.
Definition: Core.cpp:882
void LLVMDisposeModule(LLVMModuleRef M)
Destroy a module instance.
Definition: Core.cpp:223
void LLVMSetInstDebugLocation(LLVMBuilderRef Builder, LLVMValueRef Inst)
Definition: Core.cpp:2422
LLVMBool LLVMIsGlobalConstant(LLVMValueRef GlobalVar)
Definition: Core.cpp:1719
LLVMValueRef LLVMConstStructInContext(LLVMContextRef C, LLVMValueRef *ConstantVals, unsigned Count, LLVMBool Packed)
Create an anonymous ConstantStruct with the specified values.
Definition: Core.cpp:1059
LLVMBool LLVMIsTailCall(LLVMValueRef CallInst)
Obtain whether a call instruction is a tail call.
Definition: Core.cpp:2238
LLVMValueRef LLVMBlockAddress(LLVMValueRef F, LLVMBasicBlockRef BB)
Definition: Core.cpp:1466
Definition: Core.h:83
LLVMValueRef LLVMConstZExtOrBitCast(LLVMValueRef ConstantVal, LLVMTypeRef ToType)
Definition: Core.cpp:1379
LLVMValueKind
Definition: Core.h:205
LLVMValueRef LLVMConstGEP(LLVMValueRef ConstantVal, LLVMValueRef *ConstantIndices, unsigned NumIndices)
Definition: Core.cpp:1296
struct LLVMOpaqueUse * LLVMUseRef
Used to get the users and usees of a Value.
Definition: Types.h:123
LLVMValueRef LLVMConstInBoundsGEP(LLVMValueRef ConstantVal, LLVMValueRef *ConstantIndices, unsigned NumIndices)
Definition: Core.cpp:1304
Keep one copy of function when linking (inline)
Definition: Core.h:163
LLVMValueRef LLVMBuildOr(LLVMBuilderRef, LLVMValueRef LHS, LLVMValueRef RHS, const char *Name)
Definition: Core.cpp:2642
void LLVMDeleteFunction(LLVMValueRef Fn)
Remove a function from its containing module and deletes it.
Definition: Core.cpp:1828
void LLVMRemoveCallSiteEnumAttribute(LLVMValueRef C, LLVMAttributeIndex Idx, unsigned KindID)
Definition: Core.cpp:2221
struct LLVMOpaqueContext * LLVMContextRef
The top-level container for all LLVM global data.
Definition: Types.h:54
LLVMValueRef LLVMBuildFDiv(LLVMBuilderRef, LLVMValueRef LHS, LLVMValueRef RHS, const char *Name)
Definition: Core.cpp:2602
LLVMValueRef LLVMConstFPToSI(LLVMValueRef ConstantVal, LLVMTypeRef ToType)
Definition: Core.cpp:1353
OR a value and return the old one.
Definition: Core.h:315
LLVMBasicBlockRef LLVMGetPreviousBasicBlock(LLVMBasicBlockRef BB)
Go backwards in a basic block iterator.
Definition: Core.cpp:2043
LLVMValueRef LLVMGetFirstGlobal(LLVMModuleRef M)
Definition: Core.cpp:1663
void LLVMDumpModule(LLVMModuleRef M)
Dump a representation of a module to stderr.
Definition: Core.cpp:260
Function to be imported from DLL.
Definition: Core.h:191
unsigned LLVMCountIncoming(LLVMValueRef PhiNode)
Obtain the number of incoming basic blocks to a PHI node.
Definition: Core.cpp:2323
unsigned greater than
Definition: Core.h:240
LLVMValueRef LLVMBuildIntCast(LLVMBuilderRef, LLVMValueRef Val, LLVMTypeRef DestTy, const char *Name)
Definition: Core.cpp:2932
LLVMTypeRef LLVMFloatTypeInContext(LLVMContextRef C)
Obtain a 32-bit floating point type from a context.
Definition: Core.cpp:437
unsigned long long LLVMConstIntGetZExtValue(LLVMValueRef ConstantVal)
Obtain the zero extended value for an integer constant value.
Definition: Core.cpp:993
Definition: Core.h:87
void LLVMGetMDNodeOperands(LLVMValueRef V, LLVMValueRef *Dest)
Obtain the given MDNode&#39;s operands.
Definition: Core.cpp:912
LLVMValueRef LLVMConstFMul(LLVMValueRef LHSConstant, LLVMValueRef RHSConstant)
Definition: Core.cpp:1205
LLVMValueRef LLVMGetLastInstruction(LLVMBasicBlockRef BB)
Obtain the last instruction in a basic block.
Definition: Core.cpp:2103
LLVMValueRef LLVMBuildSub(LLVMBuilderRef, LLVMValueRef LHS, LLVMValueRef RHS, const char *Name)
Definition: Core.cpp:2542
LLVMUseRef LLVMGetNextUse(LLVMUseRef U)
Obtain the next use of a value.
Definition: Core.cpp:748
LLVMValueRef LLVMAddFunction(LLVMModuleRef M, const char *Name, LLVMTypeRef FunctionTy)
Add a function to a module under a specified name.
Definition: Core.cpp:1786
LLVMValueRef LLVMBuildFAdd(LLVMBuilderRef, LLVMValueRef LHS, LLVMValueRef RHS, const char *Name)
Definition: Core.cpp:2537
Keep one copy of function when linking (weak)
Definition: Core.h:167
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.
unsigned LLVMCountParamTypes(LLVMTypeRef FunctionTy)
Obtain the number of parameters this function accepts.
Definition: Core.cpp:495
LLVMIntPredicate
Definition: Core.h:237
constexpr char Attrs[]
Key for Kernel::Metadata::mAttrs.
LLVMValueRef LLVMBuildNUWSub(LLVMBuilderRef, LLVMValueRef LHS, LLVMValueRef RHS, const char *Name)
Definition: Core.cpp:2552
struct LLVMOpaqueAttributeRef * LLVMAttributeRef
Used to represent an attributes.
Definition: Types.h:130
LLVMValueRef LLVMBuildPtrToInt(LLVMBuilderRef, LLVMValueRef Val, LLVMTypeRef DestTy, const char *Name)
Definition: Core.cpp:2883
LLVMDiagnosticSeverity
Definition: Core.h:331
LLVMTypeRef LLVMStructCreateNamed(LLVMContextRef C, const char *Name)
Create an empty structure in a context having a specified name.
Definition: Core.cpp:520
LLVMValueRef LLVMConstInt(LLVMTypeRef IntTy, unsigned long long N, LLVMBool SignExtend)
Obtain a constant value for an integer type.
Definition: Core.cpp:954
size_t LLVMGetBufferSize(LLVMMemoryBufferRef MemBuf)
Definition: Core.cpp:3176
LLVMValueRef LLVMBuildAnd(LLVMBuilderRef, LLVMValueRef LHS, LLVMValueRef RHS, const char *Name)
Definition: Core.cpp:2637
void LLVMSetCmpXchgSuccessOrdering(LLVMValueRef CmpXchgInst, LLVMAtomicOrdering Ordering)
Definition: Core.cpp:3091
void LLVMSetLinkage(LLVMValueRef Global, LLVMLinkage Linkage)
Definition: Core.cpp:1509
Definition: Core.h:75
unsigned LLVMGetIntrinsicID(LLVMValueRef Fn)
Obtain the ID number from a function instance.
Definition: Core.cpp:1844
void LLVMAddTargetDependentFunctionAttr(LLVMValueRef Fn, const char *A, const char *V)
Add a target-dependent attribute to a function.
Definition: Core.cpp:1912
LLVMBasicBlockRef LLVMGetInstructionParent(LLVMValueRef Inst)
Obtain the basic block to which an instruction belongs.
Definition: Core.cpp:2091
LLVMTypeRef LLVMInt64TypeInContext(LLVMContextRef C)
Definition: Core.cpp:396
LLVMValueRef LLVMGetLastGlobal(LLVMModuleRef M)
Definition: Core.cpp:1671
const char * LLVMGetBasicBlockName(LLVMBasicBlockRef BB)
Obtain the string name of a basic block.
Definition: Core.cpp:1993
LLVMAttributeRef LLVMGetCallSiteStringAttribute(LLVMValueRef C, LLVMAttributeIndex Idx, const char *K, unsigned KLen)
Definition: Core.cpp:2214
LLVMValueRef LLVMConstAdd(LLVMValueRef LHSConstant, LLVMValueRef RHSConstant)
Definition: Core.cpp:1144
unsigned LLVMGetArrayLength(LLVMTypeRef ArrayTy)
Obtain the length of an array type.
Definition: Core.cpp:600
void LLVMDisposePassManager(LLVMPassManagerRef PM)
Frees the memory of a pass pipeline.
Definition: Core.cpp:3221
LLVMValueRef LLVMBuildIsNull(LLVMBuilderRef, LLVMValueRef Val, const char *Name)
Definition: Core.cpp:3017
void LLVMSetVolatile(LLVMValueRef MemoryAccessInst, LLVMBool IsVolatile)
Definition: Core.cpp:2810
LLVMTypeRef LLVMVoidTypeInContext(LLVMContextRef C)
Create a void type in a context.
Definition: Core.cpp:614
True if unordered, greater than, or equal.
Definition: Core.h:262
void LLVMSetUnnamedAddr(LLVMValueRef Global, LLVMBool HasUnnamedAddr)
Definition: Core.cpp:1605
LLVMValueRef LLVMConstNSWAdd(LLVMValueRef LHSConstant, LLVMValueRef RHSConstant)
Definition: Core.cpp:1149
LLVMValueRef LLVMConstNSWNeg(LLVMValueRef ConstantVal)
Definition: Core.cpp:1127
void LLVMSetTarget(LLVMModuleRef M, const char *Triple)
Set the target triple for a module.
Definition: Core.cpp:256
LLVMBasicBlockRef LLVMGetFirstBasicBlock(LLVMValueRef Fn)
Obtain the first basic block in a function.
Definition: Core.cpp:2019
LLVMTypeRef LLVMMetadataTypeInContext(LLVMContextRef C)
Create a metadata type in a context.
Definition: Core.cpp:623
LLVMValueRef LLVMBuildNUWNeg(LLVMBuilderRef B, LLVMValueRef V, const char *Name)
Definition: Core.cpp:2668
void LLVMSetCurrentDebugLocation(LLVMBuilderRef Builder, LLVMValueRef L)
Definition: Core.cpp:2410
const unsigned * LLVMGetIndices(LLVMValueRef Inst)
Obtain the indices as an array.
Definition: Core.cpp:2349
signed less than
Definition: Core.h:246
void LLVMPositionBuilderAtEnd(LLVMBuilderRef Builder, LLVMBasicBlockRef Block)
Definition: Core.cpp:2382
void LLVMStructSetBody(LLVMTypeRef StructTy, LLVMTypeRef *ElementTypes, unsigned ElementCount, LLVMBool Packed)
Set the contents of a structure type.
Definition: Core.cpp:533
LLVMValueRef LLVMBuildShl(LLVMBuilderRef, LLVMValueRef LHS, LLVMValueRef RHS, const char *Name)
Definition: Core.cpp:2622
Function to be accessible from DLL.
Definition: Core.h:192
Acquire provides a barrier of the sort necessary to acquire a lock to access other memory with normal...
Definition: Core.h:289
LLVMTypeKind
Definition: Core.h:140
static GCRegistry::Add< OcamlGC > B("ocaml", "ocaml 3.10-compatible GC")
LLVMValueRef LLVMBuildInsertElement(LLVMBuilderRef, LLVMValueRef VecVal, LLVMValueRef EltVal, LLVMValueRef Index, const char *Name)
Definition: Core.cpp:2991
LLVMValueRef LLVMBuildAlloca(LLVMBuilderRef, LLVMTypeRef Ty, const char *Name)
Definition: Core.cpp:2705
LLVMAtomicOrdering
Definition: Core.h:282
LLVMTypeRef LLVMInt32Type(void)
Definition: Core.cpp:415
void LLVMGetAttributesAtIndex(LLVMValueRef F, LLVMAttributeIndex Idx, LLVMAttributeRef *Attrs)
Definition: Core.cpp:1882
LLVMValueRef LLVMBuildPhi(LLVMBuilderRef, LLVMTypeRef Ty, const char *Name)
Definition: Core.cpp:2961
LLVMValueRef LLVMIsAMDString(LLVMValueRef Val)
Definition: Core.cpp:732
Sets the value if it&#39;s greater than the original using an unsigned comparison and return the old one...
Definition: Core.h:326
LLVMValueRef LLVMGetMetadata(LLVMValueRef Val, unsigned KindID)
Return metadata associated with an instruction value.
Definition: Core.cpp:687
void LLVMAddClause(LLVMValueRef LandingPad, LLVMValueRef ClauseVal)
Definition: Core.cpp:2507
unsigned LLVMCountBasicBlocks(LLVMValueRef Fn)
Obtain the number of basic blocks in a function.
Definition: Core.cpp:2005
LLVMBool LLVMIsPackedStruct(LLVMTypeRef StructTy)
Determine whether a structure is packed.
Definition: Core.cpp:555
void LLVMReplaceAllUsesWith(LLVMValueRef OldVal, LLVMValueRef NewVal)
Replace all uses of a value with another one.
Definition: Core.cpp:679
LLVMValueRef LLVMBuildFPToSI(LLVMBuilderRef, LLVMValueRef Val, LLVMTypeRef DestTy, const char *Name)
Definition: Core.cpp:2858
LLVMBool LLVMStartMultithreaded(void)
Deprecated: Multi-threading can only be enabled/disabled with the compile time define LLVM_ENABLE_THR...
Definition: Core.cpp:3227
LLVMDiagnosticHandler LLVMContextGetDiagnosticHandler(LLVMContextRef C)
Get the diagnostic handler of this context.
Definition: Core.cpp:94
LLVMContextRef LLVMGetModuleContext(LLVMModuleRef M)
Obtain the context to which this module is associated.
Definition: Core.cpp:304
LLVMValueRef LLVMConstFDiv(LLVMValueRef LHSConstant, LLVMValueRef RHSConstant)
Definition: Core.cpp:1232
True if unordered or greater than.
Definition: Core.h:261
#define LLVM_DECLARE_VALUE_CAST(name)
Convert value instances between types.
Definition: Core.h:1347
LLVMValueRef LLVMBuildNSWSub(LLVMBuilderRef, LLVMValueRef LHS, LLVMValueRef RHS, const char *Name)
Definition: Core.cpp:2547
LLVMValueRef LLVMGetNamedFunction(LLVMModuleRef M, const char *Name)
Obtain a Function value from a Module by its name.
Definition: Core.cpp:1792
LLVMValueRef LLVMConstFNeg(LLVMValueRef ConstantVal)
Definition: Core.cpp:1136
unsigned LLVMCountStructElementTypes(LLVMTypeRef StructTy)
Get the number of elements defined inside the structure.
Definition: Core.cpp:539
LLVMThreadLocalMode LLVMGetThreadLocalMode(LLVMValueRef GlobalVar)
Definition: Core.cpp:1727
Definition: Core.h:77
LLVMValueRef LLVMBuildSIToFP(LLVMBuilderRef, LLVMValueRef Val, LLVMTypeRef DestTy, const char *Name)
Definition: Core.cpp:2868
Definition: Core.h:114
char * LLVMPrintValueToString(LLVMValueRef Val)
Return a string representation of the value.
Definition: Core.cpp:665
LLVMModuleRef LLVMCloneModule(LLVMModuleRef M)
Return an exact copy of the specified module.
LLVMValueRef LLVMBuildExtractElement(LLVMBuilderRef, LLVMValueRef VecVal, LLVMValueRef Index, const char *Name)
Definition: Core.cpp:2985
LLVMValueRef LLVMBuildFMul(LLVMBuilderRef, LLVMValueRef LHS, LLVMValueRef RHS, const char *Name)
Definition: Core.cpp:2577
void LLVMSetDLLStorageClass(LLVMValueRef Global, LLVMDLLStorageClass Class)
Definition: Core.cpp:1596
LLVMTypeRef LLVMPPCFP128TypeInContext(LLVMContextRef C)
Obtain a 128-bit floating point type (two 64-bits) from a context.
Definition: Core.cpp:449
80 bit floating point type (X87)
Definition: Core.h:145
LLVMValueRef LLVMBuildPtrDiff(LLVMBuilderRef, LLVMValueRef LHS, LLVMValueRef RHS, const char *Name)
Definition: Core.cpp:3027
Definition: Core.h:96
LLVMValueRef LLVMBuildInBoundsGEP(LLVMBuilderRef B, LLVMValueRef Pointer, LLVMValueRef *Indices, unsigned NumIndices, const char *Name)
Definition: Core.cpp:2780
LLVMValueRef LLVMConstNUWMul(LLVMValueRef LHSConstant, LLVMValueRef RHSConstant)
Definition: Core.cpp:1199
LLVMValueRef LLVMConstExtractValue(LLVMValueRef AggConstant, unsigned *IdxList, unsigned NumIdx)
Definition: Core.cpp:1444
LLVMValueRef LLVMBuildExactUDiv(LLVMBuilderRef, LLVMValueRef LHS, LLVMValueRef RHS, const char *Name)
Definition: Core.cpp:2587
void LLVMAddDestination(LLVMValueRef IndirectBr, LLVMBasicBlockRef Dest)
Definition: Core.cpp:2495
LLVMValueRef LLVMConstOr(LLVMValueRef LHSConstant, LLVMValueRef RHSConstant)
Definition: Core.cpp:1257
unsigned LLVMGetNumContainedTypes(LLVMTypeRef Tp)
Return the number of types in the derived type.
Definition: Core.cpp:596
void LLVMInstructionEraseFromParent(LLVMValueRef Inst)
Remove and delete an instruction.
Definition: Core.cpp:2131
LLVMUseRef LLVMGetOperandUse(LLVMValueRef Val, unsigned Index)
Obtain the use of an operand at a specific index in a llvm::User value.
Definition: Core.cpp:789
void LLVMMoveBasicBlockAfter(LLVMBasicBlockRef BB, LLVMBasicBlockRef MovePos)
Move a basic block to after another one.
Definition: Core.cpp:2085
LLVMValueRef LLVMGetUsedValue(LLVMUseRef U)
Obtain the value this use corresponds to.
Definition: Core.cpp:759
LLVMTypeRef LLVMArrayType(LLVMTypeRef ElementType, unsigned ElementCount)
Create a fixed size array type that refers to a specific type.
Definition: Core.cpp:577
Definition: Core.h:74
LLVMValueRef LLVMGetElementAsConstant(LLVMValueRef C, unsigned idx)
Get an element at specified index as a constant.
Definition: Core.cpp:1039
LLVMBool LLVMIsUndef(LLVMValueRef Val)
Determine whether a value instance is undefined.
Definition: Core.cpp:830
char * LLVMGetDiagInfoDescription(LLVMDiagnosticInfoRef DI)
Return a string representation of the DiagnosticInfo.
Definition: Core.cpp:180
void LLVMSetParamAlignment(LLVMValueRef Arg, unsigned Align)
Set the alignment for a function parameter.
Definition: Core.cpp:1974
LLVMValueRef LLVMMDStringInContext(LLVMContextRef C, const char *Str, unsigned SLen)
Obtain a MDString value from a context.
Definition: Core.cpp:840
LLVMValueRef LLVMBuildResume(LLVMBuilderRef B, LLVMValueRef Exn)
Definition: Core.cpp:2482
LLVMValueRef LLVMConstString(const char *Str, unsigned Length, LLVMBool DontNullTerminate)
Create a ConstantDataSequential with string content in the global context.
Definition: Core.cpp:1033
LLVMTypeRef LLVMIntTypeInContext(LLVMContextRef C, unsigned NumBits)
Definition: Core.cpp:402
Functions.
Definition: Core.h:150
LLVMBasicBlockRef LLVMGetSuccessor(LLVMValueRef Term, unsigned i)
Return the specified successor.
Definition: Core.cpp:2270
LLVMValueRef LLVMMDString(const char *Str, unsigned SLen)
Obtain a MDString value from the global context.
Definition: Core.cpp:847
LLVMValueRef LLVMConstSRem(LLVMValueRef LHSConstant, LLVMValueRef RHSConstant)
Definition: Core.cpp:1242
Definition: Core.h:76
LLVMValueRef LLVMBuildUnreachable(LLVMBuilderRef)
Definition: Core.cpp:2486
True if ordered and less than.
Definition: Core.h:255
LLVMValueRef LLVMBuildInvoke(LLVMBuilderRef, LLVMValueRef Fn, LLVMValueRef *Args, unsigned NumArgs, LLVMBasicBlockRef Then, LLVMBasicBlockRef Catch, const char *Name)
Definition: Core.cpp:2461
void LLVMShutdown(void)
Deallocate and destroy all ManagedStatic variables.
Definition: Core.cpp:60
LLVMTypeRef LLVMPPCFP128Type(void)
Definition: Core.cpp:471
LLVMValueRef LLVMConstIntToPtr(LLVMValueRef ConstantVal, LLVMTypeRef ToType)
Definition: Core.cpp:1363
And a value and return the old one.
Definition: Core.h:313
LLVMBool LLVMIsEnumAttribute(LLVMAttributeRef A)
Check for the different types of attributes.
Definition: Core.cpp:171
LLVMValueRef LLVMConstPointerCast(LLVMValueRef ConstantVal, LLVMTypeRef ToType)
Definition: Core.cpp:1397
LLVMValueRef LLVMBuildNot(LLVMBuilderRef, LLVMValueRef V, const char *Name)
Definition: Core.cpp:2677
LLVMBasicBlockRef LLVMGetInsertBlock(LLVMBuilderRef Builder)
Definition: Core.cpp:2387
const char * LLVMGetTarget(LLVMModuleRef M)
Obtain the target triple for a module.
Definition: Core.cpp:252
LLVMTypeRef LLVMInt16Type(void)
Definition: Core.cpp:412
Sets the value if it&#39;s greater than the original using a signed comparison and return the old one...
Definition: Core.h:317
unsigned LLVMGetEnumAttributeKind(LLVMAttributeRef A)
Get the unique id corresponding to the enum attribute passed as argument.
Definition: Core.cpp:139
void LLVMPositionBuilderBefore(LLVMBuilderRef Builder, LLVMValueRef Instr)
Definition: Core.cpp:2377
void LLVMSetPersonalityFn(LLVMValueRef Fn, LLVMValueRef PersonalityFn)
Set the personality function attached to the function.
Definition: Core.cpp:1840
LLVMTypeRef LLVMGetTypeByName(LLVMModuleRef M, const char *Name)
Obtain a Type from a module by its registered name.
Definition: Core.cpp:563
LLVMValueRef LLVMGetPersonalityFn(LLVMValueRef Fn)
Obtain the personality function attached to the function.
Definition: Core.cpp:1836
unsigned LLVMGetNumClauses(LLVMValueRef LandingPad)
Definition: Core.cpp:2499
LLVMOpcode LLVMGetConstOpcode(LLVMValueRef ConstantVal)
Definition: Core.cpp:1111
Definition: Core.h:92
unsigned LLVMGetInstructionCallConv(LLVMValueRef Instr)
Obtain the calling convention for a call instruction.
Definition: Core.cpp:2171
void LLVMDumpValue(LLVMValueRef Val)
Dump a representation of a value to stderr.
Definition: Core.cpp:661
LLVMValueRef LLVMConstSub(LLVMValueRef LHSConstant, LLVMValueRef RHSConstant)
Definition: Core.cpp:1166
struct LLVMOpaqueModuleProvider * LLVMModuleProviderRef
Interface used to provide a module to JIT or interpreter.
Definition: Types.h:111
void LLVMGetNamedMetadataOperands(LLVMModuleRef M, const char *Name, LLVMValueRef *Dest)
Obtain the named metadata operands for a module.
Definition: Core.cpp:932
LLVMValueRef LLVMConstUIToFP(LLVMValueRef ConstantVal, LLVMTypeRef ToType)
Definition: Core.cpp:1338
int LLVMBool
Definition: Types.h:29
int LLVMGetNumOperands(LLVMValueRef Val)
Obtain the number of operands in a llvm::User value.
Definition: Core.cpp:798
void * LLVMContextGetDiagnosticContext(LLVMContextRef C)
Get the diagnostic context of this context.
Definition: Core.cpp:99
unsigned LLVMGetCallSiteAttributeCount(LLVMValueRef C, LLVMAttributeIndex Idx)
Definition: Core.cpp:2192
LLVMValueRef LLVMBuildGEP(LLVMBuilderRef B, LLVMValueRef Pointer, LLVMValueRef *Indices, unsigned NumIndices, const char *Name)
Definition: Core.cpp:2773
LLVMValueRef LLVMAddGlobalInAddressSpace(LLVMModuleRef M, LLVMTypeRef Ty, const char *Name, unsigned AddressSpace)
Definition: Core.cpp:1650
struct LLVMOpaqueDiagnosticInfo * LLVMDiagnosticInfoRef
Definition: Types.h:135
type with no size
Definition: Core.h:141
LLVMValueRef LLVMBuildTrunc(LLVMBuilderRef, LLVMValueRef Val, LLVMTypeRef DestTy, const char *Name)
Definition: Core.cpp:2838
const char * LLVMGetDataLayout(LLVMModuleRef M)
Definition: Core.cpp:243
Like Private, but linker removes.
Definition: Core.h:179
LLVMValueRef LLVMGetParam(LLVMValueRef Fn, unsigned Index)
Obtain the parameter at the specified index.
Definition: Core.cpp:1934
LLVMValueRef LLVMConstStringInContext(LLVMContextRef C, const char *Str, unsigned Length, LLVMBool DontNullTerminate)
Create a ConstantDataSequential and initialize it with a string.
Definition: Core.cpp:1024
LLVMValueRef LLVMConstURem(LLVMValueRef LHSConstant, LLVMValueRef RHSConstant)
Definition: Core.cpp:1237
LLVMTypeRef LLVMVoidType(void)
These are similar to the above functions except they operate on the global context.
Definition: Core.cpp:627
LLVMValueRef LLVMBuildCall(LLVMBuilderRef, LLVMValueRef Fn, LLVMValueRef *Args, unsigned NumArgs, const char *Name)
Definition: Core.cpp:2965
Definition: Core.h:71
LLVMBasicBlockRef LLVMAppendBasicBlockInContext(LLVMContextRef C, LLVMValueRef Fn, const char *Name)
Append a basic block to the end of a function.
Definition: Core.cpp:2051
LLVMTypeRef LLVMGetElementType(LLVMTypeRef Ty)
Obtain the type of elements within a sequential type.
Definition: Core.cpp:589
LLVMValueRef LLVMBuildNeg(LLVMBuilderRef, LLVMValueRef V, const char *Name)
Definition: Core.cpp:2659
void LLVMDisposeMemoryBuffer(LLVMMemoryBufferRef MemBuf)
Definition: Core.cpp:3180
LLVMValueRef LLVMBuildUIToFP(LLVMBuilderRef, LLVMValueRef Val, LLVMTypeRef DestTy, const char *Name)
Definition: Core.cpp:2863
void LLVMSetFunctionCallConv(LLVMValueRef Fn, unsigned CC)
Set the calling convention of a function.
Definition: Core.cpp:1854
Like Internal, but omit from symbol table.
Definition: Core.h:173
void LLVMGetBasicBlocks(LLVMValueRef Fn, LLVMBasicBlockRef *BasicBlocks)
Obtain all of the basic blocks in a function.
Definition: Core.cpp:2009
Sets the value if it&#39;s Smaller than the original using a signed comparison and return the old one...
Definition: Core.h:320
LLVMContextRef LLVMGetTypeContext(LLVMTypeRef Ty)
Obtain the context to which this type instance is associated.
Definition: Core.cpp:358
A filter clause.
Definition: Core.h:271
LLVMValueRef LLVMGetOperand(LLVMValueRef Val, unsigned Index)
Obtain an operand at a specific index in a llvm::User value.
Definition: Core.cpp:775
LLVMValueRef LLVMConstTruncOrBitCast(LLVMValueRef ConstantVal, LLVMTypeRef ToType)
Definition: Core.cpp:1391
unsigned LLVMCountParams(LLVMValueRef Fn)
Obtain the number of parameters in a function.
Definition: Core.cpp:1921
LLVMModuleProviderRef LLVMCreateModuleProviderForExistingModule(LLVMModuleRef M)
Changes the type of M so it can be passed to FunctionPassManagers and the JIT.
Definition: Core.cpp:3115
void LLVMInsertIntoBuilder(LLVMBuilderRef Builder, LLVMValueRef Instr)
Definition: Core.cpp:2395
LLVMValueRef LLVMBuildFPCast(LLVMBuilderRef, LLVMValueRef Val, LLVMTypeRef DestTy, const char *Name)
Definition: Core.cpp:2938
LLVMValueRef LLVMBuildRetVoid(LLVMBuilderRef)
Definition: Core.cpp:2429
LLVMValueRef LLVMBuildGlobalString(LLVMBuilderRef B, const char *Str, const char *Name)
Definition: Core.cpp:2793
LLVMValueRef LLVMConstPointerNull(LLVMTypeRef Ty)
Obtain a constant that is a constant pointer pointing to NULL for a specified type.
Definition: Core.cpp:834
void LLVMSetInitializer(LLVMValueRef GlobalVar, LLVMValueRef ConstantVal)
Definition: Core.cpp:1706
LLVMThreadLocalMode
Definition: Core.h:274
LLVMVisibility LLVMGetVisibility(LLVMValueRef Global)
Definition: Core.cpp:1581
LLVMValueRef LLVMConstNUWSub(LLVMValueRef LHSConstant, LLVMValueRef RHSConstant)
Definition: Core.cpp:1177
void LLVMInitializeCore(LLVMPassRegistryRef R)
Definition: Core.cpp:56
True if ordered and greater than.
Definition: Core.h:253
LLVMContextRef LLVMContextCreate(void)
Create a new context.
Definition: Core.cpp:79
Labels.
Definition: Core.h:148
LLVMTypeKind LLVMGetTypeKind(LLVMTypeRef Ty)
Obtain the enumerated type of a Type instance.
Definition: Core.cpp:313
LLVMTypeRef LLVMTypeOf(LLVMValueRef Val)
Obtain the type of a value.
Definition: Core.cpp:638
LLVMValueRef LLVMConstAllOnes(LLVMTypeRef Ty)
Obtain a constant value referring to the instance of a type consisting of all ones.
Definition: Core.cpp:812
LLVMValueRef LLVMConstFPTrunc(LLVMValueRef ConstantVal, LLVMTypeRef ToType)
Definition: Core.cpp:1328
LLVMValueRef LLVMGetCalledValue(LLVMValueRef Instr)
Obtain the pointer to the function invoked by this instruction.
Definition: Core.cpp:2232
LLVMValueRef LLVMConstInsertValue(LLVMValueRef AggConstant, LLVMValueRef ElementValueConstant, unsigned *IdxList, unsigned NumIdx)
Definition: Core.cpp:1450
LLVMValueRef LLVMBuildURem(LLVMBuilderRef, LLVMValueRef LHS, LLVMValueRef RHS, const char *Name)
Definition: Core.cpp:2607
LLVMTypeRef LLVMLabelType(void)
Definition: Core.cpp:630
Definition: Core.h:97
Arbitrary bit width integers.
Definition: Core.h:149
LLVMValueRef LLVMGetCondition(LLVMValueRef Branch)
Return the condition of a branch instruction.
Definition: Core.cpp:2284
LLVMValueRef LLVMBuildFCmp(LLVMBuilderRef, LLVMRealPredicate Op, LLVMValueRef LHS, LLVMValueRef RHS, const char *Name)
Definition: Core.cpp:2952
Predicate
Predicate - These are "(BI << 5) | BO" for various predicates.
Definition: PPCPredicates.h:27
struct LLVMOpaqueBasicBlock * LLVMBasicBlockRef
Represents a basic block of instructions in LLVM IR.
Definition: Types.h:83
Synchronized with respect to signal handlers executing in the same thread.
Definition: LLVMContext.h:56
Structures.
Definition: Core.h:151
LLVMValueRef LLVMGetNextInstruction(LLVMValueRef Inst)
Obtain the instruction that occurs after the one specified.
Definition: Core.cpp:2111
Definition: Core.h:113
void LLVMDeleteGlobal(LLVMValueRef GlobalVar)
Definition: Core.cpp:1695
Xor a value and return the old one.
Definition: Core.h:316
Definition: Core.h:79
LLVMValueRef LLVMConstSExtOrBitCast(LLVMValueRef ConstantVal, LLVMTypeRef ToType)
Definition: Core.cpp:1385
LLVMValueRef LLVMBuildXor(LLVMBuilderRef, LLVMValueRef LHS, LLVMValueRef RHS, const char *Name)
Definition: Core.cpp:2647
LLVMValueRef LLVMBuildUDiv(LLVMBuilderRef, LLVMValueRef LHS, LLVMValueRef RHS, const char *Name)
Definition: Core.cpp:2582
signed less or equal
Definition: Core.h:247
LLVMBool LLVMIsFunctionVarArg(LLVMTypeRef FunctionTy)
Returns whether a function type is variadic.
Definition: Core.cpp:487
LLVMValueRef LLVMGetCurrentDebugLocation(LLVMBuilderRef Builder)
Definition: Core.cpp:2416
LLVMLinkage
Definition: Core.h:160
unsigned LLVMGetNamedMetadataNumOperands(LLVMModuleRef M, const char *Name)
Obtain the number of operands for named metadata in a module.
Definition: Core.cpp:925
Definition: Core.h:86
void LLVMSetAtomicSingleThread(LLVMValueRef AtomicInst, LLVMBool SingleThread)
Definition: Core.cpp:3077
LLVMTypeRef LLVMDoubleType(void)
Definition: Core.cpp:462
32 bit floating point type
Definition: Core.h:143
LLVMValueRef LLVMBuildInsertValue(LLVMBuilderRef, LLVMValueRef AggVal, LLVMValueRef EltVal, unsigned Index, const char *Name)
Definition: Core.cpp:3010
LLVMValueRef LLVMGetUser(LLVMUseRef U)
Obtain the user value for a user.
Definition: Core.cpp:755
LLVMValueRef LLVMConstFPExt(LLVMValueRef ConstantVal, LLVMTypeRef ToType)
Definition: Core.cpp:1333
unsigned less than
Definition: Core.h:242
provides Acquire semantics for loads and Release semantics for stores.
Definition: Core.h:299
struct LLVMOpaquePassManager * LLVMPassManagerRef
Definition: Types.h:114
LLVMTypeRef LLVMStructType(LLVMTypeRef *ElementTypes, unsigned ElementCount, LLVMBool Packed)
Create a new structure type in the global context.
Definition: Core.cpp:514
LLVMValueRef LLVMBuildShuffleVector(LLVMBuilderRef, LLVMValueRef V1, LLVMValueRef V2, LLVMValueRef Mask, const char *Name)
Definition: Core.cpp:2998
double LLVMConstRealGetDouble(LLVMValueRef ConstantVal, LLVMBool *losesInfo)
Obtain the double value for an floating point constant value.
Definition: Core.cpp:1001
LLVMValueRef LLVMBuildGlobalStringPtr(LLVMBuilderRef B, const char *Str, const char *Name)
Definition: Core.cpp:2798
void LLVMSetExternallyInitialized(LLVMValueRef GlobalVar, LLVMBool IsExtInit)
Definition: Core.cpp:1770
LLVMValueRef LLVMBuildMalloc(LLVMBuilderRef, LLVMTypeRef Ty, const char *Name)
Definition: Core.cpp:2683
LLVMValueRef LLVMIsAMDNode(LLVMValueRef Val)
Definition: Core.cpp:724
Same, but only replaced by something equivalent.
Definition: Core.h:164
True if ordered and less than or equal.
Definition: Core.h:256
LLVMAttributeRef LLVMGetCallSiteEnumAttribute(LLVMValueRef C, LLVMAttributeIndex Idx, unsigned KindID)
Definition: Core.cpp:2207
LLVMValueRef LLVMBuildFree(LLVMBuilderRef, LLVMValueRef PointerVal)
Definition: Core.cpp:2715
LLVMTypeRef LLVMFunctionType(LLVMTypeRef ReturnType, LLVMTypeRef *ParamTypes, unsigned ParamCount, LLVMBool IsVarArg)
Obtain a function type consisting of a specified signature.
Definition: Core.cpp:480
unsigned less or equal
Definition: Core.h:243
LLVMValueRef LLVMBuildBitCast(LLVMBuilderRef, LLVMValueRef Val, LLVMTypeRef DestTy, const char *Name)
Definition: Core.cpp:2893
LLVMBool LLVMIsThreadLocal(LLVMValueRef GlobalVar)
Definition: Core.cpp:1711
Definition: Core.h:73
LLVMValueRef LLVMConstPtrToInt(LLVMValueRef ConstantVal, LLVMTypeRef ToType)
Definition: Core.cpp:1358
LLVMBool LLVMRunPassManager(LLVMPassManagerRef PM, LLVMModuleRef M)
Initializes, executes on the provided module, and finalizes all of the passes scheduled in the pass m...
Definition: Core.cpp:3205
LLVMValueRef LLVMGetBasicBlockTerminator(LLVMBasicBlockRef BB)
Obtain the terminator instruction for a basic block.
Definition: Core.cpp:2001
Metadata.
Definition: Core.h:155
LLVMValueRef LLVMConstStruct(LLVMValueRef *ConstantVals, unsigned Count, LLVMBool Packed)
Create a ConstantStruct in the global Context.
Definition: Core.cpp:1067
LLVMBool LLVMIsConstantString(LLVMValueRef c)
Returns true if the specified constant is an array of i8.
Definition: Core.cpp:1043
LLVMValueRef LLVMConstFCmp(LLVMRealPredicate Predicate, LLVMValueRef LHSConstant, LLVMValueRef RHSConstant)
Definition: Core.cpp:1274
LLVMTypeRef LLVMX86MMXTypeInContext(LLVMContextRef C)
Create a X86 MMX type in a context.
Definition: Core.cpp:452
LLVMValueRef LLVMConstMul(LLVMValueRef LHSConstant, LLVMValueRef RHSConstant)
Definition: Core.cpp:1188
LLVMBool LLVMIsDeclaration(LLVMValueRef Global)
Definition: Core.cpp:1476
amdgpu Simplify well known AMD library false Value Value * Arg
LLVMValueRef LLVMBuildFPExt(LLVMBuilderRef, LLVMValueRef Val, LLVMTypeRef DestTy, const char *Name)
Definition: Core.cpp:2878
LLVMValueRef LLVMConstNeg(LLVMValueRef ConstantVal)
Definition: Core.cpp:1123
void LLVMAddIncoming(LLVMValueRef PhiNode, LLVMValueRef *IncomingValues, LLVMBasicBlockRef *IncomingBlocks, unsigned Count)
Add an incoming value to the end of a PHI list.
Definition: Core.cpp:2316
LLVMValueRef LLVMBuildExtractValue(LLVMBuilderRef, LLVMValueRef AggVal, unsigned Index, const char *Name)
Definition: Core.cpp:3005
LLVMValueRef LLVMBuildAShr(LLVMBuilderRef, LLVMValueRef LHS, LLVMValueRef RHS, const char *Name)
Definition: Core.cpp:2632
void LLVMRemoveBasicBlockFromParent(LLVMBasicBlockRef BB)
Remove a basic block from a function.
Definition: Core.cpp:2077
LLVMValueRef LLVMConstFAdd(LLVMValueRef LHSConstant, LLVMValueRef RHSConstant)
Definition: Core.cpp:1161
void(* LLVMDiagnosticHandler)(LLVMDiagnosticInfoRef, void *)
Definition: Core.h:380
LLVMValueRef LLVMConstNSWSub(LLVMValueRef LHSConstant, LLVMValueRef RHSConstant)
Definition: Core.cpp:1171
LLVMValueRef LLVMBuildMul(LLVMBuilderRef, LLVMValueRef LHS, LLVMValueRef RHS, const char *Name)
Definition: Core.cpp:2562
void LLVMAddNamedMetadataOperand(LLVMModuleRef M, const char *Name, LLVMValueRef Val)
Add an operand to named metadata.
Definition: Core.cpp:942
Always false (always folded)
Definition: Core.h:251
LLVMBool LLVMIsInBounds(LLVMValueRef GEP)
Check whether the given GEP instruction is inbounds.
Definition: Core.cpp:2306
LLVMValueRef LLVMGetPreviousParam(LLVMValueRef Arg)
Obtain the previous parameter to a function.
Definition: Core.cpp:1967
LLVMModuleRef LLVMModuleCreateWithName(const char *ModuleID)
Create a new, empty module in the global context.
Definition: Core.cpp:214
unsigned LLVMGetNumIndices(LLVMValueRef Inst)
Obtain the number of indices.
Definition: Core.cpp:2337
Obsolete.
Definition: Core.h:177
void LLVMAddCase(LLVMValueRef Switch, LLVMValueRef OnVal, LLVMBasicBlockRef Dest)
Definition: Core.cpp:2490
Definition: Core.h:84
LLVMValueRef LLVMBuildArrayMalloc(LLVMBuilderRef, LLVMTypeRef Ty, LLVMValueRef Val, const char *Name)
Definition: Core.cpp:2694
char * LLVMPrintTypeToString(LLVMTypeRef Val)
Return a string representation of the type.
Definition: Core.cpp:368
LLVMBool LLVMIsConditional(LLVMValueRef Branch)
Return if a branch is conditional.
Definition: Core.cpp:2280
void LLVMRemoveEnumAttributeAtIndex(LLVMValueRef F, LLVMAttributeIndex Idx, unsigned KindID)
Definition: Core.cpp:1902
Tentative definitions.
Definition: Core.h:178
LLVMValueRef LLVMBuildIntToPtr(LLVMBuilderRef, LLVMValueRef Val, LLVMTypeRef DestTy, const char *Name)
Definition: Core.cpp:2888
LLVMValueRef LLVMConstIntOfArbitraryPrecision(LLVMTypeRef IntTy, unsigned NumWords, const uint64_t Words[])
Obtain a constant value for an integer of arbitrary precision.
Definition: Core.cpp:959
LLVMTypeRef LLVMInt64Type(void)
Definition: Core.cpp:418
16 bit floating point type
Definition: Core.h:142
LLVMVisibility
Definition: Core.h:183
unsigned LLVMGetEnumAttributeKindForName(const char *Name, size_t SLen)
Return an unique id given the name of a enum attribute, or 0 if no attribute by that name exists...
Definition: Core.cpp:126
LLVMTypeRef LLVMHalfTypeInContext(LLVMContextRef C)
Obtain a 16-bit floating point type from a context.
Definition: Core.cpp:434
LLVMBasicBlockRef LLVMAppendBasicBlock(LLVMValueRef Fn, const char *Name)
Append a basic block to the end of a function using the global context.
Definition: Core.cpp:2057
const char * LLVMGetStringAttributeValue(LLVMAttributeRef A, unsigned *Length)
Get the string attribute&#39;s value.
Definition: Core.cpp:164
guarantees that if you take all the operations affecting a specific address, a consistent ordering ex...
Definition: Core.h:286
LLVMTypeRef LLVMInt128TypeInContext(LLVMContextRef C)
Definition: Core.cpp:399
LLVMValueRef LLVMConstNUWNeg(LLVMValueRef ConstantVal)
Definition: Core.cpp:1131
LLVMValueRef LLVMBuildAtomicRMW(LLVMBuilderRef B, LLVMAtomicRMWBinOp op, LLVMValueRef PTR, LLVMValueRef Val, LLVMAtomicOrdering ordering, LLVMBool singleThread)
Definition: Core.cpp:3032
void LLVMDeleteBasicBlock(LLVMBasicBlockRef BB)
Remove a basic block from a function and delete it.
Definition: Core.cpp:2073
LLVMAtomicOrdering LLVMGetCmpXchgSuccessOrdering(LLVMValueRef CmpXchgInst)
Definition: Core.cpp:3086
LLVMValueRef LLVMBuildLShr(LLVMBuilderRef, LLVMValueRef LHS, LLVMValueRef RHS, const char *Name)
Definition: Core.cpp:2627
unsigned LLVMGetNumSuccessors(LLVMValueRef Term)
Return the number of successors that this terminator has.
Definition: Core.cpp:2266
LLVMValueRef LLVMBuildIsNotNull(LLVMBuilderRef, LLVMValueRef Val, const char *Name)
Definition: Core.cpp:3022
unsigned LLVMGetMDKindID(const char *Name, unsigned SLen)
Definition: Core.cpp:119
const NodeList & List
Definition: RDFGraph.cpp:210
LLVMBool LLVMIsConstant(LLVMValueRef Val)
Determine whether the specified value instance is constant.
Definition: Core.cpp:820
#define N
LLVMBasicBlockRef LLVMGetUnwindDest(LLVMValueRef InvokeInst)
Return the unwind destination basic block.
Definition: Core.cpp:2252
LLVMValueRef LLVMBuildFSub(LLVMBuilderRef, LLVMValueRef LHS, LLVMValueRef RHS, const char *Name)
Definition: Core.cpp:2557
LLVMBasicBlockRef LLVMGetIncomingBlock(LLVMValueRef PhiNode, unsigned Index)
Obtain an incoming value to a PHI node as an LLVMBasicBlockRef.
Definition: Core.cpp:2331
static GCRegistry::Add< ErlangGC > A("erlang", "erlang-compatible garbage collector")
void LLVMSetUnwindDest(LLVMValueRef InvokeInst, LLVMBasicBlockRef B)
Set the unwind destination basic block.
Definition: Core.cpp:2260
LLVMTypeRef LLVMInt1TypeInContext(LLVMContextRef C)
Obtain an integer type from a context with specified bit width.
Definition: Core.cpp:384
LLVMBool LLVMGetVolatile(LLVMValueRef MemoryAccessInst)
Definition: Core.cpp:2803
LLVMTypeRef LLVMInt1Type(void)
Obtain an integer type from the global context with a specified bit width.
Definition: Core.cpp:406
void LLVMGetCallSiteAttributes(LLVMValueRef C, LLVMAttributeIndex Idx, LLVMAttributeRef *Attrs)
Definition: Core.cpp:2199
LLVMTypeRef LLVMIntType(unsigned NumBits)
Definition: Core.cpp:424
void LLVMSetInstructionCallConv(LLVMValueRef Instr, unsigned CC)
Set the calling convention for a call instruction.
Definition: Core.cpp:2175
LLVMPassManagerRef LLVMCreateFunctionPassManagerForModule(LLVMModuleRef M)
Constructs a new function-by-function pass pipeline over the module provider.
Definition: Core.cpp:3196
LLVMModuleRef LLVMModuleCreateWithNameInContext(const char *ModuleID, LLVMContextRef C)
Create a new, empty module in a specific context.
Definition: Core.cpp:218
LLVMValueRef LLVMBuildSwitch(LLVMBuilderRef, LLVMValueRef V, LLVMBasicBlockRef Else, unsigned NumCases)
Definition: Core.cpp:2451
LLVMValueRef LLVMConstArray(LLVMTypeRef ElementTy, LLVMValueRef *ConstantVals, unsigned Length)
Create a ConstantArray from values.
Definition: Core.cpp:1053
128 bit floating point type (two 64-bits)
Definition: Core.h:147
LLVMCallConv
Definition: Core.h:195
void LLVMDumpType(LLVMTypeRef Val)
Dump a representation of a type to stderr.
Definition: Core.cpp:363
Definition: Core.h:78
LLVMTypeRef LLVMInt8Type(void)
Definition: Core.cpp:409
Special purpose, only applies to global arrays.
Definition: Core.h:170
signed greater or equal
Definition: Core.h:245
The GV is hidden.
Definition: Core.h:185
LLVMValueRef LLVMConstSIToFP(LLVMValueRef ConstantVal, LLVMTypeRef ToType)
Definition: Core.cpp:1343
LLVMValueRef LLVMConstLShr(LLVMValueRef LHSConstant, LLVMValueRef RHSConstant)
Definition: Core.cpp:1286
const char * LLVMGetMDString(LLVMValueRef V, unsigned *Length)
Obtain the underlying string from a MDString value.
Definition: Core.cpp:895
LLVMBool LLVMFinalizeFunctionPassManager(LLVMPassManagerRef FPM)
Finalizes all of the function passes scheduled in in the function pass manager.
Definition: Core.cpp:3217
LLVMIntPredicate LLVMGetICmpPredicate(LLVMValueRef Inst)
Obtain the predicate of an instruction.
Definition: Core.cpp:2135
void LLVMSetCleanup(LLVMValueRef LandingPad, LLVMBool Val)
Definition: Core.cpp:2516
LLVMValueRef LLVMConstShl(LLVMValueRef LHSConstant, LLVMValueRef RHSConstant)
Definition: Core.cpp:1281
LLVMValueRef LLVMBuildNUWMul(LLVMBuilderRef, LLVMValueRef LHS, LLVMValueRef RHS, const char *Name)
Definition: Core.cpp:2572
Like LinkerPrivate, but is weak.
Definition: Core.h:180
LLVMValueRef LLVMConstNot(LLVMValueRef ConstantVal)
Definition: Core.cpp:1140
LLVMValueRef LLVMBuildLandingPad(LLVMBuilderRef B, LLVMTypeRef Ty, LLVMValueRef PersFn, unsigned NumClauses, const char *Name)
Definition: Core.cpp:2470
unsigned LLVMGetAttributeCountAtIndex(LLVMValueRef F, LLVMAttributeIndex Idx)
Definition: Core.cpp:1877
LLVMValueRef LLVMGetFirstFunction(LLVMModuleRef M)
Obtain an iterator to the first Function in a Module.
Definition: Core.cpp:1796
struct LLVMOpaqueMetadata * LLVMMetadataRef
Represents an LLVM Metadata.
Definition: Types.h:90
LLVMBool LLVMPrintModuleToFile(LLVMModuleRef M, const char *Filename, char **ErrorMessage)
Print a representation of a module to a file.
Definition: Core.cpp:265
LLVMValueRef LLVMBuildVAArg(LLVMBuilderRef, LLVMValueRef List, LLVMTypeRef Ty, const char *Name)
Definition: Core.cpp:2980
void LLVMSetThreadLocalMode(LLVMValueRef GlobalVar, LLVMThreadLocalMode Mode)
Definition: Core.cpp:1744
Release is similar to Acquire, but with a barrier of the sort necessary to release a lock...
Definition: Core.h:292
Always true (always folded)
Definition: Core.h:266
LLVMBuilderRef LLVMCreateBuilderInContext(LLVMContextRef C)
Definition: Core.cpp:2362
LLVMAtomicOrdering LLVMGetOrdering(LLVMValueRef MemoryAccessInst)
Definition: Core.cpp:2817
void LLVMSetMetadata(LLVMValueRef Val, unsigned KindID, LLVMValueRef Node)
Set metadata associated with an instruction value.
Definition: Core.cpp:709
LLVMValueRef LLVMGetParamParent(LLVMValueRef Inst)
Obtain the function to which this argument belongs.
Definition: Core.cpp:1939
const char * LLVMGetValueName(LLVMValueRef Val)
Obtain the string name of a value.
Definition: Core.cpp:653
LLVMValueRef LLVMBuildSExtOrBitCast(LLVMBuilderRef, LLVMValueRef Val, LLVMTypeRef DestTy, const char *Name)
Definition: Core.cpp:2909
LLVMValueRef LLVMBuildBr(LLVMBuilderRef, LLVMBasicBlockRef Dest)
Definition: Core.cpp:2442
void LLVMAddCallSiteAttribute(LLVMValueRef C, LLVMAttributeIndex Idx, LLVMAttributeRef A)
Definition: Core.cpp:2187
Definition: Core.h:72
LLVMValueRef LLVMBuildZExtOrBitCast(LLVMBuilderRef, LLVMValueRef Val, LLVMTypeRef DestTy, const char *Name)
Definition: Core.cpp:2903
LLVMBool LLVMCreateMemoryBufferWithSTDIN(LLVMMemoryBufferRef *OutMemBuf, char **OutMessage)
Definition: Core.cpp:3140
LLVMLinkage LLVMGetLinkage(LLVMValueRef Global)
Definition: Core.cpp:1480
constexpr char Size[]
Key for Kernel::Arg::Metadata::mSize.
LLVMDLLStorageClass
Definition: Core.h:189
LLVMBasicBlockRef LLVMValueAsBasicBlock(LLVMValueRef Val)
Convert an LLVMValueRef to an LLVMBasicBlockRef instance.
Definition: Core.cpp:1989
std::underlying_type< E >::type Mask()
Get a bitmask with 1s in all places up to the high-order bit of E&#39;s largest value.
Definition: BitmaskEnum.h:81
LLVMValueRef LLVMGetPreviousFunction(LLVMValueRef Fn)
Decrement a Function iterator to the previous Function.
Definition: Core.cpp:1820
void LLVMSetOrdering(LLVMValueRef MemoryAccessInst, LLVMAtomicOrdering Ordering)
Definition: Core.cpp:2827
LLVMValueRef LLVMBuildIndirectBr(LLVMBuilderRef B, LLVMValueRef Addr, unsigned NumDests)
Definition: Core.cpp:2456
void LLVMSetGC(LLVMValueRef Fn, const char *Name)
Define the garbage collector to use during code generation.
Definition: Core.cpp:1864
LLVMDLLStorageClass LLVMGetDLLStorageClass(LLVMValueRef Global)
Definition: Core.cpp:1591
LLVMValueRef LLVMBuildNSWNeg(LLVMBuilderRef B, LLVMValueRef V, const char *Name)
Definition: Core.cpp:2663
LLVMValueRef LLVMConstExactUDiv(LLVMValueRef LHSConstant, LLVMValueRef RHSConstant)
Definition: Core.cpp:1215
Obsolete.
Definition: Core.h:175
LLVMTypeRef LLVMGetReturnType(LLVMTypeRef FunctionTy)
Obtain the Type this function Type returns.
Definition: Core.cpp:491
Definition: Core.h:70
LLVMValueRef LLVMBuildNSWMul(LLVMBuilderRef, LLVMValueRef LHS, LLVMValueRef RHS, const char *Name)
Definition: Core.cpp:2567
LLVMValueRef LLVMBuildStore(LLVMBuilderRef, LLVMValueRef Val, LLVMValueRef Ptr)
Definition: Core.cpp:2725
LLVMValueRef LLVMBuildBinOp(LLVMBuilderRef B, LLVMOpcode Op, LLVMValueRef LHS, LLVMValueRef RHS, const char *Name)
Definition: Core.cpp:2652
True if unordered: isnan(X) | isnan(Y)
Definition: Core.h:259
const char * LLVMGetModuleIdentifier(LLVMModuleRef M, size_t *Len)
Obtain the identifier of a module.
Definition: Core.cpp:227
LLVMValueRef LLVMConstZExt(LLVMValueRef ConstantVal, LLVMTypeRef ToType)
Definition: Core.cpp:1323
LLVMBool LLVMIsMultithreaded(void)
Check whether LLVM is executing in thread-safe mode or not.
Definition: Core.cpp:3234
Definition: Core.h:59
LLVMContextRef LLVMGetGlobalContext(void)
Obtain the global context instance.
Definition: Core.cpp:83
LLVMValueRef LLVMConstNSWMul(LLVMValueRef LHSConstant, LLVMValueRef RHSConstant)
Definition: Core.cpp:1193
LLVMTypeRef LLVMInt32TypeInContext(LLVMContextRef C)
Definition: Core.cpp:393
LLVMAtomicOrdering LLVMGetCmpXchgFailureOrdering(LLVMValueRef CmpXchgInst)
Definition: Core.cpp:3099
LLVMBool LLVMRunFunctionPassManager(LLVMPassManagerRef FPM, LLVMValueRef F)
Executes all of the function passes scheduled in the function pass manager on the provided function...
Definition: Core.cpp:3213
64 bit floating point type
Definition: Core.h:144
AddressSpace
Definition: AVR.h:40
LLVMTypeRef LLVMPointerType(LLVMTypeRef ElementType, unsigned AddressSpace)
Create a pointer type that points to a defined type.
Definition: Core.cpp:581
LLVMValueRef LLVMBuildLoad(LLVMBuilderRef, LLVMValueRef PointerVal, const char *Name)
Definition: Core.cpp:2720
void LLVMInstructionRemoveFromParent(LLVMValueRef Inst)
Remove and delete an instruction.
Definition: Core.cpp:2127
LLVMValueRef LLVMConstExtractElement(LLVMValueRef VectorConstant, LLVMValueRef IndexConstant)
Definition: Core.cpp:1422
void LLVMSetTailCall(LLVMValueRef CallInst, LLVMBool IsTailCall)
Set whether a call instruction is a tail call.
Definition: Core.cpp:2242
void LLVMSetModuleInlineAsm(LLVMModuleRef M, const char *Asm)
Set inline assembly for a module.
Definition: Core.cpp:298
LLVMValueRef LLVMBuildAddrSpaceCast(LLVMBuilderRef, LLVMValueRef Val, LLVMTypeRef DestTy, const char *Name)
Definition: Core.cpp:2898
LLVMBasicBlockRef LLVMGetNormalDest(LLVMValueRef InvokeInst)
Return the normal destination basic block.
Definition: Core.cpp:2248
const char * LLVMGetStringAttributeKind(LLVMAttributeRef A, unsigned *Length)
Get the string attribute&#39;s kind.
Definition: Core.cpp:157
LLVMValueRef LLVMConstFRem(LLVMValueRef LHSConstant, LLVMValueRef RHSConstant)
Definition: Core.cpp:1247
unsigned LLVMGetAlignment(LLVMValueRef V)
Obtain the preferred alignment of the value.
Definition: Core.cpp:1613
Tokens.
Definition: Core.h:157
LLVMValueRef LLVMGetNextFunction(LLVMValueRef Fn)
Advance a Function iterator to the next Function.
Definition: Core.cpp:1812
void LLVMAddAttributeAtIndex(LLVMValueRef F, LLVMAttributeIndex Idx, LLVMAttributeRef A)
Add an attribute to a function.
Definition: Core.cpp:1872
Definition: Core.h:68
void LLVMDisposeModuleProvider(LLVMModuleProviderRef M)
Destroys the module M.
Definition: Core.cpp:3119
void LLVMRemoveStringAttributeAtIndex(LLVMValueRef F, LLVMAttributeIndex Idx, const char *K, unsigned KLen)
Definition: Core.cpp:1907
LLVMTypeRef LLVMInt128Type(void)
Definition: Core.cpp:421
LLVMValueRef LLVMBuildSelect(LLVMBuilderRef, LLVMValueRef If, LLVMValueRef Then, LLVMValueRef Else, const char *Name)
Definition: Core.cpp:2973
Definition: Core.h:112
constexpr char Args[]
Key for Kernel::Metadata::mArgs.
LLVMRealPredicate
Definition: Core.h:250
LLVMTypeRef LLVMX86FP80TypeInContext(LLVMContextRef C)
Obtain a 80-bit floating point type (X87) from a context.
Definition: Core.cpp:443
True if ordered (no nans)
Definition: Core.h:258
struct LLVMOpaqueValue * LLVMValueRef
Represents an individual value in LLVM IR.
Definition: Types.h:76
void LLVMInsertIntoBuilderWithName(LLVMBuilderRef Builder, LLVMValueRef Instr, const char *Name)
Definition: Core.cpp:2399
LLVMValueRef LLVMBuildFPTrunc(LLVMBuilderRef, LLVMValueRef Val, LLVMTypeRef DestTy, const char *Name)
Definition: Core.cpp:2873
void LLVMSetIsInBounds(LLVMValueRef GEP, LLVMBool InBounds)
Set the given GEP instruction to be inbounds or not.
Definition: Core.cpp:2310
void LLVMSetAlignment(LLVMValueRef V, unsigned Bytes)
Set the preferred alignment of the value.
Definition: Core.cpp:1628
LLVMValueKind LLVMGetValueKind(LLVMValueRef Val)
Obtain the enumerated type of a Value instance.
Definition: Core.cpp:642
LLVMModuleRef LLVMGetGlobalParent(LLVMValueRef Global)
Definition: Core.cpp:1472