1 /*===-- llvm-c/Core.h - Core Library C Interface ------------------*- C -*-===*\
3 |* The LLVM Compiler Infrastructure *|
5 |* This file was developed by Gordon Henriksen and is distributed under the *|
6 |* University of Illinois Open Source License. See LICENSE.TXT for details. *|
8 |*===----------------------------------------------------------------------===*|
10 |* This header declares the C interface to libLLVMCore.a, which implements *|
11 |* the LLVM intermediate representation. *|
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). *|
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. *|
26 |* 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. *|
31 \*===----------------------------------------------------------------------===*/
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"
48 typedef struct LLVMOpaqueModule *LLVMModuleRef;
49 typedef struct LLVMOpaqueType *LLVMTypeRef;
50 typedef struct LLVMOpaqueValue *LLVMValueRef;
51 typedef struct LLVMOpaqueBasicBlock *LLVMBasicBlockRef;
52 typedef struct LLVMOpaqueBuilder *LLVMBuilderRef;
55 LLVMVoidTypeKind, /* type with no size */
56 LLVMFloatTypeKind, /* 32 bit floating point type */
57 LLVMDoubleTypeKind, /* 64 bit floating point type */
58 LLVMX86_FP80TypeKind, /* 80 bit floating point type (X87) */
59 LLVMFP128TypeKind, /* 128 bit floating point type (112-bit mantissa) */
60 LLVMPPC_FP128TypeKind, /* 128 bit floating point type (two 64-bits) */
61 LLVMLabelTypeKind, /* Labels */
62 LLVMIntegerTypeKind, /* Arbitrary bit width integers */
63 LLVMFunctionTypeKind, /* Functions */
64 LLVMStructTypeKind, /* Structures */
65 LLVMArrayTypeKind, /* Arrays */
66 LLVMPointerTypeKind, /* Pointers */
67 LLVMOpaqueTypeKind, /* Opaque: type with unknown structure */
68 LLVMVectorTypeKind /* SIMD 'packed' format, or other vector type */
72 LLVMExternalLinkage, /* Externally visible function */
73 LLVMLinkOnceLinkage, /* Keep one copy of function when linking (inline) */
74 LLVMWeakLinkage, /* Keep one copy of function when linking (weak) */
75 LLVMAppendingLinkage, /* Special purpose, only applies to global arrays */
76 LLVMInternalLinkage, /* Rename collisions when linking (static functions)*/
77 LLVMDLLImportLinkage, /* Function to be imported from DLL */
78 LLVMDLLExportLinkage, /* Function to be accessible from DLL */
79 LLVMExternalWeakLinkage,/* ExternalWeak linkage description */
80 LLVMGhostLinkage /* Stand-in functions for streaming fns from bitcode*/
84 LLVMDefaultVisibility, /* The GV is visible */
85 LLVMHiddenVisibility, /* The GV is hidden */
86 LLVMProtectedVisibility /* The GV is protected */
93 LLVMX86StdcallCallConv = 64,
94 LLVMX86FastcallCallConv = 65
98 LLVMIntEQ = 32, /* equal */
99 LLVMIntNE, /* not equal */
100 LLVMIntUGT, /* unsigned greater than */
101 LLVMIntUGE, /* unsigned greater or equal */
102 LLVMIntULT, /* unsigned less than */
103 LLVMIntULE, /* unsigned less or equal */
104 LLVMIntSGT, /* signed greater than */
105 LLVMIntSGE, /* signed greater or equal */
106 LLVMIntSLT, /* signed less than */
107 LLVMIntSLE /* signed less or equal */
111 LLVMRealPredicateFalse, /* Always false (always folded) */
112 LLVMRealOEQ, /* True if ordered and equal */
113 LLVMRealOGT, /* True if ordered and greater than */
114 LLVMRealOGE, /* True if ordered and greater than or equal */
115 LLVMRealOLT, /* True if ordered and less than */
116 LLVMRealOLE, /* True if ordered and less than or equal */
117 LLVMRealONE, /* True if ordered and operands are unequal */
118 LLVMRealORD, /* True if ordered (no nans) */
119 LLVMRealUNO, /* True if unordered: isnan(X) | isnan(Y) */
120 LLVMRealUEQ, /* True if unordered or equal */
121 LLVMRealUGT, /* True if unordered or greater than */
122 LLVMRealUGE, /* True if unordered, greater than, or equal */
123 LLVMRealULT, /* True if unordered or less than */
124 LLVMRealULE, /* True if unordered, less than, or equal */
125 LLVMRealUNE, /* True if unordered or not equal */
126 LLVMRealPredicateTrue /* Always true (always folded) */
130 /*===-- Modules -----------------------------------------------------------===*/
132 /* Create and destroy modules. */
133 LLVMModuleRef LLVMModuleCreateWithName(const char *ModuleID);
134 void LLVMDisposeModule(LLVMModuleRef M);
136 /* Same as Module::addTypeName. */
137 int LLVMAddTypeName(LLVMModuleRef M, const char *Name, LLVMTypeRef Ty);
138 void LLVMDeleteTypeName(LLVMModuleRef M, const char *Name);
141 /*===-- Types -------------------------------------------------------------===*/
143 /* LLVM types conform to the following hierarchy:
158 LLVMTypeKind LLVMGetTypeKind(LLVMTypeRef Ty);
159 void LLVMRefineAbstractType(LLVMTypeRef AbstractType, LLVMTypeRef ConcreteType);
161 /* Operations on integer types */
162 LLVMTypeRef LLVMInt1Type();
163 LLVMTypeRef LLVMInt8Type();
164 LLVMTypeRef LLVMInt16Type();
165 LLVMTypeRef LLVMInt32Type();
166 LLVMTypeRef LLVMInt64Type();
167 LLVMTypeRef LLVMCreateIntType(unsigned NumBits);
168 unsigned LLVMGetIntTypeWidth(LLVMTypeRef IntegerTy);
170 /* Operations on real types */
171 LLVMTypeRef LLVMFloatType();
172 LLVMTypeRef LLVMDoubleType();
173 LLVMTypeRef LLVMX86FP80Type();
174 LLVMTypeRef LLVMFP128Type();
175 LLVMTypeRef LLVMPPCFP128Type();
177 /* Operations on function types */
178 LLVMTypeRef LLVMCreateFunctionType(LLVMTypeRef ReturnType,
179 LLVMTypeRef *ParamTypes, unsigned ParamCount,
181 int LLVMIsFunctionVarArg(LLVMTypeRef FunctionTy);
182 LLVMTypeRef LLVMGetReturnType(LLVMTypeRef FunctionTy);
183 unsigned LLVMCountParamTypes(LLVMTypeRef FunctionTy);
184 void LLVMGetParamTypes(LLVMTypeRef FunctionTy, LLVMTypeRef *Dest);
186 /* Operations on struct types */
187 LLVMTypeRef LLVMCreateStructType(LLVMTypeRef *ElementTypes,
188 unsigned ElementCount, int Packed);
189 unsigned LLVMCountStructElementTypes(LLVMTypeRef StructTy);
190 void LLVMGetStructElementTypes(LLVMTypeRef StructTy, LLVMTypeRef *Dest);
191 int LLVMIsPackedStruct(LLVMTypeRef StructTy);
193 /* Operations on array, pointer, and vector types (sequence types) */
194 LLVMTypeRef LLVMCreateArrayType(LLVMTypeRef ElementType, unsigned ElementCount);
195 LLVMTypeRef LLVMCreatePointerType(LLVMTypeRef ElementType);
196 LLVMTypeRef LLVMCreateVectorType(LLVMTypeRef ElementType,unsigned ElementCount);
198 LLVMTypeRef LLVMGetElementType(LLVMTypeRef Ty);
199 unsigned LLVMGetArrayLength(LLVMTypeRef ArrayTy);
200 unsigned LLVMGetVectorSize(LLVMTypeRef VectorTy);
202 /* Operations on other types */
203 LLVMTypeRef LLVMVoidType();
204 LLVMTypeRef LLVMLabelType();
205 LLVMTypeRef LLVMCreateOpaqueType();
208 /*===-- Values ------------------------------------------------------------===*/
210 /* The bulk of LLVM's object model consists of values, which comprise a very
211 * rich type hierarchy.
224 /* Operations on all values */
225 LLVMTypeRef LLVMTypeOf(LLVMValueRef Val);
226 const char *LLVMGetValueName(LLVMValueRef Val);
227 void LLVMSetValueName(LLVMValueRef Val, const char *Name);
228 void LLVMDumpValue(LLVMValueRef Val);
230 /* Operations on constants of any type */
231 LLVMValueRef LLVMGetNull(LLVMTypeRef Ty); /* all zeroes */
232 LLVMValueRef LLVMGetAllOnes(LLVMTypeRef Ty); /* only for int/vector */
233 LLVMValueRef LLVMGetUndef(LLVMTypeRef Ty);
234 int LLVMIsConstant(LLVMValueRef Val);
235 int LLVMIsNull(LLVMValueRef Val);
236 int LLVMIsUndef(LLVMValueRef Val);
238 /* Operations on scalar constants */
239 LLVMValueRef LLVMGetIntConstant(LLVMTypeRef IntTy, unsigned long long N,
241 LLVMValueRef LLVMGetRealConstant(LLVMTypeRef RealTy, double N);
243 /* Operations on composite constants */
244 LLVMValueRef LLVMGetStringConstant(const char *Str, unsigned Length,
245 int DontNullTerminate);
246 LLVMValueRef LLVMGetArrayConstant(LLVMTypeRef ArrayTy,
247 LLVMValueRef *ConstantVals, unsigned Length);
248 LLVMValueRef LLVMGetStructConstant(LLVMValueRef *ConstantVals, unsigned Count,
250 LLVMValueRef LLVMGetVectorConstant(LLVMValueRef *ScalarConstantVals,
253 /* Operations on global variables, functions, and aliases (globals) */
254 int LLVMIsDeclaration(LLVMValueRef Global);
255 LLVMLinkage LLVMGetLinkage(LLVMValueRef Global);
256 void LLVMSetLinkage(LLVMValueRef Global, LLVMLinkage Linkage);
257 const char *LLVMGetSection(LLVMValueRef Global);
258 void LLVMSetSection(LLVMValueRef Global, const char *Section);
259 LLVMVisibility LLVMGetVisibility(LLVMValueRef Global);
260 void LLVMSetVisibility(LLVMValueRef Global, LLVMVisibility Viz);
261 unsigned LLVMGetAlignment(LLVMValueRef Global);
262 void LLVMSetAlignment(LLVMValueRef Global, unsigned Bytes);
264 /* Operations on global variables */
265 LLVMValueRef LLVMAddGlobal(LLVMModuleRef M, LLVMTypeRef Ty, const char *Name);
266 void LLVMDeleteGlobal(LLVMValueRef GlobalVar);
267 int LLVMHasInitializer(LLVMValueRef GlobalVar);
268 LLVMValueRef LLVMGetInitializer(LLVMValueRef GlobalVar);
269 void LLVMSetInitializer(LLVMValueRef GlobalVar, LLVMValueRef ConstantVal);
270 int LLVMIsThreadLocal(LLVMValueRef GlobalVar);
271 void LLVMSetThreadLocal(LLVMValueRef GlobalVar, int IsThreadLocal);
273 /* Operations on functions */
274 LLVMValueRef LLVMAddFunction(LLVMModuleRef M, const char *Name,
275 LLVMTypeRef FunctionTy);
276 void LLVMDeleteFunction(LLVMValueRef Fn);
277 unsigned LLVMCountParams(LLVMValueRef Fn);
278 void LLVMGetParams(LLVMValueRef Fn, LLVMValueRef *Params);
279 LLVMValueRef LLVMGetParam(LLVMValueRef Fn, unsigned Index);
280 unsigned LLVMGetIntrinsicID(LLVMValueRef Fn);
281 unsigned LLVMGetFunctionCallConv(LLVMValueRef Fn);
282 void LLVMSetFunctionCallConv(LLVMValueRef Fn, unsigned CC);
284 /* Operations on basic blocks */
285 LLVMValueRef LLVMBasicBlockAsValue(LLVMBasicBlockRef Bb);
286 int LLVMValueIsBasicBlock(LLVMValueRef Val);
287 LLVMBasicBlockRef LLVMValueAsBasicBlock(LLVMValueRef Val);
288 unsigned LLVMCountBasicBlocks(LLVMValueRef Fn);
289 void LLVMGetBasicBlocks(LLVMValueRef Fn, LLVMBasicBlockRef *BasicBlocks);
290 LLVMBasicBlockRef LLVMGetEntryBasicBlock(LLVMValueRef Fn);
291 LLVMBasicBlockRef LLVMAppendBasicBlock(LLVMValueRef Fn, const char *Name);
292 LLVMBasicBlockRef LLVMInsertBasicBlock(LLVMBasicBlockRef InsertBeforeBB,
294 void LLVMDeleteBasicBlock(LLVMBasicBlockRef BB);
297 /*===-- Instruction builders ----------------------------------------------===*/
299 /* An instruction builder represents a point within a basic block, and is the
300 * exclusive means of building instructions using the C interface.
303 LLVMBuilderRef LLVMCreateBuilder();
304 void LLVMPositionBuilderBefore(LLVMBuilderRef Builder, LLVMValueRef Instr);
305 void LLVMPositionBuilderAtEnd(LLVMBuilderRef Builder, LLVMBasicBlockRef Block);
306 void LLVMDisposeBuilder(LLVMBuilderRef Builder);
309 LLVMValueRef LLVMBuildRetVoid(LLVMBuilderRef);
310 LLVMValueRef LLVMBuildRet(LLVMBuilderRef, LLVMValueRef V);
311 LLVMValueRef LLVMBuildBr(LLVMBuilderRef, LLVMBasicBlockRef Dest);
312 LLVMValueRef LLVMBuildCondBr(LLVMBuilderRef, LLVMValueRef If,
313 LLVMBasicBlockRef Then, LLVMBasicBlockRef Else);
314 LLVMValueRef LLVMBuildSwitch(LLVMBuilderRef, LLVMValueRef V,
315 LLVMBasicBlockRef Else, unsigned NumCases);
316 LLVMValueRef LLVMBuildInvoke(LLVMBuilderRef, LLVMValueRef Fn,
317 LLVMValueRef *Args, unsigned NumArgs,
318 LLVMBasicBlockRef Then, LLVMBasicBlockRef Catch,
320 LLVMValueRef LLVMBuildUnwind(LLVMBuilderRef);
321 LLVMValueRef LLVMBuildUnreachable(LLVMBuilderRef);
324 LLVMValueRef LLVMBuildAdd(LLVMBuilderRef, LLVMValueRef LHS, LLVMValueRef RHS,
326 LLVMValueRef LLVMBuildSub(LLVMBuilderRef, LLVMValueRef LHS, LLVMValueRef RHS,
328 LLVMValueRef LLVMBuildMul(LLVMBuilderRef, LLVMValueRef LHS, LLVMValueRef RHS,
330 LLVMValueRef LLVMBuildUDiv(LLVMBuilderRef, LLVMValueRef LHS, LLVMValueRef RHS,
332 LLVMValueRef LLVMBuildSDiv(LLVMBuilderRef, LLVMValueRef LHS, LLVMValueRef RHS,
334 LLVMValueRef LLVMBuildFDiv(LLVMBuilderRef, LLVMValueRef LHS, LLVMValueRef RHS,
336 LLVMValueRef LLVMBuildURem(LLVMBuilderRef, LLVMValueRef LHS, LLVMValueRef RHS,
338 LLVMValueRef LLVMBuildSRem(LLVMBuilderRef, LLVMValueRef LHS, LLVMValueRef RHS,
340 LLVMValueRef LLVMBuildFRem(LLVMBuilderRef, LLVMValueRef LHS, LLVMValueRef RHS,
342 LLVMValueRef LLVMBuildShl(LLVMBuilderRef, LLVMValueRef LHS, LLVMValueRef RHS,
344 LLVMValueRef LLVMBuildLShr(LLVMBuilderRef, LLVMValueRef LHS, LLVMValueRef RHS,
346 LLVMValueRef LLVMBuildAShr(LLVMBuilderRef, LLVMValueRef LHS, LLVMValueRef RHS,
348 LLVMValueRef LLVMBuildAnd(LLVMBuilderRef, LLVMValueRef LHS, LLVMValueRef RHS,
350 LLVMValueRef LLVMBuildOr(LLVMBuilderRef, LLVMValueRef LHS, LLVMValueRef RHS,
352 LLVMValueRef LLVMBuildXor(LLVMBuilderRef, LLVMValueRef LHS, LLVMValueRef RHS,
354 LLVMValueRef LLVMBuildNeg(LLVMBuilderRef, LLVMValueRef V, const char *Name);
355 LLVMValueRef LLVMBuildNot(LLVMBuilderRef, LLVMValueRef V, const char *Name);
358 LLVMValueRef LLVMBuildMalloc(LLVMBuilderRef, LLVMTypeRef Ty, const char *Name);
359 LLVMValueRef LLVMBuildArrayMalloc(LLVMBuilderRef, LLVMTypeRef Ty,
360 LLVMValueRef Val, const char *Name);
361 LLVMValueRef LLVMBuildAlloca(LLVMBuilderRef, LLVMTypeRef Ty, const char *Name);
362 LLVMValueRef LLVMBuildArrayAlloca(LLVMBuilderRef, LLVMTypeRef Ty,
363 LLVMValueRef Val, const char *Name);
364 LLVMValueRef LLVMBuildFree(LLVMBuilderRef, LLVMValueRef PointerVal);
365 LLVMValueRef LLVMBuildLoad(LLVMBuilderRef, LLVMValueRef PointerVal,
367 LLVMValueRef LLVMBuildStore(LLVMBuilderRef, LLVMValueRef Val, LLVMValueRef Ptr);
368 LLVMValueRef LLVMBuildGEP(LLVMBuilderRef B, LLVMValueRef Pointer,
369 LLVMValueRef *Indices, unsigned NumIndices,
373 LLVMValueRef LLVMBuildTrunc(LLVMBuilderRef, LLVMValueRef Val,
374 LLVMTypeRef DestTy, const char *Name);
375 LLVMValueRef LLVMBuildZExt(LLVMBuilderRef, LLVMValueRef Val,
376 LLVMTypeRef DestTy, const char *Name);
377 LLVMValueRef LLVMBuildSExt(LLVMBuilderRef, LLVMValueRef Val,
378 LLVMTypeRef DestTy, const char *Name);
379 LLVMValueRef LLVMBuildFPToUI(LLVMBuilderRef, LLVMValueRef Val,
380 LLVMTypeRef DestTy, const char *Name);
381 LLVMValueRef LLVMBuildFPToSI(LLVMBuilderRef, LLVMValueRef Val,
382 LLVMTypeRef DestTy, const char *Name);
383 LLVMValueRef LLVMBuildUIToFP(LLVMBuilderRef, LLVMValueRef Val,
384 LLVMTypeRef DestTy, const char *Name);
385 LLVMValueRef LLVMBuildSIToFP(LLVMBuilderRef, LLVMValueRef Val,
386 LLVMTypeRef DestTy, const char *Name);
387 LLVMValueRef LLVMBuildFPTrunc(LLVMBuilderRef, LLVMValueRef Val,
388 LLVMTypeRef DestTy, const char *Name);
389 LLVMValueRef LLVMBuildFPExt(LLVMBuilderRef, LLVMValueRef Val,
390 LLVMTypeRef DestTy, const char *Name);
391 LLVMValueRef LLVMBuildPtrToInt(LLVMBuilderRef, LLVMValueRef Val,
392 LLVMTypeRef DestTy, const char *Name);
393 LLVMValueRef LLVMBuildIntToPtr(LLVMBuilderRef, LLVMValueRef Val,
394 LLVMTypeRef DestTy, const char *Name);
395 LLVMValueRef LLVMBuildBitCast(LLVMBuilderRef, LLVMValueRef Val,
396 LLVMTypeRef DestTy, const char *Name);
399 LLVMValueRef LLVMBuildICmp(LLVMBuilderRef, LLVMIntPredicate Op,
400 LLVMValueRef LHS, LLVMValueRef RHS,
402 LLVMValueRef LLVMBuildFCmp(LLVMBuilderRef, LLVMRealPredicate Op,
403 LLVMValueRef LHS, LLVMValueRef RHS,
406 /* Miscellaneous instructions */
407 LLVMValueRef LLVMBuildPhi(LLVMBuilderRef, LLVMTypeRef Ty, const char *Name);
408 LLVMValueRef LLVMBuildCall(LLVMBuilderRef, LLVMValueRef Fn,
409 LLVMValueRef *Args, unsigned NumArgs,
411 LLVMValueRef LLVMBuildSelect(LLVMBuilderRef, LLVMValueRef If,
412 LLVMValueRef Then, LLVMValueRef Else,
414 LLVMValueRef LLVMBuildVAArg(LLVMBuilderRef, LLVMValueRef List, LLVMTypeRef Ty,
416 LLVMValueRef LLVMBuildExtractElement(LLVMBuilderRef, LLVMValueRef VecVal,
417 LLVMValueRef Index, const char *Name);
418 LLVMValueRef LLVMBuildInsertElement(LLVMBuilderRef, LLVMValueRef VecVal,
419 LLVMValueRef EltVal, LLVMValueRef Index,
421 LLVMValueRef LLVMBuildShuffleVector(LLVMBuilderRef, LLVMValueRef V1,
422 LLVMValueRef V2, LLVMValueRef Mask,
429 /* Opaque module conversions
431 inline Module *unwrap(LLVMModuleRef M) {
432 return reinterpret_cast<Module*>(M);
435 inline LLVMModuleRef wrap(Module *M) {
436 return reinterpret_cast<LLVMModuleRef>(M);
439 /* Opaque type conversions
441 inline Type *unwrap(LLVMTypeRef Ty) {
442 return reinterpret_cast<Type*>(Ty);
446 inline T *unwrap(LLVMTypeRef Ty) {
447 return cast<T>(unwrap(Ty));
450 inline Type **unwrap(LLVMTypeRef* Tys) {
451 return reinterpret_cast<Type**>(Tys);
454 inline LLVMTypeRef wrap(const Type *Ty) {
455 return reinterpret_cast<LLVMTypeRef>(const_cast<Type*>(Ty));
458 inline LLVMTypeRef *wrap(const Type **Tys) {
459 return reinterpret_cast<LLVMTypeRef*>(const_cast<Type**>(Tys));
462 /* Opaque value conversions
464 inline Value *unwrap(LLVMValueRef Val) {
465 return reinterpret_cast<Value*>(Val);
469 inline T *unwrap(LLVMValueRef Val) {
470 return cast<T>(unwrap(Val));
473 inline Value **unwrap(LLVMValueRef *Vals) {
474 return reinterpret_cast<Value**>(Vals);
478 inline T **unwrap(LLVMValueRef *Vals, unsigned Length) {
480 for (LLVMValueRef *I = Vals, E = Vals + Length; I != E; ++I)
483 return reinterpret_cast<T**>(Vals);
486 inline LLVMValueRef wrap(const Value *Val) {
487 return reinterpret_cast<LLVMValueRef>(const_cast<Value*>(Val));
490 inline LLVMValueRef *wrap(const Value **Vals) {
491 return reinterpret_cast<LLVMValueRef*>(const_cast<Value**>(Vals));
494 /* Basic block conversions
496 inline BasicBlock *unwrap(LLVMBasicBlockRef BBRef) {
497 return reinterpret_cast<BasicBlock*>(BBRef);
500 inline LLVMBasicBlockRef wrap(const BasicBlock *BB) {
501 return reinterpret_cast<LLVMBasicBlockRef>(const_cast<BasicBlock*>(BB));
504 /* Opaque builder conversions.
506 inline LLVMBuilder *unwrap(LLVMBuilderRef B) {
507 return reinterpret_cast<LLVMBuilder*>(B);
510 inline LLVMBuilderRef wrap(LLVMBuilder *B) {
511 return reinterpret_cast<LLVMBuilderRef>(B);
515 #endif /* !defined(__cplusplus) */
517 #endif /* !defined(LLVM_C_CORE_H) */