blob: 6c4b5de2b6ab9f9ca821a27c9e412fe45bbe738b [file] [log] [blame]
Gordon Henriksen76a03742007-09-18 03:18:57 +00001/*===-- llvm-c/Core.h - Core Library C Interface ------------------*- C -*-===*\
2|* *|
3|* The LLVM Compiler Infrastructure *|
4|* *|
Chris Lattnere9cc7422007-12-29 19:59:42 +00005|* This file is distributed under the University of Illinois Open Source *|
6|* License. See LICENSE.TXT for details. *|
Gordon Henriksen76a03742007-09-18 03:18:57 +00007|* *|
8|*===----------------------------------------------------------------------===*|
9|* *|
10|* This header declares the C interface to libLLVMCore.a, which implements *|
11|* the LLVM intermediate representation. *|
12|* *|
13|* LLVM uses a polymorphic type hierarchy which C cannot represent, therefore *|
14|* parameters must be passed as base types. Despite the declared types, most *|
15|* of the functions provided operate only on branches of the type hierarchy. *|
16|* The declared parameter names are descriptive and specify which type is *|
17|* required. Additionally, each type hierarchy is documented along with the *|
18|* functions that operate upon it. For more detail, refer to LLVM's C++ code. *|
19|* If in doubt, refer to Core.cpp, which performs paramter downcasts in the *|
20|* form unwrap<RequiredType>(Param). *|
21|* *|
22|* Many exotic languages can interoperate with C code but have a harder time *|
23|* with C++ due to name mangling. So in addition to C, this interface enables *|
24|* tools written in such languages. *|
25|* *|
Gordon Henriksen7330acd2007-10-05 23:59:36 +000026|* When included into a C++ source file, also declares 'wrap' and 'unwrap' *|
27|* helpers to perform opaque reference<-->pointer conversions. These helpers *|
28|* are shorter and more tightly typed than writing the casts by hand when *|
29|* authoring bindings. In assert builds, they will do runtime type checking. *|
30|* *|
Gordon Henriksen76a03742007-09-18 03:18:57 +000031\*===----------------------------------------------------------------------===*/
32
33#ifndef LLVM_C_CORE_H
34#define LLVM_C_CORE_H
35
36#ifdef __cplusplus
Gordon Henriksen7330acd2007-10-05 23:59:36 +000037
38/* Need these includes to support the LLVM 'cast' template for the C++ 'wrap'
39 and 'unwrap' conversion functions. */
40#include "llvm/Module.h"
41#include "llvm/Support/LLVMBuilder.h"
Gordon Henriksen878114b2008-03-16 04:20:44 +000042#include "llvm/Pass.h"
43#include "llvm/PassManager.h"
Gordon Henriksen7330acd2007-10-05 23:59:36 +000044
Gordon Henriksen76a03742007-09-18 03:18:57 +000045extern "C" {
46#endif
47
48
49/* Opaque types. */
Gordon Henriksen4a4d7352007-12-30 17:46:33 +000050
51/**
52 * The top-level container for all other LLVM Intermediate Representation (IR)
53 * objects. See the llvm::Module class.
54 */
Gordon Henriksen76a03742007-09-18 03:18:57 +000055typedef struct LLVMOpaqueModule *LLVMModuleRef;
Gordon Henriksen4a4d7352007-12-30 17:46:33 +000056
57/**
Gordon Henriksena49d4352008-03-07 19:13:06 +000058 * Each value in the LLVM IR has a type, an LLVMTypeRef. See the llvm::Type
59 * class.
Gordon Henriksen4a4d7352007-12-30 17:46:33 +000060 */
Gordon Henriksen76a03742007-09-18 03:18:57 +000061typedef struct LLVMOpaqueType *LLVMTypeRef;
Gordon Henriksen4a4d7352007-12-30 17:46:33 +000062
63/**
Gordon Henriksena49d4352008-03-07 19:13:06 +000064 * When building recursive types using LLVMRefineType, LLVMTypeRef values may
65 * become invalid; use LLVMTypeHandleRef to resolve this problem. See the
66 * llvm::AbstractTypeHolder class.
Gordon Henriksen4a4d7352007-12-30 17:46:33 +000067 */
Gordon Henriksenffb48762007-10-07 00:13:35 +000068typedef struct LLVMOpaqueTypeHandle *LLVMTypeHandleRef;
Gordon Henriksen4a4d7352007-12-30 17:46:33 +000069
Gordon Henriksen76a03742007-09-18 03:18:57 +000070typedef struct LLVMOpaqueValue *LLVMValueRef;
Gordon Henriksenc23b66c2007-09-26 20:56:12 +000071typedef struct LLVMOpaqueBasicBlock *LLVMBasicBlockRef;
72typedef struct LLVMOpaqueBuilder *LLVMBuilderRef;
Gordon Henriksen34eb6d82007-12-19 22:30:40 +000073
74/* Used to provide a module to JIT or interpreter.
75 * See the llvm::ModuleProvider class.
76 */
Gordon Henriksen0a68fe22007-12-12 01:04:30 +000077typedef struct LLVMOpaqueModuleProvider *LLVMModuleProviderRef;
Gordon Henriksen76a03742007-09-18 03:18:57 +000078
Gordon Henriksen34eb6d82007-12-19 22:30:40 +000079/* Used to provide a module to JIT or interpreter.
80 * See the llvm::MemoryBuffer class.
81 */
82typedef struct LLVMOpaqueMemoryBuffer *LLVMMemoryBufferRef;
83
Gordon Henriksen878114b2008-03-16 04:20:44 +000084/** See the llvm::PassManagerBase class. */
85typedef struct LLVMOpaquePassManager *LLVMPassManagerRef;
86
Gordon Henriksen76a03742007-09-18 03:18:57 +000087typedef enum {
Gordon Henriksen4a4d7352007-12-30 17:46:33 +000088 LLVMVoidTypeKind, /**< type with no size */
89 LLVMFloatTypeKind, /**< 32 bit floating point type */
90 LLVMDoubleTypeKind, /**< 64 bit floating point type */
91 LLVMX86_FP80TypeKind, /**< 80 bit floating point type (X87) */
92 LLVMFP128TypeKind, /**< 128 bit floating point type (112-bit mantissa)*/
93 LLVMPPC_FP128TypeKind, /**< 128 bit floating point type (two 64-bits) */
94 LLVMLabelTypeKind, /**< Labels */
95 LLVMIntegerTypeKind, /**< Arbitrary bit width integers */
96 LLVMFunctionTypeKind, /**< Functions */
97 LLVMStructTypeKind, /**< Structures */
98 LLVMArrayTypeKind, /**< Arrays */
99 LLVMPointerTypeKind, /**< Pointers */
100 LLVMOpaqueTypeKind, /**< Opaque: type with unknown structure */
101 LLVMVectorTypeKind /**< SIMD 'packed' format, or other vector type */
Gordon Henriksen76a03742007-09-18 03:18:57 +0000102} LLVMTypeKind;
103
104typedef enum {
Gordon Henriksen4a4d7352007-12-30 17:46:33 +0000105 LLVMExternalLinkage, /**< Externally visible function */
106 LLVMLinkOnceLinkage, /**< Keep one copy of function when linking (inline)*/
107 LLVMWeakLinkage, /**< Keep one copy of function when linking (weak) */
108 LLVMAppendingLinkage, /**< Special purpose, only applies to global arrays */
109 LLVMInternalLinkage, /**< Rename collisions when linking (static
110 functions) */
111 LLVMDLLImportLinkage, /**< Function to be imported from DLL */
112 LLVMDLLExportLinkage, /**< Function to be accessible from DLL */
113 LLVMExternalWeakLinkage,/**< ExternalWeak linkage description */
114 LLVMGhostLinkage /**< Stand-in functions for streaming fns from
115 bitcode */
Gordon Henriksen76a03742007-09-18 03:18:57 +0000116} LLVMLinkage;
117
118typedef enum {
Gordon Henriksen4a4d7352007-12-30 17:46:33 +0000119 LLVMDefaultVisibility, /**< The GV is visible */
120 LLVMHiddenVisibility, /**< The GV is hidden */
121 LLVMProtectedVisibility /**< The GV is protected */
Gordon Henriksen76a03742007-09-18 03:18:57 +0000122} LLVMVisibility;
123
Gordon Henriksenc23b66c2007-09-26 20:56:12 +0000124typedef enum {
125 LLVMCCallConv = 0,
126 LLVMFastCallConv = 8,
127 LLVMColdCallConv = 9,
128 LLVMX86StdcallCallConv = 64,
129 LLVMX86FastcallCallConv = 65
130} LLVMCallConv;
131
132typedef enum {
Gordon Henriksen4a4d7352007-12-30 17:46:33 +0000133 LLVMIntEQ = 32, /**< equal */
134 LLVMIntNE, /**< not equal */
135 LLVMIntUGT, /**< unsigned greater than */
136 LLVMIntUGE, /**< unsigned greater or equal */
137 LLVMIntULT, /**< unsigned less than */
138 LLVMIntULE, /**< unsigned less or equal */
139 LLVMIntSGT, /**< signed greater than */
140 LLVMIntSGE, /**< signed greater or equal */
141 LLVMIntSLT, /**< signed less than */
142 LLVMIntSLE /**< signed less or equal */
Gordon Henriksenc23b66c2007-09-26 20:56:12 +0000143} LLVMIntPredicate;
144
145typedef enum {
Gordon Henriksen4a4d7352007-12-30 17:46:33 +0000146 LLVMRealPredicateFalse, /**< Always false (always folded) */
147 LLVMRealOEQ, /**< True if ordered and equal */
148 LLVMRealOGT, /**< True if ordered and greater than */
149 LLVMRealOGE, /**< True if ordered and greater than or equal */
150 LLVMRealOLT, /**< True if ordered and less than */
151 LLVMRealOLE, /**< True if ordered and less than or equal */
152 LLVMRealONE, /**< True if ordered and operands are unequal */
153 LLVMRealORD, /**< True if ordered (no nans) */
154 LLVMRealUNO, /**< True if unordered: isnan(X) | isnan(Y) */
155 LLVMRealUEQ, /**< True if unordered or equal */
156 LLVMRealUGT, /**< True if unordered or greater than */
157 LLVMRealUGE, /**< True if unordered, greater than, or equal */
158 LLVMRealULT, /**< True if unordered or less than */
159 LLVMRealULE, /**< True if unordered, less than, or equal */
160 LLVMRealUNE, /**< True if unordered or not equal */
161 LLVMRealPredicateTrue /**< Always true (always folded) */
Gordon Henriksenc23b66c2007-09-26 20:56:12 +0000162} LLVMRealPredicate;
163
Gordon Henriksen76a03742007-09-18 03:18:57 +0000164
Gordon Henriksen34eb6d82007-12-19 22:30:40 +0000165/*===-- Error handling ----------------------------------------------------===*/
166
167void LLVMDisposeMessage(char *Message);
168
169
Gordon Henriksen76a03742007-09-18 03:18:57 +0000170/*===-- Modules -----------------------------------------------------------===*/
171
172/* Create and destroy modules. */
Gordon Henriksena49d4352008-03-07 19:13:06 +0000173/** See llvm::Module::Module. */
Gordon Henriksen76a03742007-09-18 03:18:57 +0000174LLVMModuleRef LLVMModuleCreateWithName(const char *ModuleID);
Gordon Henriksena49d4352008-03-07 19:13:06 +0000175
176/** See llvm::Module::~Module. */
Gordon Henriksen76a03742007-09-18 03:18:57 +0000177void LLVMDisposeModule(LLVMModuleRef M);
178
Gordon Henriksena49d4352008-03-07 19:13:06 +0000179/** Data layout. See Module::getDataLayout. */
Gordon Henriksen05568bb2007-12-27 20:13:47 +0000180const char *LLVMGetDataLayout(LLVMModuleRef M);
181void LLVMSetDataLayout(LLVMModuleRef M, const char *Triple);
182
Gordon Henriksena49d4352008-03-07 19:13:06 +0000183/** Target triple. See Module::getTargetTriple. */
Gordon Henriksen05568bb2007-12-27 20:13:47 +0000184const char *LLVMGetTarget(LLVMModuleRef M);
185void LLVMSetTarget(LLVMModuleRef M, const char *Triple);
186
Gordon Henriksena49d4352008-03-07 19:13:06 +0000187/** See Module::addTypeName. */
Gordon Henriksen76a03742007-09-18 03:18:57 +0000188int LLVMAddTypeName(LLVMModuleRef M, const char *Name, LLVMTypeRef Ty);
Gordon Henriksenc23b66c2007-09-26 20:56:12 +0000189void LLVMDeleteTypeName(LLVMModuleRef M, const char *Name);
Gordon Henriksen76a03742007-09-18 03:18:57 +0000190
Gordon Henriksen6c6075e2008-03-14 23:58:56 +0000191/** See Module::dump. */
192void LLVMDumpModule(LLVMModuleRef M);
193
Gordon Henriksen76a03742007-09-18 03:18:57 +0000194
Gordon Henriksenc23b66c2007-09-26 20:56:12 +0000195/*===-- Types -------------------------------------------------------------===*/
Gordon Henriksen76a03742007-09-18 03:18:57 +0000196
197/* LLVM types conform to the following hierarchy:
198 *
199 * types:
200 * integer type
201 * real type
202 * function type
203 * sequence types:
204 * array type
205 * pointer type
206 * vector type
207 * void type
208 * label type
209 * opaque type
210 */
211
Gordon Henriksena49d4352008-03-07 19:13:06 +0000212/** See llvm::LLVMTypeKind::getTypeID. */
Gordon Henriksen76a03742007-09-18 03:18:57 +0000213LLVMTypeKind LLVMGetTypeKind(LLVMTypeRef Ty);
Gordon Henriksena49d4352008-03-07 19:13:06 +0000214
215/** See llvm::DerivedType::refineAbstractTypeTo. */
Gordon Henriksen76a03742007-09-18 03:18:57 +0000216void LLVMRefineAbstractType(LLVMTypeRef AbstractType, LLVMTypeRef ConcreteType);
217
218/* Operations on integer types */
219LLVMTypeRef LLVMInt1Type();
220LLVMTypeRef LLVMInt8Type();
221LLVMTypeRef LLVMInt16Type();
222LLVMTypeRef LLVMInt32Type();
223LLVMTypeRef LLVMInt64Type();
Gordon Henriksened7beaa2007-10-06 16:05:20 +0000224LLVMTypeRef LLVMIntType(unsigned NumBits);
Gordon Henriksenc23b66c2007-09-26 20:56:12 +0000225unsigned LLVMGetIntTypeWidth(LLVMTypeRef IntegerTy);
Gordon Henriksen76a03742007-09-18 03:18:57 +0000226
227/* Operations on real types */
228LLVMTypeRef LLVMFloatType();
229LLVMTypeRef LLVMDoubleType();
230LLVMTypeRef LLVMX86FP80Type();
231LLVMTypeRef LLVMFP128Type();
232LLVMTypeRef LLVMPPCFP128Type();
233
234/* Operations on function types */
Gordon Henriksened7beaa2007-10-06 16:05:20 +0000235LLVMTypeRef LLVMFunctionType(LLVMTypeRef ReturnType,
236 LLVMTypeRef *ParamTypes, unsigned ParamCount,
237 int IsVarArg);
Gordon Henriksen76a03742007-09-18 03:18:57 +0000238int LLVMIsFunctionVarArg(LLVMTypeRef FunctionTy);
Gordon Henriksenc23b66c2007-09-26 20:56:12 +0000239LLVMTypeRef LLVMGetReturnType(LLVMTypeRef FunctionTy);
240unsigned LLVMCountParamTypes(LLVMTypeRef FunctionTy);
241void LLVMGetParamTypes(LLVMTypeRef FunctionTy, LLVMTypeRef *Dest);
Gordon Henriksen76a03742007-09-18 03:18:57 +0000242
243/* Operations on struct types */
Gordon Henriksened7beaa2007-10-06 16:05:20 +0000244LLVMTypeRef LLVMStructType(LLVMTypeRef *ElementTypes, unsigned ElementCount,
245 int Packed);
Gordon Henriksenc23b66c2007-09-26 20:56:12 +0000246unsigned LLVMCountStructElementTypes(LLVMTypeRef StructTy);
Gordon Henriksen76a03742007-09-18 03:18:57 +0000247void LLVMGetStructElementTypes(LLVMTypeRef StructTy, LLVMTypeRef *Dest);
248int LLVMIsPackedStruct(LLVMTypeRef StructTy);
249
250/* Operations on array, pointer, and vector types (sequence types) */
Gordon Henriksened7beaa2007-10-06 16:05:20 +0000251LLVMTypeRef LLVMArrayType(LLVMTypeRef ElementType, unsigned ElementCount);
Gordon Henriksen5a3fe032007-12-17 16:08:32 +0000252LLVMTypeRef LLVMPointerType(LLVMTypeRef ElementType, unsigned AddressSpace);
Gordon Henriksened7beaa2007-10-06 16:05:20 +0000253LLVMTypeRef LLVMVectorType(LLVMTypeRef ElementType, unsigned ElementCount);
Gordon Henriksen76a03742007-09-18 03:18:57 +0000254
255LLVMTypeRef LLVMGetElementType(LLVMTypeRef Ty);
256unsigned LLVMGetArrayLength(LLVMTypeRef ArrayTy);
Gordon Henriksen5a3fe032007-12-17 16:08:32 +0000257unsigned LLVMGetPointerAddressSpace(LLVMTypeRef PointerTy);
Gordon Henriksen76a03742007-09-18 03:18:57 +0000258unsigned LLVMGetVectorSize(LLVMTypeRef VectorTy);
259
260/* Operations on other types */
261LLVMTypeRef LLVMVoidType();
262LLVMTypeRef LLVMLabelType();
Gordon Henriksened7beaa2007-10-06 16:05:20 +0000263LLVMTypeRef LLVMOpaqueType();
Gordon Henriksen76a03742007-09-18 03:18:57 +0000264
Gordon Henriksenffb48762007-10-07 00:13:35 +0000265/* Operations on type handles */
266LLVMTypeHandleRef LLVMCreateTypeHandle(LLVMTypeRef PotentiallyAbstractTy);
267void LLVMRefineType(LLVMTypeRef AbstractTy, LLVMTypeRef ConcreteTy);
268LLVMTypeRef LLVMResolveTypeHandle(LLVMTypeHandleRef TypeHandle);
269void LLVMDisposeTypeHandle(LLVMTypeHandleRef TypeHandle);
270
Gordon Henriksen76a03742007-09-18 03:18:57 +0000271
272/*===-- Values ------------------------------------------------------------===*/
273
274/* The bulk of LLVM's object model consists of values, which comprise a very
275 * rich type hierarchy.
276 *
277 * values:
278 * constants:
279 * scalar constants
280 * composite contants
281 * globals:
282 * global variable
283 * function
284 * alias
Gordon Henriksenc23b66c2007-09-26 20:56:12 +0000285 * basic blocks
Gordon Henriksen76a03742007-09-18 03:18:57 +0000286 */
287
288/* Operations on all values */
Gordon Henriksenc23b66c2007-09-26 20:56:12 +0000289LLVMTypeRef LLVMTypeOf(LLVMValueRef Val);
Gordon Henriksen76a03742007-09-18 03:18:57 +0000290const char *LLVMGetValueName(LLVMValueRef Val);
291void LLVMSetValueName(LLVMValueRef Val, const char *Name);
Gordon Henriksen1d0d24c2007-10-06 00:08:49 +0000292void LLVMDumpValue(LLVMValueRef Val);
Gordon Henriksen76a03742007-09-18 03:18:57 +0000293
294/* Operations on constants of any type */
Gordon Henriksen1046c732007-10-06 15:11:06 +0000295LLVMValueRef LLVMConstNull(LLVMTypeRef Ty); /* all zeroes */
296LLVMValueRef LLVMConstAllOnes(LLVMTypeRef Ty); /* only for int/vector */
Gordon Henriksen76a03742007-09-18 03:18:57 +0000297LLVMValueRef LLVMGetUndef(LLVMTypeRef Ty);
Gordon Henriksendc88c062007-09-18 18:07:51 +0000298int LLVMIsConstant(LLVMValueRef Val);
Gordon Henriksen76a03742007-09-18 03:18:57 +0000299int LLVMIsNull(LLVMValueRef Val);
Gordon Henriksendc88c062007-09-18 18:07:51 +0000300int LLVMIsUndef(LLVMValueRef Val);
Gordon Henriksen76a03742007-09-18 03:18:57 +0000301
302/* Operations on scalar constants */
Gordon Henriksen1046c732007-10-06 15:11:06 +0000303LLVMValueRef LLVMConstInt(LLVMTypeRef IntTy, unsigned long long N,
304 int SignExtend);
305LLVMValueRef LLVMConstReal(LLVMTypeRef RealTy, double N);
Gordon Henriksen931e1212008-02-02 01:07:50 +0000306LLVMValueRef LLVMConstRealOfString(LLVMTypeRef RealTy, const char *Text);
Gordon Henriksen76a03742007-09-18 03:18:57 +0000307
308/* Operations on composite constants */
Gordon Henriksen1046c732007-10-06 15:11:06 +0000309LLVMValueRef LLVMConstString(const char *Str, unsigned Length,
310 int DontNullTerminate);
311LLVMValueRef LLVMConstArray(LLVMTypeRef ArrayTy,
312 LLVMValueRef *ConstantVals, unsigned Length);
313LLVMValueRef LLVMConstStruct(LLVMValueRef *ConstantVals, unsigned Count,
314 int packed);
315LLVMValueRef LLVMConstVector(LLVMValueRef *ScalarConstantVals, unsigned Size);
Gordon Henriksen76a03742007-09-18 03:18:57 +0000316
Gordon Henriksen7ce31762007-10-06 14:29:36 +0000317/* Constant expressions */
318LLVMValueRef LLVMSizeOf(LLVMTypeRef Ty);
319LLVMValueRef LLVMConstNeg(LLVMValueRef ConstantVal);
320LLVMValueRef LLVMConstNot(LLVMValueRef ConstantVal);
321LLVMValueRef LLVMConstAdd(LLVMValueRef LHSConstant, LLVMValueRef RHSConstant);
322LLVMValueRef LLVMConstSub(LLVMValueRef LHSConstant, LLVMValueRef RHSConstant);
323LLVMValueRef LLVMConstMul(LLVMValueRef LHSConstant, LLVMValueRef RHSConstant);
324LLVMValueRef LLVMConstUDiv(LLVMValueRef LHSConstant, LLVMValueRef RHSConstant);
325LLVMValueRef LLVMConstSDiv(LLVMValueRef LHSConstant, LLVMValueRef RHSConstant);
326LLVMValueRef LLVMConstFDiv(LLVMValueRef LHSConstant, LLVMValueRef RHSConstant);
327LLVMValueRef LLVMConstURem(LLVMValueRef LHSConstant, LLVMValueRef RHSConstant);
328LLVMValueRef LLVMConstSRem(LLVMValueRef LHSConstant, LLVMValueRef RHSConstant);
329LLVMValueRef LLVMConstFRem(LLVMValueRef LHSConstant, LLVMValueRef RHSConstant);
330LLVMValueRef LLVMConstAnd(LLVMValueRef LHSConstant, LLVMValueRef RHSConstant);
331LLVMValueRef LLVMConstOr(LLVMValueRef LHSConstant, LLVMValueRef RHSConstant);
332LLVMValueRef LLVMConstXor(LLVMValueRef LHSConstant, LLVMValueRef RHSConstant);
333LLVMValueRef LLVMConstICmp(LLVMIntPredicate Predicate,
334 LLVMValueRef LHSConstant, LLVMValueRef RHSConstant);
335LLVMValueRef LLVMConstFCmp(LLVMRealPredicate Predicate,
336 LLVMValueRef LHSConstant, LLVMValueRef RHSConstant);
337LLVMValueRef LLVMConstShl(LLVMValueRef LHSConstant, LLVMValueRef RHSConstant);
338LLVMValueRef LLVMConstLShr(LLVMValueRef LHSConstant, LLVMValueRef RHSConstant);
339LLVMValueRef LLVMConstAShr(LLVMValueRef LHSConstant, LLVMValueRef RHSConstant);
340LLVMValueRef LLVMConstGEP(LLVMValueRef ConstantVal,
341 LLVMValueRef *ConstantIndices, unsigned NumIndices);
342LLVMValueRef LLVMConstTrunc(LLVMValueRef ConstantVal, LLVMTypeRef ToType);
343LLVMValueRef LLVMConstSExt(LLVMValueRef ConstantVal, LLVMTypeRef ToType);
344LLVMValueRef LLVMConstZExt(LLVMValueRef ConstantVal, LLVMTypeRef ToType);
345LLVMValueRef LLVMConstFPTrunc(LLVMValueRef ConstantVal, LLVMTypeRef ToType);
346LLVMValueRef LLVMConstFPExt(LLVMValueRef ConstantVal, LLVMTypeRef ToType);
347LLVMValueRef LLVMConstUIToFP(LLVMValueRef ConstantVal, LLVMTypeRef ToType);
348LLVMValueRef LLVMConstSIToFP(LLVMValueRef ConstantVal, LLVMTypeRef ToType);
349LLVMValueRef LLVMConstFPToUI(LLVMValueRef ConstantVal, LLVMTypeRef ToType);
350LLVMValueRef LLVMConstFPToSI(LLVMValueRef ConstantVal, LLVMTypeRef ToType);
351LLVMValueRef LLVMConstPtrToInt(LLVMValueRef ConstantVal, LLVMTypeRef ToType);
352LLVMValueRef LLVMConstIntToPtr(LLVMValueRef ConstantVal, LLVMTypeRef ToType);
353LLVMValueRef LLVMConstBitCast(LLVMValueRef ConstantVal, LLVMTypeRef ToType);
354LLVMValueRef LLVMConstSelect(LLVMValueRef ConstantCondition,
355 LLVMValueRef ConstantIfTrue,
356 LLVMValueRef ConstantIfFalse);
357LLVMValueRef LLVMConstExtractElement(LLVMValueRef VectorConstant,
358 LLVMValueRef IndexConstant);
359LLVMValueRef LLVMConstInsertElement(LLVMValueRef VectorConstant,
360 LLVMValueRef ElementValueConstant,
361 LLVMValueRef IndexConstant);
362LLVMValueRef LLVMConstShuffleVector(LLVMValueRef VectorAConstant,
363 LLVMValueRef VectorBConstant,
364 LLVMValueRef MaskConstant);
365
Gordon Henriksen76a03742007-09-18 03:18:57 +0000366/* Operations on global variables, functions, and aliases (globals) */
367int LLVMIsDeclaration(LLVMValueRef Global);
368LLVMLinkage LLVMGetLinkage(LLVMValueRef Global);
369void LLVMSetLinkage(LLVMValueRef Global, LLVMLinkage Linkage);
370const char *LLVMGetSection(LLVMValueRef Global);
371void LLVMSetSection(LLVMValueRef Global, const char *Section);
372LLVMVisibility LLVMGetVisibility(LLVMValueRef Global);
373void LLVMSetVisibility(LLVMValueRef Global, LLVMVisibility Viz);
374unsigned LLVMGetAlignment(LLVMValueRef Global);
375void LLVMSetAlignment(LLVMValueRef Global, unsigned Bytes);
376
377/* Operations on global variables */
378LLVMValueRef LLVMAddGlobal(LLVMModuleRef M, LLVMTypeRef Ty, const char *Name);
Gordon Henriksen783f7bb2007-10-08 03:45:09 +0000379LLVMValueRef LLVMGetNamedGlobal(LLVMModuleRef M, const char *Name);
Gordon Henriksen76a03742007-09-18 03:18:57 +0000380void LLVMDeleteGlobal(LLVMValueRef GlobalVar);
381int LLVMHasInitializer(LLVMValueRef GlobalVar);
382LLVMValueRef LLVMGetInitializer(LLVMValueRef GlobalVar);
383void LLVMSetInitializer(LLVMValueRef GlobalVar, LLVMValueRef ConstantVal);
384int LLVMIsThreadLocal(LLVMValueRef GlobalVar);
385void LLVMSetThreadLocal(LLVMValueRef GlobalVar, int IsThreadLocal);
Gordon Henriksen751ebf72007-10-07 17:31:42 +0000386int LLVMIsGlobalConstant(LLVMValueRef GlobalVar);
387void LLVMSetGlobalConstant(LLVMValueRef GlobalVar, int IsConstant);
Gordon Henriksen76a03742007-09-18 03:18:57 +0000388
Gordon Henriksenc23b66c2007-09-26 20:56:12 +0000389/* Operations on functions */
390LLVMValueRef LLVMAddFunction(LLVMModuleRef M, const char *Name,
391 LLVMTypeRef FunctionTy);
Gordon Henriksen783f7bb2007-10-08 03:45:09 +0000392LLVMValueRef LLVMGetNamedFunction(LLVMModuleRef M, const char *Name);
Gordon Henriksenc23b66c2007-09-26 20:56:12 +0000393void LLVMDeleteFunction(LLVMValueRef Fn);
394unsigned LLVMCountParams(LLVMValueRef Fn);
395void LLVMGetParams(LLVMValueRef Fn, LLVMValueRef *Params);
396LLVMValueRef LLVMGetParam(LLVMValueRef Fn, unsigned Index);
397unsigned LLVMGetIntrinsicID(LLVMValueRef Fn);
398unsigned LLVMGetFunctionCallConv(LLVMValueRef Fn);
399void LLVMSetFunctionCallConv(LLVMValueRef Fn, unsigned CC);
Gordon Henriksen71183b62007-12-10 03:18:06 +0000400const char *LLVMGetCollector(LLVMValueRef Fn);
401void LLVMSetCollector(LLVMValueRef Fn, const char *Coll);
Gordon Henriksenc23b66c2007-09-26 20:56:12 +0000402
403/* Operations on basic blocks */
404LLVMValueRef LLVMBasicBlockAsValue(LLVMBasicBlockRef Bb);
405int LLVMValueIsBasicBlock(LLVMValueRef Val);
406LLVMBasicBlockRef LLVMValueAsBasicBlock(LLVMValueRef Val);
407unsigned LLVMCountBasicBlocks(LLVMValueRef Fn);
408void LLVMGetBasicBlocks(LLVMValueRef Fn, LLVMBasicBlockRef *BasicBlocks);
409LLVMBasicBlockRef LLVMGetEntryBasicBlock(LLVMValueRef Fn);
410LLVMBasicBlockRef LLVMAppendBasicBlock(LLVMValueRef Fn, const char *Name);
411LLVMBasicBlockRef LLVMInsertBasicBlock(LLVMBasicBlockRef InsertBeforeBB,
412 const char *Name);
413void LLVMDeleteBasicBlock(LLVMBasicBlockRef BB);
414
Gordon Henriksen1158c532007-12-29 20:45:00 +0000415/* Operations on call sites */
416void LLVMSetInstructionCallConv(LLVMValueRef Instr, unsigned CC);
417unsigned LLVMGetInstructionCallConv(LLVMValueRef Instr);
418
Gordon Henriksen44dd8fb2007-10-08 18:14:39 +0000419/* Operations on phi nodes */
420void LLVMAddIncoming(LLVMValueRef PhiNode, LLVMValueRef *IncomingValues,
421 LLVMBasicBlockRef *IncomingBlocks, unsigned Count);
422unsigned LLVMCountIncoming(LLVMValueRef PhiNode);
423LLVMValueRef LLVMGetIncomingValue(LLVMValueRef PhiNode, unsigned Index);
424LLVMBasicBlockRef LLVMGetIncomingBlock(LLVMValueRef PhiNode, unsigned Index);
Gordon Henriksenc23b66c2007-09-26 20:56:12 +0000425
426/*===-- Instruction builders ----------------------------------------------===*/
427
428/* An instruction builder represents a point within a basic block, and is the
429 * exclusive means of building instructions using the C interface.
430 */
431
432LLVMBuilderRef LLVMCreateBuilder();
433void LLVMPositionBuilderBefore(LLVMBuilderRef Builder, LLVMValueRef Instr);
434void LLVMPositionBuilderAtEnd(LLVMBuilderRef Builder, LLVMBasicBlockRef Block);
435void LLVMDisposeBuilder(LLVMBuilderRef Builder);
436
437/* Terminators */
438LLVMValueRef LLVMBuildRetVoid(LLVMBuilderRef);
439LLVMValueRef LLVMBuildRet(LLVMBuilderRef, LLVMValueRef V);
440LLVMValueRef LLVMBuildBr(LLVMBuilderRef, LLVMBasicBlockRef Dest);
441LLVMValueRef LLVMBuildCondBr(LLVMBuilderRef, LLVMValueRef If,
442 LLVMBasicBlockRef Then, LLVMBasicBlockRef Else);
443LLVMValueRef LLVMBuildSwitch(LLVMBuilderRef, LLVMValueRef V,
444 LLVMBasicBlockRef Else, unsigned NumCases);
445LLVMValueRef LLVMBuildInvoke(LLVMBuilderRef, LLVMValueRef Fn,
446 LLVMValueRef *Args, unsigned NumArgs,
447 LLVMBasicBlockRef Then, LLVMBasicBlockRef Catch,
448 const char *Name);
449LLVMValueRef LLVMBuildUnwind(LLVMBuilderRef);
450LLVMValueRef LLVMBuildUnreachable(LLVMBuilderRef);
451
Gordon Henriksen097102c2008-01-01 05:50:53 +0000452/* Add a case to the switch instruction */
453void LLVMAddCase(LLVMValueRef Switch, LLVMValueRef OnVal,
454 LLVMBasicBlockRef Dest);
455
Gordon Henriksenc23b66c2007-09-26 20:56:12 +0000456/* Arithmetic */
457LLVMValueRef LLVMBuildAdd(LLVMBuilderRef, LLVMValueRef LHS, LLVMValueRef RHS,
458 const char *Name);
459LLVMValueRef LLVMBuildSub(LLVMBuilderRef, LLVMValueRef LHS, LLVMValueRef RHS,
460 const char *Name);
461LLVMValueRef LLVMBuildMul(LLVMBuilderRef, LLVMValueRef LHS, LLVMValueRef RHS,
462 const char *Name);
463LLVMValueRef LLVMBuildUDiv(LLVMBuilderRef, LLVMValueRef LHS, LLVMValueRef RHS,
464 const char *Name);
465LLVMValueRef LLVMBuildSDiv(LLVMBuilderRef, LLVMValueRef LHS, LLVMValueRef RHS,
466 const char *Name);
467LLVMValueRef LLVMBuildFDiv(LLVMBuilderRef, LLVMValueRef LHS, LLVMValueRef RHS,
468 const char *Name);
469LLVMValueRef LLVMBuildURem(LLVMBuilderRef, LLVMValueRef LHS, LLVMValueRef RHS,
470 const char *Name);
471LLVMValueRef LLVMBuildSRem(LLVMBuilderRef, LLVMValueRef LHS, LLVMValueRef RHS,
472 const char *Name);
473LLVMValueRef LLVMBuildFRem(LLVMBuilderRef, LLVMValueRef LHS, LLVMValueRef RHS,
474 const char *Name);
475LLVMValueRef LLVMBuildShl(LLVMBuilderRef, LLVMValueRef LHS, LLVMValueRef RHS,
476 const char *Name);
477LLVMValueRef LLVMBuildLShr(LLVMBuilderRef, LLVMValueRef LHS, LLVMValueRef RHS,
478 const char *Name);
479LLVMValueRef LLVMBuildAShr(LLVMBuilderRef, LLVMValueRef LHS, LLVMValueRef RHS,
480 const char *Name);
481LLVMValueRef LLVMBuildAnd(LLVMBuilderRef, LLVMValueRef LHS, LLVMValueRef RHS,
482 const char *Name);
483LLVMValueRef LLVMBuildOr(LLVMBuilderRef, LLVMValueRef LHS, LLVMValueRef RHS,
484 const char *Name);
485LLVMValueRef LLVMBuildXor(LLVMBuilderRef, LLVMValueRef LHS, LLVMValueRef RHS,
486 const char *Name);
487LLVMValueRef LLVMBuildNeg(LLVMBuilderRef, LLVMValueRef V, const char *Name);
488LLVMValueRef LLVMBuildNot(LLVMBuilderRef, LLVMValueRef V, const char *Name);
489
490/* Memory */
491LLVMValueRef LLVMBuildMalloc(LLVMBuilderRef, LLVMTypeRef Ty, const char *Name);
492LLVMValueRef LLVMBuildArrayMalloc(LLVMBuilderRef, LLVMTypeRef Ty,
493 LLVMValueRef Val, const char *Name);
494LLVMValueRef LLVMBuildAlloca(LLVMBuilderRef, LLVMTypeRef Ty, const char *Name);
495LLVMValueRef LLVMBuildArrayAlloca(LLVMBuilderRef, LLVMTypeRef Ty,
496 LLVMValueRef Val, const char *Name);
497LLVMValueRef LLVMBuildFree(LLVMBuilderRef, LLVMValueRef PointerVal);
498LLVMValueRef LLVMBuildLoad(LLVMBuilderRef, LLVMValueRef PointerVal,
499 const char *Name);
500LLVMValueRef LLVMBuildStore(LLVMBuilderRef, LLVMValueRef Val, LLVMValueRef Ptr);
501LLVMValueRef LLVMBuildGEP(LLVMBuilderRef B, LLVMValueRef Pointer,
502 LLVMValueRef *Indices, unsigned NumIndices,
503 const char *Name);
504
505/* Casts */
506LLVMValueRef LLVMBuildTrunc(LLVMBuilderRef, LLVMValueRef Val,
507 LLVMTypeRef DestTy, const char *Name);
508LLVMValueRef LLVMBuildZExt(LLVMBuilderRef, LLVMValueRef Val,
509 LLVMTypeRef DestTy, const char *Name);
510LLVMValueRef LLVMBuildSExt(LLVMBuilderRef, LLVMValueRef Val,
511 LLVMTypeRef DestTy, const char *Name);
512LLVMValueRef LLVMBuildFPToUI(LLVMBuilderRef, LLVMValueRef Val,
513 LLVMTypeRef DestTy, const char *Name);
514LLVMValueRef LLVMBuildFPToSI(LLVMBuilderRef, LLVMValueRef Val,
515 LLVMTypeRef DestTy, const char *Name);
516LLVMValueRef LLVMBuildUIToFP(LLVMBuilderRef, LLVMValueRef Val,
517 LLVMTypeRef DestTy, const char *Name);
518LLVMValueRef LLVMBuildSIToFP(LLVMBuilderRef, LLVMValueRef Val,
519 LLVMTypeRef DestTy, const char *Name);
520LLVMValueRef LLVMBuildFPTrunc(LLVMBuilderRef, LLVMValueRef Val,
521 LLVMTypeRef DestTy, const char *Name);
522LLVMValueRef LLVMBuildFPExt(LLVMBuilderRef, LLVMValueRef Val,
523 LLVMTypeRef DestTy, const char *Name);
524LLVMValueRef LLVMBuildPtrToInt(LLVMBuilderRef, LLVMValueRef Val,
525 LLVMTypeRef DestTy, const char *Name);
526LLVMValueRef LLVMBuildIntToPtr(LLVMBuilderRef, LLVMValueRef Val,
527 LLVMTypeRef DestTy, const char *Name);
528LLVMValueRef LLVMBuildBitCast(LLVMBuilderRef, LLVMValueRef Val,
529 LLVMTypeRef DestTy, const char *Name);
530
531/* Comparisons */
532LLVMValueRef LLVMBuildICmp(LLVMBuilderRef, LLVMIntPredicate Op,
533 LLVMValueRef LHS, LLVMValueRef RHS,
534 const char *Name);
535LLVMValueRef LLVMBuildFCmp(LLVMBuilderRef, LLVMRealPredicate Op,
536 LLVMValueRef LHS, LLVMValueRef RHS,
537 const char *Name);
538
539/* Miscellaneous instructions */
540LLVMValueRef LLVMBuildPhi(LLVMBuilderRef, LLVMTypeRef Ty, const char *Name);
541LLVMValueRef LLVMBuildCall(LLVMBuilderRef, LLVMValueRef Fn,
542 LLVMValueRef *Args, unsigned NumArgs,
543 const char *Name);
544LLVMValueRef LLVMBuildSelect(LLVMBuilderRef, LLVMValueRef If,
545 LLVMValueRef Then, LLVMValueRef Else,
546 const char *Name);
547LLVMValueRef LLVMBuildVAArg(LLVMBuilderRef, LLVMValueRef List, LLVMTypeRef Ty,
548 const char *Name);
549LLVMValueRef LLVMBuildExtractElement(LLVMBuilderRef, LLVMValueRef VecVal,
550 LLVMValueRef Index, const char *Name);
551LLVMValueRef LLVMBuildInsertElement(LLVMBuilderRef, LLVMValueRef VecVal,
552 LLVMValueRef EltVal, LLVMValueRef Index,
553 const char *Name);
554LLVMValueRef LLVMBuildShuffleVector(LLVMBuilderRef, LLVMValueRef V1,
555 LLVMValueRef V2, LLVMValueRef Mask,
556 const char *Name);
Gordon Henriksen76a03742007-09-18 03:18:57 +0000557
Gordon Henriksen34eb6d82007-12-19 22:30:40 +0000558
Gordon Henriksen0a68fe22007-12-12 01:04:30 +0000559/*===-- Module providers --------------------------------------------------===*/
560
561/* Encapsulates the module M in a module provider, taking ownership of the
562 * module.
563 * See the constructor llvm::ExistingModuleProvider::ExistingModuleProvider.
564 */
565LLVMModuleProviderRef
566LLVMCreateModuleProviderForExistingModule(LLVMModuleRef M);
567
568/* Destroys the module provider MP as well as the contained module.
569 * See the destructor llvm::ModuleProvider::~ModuleProvider.
570 */
571void LLVMDisposeModuleProvider(LLVMModuleProviderRef MP);
572
Gordon Henriksen34eb6d82007-12-19 22:30:40 +0000573
574/*===-- Memory buffers ----------------------------------------------------===*/
575
576int LLVMCreateMemoryBufferWithContentsOfFile(const char *Path,
577 LLVMMemoryBufferRef *OutMemBuf,
578 char **OutMessage);
579int LLVMCreateMemoryBufferWithSTDIN(LLVMMemoryBufferRef *OutMemBuf,
580 char **OutMessage);
581void LLVMDisposeMemoryBuffer(LLVMMemoryBufferRef MemBuf);
582
Gordon Henriksen878114b2008-03-16 04:20:44 +0000583
584/*===-- Pass Managers -----------------------------------------------------===*/
585
586/** Constructs a new whole-module pass pipeline. This type of pipeline is
587 suitable for link-time optimization and whole-module transformations.
588 See llvm::PassManager::PassManager. */
589LLVMPassManagerRef LLVMCreatePassManager();
590
591/** Constructs a new function-by-function pass pipeline over the module
592 provider. It does not take ownership of the module provider. This type of
593 pipeline is suitable for code generation and JIT compilation tasks.
594 See llvm::FunctionPassManager::FunctionPassManager. */
595LLVMPassManagerRef LLVMCreateFunctionPassManager(LLVMModuleProviderRef MP);
596
597/** Initializes, executes on the provided module, and finalizes all of the
598 passes scheduled in the pass manager. Returns 1 if any of the passes
599 modified the module, 0 otherwise. See llvm::PassManager::run(Module&). */
600int LLVMRunPassManager(LLVMPassManagerRef PM, LLVMModuleRef M);
601
602/** Initializes all of the function passes scheduled in the function pass
603 manager. Returns 1 if any of the passes modified the module, 0 otherwise.
604 See llvm::FunctionPassManager::doInitialization. */
605int LLVMInitializeFunctionPassManager(LLVMPassManagerRef FPM);
606
607/** Executes all of the function passes scheduled in the function pass manager
608 on the provided function. Returns 1 if any of the passes modified the
609 function, false otherwise.
610 See llvm::FunctionPassManager::run(Function&). */
611int LLVMRunFunctionPassManager(LLVMPassManagerRef FPM, LLVMValueRef F);
612
613/** Finalizes all of the function passes scheduled in in the function pass
614 manager. Returns 1 if any of the passes modified the module, 0 otherwise.
615 See llvm::FunctionPassManager::doFinalization. */
616int LLVMFinalizeFunctionPassManager(LLVMPassManagerRef FPM);
617
618/** Frees the memory of a pass pipeline. For function pipelines, does not free
619 the module provider.
620 See llvm::PassManagerBase::~PassManagerBase. */
621void LLVMDisposePassManager(LLVMPassManagerRef PM);
622
623
Gordon Henriksen76a03742007-09-18 03:18:57 +0000624#ifdef __cplusplus
625}
Gordon Henriksen76a03742007-09-18 03:18:57 +0000626
Gordon Henriksen7330acd2007-10-05 23:59:36 +0000627namespace llvm {
Gordon Henriksen0a68fe22007-12-12 01:04:30 +0000628 class ModuleProvider;
Gordon Henriksen34eb6d82007-12-19 22:30:40 +0000629 class MemoryBuffer;
Gordon Henriksen0a68fe22007-12-12 01:04:30 +0000630
Gordon Henriksen34eb6d82007-12-19 22:30:40 +0000631 #define DEFINE_SIMPLE_CONVERSION_FUNCTIONS(ty, ref) \
632 inline ty *unwrap(ref P) { \
633 return reinterpret_cast<ty*>(P); \
634 } \
635 \
636 inline ref wrap(const ty *P) { \
637 return reinterpret_cast<ref>(const_cast<ty*>(P)); \
638 }
Gordon Henriksen7330acd2007-10-05 23:59:36 +0000639
Gordon Henriksen878114b2008-03-16 04:20:44 +0000640 #define DEFINE_ISA_CONVERSION_FUNCTIONS(ty, ref) \
641 DEFINE_SIMPLE_CONVERSION_FUNCTIONS(ty, ref) \
642 \
643 template<typename T> \
644 inline T *unwrap(ref P) { \
645 return cast<T>(unwrap(P)); \
646 }
647
648 #define DEFINE_STDCXX_CONVERSION_FUNCTIONS(ty, ref) \
649 DEFINE_SIMPLE_CONVERSION_FUNCTIONS(ty, ref) \
650 \
651 template<typename T> \
652 inline T *unwrap(ref P) { \
653 T *Q = dynamic_cast<T*>(unwrap(P)); \
654 assert(Q && "Invalid cast!"); \
655 return Q; \
656 }
657
658 DEFINE_ISA_CONVERSION_FUNCTIONS (Type, LLVMTypeRef )
659 DEFINE_ISA_CONVERSION_FUNCTIONS (Value, LLVMValueRef )
Gordon Henriksen823f9732007-12-27 18:25:59 +0000660 DEFINE_SIMPLE_CONVERSION_FUNCTIONS(Module, LLVMModuleRef )
661 DEFINE_SIMPLE_CONVERSION_FUNCTIONS(BasicBlock, LLVMBasicBlockRef )
662 DEFINE_SIMPLE_CONVERSION_FUNCTIONS(LLVMFoldingBuilder, LLVMBuilderRef )
663 DEFINE_SIMPLE_CONVERSION_FUNCTIONS(PATypeHolder, LLVMTypeHandleRef )
664 DEFINE_SIMPLE_CONVERSION_FUNCTIONS(ModuleProvider, LLVMModuleProviderRef)
665 DEFINE_SIMPLE_CONVERSION_FUNCTIONS(MemoryBuffer, LLVMMemoryBufferRef )
Gordon Henriksen878114b2008-03-16 04:20:44 +0000666 DEFINE_STDCXX_CONVERSION_FUNCTIONS(PassManagerBase, LLVMPassManagerRef )
Gordon Henriksen7330acd2007-10-05 23:59:36 +0000667
Gordon Henriksen878114b2008-03-16 04:20:44 +0000668 #undef DEFINE_STDCXX_CONVERSION_FUNCTIONS
669 #undef DEFINE_ISA_CONVERSION_FUNCTIONS
Gordon Henriksen34eb6d82007-12-19 22:30:40 +0000670 #undef DEFINE_SIMPLE_CONVERSION_FUNCTIONS
Gordon Henriksen7330acd2007-10-05 23:59:36 +0000671
Gordon Henriksen34eb6d82007-12-19 22:30:40 +0000672 /* Specialized opaque type conversions.
673 */
Gordon Henriksen7330acd2007-10-05 23:59:36 +0000674 inline Type **unwrap(LLVMTypeRef* Tys) {
675 return reinterpret_cast<Type**>(Tys);
676 }
677
Gordon Henriksen7330acd2007-10-05 23:59:36 +0000678 inline LLVMTypeRef *wrap(const Type **Tys) {
679 return reinterpret_cast<LLVMTypeRef*>(const_cast<Type**>(Tys));
680 }
681
Gordon Henriksen34eb6d82007-12-19 22:30:40 +0000682 /* Specialized opaque value conversions.
Gordon Henriksen7330acd2007-10-05 23:59:36 +0000683 */
Gordon Henriksen7330acd2007-10-05 23:59:36 +0000684 inline Value **unwrap(LLVMValueRef *Vals) {
685 return reinterpret_cast<Value**>(Vals);
686 }
687
688 template<typename T>
689 inline T **unwrap(LLVMValueRef *Vals, unsigned Length) {
690 #if DEBUG
691 for (LLVMValueRef *I = Vals, E = Vals + Length; I != E; ++I)
692 cast<T>(*I);
693 #endif
694 return reinterpret_cast<T**>(Vals);
695 }
696
Gordon Henriksen7330acd2007-10-05 23:59:36 +0000697 inline LLVMValueRef *wrap(const Value **Vals) {
698 return reinterpret_cast<LLVMValueRef*>(const_cast<Value**>(Vals));
699 }
Gordon Henriksen7330acd2007-10-05 23:59:36 +0000700}
701
702#endif /* !defined(__cplusplus) */
703
704#endif /* !defined(LLVM_C_CORE_H) */