comparison tools/binding/llvm/c/Core.d @ 1274:4ff9ab0d472c

Check in some old changes to the binding, from before I had commit access. - Add bindings for InsertValue and ExtractValue - Updates to use new APIs where they were renamed or removed. - Add generic error messages if LLVM didn't provide one. - Enable typesafe variadic arguments for GetGEP.
author Frits van Bommel <fvbommel wxs.nl>
date Mon, 27 Apr 2009 22:34:36 +0200
parents 1ba61de8796b
children 29b0f2d11c92
comparison
equal deleted inserted replaced
1273:1ba61de8796b 1274:4ff9ab0d472c
1 // Converted to the D programming language by Tomas Lindquist Olsen 2008 1 // Converted to the D programming language by Tomas Lindquist Olsen 2008
2 // and Frits van Bommel 2008
2 // Original file header: 3 // Original file header:
3 /*===-- llvm-c/Core.h - Core Library C Interface ------------------*- C -*-===*\ 4 /*===-- llvm-c/Core.h - Core Library C Interface ------------------*- C -*-===*\
4 |* *| 5 |* *|
5 |* The LLVM Compiler Infrastructure *| 6 |* The LLVM Compiler Infrastructure *|
6 |* *| 7 |* *|
220 * label type 221 * label type
221 * opaque type 222 * opaque type
222 */ 223 */
223 224
224 LLVMTypeKind LLVMGetTypeKind(LLVMTypeRef Ty); 225 LLVMTypeKind LLVMGetTypeKind(LLVMTypeRef Ty);
225 void LLVMRefineAbstractType(LLVMTypeRef AbstractType, LLVMTypeRef ConcreteType);
226 226
227 /* Operations on integer types */ 227 /* Operations on integer types */
228 LLVMTypeRef LLVMInt1Type(); 228 LLVMTypeRef LLVMInt1Type();
229 LLVMTypeRef LLVMInt8Type(); 229 LLVMTypeRef LLVMInt8Type();
230 LLVMTypeRef LLVMInt16Type(); 230 LLVMTypeRef LLVMInt16Type();
369 LLVMValueRef ElementValueConstant, 369 LLVMValueRef ElementValueConstant,
370 LLVMValueRef IndexConstant); 370 LLVMValueRef IndexConstant);
371 LLVMValueRef LLVMConstShuffleVector(LLVMValueRef VectorAConstant, 371 LLVMValueRef LLVMConstShuffleVector(LLVMValueRef VectorAConstant,
372 LLVMValueRef VectorBConstant, 372 LLVMValueRef VectorBConstant,
373 LLVMValueRef MaskConstant); 373 LLVMValueRef MaskConstant);
374 LLVMValueRef LLVMConstExtractValue(LLVMValueRef AggConstant, uint *IdxList,
375 uint NumIdx);
376 LLVMValueRef LLVMConstInsertValue(LLVMValueRef AggConstant,
377 LLVMValueRef ElementValueConstant,
378 uint *IdxList, uint NumIdx);
374 379
375 /* Operations on global variables, functions, and aliases (globals) */ 380 /* Operations on global variables, functions, and aliases (globals) */
376 LLVMModuleRef LLVMGetGlobalParent(LLVMValueRef Global); 381 LLVMModuleRef LLVMGetGlobalParent(LLVMValueRef Global);
377 int LLVMIsDeclaration(LLVMValueRef Global); 382 int LLVMIsDeclaration(LLVMValueRef Global);
378 LLVMLinkage LLVMGetLinkage(LLVMValueRef Global); 383 LLVMLinkage LLVMGetLinkage(LLVMValueRef Global);
390 LLVMValueRef LLVMGetFirstGlobal(LLVMModuleRef M); 395 LLVMValueRef LLVMGetFirstGlobal(LLVMModuleRef M);
391 LLVMValueRef LLVMGetLastGlobal(LLVMModuleRef M); 396 LLVMValueRef LLVMGetLastGlobal(LLVMModuleRef M);
392 LLVMValueRef LLVMGetNextGlobal(LLVMValueRef GlobalVar); 397 LLVMValueRef LLVMGetNextGlobal(LLVMValueRef GlobalVar);
393 LLVMValueRef LLVMGetPreviousGlobal(LLVMValueRef GlobalVar); 398 LLVMValueRef LLVMGetPreviousGlobal(LLVMValueRef GlobalVar);
394 void LLVMDeleteGlobal(LLVMValueRef GlobalVar); 399 void LLVMDeleteGlobal(LLVMValueRef GlobalVar);
395 int LLVMHasInitializer(LLVMValueRef GlobalVar);
396 LLVMValueRef LLVMGetInitializer(LLVMValueRef GlobalVar); 400 LLVMValueRef LLVMGetInitializer(LLVMValueRef GlobalVar);
397 void LLVMSetInitializer(LLVMValueRef GlobalVar, LLVMValueRef ConstantVal); 401 void LLVMSetInitializer(LLVMValueRef GlobalVar, LLVMValueRef ConstantVal);
398 int LLVMIsThreadLocal(LLVMValueRef GlobalVar); 402 int LLVMIsThreadLocal(LLVMValueRef GlobalVar);
399 void LLVMSetThreadLocal(LLVMValueRef GlobalVar, int IsThreadLocal); 403 void LLVMSetThreadLocal(LLVMValueRef GlobalVar, int IsThreadLocal);
400 int LLVMIsGlobalConstant(LLVMValueRef GlobalVar); 404 int LLVMIsGlobalConstant(LLVMValueRef GlobalVar);
410 LLVMValueRef LLVMGetPreviousFunction(LLVMValueRef Fn); 414 LLVMValueRef LLVMGetPreviousFunction(LLVMValueRef Fn);
411 void LLVMDeleteFunction(LLVMValueRef Fn); 415 void LLVMDeleteFunction(LLVMValueRef Fn);
412 uint LLVMGetIntrinsicID(LLVMValueRef Fn); 416 uint LLVMGetIntrinsicID(LLVMValueRef Fn);
413 uint LLVMGetFunctionCallConv(LLVMValueRef Fn); 417 uint LLVMGetFunctionCallConv(LLVMValueRef Fn);
414 void LLVMSetFunctionCallConv(LLVMValueRef Fn, uint CC); 418 void LLVMSetFunctionCallConv(LLVMValueRef Fn, uint CC);
415 /*const*/ char *LLVMGetCollector(LLVMValueRef Fn); 419 /*const*/ char *LLVMGetGC(LLVMValueRef Fn);
416 void LLVMSetCollector(LLVMValueRef Fn, /*const*/ char *Coll); 420 void LLVMSetGC(LLVMValueRef Fn, /*const*/ char *Name);
417 421
418 /* Operations on parameters */ 422 /* Operations on parameters */
419 uint LLVMCountParams(LLVMValueRef Fn); 423 uint LLVMCountParams(LLVMValueRef Fn);
420 void LLVMGetParams(LLVMValueRef Fn, LLVMValueRef *Params); 424 void LLVMGetParams(LLVMValueRef Fn, LLVMValueRef *Params);
421 LLVMValueRef LLVMGetParam(LLVMValueRef Fn, uint Index); 425 LLVMValueRef LLVMGetParam(LLVMValueRef Fn, uint Index);
602 LLVMValueRef EltVal, LLVMValueRef Index, 606 LLVMValueRef EltVal, LLVMValueRef Index,
603 /*const*/ char *Name); 607 /*const*/ char *Name);
604 LLVMValueRef LLVMBuildShuffleVector(LLVMBuilderRef, LLVMValueRef V1, 608 LLVMValueRef LLVMBuildShuffleVector(LLVMBuilderRef, LLVMValueRef V1,
605 LLVMValueRef V2, LLVMValueRef Mask, 609 LLVMValueRef V2, LLVMValueRef Mask,
606 /*const*/ char *Name); 610 /*const*/ char *Name);
611 LLVMValueRef LLVMBuildExtractValue(LLVMBuilderRef, LLVMValueRef AggVal,
612 uint Index, /*const*/ char *Name);
613 LLVMValueRef LLVMBuildInsertValue(LLVMBuilderRef, LLVMValueRef AggVal,
614 LLVMValueRef EltVal, uint Index,
615 /*const*/ char *Name);
607 616
608 617
609 /*===-- Module providers --------------------------------------------------===*/ 618 /*===-- Module providers --------------------------------------------------===*/
610 619
611 /* Encapsulates the module M in a module provider, taking ownership of the 620 /* Encapsulates the module M in a module provider, taking ownership of the