blob: 2c1228e30128b14b0421d08a785507db03888c33 [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"
42
Gordon Henriksen76a03742007-09-18 03:18:57 +000043extern "C" {
44#endif
45
46
47/* Opaque types. */
Gordon Henriksen4a4d7352007-12-30 17:46:33 +000048
49/**
50 * The top-level container for all other LLVM Intermediate Representation (IR)
51 * objects. See the llvm::Module class.
52 */
Gordon Henriksen76a03742007-09-18 03:18:57 +000053typedef struct LLVMOpaqueModule *LLVMModuleRef;
Gordon Henriksen4a4d7352007-12-30 17:46:33 +000054
55/**
Gordon Henriksena49d4352008-03-07 19:13:06 +000056 * Each value in the LLVM IR has a type, an LLVMTypeRef. See the llvm::Type
57 * class.
Gordon Henriksen4a4d7352007-12-30 17:46:33 +000058 */
Gordon Henriksen76a03742007-09-18 03:18:57 +000059typedef struct LLVMOpaqueType *LLVMTypeRef;
Gordon Henriksen4a4d7352007-12-30 17:46:33 +000060
61/**
Gordon Henriksena49d4352008-03-07 19:13:06 +000062 * When building recursive types using LLVMRefineType, LLVMTypeRef values may
63 * become invalid; use LLVMTypeHandleRef to resolve this problem. See the
64 * llvm::AbstractTypeHolder class.
Gordon Henriksen4a4d7352007-12-30 17:46:33 +000065 */
Gordon Henriksenffb48762007-10-07 00:13:35 +000066typedef struct LLVMOpaqueTypeHandle *LLVMTypeHandleRef;
Gordon Henriksen4a4d7352007-12-30 17:46:33 +000067
Gordon Henriksen76a03742007-09-18 03:18:57 +000068typedef struct LLVMOpaqueValue *LLVMValueRef;
Gordon Henriksenc23b66c2007-09-26 20:56:12 +000069typedef struct LLVMOpaqueBasicBlock *LLVMBasicBlockRef;
70typedef struct LLVMOpaqueBuilder *LLVMBuilderRef;
Gordon Henriksen34eb6d82007-12-19 22:30:40 +000071
72/* Used to provide a module to JIT or interpreter.
73 * See the llvm::ModuleProvider class.
74 */
Gordon Henriksen0a68fe22007-12-12 01:04:30 +000075typedef struct LLVMOpaqueModuleProvider *LLVMModuleProviderRef;
Gordon Henriksen76a03742007-09-18 03:18:57 +000076
Gordon Henriksen34eb6d82007-12-19 22:30:40 +000077/* Used to provide a module to JIT or interpreter.
78 * See the llvm::MemoryBuffer class.
79 */
80typedef struct LLVMOpaqueMemoryBuffer *LLVMMemoryBufferRef;
81
Gordon Henriksen878114b2008-03-16 04:20:44 +000082/** See the llvm::PassManagerBase class. */
83typedef struct LLVMOpaquePassManager *LLVMPassManagerRef;
84
Gordon Henriksen76a03742007-09-18 03:18:57 +000085typedef enum {
Gordon Henriksen4a4d7352007-12-30 17:46:33 +000086 LLVMVoidTypeKind, /**< type with no size */
87 LLVMFloatTypeKind, /**< 32 bit floating point type */
88 LLVMDoubleTypeKind, /**< 64 bit floating point type */
89 LLVMX86_FP80TypeKind, /**< 80 bit floating point type (X87) */
90 LLVMFP128TypeKind, /**< 128 bit floating point type (112-bit mantissa)*/
91 LLVMPPC_FP128TypeKind, /**< 128 bit floating point type (two 64-bits) */
92 LLVMLabelTypeKind, /**< Labels */
93 LLVMIntegerTypeKind, /**< Arbitrary bit width integers */
94 LLVMFunctionTypeKind, /**< Functions */
95 LLVMStructTypeKind, /**< Structures */
96 LLVMArrayTypeKind, /**< Arrays */
97 LLVMPointerTypeKind, /**< Pointers */
98 LLVMOpaqueTypeKind, /**< Opaque: type with unknown structure */
99 LLVMVectorTypeKind /**< SIMD 'packed' format, or other vector type */
Gordon Henriksen76a03742007-09-18 03:18:57 +0000100} LLVMTypeKind;
101
102typedef enum {
Gordon Henriksen4a4d7352007-12-30 17:46:33 +0000103 LLVMExternalLinkage, /**< Externally visible function */
104 LLVMLinkOnceLinkage, /**< Keep one copy of function when linking (inline)*/
105 LLVMWeakLinkage, /**< Keep one copy of function when linking (weak) */
106 LLVMAppendingLinkage, /**< Special purpose, only applies to global arrays */
107 LLVMInternalLinkage, /**< Rename collisions when linking (static
108 functions) */
109 LLVMDLLImportLinkage, /**< Function to be imported from DLL */
110 LLVMDLLExportLinkage, /**< Function to be accessible from DLL */
111 LLVMExternalWeakLinkage,/**< ExternalWeak linkage description */
112 LLVMGhostLinkage /**< Stand-in functions for streaming fns from
113 bitcode */
Gordon Henriksen76a03742007-09-18 03:18:57 +0000114} LLVMLinkage;
115
116typedef enum {
Gordon Henriksen4a4d7352007-12-30 17:46:33 +0000117 LLVMDefaultVisibility, /**< The GV is visible */
118 LLVMHiddenVisibility, /**< The GV is hidden */
119 LLVMProtectedVisibility /**< The GV is protected */
Gordon Henriksen76a03742007-09-18 03:18:57 +0000120} LLVMVisibility;
121
Gordon Henriksenc23b66c2007-09-26 20:56:12 +0000122typedef enum {
123 LLVMCCallConv = 0,
124 LLVMFastCallConv = 8,
125 LLVMColdCallConv = 9,
126 LLVMX86StdcallCallConv = 64,
127 LLVMX86FastcallCallConv = 65
128} LLVMCallConv;
129
130typedef enum {
Gordon Henriksen4a4d7352007-12-30 17:46:33 +0000131 LLVMIntEQ = 32, /**< equal */
132 LLVMIntNE, /**< not equal */
133 LLVMIntUGT, /**< unsigned greater than */
134 LLVMIntUGE, /**< unsigned greater or equal */
135 LLVMIntULT, /**< unsigned less than */
136 LLVMIntULE, /**< unsigned less or equal */
137 LLVMIntSGT, /**< signed greater than */
138 LLVMIntSGE, /**< signed greater or equal */
139 LLVMIntSLT, /**< signed less than */
140 LLVMIntSLE /**< signed less or equal */
Gordon Henriksenc23b66c2007-09-26 20:56:12 +0000141} LLVMIntPredicate;
142
143typedef enum {
Gordon Henriksen4a4d7352007-12-30 17:46:33 +0000144 LLVMRealPredicateFalse, /**< Always false (always folded) */
145 LLVMRealOEQ, /**< True if ordered and equal */
146 LLVMRealOGT, /**< True if ordered and greater than */
147 LLVMRealOGE, /**< True if ordered and greater than or equal */
148 LLVMRealOLT, /**< True if ordered and less than */
149 LLVMRealOLE, /**< True if ordered and less than or equal */
150 LLVMRealONE, /**< True if ordered and operands are unequal */
151 LLVMRealORD, /**< True if ordered (no nans) */
152 LLVMRealUNO, /**< True if unordered: isnan(X) | isnan(Y) */
153 LLVMRealUEQ, /**< True if unordered or equal */
154 LLVMRealUGT, /**< True if unordered or greater than */
155 LLVMRealUGE, /**< True if unordered, greater than, or equal */
156 LLVMRealULT, /**< True if unordered or less than */
157 LLVMRealULE, /**< True if unordered, less than, or equal */
158 LLVMRealUNE, /**< True if unordered or not equal */
159 LLVMRealPredicateTrue /**< Always true (always folded) */
Gordon Henriksenc23b66c2007-09-26 20:56:12 +0000160} LLVMRealPredicate;
161
Gordon Henriksen76a03742007-09-18 03:18:57 +0000162
Gordon Henriksen34eb6d82007-12-19 22:30:40 +0000163/*===-- Error handling ----------------------------------------------------===*/
164
165void LLVMDisposeMessage(char *Message);
166
167
Gordon Henriksen76a03742007-09-18 03:18:57 +0000168/*===-- Modules -----------------------------------------------------------===*/
169
170/* Create and destroy modules. */
Gordon Henriksena49d4352008-03-07 19:13:06 +0000171/** See llvm::Module::Module. */
Gordon Henriksen76a03742007-09-18 03:18:57 +0000172LLVMModuleRef LLVMModuleCreateWithName(const char *ModuleID);
Gordon Henriksena49d4352008-03-07 19:13:06 +0000173
174/** See llvm::Module::~Module. */
Gordon Henriksen76a03742007-09-18 03:18:57 +0000175void LLVMDisposeModule(LLVMModuleRef M);
176
Gordon Henriksena49d4352008-03-07 19:13:06 +0000177/** Data layout. See Module::getDataLayout. */
Gordon Henriksen05568bb2007-12-27 20:13:47 +0000178const char *LLVMGetDataLayout(LLVMModuleRef M);
179void LLVMSetDataLayout(LLVMModuleRef M, const char *Triple);
180
Gordon Henriksena49d4352008-03-07 19:13:06 +0000181/** Target triple. See Module::getTargetTriple. */
Gordon Henriksen05568bb2007-12-27 20:13:47 +0000182const char *LLVMGetTarget(LLVMModuleRef M);
183void LLVMSetTarget(LLVMModuleRef M, const char *Triple);
184
Gordon Henriksena49d4352008-03-07 19:13:06 +0000185/** See Module::addTypeName. */
Gordon Henriksen76a03742007-09-18 03:18:57 +0000186int LLVMAddTypeName(LLVMModuleRef M, const char *Name, LLVMTypeRef Ty);
Gordon Henriksenc23b66c2007-09-26 20:56:12 +0000187void LLVMDeleteTypeName(LLVMModuleRef M, const char *Name);
Gordon Henriksen76a03742007-09-18 03:18:57 +0000188
Gordon Henriksen6c6075e2008-03-14 23:58:56 +0000189/** See Module::dump. */
190void LLVMDumpModule(LLVMModuleRef M);
191
Gordon Henriksen76a03742007-09-18 03:18:57 +0000192
Gordon Henriksenc23b66c2007-09-26 20:56:12 +0000193/*===-- Types -------------------------------------------------------------===*/
Gordon Henriksen76a03742007-09-18 03:18:57 +0000194
195/* LLVM types conform to the following hierarchy:
196 *
197 * types:
198 * integer type
199 * real type
200 * function type
201 * sequence types:
202 * array type
203 * pointer type
204 * vector type
205 * void type
206 * label type
207 * opaque type
208 */
209
Gordon Henriksena49d4352008-03-07 19:13:06 +0000210/** See llvm::LLVMTypeKind::getTypeID. */
Gordon Henriksen76a03742007-09-18 03:18:57 +0000211LLVMTypeKind LLVMGetTypeKind(LLVMTypeRef Ty);
Gordon Henriksena49d4352008-03-07 19:13:06 +0000212
213/** See llvm::DerivedType::refineAbstractTypeTo. */
Gordon Henriksen76a03742007-09-18 03:18:57 +0000214void LLVMRefineAbstractType(LLVMTypeRef AbstractType, LLVMTypeRef ConcreteType);
215
216/* Operations on integer types */
217LLVMTypeRef LLVMInt1Type();
218LLVMTypeRef LLVMInt8Type();
219LLVMTypeRef LLVMInt16Type();
220LLVMTypeRef LLVMInt32Type();
221LLVMTypeRef LLVMInt64Type();
Gordon Henriksened7beaa2007-10-06 16:05:20 +0000222LLVMTypeRef LLVMIntType(unsigned NumBits);
Gordon Henriksenc23b66c2007-09-26 20:56:12 +0000223unsigned LLVMGetIntTypeWidth(LLVMTypeRef IntegerTy);
Gordon Henriksen76a03742007-09-18 03:18:57 +0000224
225/* Operations on real types */
226LLVMTypeRef LLVMFloatType();
227LLVMTypeRef LLVMDoubleType();
228LLVMTypeRef LLVMX86FP80Type();
229LLVMTypeRef LLVMFP128Type();
230LLVMTypeRef LLVMPPCFP128Type();
231
232/* Operations on function types */
Gordon Henriksened7beaa2007-10-06 16:05:20 +0000233LLVMTypeRef LLVMFunctionType(LLVMTypeRef ReturnType,
234 LLVMTypeRef *ParamTypes, unsigned ParamCount,
235 int IsVarArg);
Gordon Henriksen76a03742007-09-18 03:18:57 +0000236int LLVMIsFunctionVarArg(LLVMTypeRef FunctionTy);
Gordon Henriksenc23b66c2007-09-26 20:56:12 +0000237LLVMTypeRef LLVMGetReturnType(LLVMTypeRef FunctionTy);
238unsigned LLVMCountParamTypes(LLVMTypeRef FunctionTy);
239void LLVMGetParamTypes(LLVMTypeRef FunctionTy, LLVMTypeRef *Dest);
Gordon Henriksen76a03742007-09-18 03:18:57 +0000240
241/* Operations on struct types */
Gordon Henriksened7beaa2007-10-06 16:05:20 +0000242LLVMTypeRef LLVMStructType(LLVMTypeRef *ElementTypes, unsigned ElementCount,
243 int Packed);
Gordon Henriksenc23b66c2007-09-26 20:56:12 +0000244unsigned LLVMCountStructElementTypes(LLVMTypeRef StructTy);
Gordon Henriksen76a03742007-09-18 03:18:57 +0000245void LLVMGetStructElementTypes(LLVMTypeRef StructTy, LLVMTypeRef *Dest);
246int LLVMIsPackedStruct(LLVMTypeRef StructTy);
247
248/* Operations on array, pointer, and vector types (sequence types) */
Gordon Henriksened7beaa2007-10-06 16:05:20 +0000249LLVMTypeRef LLVMArrayType(LLVMTypeRef ElementType, unsigned ElementCount);
Gordon Henriksen5a3fe032007-12-17 16:08:32 +0000250LLVMTypeRef LLVMPointerType(LLVMTypeRef ElementType, unsigned AddressSpace);
Gordon Henriksened7beaa2007-10-06 16:05:20 +0000251LLVMTypeRef LLVMVectorType(LLVMTypeRef ElementType, unsigned ElementCount);
Gordon Henriksen76a03742007-09-18 03:18:57 +0000252
253LLVMTypeRef LLVMGetElementType(LLVMTypeRef Ty);
254unsigned LLVMGetArrayLength(LLVMTypeRef ArrayTy);
Gordon Henriksen5a3fe032007-12-17 16:08:32 +0000255unsigned LLVMGetPointerAddressSpace(LLVMTypeRef PointerTy);
Gordon Henriksen76a03742007-09-18 03:18:57 +0000256unsigned LLVMGetVectorSize(LLVMTypeRef VectorTy);
257
258/* Operations on other types */
259LLVMTypeRef LLVMVoidType();
260LLVMTypeRef LLVMLabelType();
Gordon Henriksened7beaa2007-10-06 16:05:20 +0000261LLVMTypeRef LLVMOpaqueType();
Gordon Henriksen76a03742007-09-18 03:18:57 +0000262
Gordon Henriksenffb48762007-10-07 00:13:35 +0000263/* Operations on type handles */
264LLVMTypeHandleRef LLVMCreateTypeHandle(LLVMTypeRef PotentiallyAbstractTy);
265void LLVMRefineType(LLVMTypeRef AbstractTy, LLVMTypeRef ConcreteTy);
266LLVMTypeRef LLVMResolveTypeHandle(LLVMTypeHandleRef TypeHandle);
267void LLVMDisposeTypeHandle(LLVMTypeHandleRef TypeHandle);
268
Gordon Henriksen76a03742007-09-18 03:18:57 +0000269
270/*===-- Values ------------------------------------------------------------===*/
271
272/* The bulk of LLVM's object model consists of values, which comprise a very
273 * rich type hierarchy.
274 *
275 * values:
276 * constants:
277 * scalar constants
278 * composite contants
279 * globals:
280 * global variable
281 * function
282 * alias
Gordon Henriksenc23b66c2007-09-26 20:56:12 +0000283 * basic blocks
Gordon Henriksen76a03742007-09-18 03:18:57 +0000284 */
285
286/* Operations on all values */
Gordon Henriksenc23b66c2007-09-26 20:56:12 +0000287LLVMTypeRef LLVMTypeOf(LLVMValueRef Val);
Gordon Henriksen76a03742007-09-18 03:18:57 +0000288const char *LLVMGetValueName(LLVMValueRef Val);
289void LLVMSetValueName(LLVMValueRef Val, const char *Name);
Gordon Henriksen1d0d24c2007-10-06 00:08:49 +0000290void LLVMDumpValue(LLVMValueRef Val);
Gordon Henriksen76a03742007-09-18 03:18:57 +0000291
292/* Operations on constants of any type */
Gordon Henriksen1046c732007-10-06 15:11:06 +0000293LLVMValueRef LLVMConstNull(LLVMTypeRef Ty); /* all zeroes */
294LLVMValueRef LLVMConstAllOnes(LLVMTypeRef Ty); /* only for int/vector */
Gordon Henriksen76a03742007-09-18 03:18:57 +0000295LLVMValueRef LLVMGetUndef(LLVMTypeRef Ty);
Gordon Henriksendc88c062007-09-18 18:07:51 +0000296int LLVMIsConstant(LLVMValueRef Val);
Gordon Henriksen76a03742007-09-18 03:18:57 +0000297int LLVMIsNull(LLVMValueRef Val);
Gordon Henriksendc88c062007-09-18 18:07:51 +0000298int LLVMIsUndef(LLVMValueRef Val);
Gordon Henriksen76a03742007-09-18 03:18:57 +0000299
300/* Operations on scalar constants */
Gordon Henriksen1046c732007-10-06 15:11:06 +0000301LLVMValueRef LLVMConstInt(LLVMTypeRef IntTy, unsigned long long N,
302 int SignExtend);
303LLVMValueRef LLVMConstReal(LLVMTypeRef RealTy, double N);
Gordon Henriksen931e1212008-02-02 01:07:50 +0000304LLVMValueRef LLVMConstRealOfString(LLVMTypeRef RealTy, const char *Text);
Gordon Henriksen76a03742007-09-18 03:18:57 +0000305
306/* Operations on composite constants */
Gordon Henriksen1046c732007-10-06 15:11:06 +0000307LLVMValueRef LLVMConstString(const char *Str, unsigned Length,
308 int DontNullTerminate);
309LLVMValueRef LLVMConstArray(LLVMTypeRef ArrayTy,
310 LLVMValueRef *ConstantVals, unsigned Length);
311LLVMValueRef LLVMConstStruct(LLVMValueRef *ConstantVals, unsigned Count,
312 int packed);
313LLVMValueRef LLVMConstVector(LLVMValueRef *ScalarConstantVals, unsigned Size);
Gordon Henriksen76a03742007-09-18 03:18:57 +0000314
Gordon Henriksen7ce31762007-10-06 14:29:36 +0000315/* Constant expressions */
316LLVMValueRef LLVMSizeOf(LLVMTypeRef Ty);
317LLVMValueRef LLVMConstNeg(LLVMValueRef ConstantVal);
318LLVMValueRef LLVMConstNot(LLVMValueRef ConstantVal);
319LLVMValueRef LLVMConstAdd(LLVMValueRef LHSConstant, LLVMValueRef RHSConstant);
320LLVMValueRef LLVMConstSub(LLVMValueRef LHSConstant, LLVMValueRef RHSConstant);
321LLVMValueRef LLVMConstMul(LLVMValueRef LHSConstant, LLVMValueRef RHSConstant);
322LLVMValueRef LLVMConstUDiv(LLVMValueRef LHSConstant, LLVMValueRef RHSConstant);
323LLVMValueRef LLVMConstSDiv(LLVMValueRef LHSConstant, LLVMValueRef RHSConstant);
324LLVMValueRef LLVMConstFDiv(LLVMValueRef LHSConstant, LLVMValueRef RHSConstant);
325LLVMValueRef LLVMConstURem(LLVMValueRef LHSConstant, LLVMValueRef RHSConstant);
326LLVMValueRef LLVMConstSRem(LLVMValueRef LHSConstant, LLVMValueRef RHSConstant);
327LLVMValueRef LLVMConstFRem(LLVMValueRef LHSConstant, LLVMValueRef RHSConstant);
328LLVMValueRef LLVMConstAnd(LLVMValueRef LHSConstant, LLVMValueRef RHSConstant);
329LLVMValueRef LLVMConstOr(LLVMValueRef LHSConstant, LLVMValueRef RHSConstant);
330LLVMValueRef LLVMConstXor(LLVMValueRef LHSConstant, LLVMValueRef RHSConstant);
331LLVMValueRef LLVMConstICmp(LLVMIntPredicate Predicate,
332 LLVMValueRef LHSConstant, LLVMValueRef RHSConstant);
333LLVMValueRef LLVMConstFCmp(LLVMRealPredicate Predicate,
334 LLVMValueRef LHSConstant, LLVMValueRef RHSConstant);
335LLVMValueRef LLVMConstShl(LLVMValueRef LHSConstant, LLVMValueRef RHSConstant);
336LLVMValueRef LLVMConstLShr(LLVMValueRef LHSConstant, LLVMValueRef RHSConstant);
337LLVMValueRef LLVMConstAShr(LLVMValueRef LHSConstant, LLVMValueRef RHSConstant);
338LLVMValueRef LLVMConstGEP(LLVMValueRef ConstantVal,
339 LLVMValueRef *ConstantIndices, unsigned NumIndices);
340LLVMValueRef LLVMConstTrunc(LLVMValueRef ConstantVal, LLVMTypeRef ToType);
341LLVMValueRef LLVMConstSExt(LLVMValueRef ConstantVal, LLVMTypeRef ToType);
342LLVMValueRef LLVMConstZExt(LLVMValueRef ConstantVal, LLVMTypeRef ToType);
343LLVMValueRef LLVMConstFPTrunc(LLVMValueRef ConstantVal, LLVMTypeRef ToType);
344LLVMValueRef LLVMConstFPExt(LLVMValueRef ConstantVal, LLVMTypeRef ToType);
345LLVMValueRef LLVMConstUIToFP(LLVMValueRef ConstantVal, LLVMTypeRef ToType);
346LLVMValueRef LLVMConstSIToFP(LLVMValueRef ConstantVal, LLVMTypeRef ToType);
347LLVMValueRef LLVMConstFPToUI(LLVMValueRef ConstantVal, LLVMTypeRef ToType);
348LLVMValueRef LLVMConstFPToSI(LLVMValueRef ConstantVal, LLVMTypeRef ToType);
349LLVMValueRef LLVMConstPtrToInt(LLVMValueRef ConstantVal, LLVMTypeRef ToType);
350LLVMValueRef LLVMConstIntToPtr(LLVMValueRef ConstantVal, LLVMTypeRef ToType);
351LLVMValueRef LLVMConstBitCast(LLVMValueRef ConstantVal, LLVMTypeRef ToType);
352LLVMValueRef LLVMConstSelect(LLVMValueRef ConstantCondition,
353 LLVMValueRef ConstantIfTrue,
354 LLVMValueRef ConstantIfFalse);
355LLVMValueRef LLVMConstExtractElement(LLVMValueRef VectorConstant,
356 LLVMValueRef IndexConstant);
357LLVMValueRef LLVMConstInsertElement(LLVMValueRef VectorConstant,
358 LLVMValueRef ElementValueConstant,
359 LLVMValueRef IndexConstant);
360LLVMValueRef LLVMConstShuffleVector(LLVMValueRef VectorAConstant,
361 LLVMValueRef VectorBConstant,
362 LLVMValueRef MaskConstant);
363
Gordon Henriksen76a03742007-09-18 03:18:57 +0000364/* Operations on global variables, functions, and aliases (globals) */
365int LLVMIsDeclaration(LLVMValueRef Global);
366LLVMLinkage LLVMGetLinkage(LLVMValueRef Global);
367void LLVMSetLinkage(LLVMValueRef Global, LLVMLinkage Linkage);
368const char *LLVMGetSection(LLVMValueRef Global);
369void LLVMSetSection(LLVMValueRef Global, const char *Section);
370LLVMVisibility LLVMGetVisibility(LLVMValueRef Global);
371void LLVMSetVisibility(LLVMValueRef Global, LLVMVisibility Viz);
372unsigned LLVMGetAlignment(LLVMValueRef Global);
373void LLVMSetAlignment(LLVMValueRef Global, unsigned Bytes);
374
375/* Operations on global variables */
376LLVMValueRef LLVMAddGlobal(LLVMModuleRef M, LLVMTypeRef Ty, const char *Name);
Gordon Henriksen783f7bb2007-10-08 03:45:09 +0000377LLVMValueRef LLVMGetNamedGlobal(LLVMModuleRef M, const char *Name);
Gordon Henriksen76a03742007-09-18 03:18:57 +0000378void LLVMDeleteGlobal(LLVMValueRef GlobalVar);
379int LLVMHasInitializer(LLVMValueRef GlobalVar);
380LLVMValueRef LLVMGetInitializer(LLVMValueRef GlobalVar);
381void LLVMSetInitializer(LLVMValueRef GlobalVar, LLVMValueRef ConstantVal);
382int LLVMIsThreadLocal(LLVMValueRef GlobalVar);
383void LLVMSetThreadLocal(LLVMValueRef GlobalVar, int IsThreadLocal);
Gordon Henriksen751ebf72007-10-07 17:31:42 +0000384int LLVMIsGlobalConstant(LLVMValueRef GlobalVar);
385void LLVMSetGlobalConstant(LLVMValueRef GlobalVar, int IsConstant);
Gordon Henriksen76a03742007-09-18 03:18:57 +0000386
Gordon Henriksenc23b66c2007-09-26 20:56:12 +0000387/* Operations on functions */
388LLVMValueRef LLVMAddFunction(LLVMModuleRef M, const char *Name,
389 LLVMTypeRef FunctionTy);
Gordon Henriksen783f7bb2007-10-08 03:45:09 +0000390LLVMValueRef LLVMGetNamedFunction(LLVMModuleRef M, const char *Name);
Gordon Henriksenc23b66c2007-09-26 20:56:12 +0000391void LLVMDeleteFunction(LLVMValueRef Fn);
392unsigned LLVMCountParams(LLVMValueRef Fn);
393void LLVMGetParams(LLVMValueRef Fn, LLVMValueRef *Params);
394LLVMValueRef LLVMGetParam(LLVMValueRef Fn, unsigned Index);
395unsigned LLVMGetIntrinsicID(LLVMValueRef Fn);
396unsigned LLVMGetFunctionCallConv(LLVMValueRef Fn);
397void LLVMSetFunctionCallConv(LLVMValueRef Fn, unsigned CC);
Gordon Henriksen71183b62007-12-10 03:18:06 +0000398const char *LLVMGetCollector(LLVMValueRef Fn);
399void LLVMSetCollector(LLVMValueRef Fn, const char *Coll);
Gordon Henriksenc23b66c2007-09-26 20:56:12 +0000400
401/* Operations on basic blocks */
402LLVMValueRef LLVMBasicBlockAsValue(LLVMBasicBlockRef Bb);
403int LLVMValueIsBasicBlock(LLVMValueRef Val);
404LLVMBasicBlockRef LLVMValueAsBasicBlock(LLVMValueRef Val);
405unsigned LLVMCountBasicBlocks(LLVMValueRef Fn);
406void LLVMGetBasicBlocks(LLVMValueRef Fn, LLVMBasicBlockRef *BasicBlocks);
407LLVMBasicBlockRef LLVMGetEntryBasicBlock(LLVMValueRef Fn);
408LLVMBasicBlockRef LLVMAppendBasicBlock(LLVMValueRef Fn, const char *Name);
409LLVMBasicBlockRef LLVMInsertBasicBlock(LLVMBasicBlockRef InsertBeforeBB,
410 const char *Name);
411void LLVMDeleteBasicBlock(LLVMBasicBlockRef BB);
412
Gordon Henriksen1158c532007-12-29 20:45:00 +0000413/* Operations on call sites */
414void LLVMSetInstructionCallConv(LLVMValueRef Instr, unsigned CC);
415unsigned LLVMGetInstructionCallConv(LLVMValueRef Instr);
416
Gordon Henriksen44dd8fb2007-10-08 18:14:39 +0000417/* Operations on phi nodes */
418void LLVMAddIncoming(LLVMValueRef PhiNode, LLVMValueRef *IncomingValues,
419 LLVMBasicBlockRef *IncomingBlocks, unsigned Count);
420unsigned LLVMCountIncoming(LLVMValueRef PhiNode);
421LLVMValueRef LLVMGetIncomingValue(LLVMValueRef PhiNode, unsigned Index);
422LLVMBasicBlockRef LLVMGetIncomingBlock(LLVMValueRef PhiNode, unsigned Index);
Gordon Henriksenc23b66c2007-09-26 20:56:12 +0000423
424/*===-- Instruction builders ----------------------------------------------===*/
425
426/* An instruction builder represents a point within a basic block, and is the
427 * exclusive means of building instructions using the C interface.
428 */
429
430LLVMBuilderRef LLVMCreateBuilder();
431void LLVMPositionBuilderBefore(LLVMBuilderRef Builder, LLVMValueRef Instr);
432void LLVMPositionBuilderAtEnd(LLVMBuilderRef Builder, LLVMBasicBlockRef Block);
433void LLVMDisposeBuilder(LLVMBuilderRef Builder);
434
435/* Terminators */
436LLVMValueRef LLVMBuildRetVoid(LLVMBuilderRef);
437LLVMValueRef LLVMBuildRet(LLVMBuilderRef, LLVMValueRef V);
438LLVMValueRef LLVMBuildBr(LLVMBuilderRef, LLVMBasicBlockRef Dest);
439LLVMValueRef LLVMBuildCondBr(LLVMBuilderRef, LLVMValueRef If,
440 LLVMBasicBlockRef Then, LLVMBasicBlockRef Else);
441LLVMValueRef LLVMBuildSwitch(LLVMBuilderRef, LLVMValueRef V,
442 LLVMBasicBlockRef Else, unsigned NumCases);
443LLVMValueRef LLVMBuildInvoke(LLVMBuilderRef, LLVMValueRef Fn,
444 LLVMValueRef *Args, unsigned NumArgs,
445 LLVMBasicBlockRef Then, LLVMBasicBlockRef Catch,
446 const char *Name);
447LLVMValueRef LLVMBuildUnwind(LLVMBuilderRef);
448LLVMValueRef LLVMBuildUnreachable(LLVMBuilderRef);
449
Gordon Henriksen097102c2008-01-01 05:50:53 +0000450/* Add a case to the switch instruction */
451void LLVMAddCase(LLVMValueRef Switch, LLVMValueRef OnVal,
452 LLVMBasicBlockRef Dest);
453
Gordon Henriksenc23b66c2007-09-26 20:56:12 +0000454/* Arithmetic */
455LLVMValueRef LLVMBuildAdd(LLVMBuilderRef, LLVMValueRef LHS, LLVMValueRef RHS,
456 const char *Name);
457LLVMValueRef LLVMBuildSub(LLVMBuilderRef, LLVMValueRef LHS, LLVMValueRef RHS,
458 const char *Name);
459LLVMValueRef LLVMBuildMul(LLVMBuilderRef, LLVMValueRef LHS, LLVMValueRef RHS,
460 const char *Name);
461LLVMValueRef LLVMBuildUDiv(LLVMBuilderRef, LLVMValueRef LHS, LLVMValueRef RHS,
462 const char *Name);
463LLVMValueRef LLVMBuildSDiv(LLVMBuilderRef, LLVMValueRef LHS, LLVMValueRef RHS,
464 const char *Name);
465LLVMValueRef LLVMBuildFDiv(LLVMBuilderRef, LLVMValueRef LHS, LLVMValueRef RHS,
466 const char *Name);
467LLVMValueRef LLVMBuildURem(LLVMBuilderRef, LLVMValueRef LHS, LLVMValueRef RHS,
468 const char *Name);
469LLVMValueRef LLVMBuildSRem(LLVMBuilderRef, LLVMValueRef LHS, LLVMValueRef RHS,
470 const char *Name);
471LLVMValueRef LLVMBuildFRem(LLVMBuilderRef, LLVMValueRef LHS, LLVMValueRef RHS,
472 const char *Name);
473LLVMValueRef LLVMBuildShl(LLVMBuilderRef, LLVMValueRef LHS, LLVMValueRef RHS,
474 const char *Name);
475LLVMValueRef LLVMBuildLShr(LLVMBuilderRef, LLVMValueRef LHS, LLVMValueRef RHS,
476 const char *Name);
477LLVMValueRef LLVMBuildAShr(LLVMBuilderRef, LLVMValueRef LHS, LLVMValueRef RHS,
478 const char *Name);
479LLVMValueRef LLVMBuildAnd(LLVMBuilderRef, LLVMValueRef LHS, LLVMValueRef RHS,
480 const char *Name);
481LLVMValueRef LLVMBuildOr(LLVMBuilderRef, LLVMValueRef LHS, LLVMValueRef RHS,
482 const char *Name);
483LLVMValueRef LLVMBuildXor(LLVMBuilderRef, LLVMValueRef LHS, LLVMValueRef RHS,
484 const char *Name);
485LLVMValueRef LLVMBuildNeg(LLVMBuilderRef, LLVMValueRef V, const char *Name);
486LLVMValueRef LLVMBuildNot(LLVMBuilderRef, LLVMValueRef V, const char *Name);
487
488/* Memory */
489LLVMValueRef LLVMBuildMalloc(LLVMBuilderRef, LLVMTypeRef Ty, const char *Name);
490LLVMValueRef LLVMBuildArrayMalloc(LLVMBuilderRef, LLVMTypeRef Ty,
491 LLVMValueRef Val, const char *Name);
492LLVMValueRef LLVMBuildAlloca(LLVMBuilderRef, LLVMTypeRef Ty, const char *Name);
493LLVMValueRef LLVMBuildArrayAlloca(LLVMBuilderRef, LLVMTypeRef Ty,
494 LLVMValueRef Val, const char *Name);
495LLVMValueRef LLVMBuildFree(LLVMBuilderRef, LLVMValueRef PointerVal);
496LLVMValueRef LLVMBuildLoad(LLVMBuilderRef, LLVMValueRef PointerVal,
497 const char *Name);
498LLVMValueRef LLVMBuildStore(LLVMBuilderRef, LLVMValueRef Val, LLVMValueRef Ptr);
499LLVMValueRef LLVMBuildGEP(LLVMBuilderRef B, LLVMValueRef Pointer,
500 LLVMValueRef *Indices, unsigned NumIndices,
501 const char *Name);
502
503/* Casts */
504LLVMValueRef LLVMBuildTrunc(LLVMBuilderRef, LLVMValueRef Val,
505 LLVMTypeRef DestTy, const char *Name);
506LLVMValueRef LLVMBuildZExt(LLVMBuilderRef, LLVMValueRef Val,
507 LLVMTypeRef DestTy, const char *Name);
508LLVMValueRef LLVMBuildSExt(LLVMBuilderRef, LLVMValueRef Val,
509 LLVMTypeRef DestTy, const char *Name);
510LLVMValueRef LLVMBuildFPToUI(LLVMBuilderRef, LLVMValueRef Val,
511 LLVMTypeRef DestTy, const char *Name);
512LLVMValueRef LLVMBuildFPToSI(LLVMBuilderRef, LLVMValueRef Val,
513 LLVMTypeRef DestTy, const char *Name);
514LLVMValueRef LLVMBuildUIToFP(LLVMBuilderRef, LLVMValueRef Val,
515 LLVMTypeRef DestTy, const char *Name);
516LLVMValueRef LLVMBuildSIToFP(LLVMBuilderRef, LLVMValueRef Val,
517 LLVMTypeRef DestTy, const char *Name);
518LLVMValueRef LLVMBuildFPTrunc(LLVMBuilderRef, LLVMValueRef Val,
519 LLVMTypeRef DestTy, const char *Name);
520LLVMValueRef LLVMBuildFPExt(LLVMBuilderRef, LLVMValueRef Val,
521 LLVMTypeRef DestTy, const char *Name);
522LLVMValueRef LLVMBuildPtrToInt(LLVMBuilderRef, LLVMValueRef Val,
523 LLVMTypeRef DestTy, const char *Name);
524LLVMValueRef LLVMBuildIntToPtr(LLVMBuilderRef, LLVMValueRef Val,
525 LLVMTypeRef DestTy, const char *Name);
526LLVMValueRef LLVMBuildBitCast(LLVMBuilderRef, LLVMValueRef Val,
527 LLVMTypeRef DestTy, const char *Name);
528
529/* Comparisons */
530LLVMValueRef LLVMBuildICmp(LLVMBuilderRef, LLVMIntPredicate Op,
531 LLVMValueRef LHS, LLVMValueRef RHS,
532 const char *Name);
533LLVMValueRef LLVMBuildFCmp(LLVMBuilderRef, LLVMRealPredicate Op,
534 LLVMValueRef LHS, LLVMValueRef RHS,
535 const char *Name);
536
537/* Miscellaneous instructions */
538LLVMValueRef LLVMBuildPhi(LLVMBuilderRef, LLVMTypeRef Ty, const char *Name);
539LLVMValueRef LLVMBuildCall(LLVMBuilderRef, LLVMValueRef Fn,
540 LLVMValueRef *Args, unsigned NumArgs,
541 const char *Name);
542LLVMValueRef LLVMBuildSelect(LLVMBuilderRef, LLVMValueRef If,
543 LLVMValueRef Then, LLVMValueRef Else,
544 const char *Name);
545LLVMValueRef LLVMBuildVAArg(LLVMBuilderRef, LLVMValueRef List, LLVMTypeRef Ty,
546 const char *Name);
547LLVMValueRef LLVMBuildExtractElement(LLVMBuilderRef, LLVMValueRef VecVal,
548 LLVMValueRef Index, const char *Name);
549LLVMValueRef LLVMBuildInsertElement(LLVMBuilderRef, LLVMValueRef VecVal,
550 LLVMValueRef EltVal, LLVMValueRef Index,
551 const char *Name);
552LLVMValueRef LLVMBuildShuffleVector(LLVMBuilderRef, LLVMValueRef V1,
553 LLVMValueRef V2, LLVMValueRef Mask,
554 const char *Name);
Gordon Henriksen76a03742007-09-18 03:18:57 +0000555
Gordon Henriksen34eb6d82007-12-19 22:30:40 +0000556
Gordon Henriksen0a68fe22007-12-12 01:04:30 +0000557/*===-- Module providers --------------------------------------------------===*/
558
559/* Encapsulates the module M in a module provider, taking ownership of the
560 * module.
561 * See the constructor llvm::ExistingModuleProvider::ExistingModuleProvider.
562 */
563LLVMModuleProviderRef
564LLVMCreateModuleProviderForExistingModule(LLVMModuleRef M);
565
566/* Destroys the module provider MP as well as the contained module.
567 * See the destructor llvm::ModuleProvider::~ModuleProvider.
568 */
569void LLVMDisposeModuleProvider(LLVMModuleProviderRef MP);
570
Gordon Henriksen34eb6d82007-12-19 22:30:40 +0000571
572/*===-- Memory buffers ----------------------------------------------------===*/
573
574int LLVMCreateMemoryBufferWithContentsOfFile(const char *Path,
575 LLVMMemoryBufferRef *OutMemBuf,
576 char **OutMessage);
577int LLVMCreateMemoryBufferWithSTDIN(LLVMMemoryBufferRef *OutMemBuf,
578 char **OutMessage);
579void LLVMDisposeMemoryBuffer(LLVMMemoryBufferRef MemBuf);
580
Gordon Henriksen878114b2008-03-16 04:20:44 +0000581
582/*===-- Pass Managers -----------------------------------------------------===*/
583
584/** Constructs a new whole-module pass pipeline. This type of pipeline is
585 suitable for link-time optimization and whole-module transformations.
586 See llvm::PassManager::PassManager. */
587LLVMPassManagerRef LLVMCreatePassManager();
588
589/** Constructs a new function-by-function pass pipeline over the module
590 provider. It does not take ownership of the module provider. This type of
591 pipeline is suitable for code generation and JIT compilation tasks.
592 See llvm::FunctionPassManager::FunctionPassManager. */
593LLVMPassManagerRef LLVMCreateFunctionPassManager(LLVMModuleProviderRef MP);
594
595/** Initializes, executes on the provided module, and finalizes all of the
596 passes scheduled in the pass manager. Returns 1 if any of the passes
597 modified the module, 0 otherwise. See llvm::PassManager::run(Module&). */
598int LLVMRunPassManager(LLVMPassManagerRef PM, LLVMModuleRef M);
599
600/** Initializes all of the function passes scheduled in the function pass
601 manager. Returns 1 if any of the passes modified the module, 0 otherwise.
602 See llvm::FunctionPassManager::doInitialization. */
603int LLVMInitializeFunctionPassManager(LLVMPassManagerRef FPM);
604
605/** Executes all of the function passes scheduled in the function pass manager
606 on the provided function. Returns 1 if any of the passes modified the
607 function, false otherwise.
608 See llvm::FunctionPassManager::run(Function&). */
609int LLVMRunFunctionPassManager(LLVMPassManagerRef FPM, LLVMValueRef F);
610
611/** Finalizes all of the function passes scheduled in in the function pass
612 manager. Returns 1 if any of the passes modified the module, 0 otherwise.
613 See llvm::FunctionPassManager::doFinalization. */
614int LLVMFinalizeFunctionPassManager(LLVMPassManagerRef FPM);
615
616/** Frees the memory of a pass pipeline. For function pipelines, does not free
617 the module provider.
618 See llvm::PassManagerBase::~PassManagerBase. */
619void LLVMDisposePassManager(LLVMPassManagerRef PM);
620
621
Gordon Henriksen76a03742007-09-18 03:18:57 +0000622#ifdef __cplusplus
623}
Gordon Henriksen76a03742007-09-18 03:18:57 +0000624
Gordon Henriksen7330acd2007-10-05 23:59:36 +0000625namespace llvm {
Gordon Henriksen0a68fe22007-12-12 01:04:30 +0000626 class ModuleProvider;
Gordon Henriksen34eb6d82007-12-19 22:30:40 +0000627 class MemoryBuffer;
Gordon Henriksen96571492008-03-16 15:55:43 +0000628 class PassManagerBase;
Gordon Henriksen0a68fe22007-12-12 01:04:30 +0000629
Gordon Henriksen34eb6d82007-12-19 22:30:40 +0000630 #define DEFINE_SIMPLE_CONVERSION_FUNCTIONS(ty, ref) \
631 inline ty *unwrap(ref P) { \
632 return reinterpret_cast<ty*>(P); \
633 } \
634 \
635 inline ref wrap(const ty *P) { \
636 return reinterpret_cast<ref>(const_cast<ty*>(P)); \
637 }
Gordon Henriksen7330acd2007-10-05 23:59:36 +0000638
Gordon Henriksen878114b2008-03-16 04:20:44 +0000639 #define DEFINE_ISA_CONVERSION_FUNCTIONS(ty, ref) \
640 DEFINE_SIMPLE_CONVERSION_FUNCTIONS(ty, ref) \
641 \
642 template<typename T> \
643 inline T *unwrap(ref P) { \
644 return cast<T>(unwrap(P)); \
645 }
646
647 #define DEFINE_STDCXX_CONVERSION_FUNCTIONS(ty, ref) \
648 DEFINE_SIMPLE_CONVERSION_FUNCTIONS(ty, ref) \
649 \
650 template<typename T> \
651 inline T *unwrap(ref P) { \
652 T *Q = dynamic_cast<T*>(unwrap(P)); \
653 assert(Q && "Invalid cast!"); \
654 return Q; \
655 }
656
657 DEFINE_ISA_CONVERSION_FUNCTIONS (Type, LLVMTypeRef )
658 DEFINE_ISA_CONVERSION_FUNCTIONS (Value, LLVMValueRef )
Gordon Henriksen823f9732007-12-27 18:25:59 +0000659 DEFINE_SIMPLE_CONVERSION_FUNCTIONS(Module, LLVMModuleRef )
660 DEFINE_SIMPLE_CONVERSION_FUNCTIONS(BasicBlock, LLVMBasicBlockRef )
661 DEFINE_SIMPLE_CONVERSION_FUNCTIONS(LLVMFoldingBuilder, LLVMBuilderRef )
662 DEFINE_SIMPLE_CONVERSION_FUNCTIONS(PATypeHolder, LLVMTypeHandleRef )
663 DEFINE_SIMPLE_CONVERSION_FUNCTIONS(ModuleProvider, LLVMModuleProviderRef)
664 DEFINE_SIMPLE_CONVERSION_FUNCTIONS(MemoryBuffer, LLVMMemoryBufferRef )
Gordon Henriksen878114b2008-03-16 04:20:44 +0000665 DEFINE_STDCXX_CONVERSION_FUNCTIONS(PassManagerBase, LLVMPassManagerRef )
Gordon Henriksen7330acd2007-10-05 23:59:36 +0000666
Gordon Henriksen878114b2008-03-16 04:20:44 +0000667 #undef DEFINE_STDCXX_CONVERSION_FUNCTIONS
668 #undef DEFINE_ISA_CONVERSION_FUNCTIONS
Gordon Henriksen34eb6d82007-12-19 22:30:40 +0000669 #undef DEFINE_SIMPLE_CONVERSION_FUNCTIONS
Gordon Henriksen7330acd2007-10-05 23:59:36 +0000670
Gordon Henriksen34eb6d82007-12-19 22:30:40 +0000671 /* Specialized opaque type conversions.
672 */
Gordon Henriksen7330acd2007-10-05 23:59:36 +0000673 inline Type **unwrap(LLVMTypeRef* Tys) {
674 return reinterpret_cast<Type**>(Tys);
675 }
676
Gordon Henriksen7330acd2007-10-05 23:59:36 +0000677 inline LLVMTypeRef *wrap(const Type **Tys) {
678 return reinterpret_cast<LLVMTypeRef*>(const_cast<Type**>(Tys));
679 }
680
Gordon Henriksen34eb6d82007-12-19 22:30:40 +0000681 /* Specialized opaque value conversions.
Gordon Henriksen7330acd2007-10-05 23:59:36 +0000682 */
Gordon Henriksen7330acd2007-10-05 23:59:36 +0000683 inline Value **unwrap(LLVMValueRef *Vals) {
684 return reinterpret_cast<Value**>(Vals);
685 }
686
687 template<typename T>
688 inline T **unwrap(LLVMValueRef *Vals, unsigned Length) {
689 #if DEBUG
690 for (LLVMValueRef *I = Vals, E = Vals + Length; I != E; ++I)
691 cast<T>(*I);
692 #endif
693 return reinterpret_cast<T**>(Vals);
694 }
695
Gordon Henriksen7330acd2007-10-05 23:59:36 +0000696 inline LLVMValueRef *wrap(const Value **Vals) {
697 return reinterpret_cast<LLVMValueRef*>(const_cast<Value**>(Vals));
698 }
Gordon Henriksen7330acd2007-10-05 23:59:36 +0000699}
700
701#endif /* !defined(__cplusplus) */
702
703#endif /* !defined(LLVM_C_CORE_H) */