Gordon Henriksen | 76a0374 | 2007-09-18 03:18:57 +0000 | [diff] [blame] | 1 | /*===-- llvm-c/Core.h - Core Library C Interface ------------------*- C -*-===*\ |
| 2 | |* *| |
| 3 | |* The LLVM Compiler Infrastructure *| |
| 4 | |* *| |
| 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. *| |
| 7 | |* *| |
| 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 | |* *| |
| 26 | \*===----------------------------------------------------------------------===*/ |
| 27 | |
| 28 | #ifndef LLVM_C_CORE_H |
| 29 | #define LLVM_C_CORE_H |
| 30 | |
| 31 | #ifdef __cplusplus |
| 32 | extern "C" { |
| 33 | #endif |
| 34 | |
| 35 | |
| 36 | /* Opaque types. */ |
| 37 | typedef struct LLVMOpaqueModule *LLVMModuleRef; |
| 38 | typedef struct LLVMOpaqueType *LLVMTypeRef; |
| 39 | typedef struct LLVMOpaqueValue *LLVMValueRef; |
Gordon Henriksen | c23b66c | 2007-09-26 20:56:12 +0000 | [diff] [blame] | 40 | typedef struct LLVMOpaqueBasicBlock *LLVMBasicBlockRef; |
| 41 | typedef struct LLVMOpaqueBuilder *LLVMBuilderRef; |
Gordon Henriksen | 76a0374 | 2007-09-18 03:18:57 +0000 | [diff] [blame] | 42 | |
| 43 | typedef enum { |
Gordon Henriksen | c23b66c | 2007-09-26 20:56:12 +0000 | [diff] [blame] | 44 | LLVMVoidTypeKind, /* type with no size */ |
Gordon Henriksen | 76a0374 | 2007-09-18 03:18:57 +0000 | [diff] [blame] | 45 | LLVMFloatTypeKind, /* 32 bit floating point type */ |
| 46 | LLVMDoubleTypeKind, /* 64 bit floating point type */ |
| 47 | LLVMX86_FP80TypeKind, /* 80 bit floating point type (X87) */ |
| 48 | LLVMFP128TypeKind, /* 128 bit floating point type (112-bit mantissa) */ |
| 49 | LLVMPPC_FP128TypeKind, /* 128 bit floating point type (two 64-bits) */ |
| 50 | LLVMLabelTypeKind, /* Labels */ |
| 51 | LLVMIntegerTypeKind, /* Arbitrary bit width integers */ |
| 52 | LLVMFunctionTypeKind, /* Functions */ |
| 53 | LLVMStructTypeKind, /* Structures */ |
| 54 | LLVMArrayTypeKind, /* Arrays */ |
| 55 | LLVMPointerTypeKind, /* Pointers */ |
| 56 | LLVMOpaqueTypeKind, /* Opaque: type with unknown structure */ |
| 57 | LLVMVectorTypeKind /* SIMD 'packed' format, or other vector type */ |
| 58 | } LLVMTypeKind; |
| 59 | |
| 60 | typedef enum { |
Gordon Henriksen | c23b66c | 2007-09-26 20:56:12 +0000 | [diff] [blame] | 61 | LLVMExternalLinkage, /* Externally visible function */ |
Gordon Henriksen | 76a0374 | 2007-09-18 03:18:57 +0000 | [diff] [blame] | 62 | LLVMLinkOnceLinkage, /* Keep one copy of function when linking (inline) */ |
| 63 | LLVMWeakLinkage, /* Keep one copy of function when linking (weak) */ |
| 64 | LLVMAppendingLinkage, /* Special purpose, only applies to global arrays */ |
| 65 | LLVMInternalLinkage, /* Rename collisions when linking (static functions)*/ |
| 66 | LLVMDLLImportLinkage, /* Function to be imported from DLL */ |
| 67 | LLVMDLLExportLinkage, /* Function to be accessible from DLL */ |
| 68 | LLVMExternalWeakLinkage,/* ExternalWeak linkage description */ |
| 69 | LLVMGhostLinkage /* Stand-in functions for streaming fns from bitcode*/ |
| 70 | } LLVMLinkage; |
| 71 | |
| 72 | typedef enum { |
Gordon Henriksen | c23b66c | 2007-09-26 20:56:12 +0000 | [diff] [blame] | 73 | LLVMDefaultVisibility, /* The GV is visible */ |
| 74 | LLVMHiddenVisibility, /* The GV is hidden */ |
| 75 | LLVMProtectedVisibility /* The GV is protected */ |
Gordon Henriksen | 76a0374 | 2007-09-18 03:18:57 +0000 | [diff] [blame] | 76 | } LLVMVisibility; |
| 77 | |
Gordon Henriksen | c23b66c | 2007-09-26 20:56:12 +0000 | [diff] [blame] | 78 | typedef enum { |
| 79 | LLVMCCallConv = 0, |
| 80 | LLVMFastCallConv = 8, |
| 81 | LLVMColdCallConv = 9, |
| 82 | LLVMX86StdcallCallConv = 64, |
| 83 | LLVMX86FastcallCallConv = 65 |
| 84 | } LLVMCallConv; |
| 85 | |
| 86 | typedef enum { |
| 87 | LLVMIntEQ = 32, /* equal */ |
| 88 | LLVMIntNE, /* not equal */ |
| 89 | LLVMIntUGT, /* unsigned greater than */ |
| 90 | LLVMIntUGE, /* unsigned greater or equal */ |
| 91 | LLVMIntULT, /* unsigned less than */ |
| 92 | LLVMIntULE, /* unsigned less or equal */ |
| 93 | LLVMIntSGT, /* signed greater than */ |
| 94 | LLVMIntSGE, /* signed greater or equal */ |
| 95 | LLVMIntSLT, /* signed less than */ |
| 96 | LLVMIntSLE /* signed less or equal */ |
| 97 | } LLVMIntPredicate; |
| 98 | |
| 99 | typedef enum { |
| 100 | LLVMRealPredicateFalse, /* Always false (always folded) */ |
| 101 | LLVMRealOEQ, /* True if ordered and equal */ |
| 102 | LLVMRealOGT, /* True if ordered and greater than */ |
| 103 | LLVMRealOGE, /* True if ordered and greater than or equal */ |
| 104 | LLVMRealOLT, /* True if ordered and less than */ |
| 105 | LLVMRealOLE, /* True if ordered and less than or equal */ |
| 106 | LLVMRealONE, /* True if ordered and operands are unequal */ |
| 107 | LLVMRealORD, /* True if ordered (no nans) */ |
| 108 | LLVMRealUNO, /* True if unordered: isnan(X) | isnan(Y) */ |
| 109 | LLVMRealUEQ, /* True if unordered or equal */ |
| 110 | LLVMRealUGT, /* True if unordered or greater than */ |
| 111 | LLVMRealUGE, /* True if unordered, greater than, or equal */ |
| 112 | LLVMRealULT, /* True if unordered or less than */ |
| 113 | LLVMRealULE, /* True if unordered, less than, or equal */ |
| 114 | LLVMRealUNE, /* True if unordered or not equal */ |
| 115 | LLVMRealPredicateTrue /* Always true (always folded) */ |
| 116 | } LLVMRealPredicate; |
| 117 | |
Gordon Henriksen | 76a0374 | 2007-09-18 03:18:57 +0000 | [diff] [blame] | 118 | |
| 119 | /*===-- Modules -----------------------------------------------------------===*/ |
| 120 | |
| 121 | /* Create and destroy modules. */ |
| 122 | LLVMModuleRef LLVMModuleCreateWithName(const char *ModuleID); |
| 123 | void LLVMDisposeModule(LLVMModuleRef M); |
| 124 | |
| 125 | /* Same as Module::addTypeName. */ |
| 126 | int LLVMAddTypeName(LLVMModuleRef M, const char *Name, LLVMTypeRef Ty); |
Gordon Henriksen | c23b66c | 2007-09-26 20:56:12 +0000 | [diff] [blame] | 127 | void LLVMDeleteTypeName(LLVMModuleRef M, const char *Name); |
Gordon Henriksen | 76a0374 | 2007-09-18 03:18:57 +0000 | [diff] [blame] | 128 | |
| 129 | |
Gordon Henriksen | c23b66c | 2007-09-26 20:56:12 +0000 | [diff] [blame] | 130 | /*===-- Types -------------------------------------------------------------===*/ |
Gordon Henriksen | 76a0374 | 2007-09-18 03:18:57 +0000 | [diff] [blame] | 131 | |
| 132 | /* LLVM types conform to the following hierarchy: |
| 133 | * |
| 134 | * types: |
| 135 | * integer type |
| 136 | * real type |
| 137 | * function type |
| 138 | * sequence types: |
| 139 | * array type |
| 140 | * pointer type |
| 141 | * vector type |
| 142 | * void type |
| 143 | * label type |
| 144 | * opaque type |
| 145 | */ |
| 146 | |
| 147 | LLVMTypeKind LLVMGetTypeKind(LLVMTypeRef Ty); |
| 148 | void LLVMRefineAbstractType(LLVMTypeRef AbstractType, LLVMTypeRef ConcreteType); |
| 149 | |
| 150 | /* Operations on integer types */ |
| 151 | LLVMTypeRef LLVMInt1Type(); |
| 152 | LLVMTypeRef LLVMInt8Type(); |
| 153 | LLVMTypeRef LLVMInt16Type(); |
| 154 | LLVMTypeRef LLVMInt32Type(); |
| 155 | LLVMTypeRef LLVMInt64Type(); |
Gordon Henriksen | c23b66c | 2007-09-26 20:56:12 +0000 | [diff] [blame] | 156 | LLVMTypeRef LLVMCreateIntType(unsigned NumBits); |
| 157 | unsigned LLVMGetIntTypeWidth(LLVMTypeRef IntegerTy); |
Gordon Henriksen | 76a0374 | 2007-09-18 03:18:57 +0000 | [diff] [blame] | 158 | |
| 159 | /* Operations on real types */ |
| 160 | LLVMTypeRef LLVMFloatType(); |
| 161 | LLVMTypeRef LLVMDoubleType(); |
| 162 | LLVMTypeRef LLVMX86FP80Type(); |
| 163 | LLVMTypeRef LLVMFP128Type(); |
| 164 | LLVMTypeRef LLVMPPCFP128Type(); |
| 165 | |
| 166 | /* Operations on function types */ |
| 167 | LLVMTypeRef LLVMCreateFunctionType(LLVMTypeRef ReturnType, |
| 168 | LLVMTypeRef *ParamTypes, unsigned ParamCount, |
| 169 | int IsVarArg); |
| 170 | int LLVMIsFunctionVarArg(LLVMTypeRef FunctionTy); |
Gordon Henriksen | c23b66c | 2007-09-26 20:56:12 +0000 | [diff] [blame] | 171 | LLVMTypeRef LLVMGetReturnType(LLVMTypeRef FunctionTy); |
| 172 | unsigned LLVMCountParamTypes(LLVMTypeRef FunctionTy); |
| 173 | void LLVMGetParamTypes(LLVMTypeRef FunctionTy, LLVMTypeRef *Dest); |
Gordon Henriksen | 76a0374 | 2007-09-18 03:18:57 +0000 | [diff] [blame] | 174 | |
| 175 | /* Operations on struct types */ |
| 176 | LLVMTypeRef LLVMCreateStructType(LLVMTypeRef *ElementTypes, |
| 177 | unsigned ElementCount, int Packed); |
Gordon Henriksen | c23b66c | 2007-09-26 20:56:12 +0000 | [diff] [blame] | 178 | unsigned LLVMCountStructElementTypes(LLVMTypeRef StructTy); |
Gordon Henriksen | 76a0374 | 2007-09-18 03:18:57 +0000 | [diff] [blame] | 179 | void LLVMGetStructElementTypes(LLVMTypeRef StructTy, LLVMTypeRef *Dest); |
| 180 | int LLVMIsPackedStruct(LLVMTypeRef StructTy); |
| 181 | |
| 182 | /* Operations on array, pointer, and vector types (sequence types) */ |
| 183 | LLVMTypeRef LLVMCreateArrayType(LLVMTypeRef ElementType, unsigned ElementCount); |
| 184 | LLVMTypeRef LLVMCreatePointerType(LLVMTypeRef ElementType); |
| 185 | LLVMTypeRef LLVMCreateVectorType(LLVMTypeRef ElementType,unsigned ElementCount); |
| 186 | |
| 187 | LLVMTypeRef LLVMGetElementType(LLVMTypeRef Ty); |
| 188 | unsigned LLVMGetArrayLength(LLVMTypeRef ArrayTy); |
| 189 | unsigned LLVMGetVectorSize(LLVMTypeRef VectorTy); |
| 190 | |
| 191 | /* Operations on other types */ |
| 192 | LLVMTypeRef LLVMVoidType(); |
| 193 | LLVMTypeRef LLVMLabelType(); |
| 194 | LLVMTypeRef LLVMCreateOpaqueType(); |
| 195 | |
| 196 | |
| 197 | /*===-- Values ------------------------------------------------------------===*/ |
| 198 | |
| 199 | /* The bulk of LLVM's object model consists of values, which comprise a very |
| 200 | * rich type hierarchy. |
| 201 | * |
| 202 | * values: |
| 203 | * constants: |
| 204 | * scalar constants |
| 205 | * composite contants |
| 206 | * globals: |
| 207 | * global variable |
| 208 | * function |
| 209 | * alias |
Gordon Henriksen | c23b66c | 2007-09-26 20:56:12 +0000 | [diff] [blame] | 210 | * basic blocks |
Gordon Henriksen | 76a0374 | 2007-09-18 03:18:57 +0000 | [diff] [blame] | 211 | */ |
| 212 | |
| 213 | /* Operations on all values */ |
Gordon Henriksen | c23b66c | 2007-09-26 20:56:12 +0000 | [diff] [blame] | 214 | LLVMTypeRef LLVMTypeOf(LLVMValueRef Val); |
Gordon Henriksen | 76a0374 | 2007-09-18 03:18:57 +0000 | [diff] [blame] | 215 | const char *LLVMGetValueName(LLVMValueRef Val); |
| 216 | void LLVMSetValueName(LLVMValueRef Val, const char *Name); |
| 217 | |
| 218 | /* Operations on constants of any type */ |
| 219 | LLVMValueRef LLVMGetNull(LLVMTypeRef Ty); /* all zeroes */ |
| 220 | LLVMValueRef LLVMGetAllOnes(LLVMTypeRef Ty); /* only for int/vector */ |
| 221 | LLVMValueRef LLVMGetUndef(LLVMTypeRef Ty); |
Gordon Henriksen | dc88c06 | 2007-09-18 18:07:51 +0000 | [diff] [blame] | 222 | int LLVMIsConstant(LLVMValueRef Val); |
Gordon Henriksen | 76a0374 | 2007-09-18 03:18:57 +0000 | [diff] [blame] | 223 | int LLVMIsNull(LLVMValueRef Val); |
Gordon Henriksen | dc88c06 | 2007-09-18 18:07:51 +0000 | [diff] [blame] | 224 | int LLVMIsUndef(LLVMValueRef Val); |
Gordon Henriksen | 76a0374 | 2007-09-18 03:18:57 +0000 | [diff] [blame] | 225 | |
| 226 | /* Operations on scalar constants */ |
| 227 | LLVMValueRef LLVMGetIntConstant(LLVMTypeRef IntTy, unsigned long long N, |
| 228 | int SignExtend); |
| 229 | LLVMValueRef LLVMGetRealConstant(LLVMTypeRef RealTy, double N); |
| 230 | |
| 231 | /* Operations on composite constants */ |
| 232 | LLVMValueRef LLVMGetStringConstant(const char *Str, unsigned Length, |
| 233 | int DontNullTerminate); |
| 234 | LLVMValueRef LLVMGetArrayConstant(LLVMTypeRef ArrayTy, |
| 235 | LLVMValueRef *ConstantVals, unsigned Length); |
| 236 | LLVMValueRef LLVMGetStructConstant(LLVMValueRef *ConstantVals, unsigned Count, |
| 237 | int packed); |
| 238 | LLVMValueRef LLVMGetVectorConstant(LLVMValueRef *ScalarConstantVals, |
| 239 | unsigned Size); |
| 240 | |
| 241 | /* Operations on global variables, functions, and aliases (globals) */ |
| 242 | int LLVMIsDeclaration(LLVMValueRef Global); |
| 243 | LLVMLinkage LLVMGetLinkage(LLVMValueRef Global); |
| 244 | void LLVMSetLinkage(LLVMValueRef Global, LLVMLinkage Linkage); |
| 245 | const char *LLVMGetSection(LLVMValueRef Global); |
| 246 | void LLVMSetSection(LLVMValueRef Global, const char *Section); |
| 247 | LLVMVisibility LLVMGetVisibility(LLVMValueRef Global); |
| 248 | void LLVMSetVisibility(LLVMValueRef Global, LLVMVisibility Viz); |
| 249 | unsigned LLVMGetAlignment(LLVMValueRef Global); |
| 250 | void LLVMSetAlignment(LLVMValueRef Global, unsigned Bytes); |
| 251 | |
| 252 | /* Operations on global variables */ |
| 253 | LLVMValueRef LLVMAddGlobal(LLVMModuleRef M, LLVMTypeRef Ty, const char *Name); |
| 254 | void LLVMDeleteGlobal(LLVMValueRef GlobalVar); |
| 255 | int LLVMHasInitializer(LLVMValueRef GlobalVar); |
| 256 | LLVMValueRef LLVMGetInitializer(LLVMValueRef GlobalVar); |
| 257 | void LLVMSetInitializer(LLVMValueRef GlobalVar, LLVMValueRef ConstantVal); |
| 258 | int LLVMIsThreadLocal(LLVMValueRef GlobalVar); |
| 259 | void LLVMSetThreadLocal(LLVMValueRef GlobalVar, int IsThreadLocal); |
| 260 | |
Gordon Henriksen | c23b66c | 2007-09-26 20:56:12 +0000 | [diff] [blame] | 261 | /* Operations on functions */ |
| 262 | LLVMValueRef LLVMAddFunction(LLVMModuleRef M, const char *Name, |
| 263 | LLVMTypeRef FunctionTy); |
| 264 | void LLVMDeleteFunction(LLVMValueRef Fn); |
| 265 | unsigned LLVMCountParams(LLVMValueRef Fn); |
| 266 | void LLVMGetParams(LLVMValueRef Fn, LLVMValueRef *Params); |
| 267 | LLVMValueRef LLVMGetParam(LLVMValueRef Fn, unsigned Index); |
| 268 | unsigned LLVMGetIntrinsicID(LLVMValueRef Fn); |
| 269 | unsigned LLVMGetFunctionCallConv(LLVMValueRef Fn); |
| 270 | void LLVMSetFunctionCallConv(LLVMValueRef Fn, unsigned CC); |
| 271 | |
| 272 | /* Operations on basic blocks */ |
| 273 | LLVMValueRef LLVMBasicBlockAsValue(LLVMBasicBlockRef Bb); |
| 274 | int LLVMValueIsBasicBlock(LLVMValueRef Val); |
| 275 | LLVMBasicBlockRef LLVMValueAsBasicBlock(LLVMValueRef Val); |
| 276 | unsigned LLVMCountBasicBlocks(LLVMValueRef Fn); |
| 277 | void LLVMGetBasicBlocks(LLVMValueRef Fn, LLVMBasicBlockRef *BasicBlocks); |
| 278 | LLVMBasicBlockRef LLVMGetEntryBasicBlock(LLVMValueRef Fn); |
| 279 | LLVMBasicBlockRef LLVMAppendBasicBlock(LLVMValueRef Fn, const char *Name); |
| 280 | LLVMBasicBlockRef LLVMInsertBasicBlock(LLVMBasicBlockRef InsertBeforeBB, |
| 281 | const char *Name); |
| 282 | void LLVMDeleteBasicBlock(LLVMBasicBlockRef BB); |
| 283 | |
| 284 | |
| 285 | /*===-- Instruction builders ----------------------------------------------===*/ |
| 286 | |
| 287 | /* An instruction builder represents a point within a basic block, and is the |
| 288 | * exclusive means of building instructions using the C interface. |
| 289 | */ |
| 290 | |
| 291 | LLVMBuilderRef LLVMCreateBuilder(); |
| 292 | void LLVMPositionBuilderBefore(LLVMBuilderRef Builder, LLVMValueRef Instr); |
| 293 | void LLVMPositionBuilderAtEnd(LLVMBuilderRef Builder, LLVMBasicBlockRef Block); |
| 294 | void LLVMDisposeBuilder(LLVMBuilderRef Builder); |
| 295 | |
| 296 | /* Terminators */ |
| 297 | LLVMValueRef LLVMBuildRetVoid(LLVMBuilderRef); |
| 298 | LLVMValueRef LLVMBuildRet(LLVMBuilderRef, LLVMValueRef V); |
| 299 | LLVMValueRef LLVMBuildBr(LLVMBuilderRef, LLVMBasicBlockRef Dest); |
| 300 | LLVMValueRef LLVMBuildCondBr(LLVMBuilderRef, LLVMValueRef If, |
| 301 | LLVMBasicBlockRef Then, LLVMBasicBlockRef Else); |
| 302 | LLVMValueRef LLVMBuildSwitch(LLVMBuilderRef, LLVMValueRef V, |
| 303 | LLVMBasicBlockRef Else, unsigned NumCases); |
| 304 | LLVMValueRef LLVMBuildInvoke(LLVMBuilderRef, LLVMValueRef Fn, |
| 305 | LLVMValueRef *Args, unsigned NumArgs, |
| 306 | LLVMBasicBlockRef Then, LLVMBasicBlockRef Catch, |
| 307 | const char *Name); |
| 308 | LLVMValueRef LLVMBuildUnwind(LLVMBuilderRef); |
| 309 | LLVMValueRef LLVMBuildUnreachable(LLVMBuilderRef); |
| 310 | |
| 311 | /* Arithmetic */ |
| 312 | LLVMValueRef LLVMBuildAdd(LLVMBuilderRef, LLVMValueRef LHS, LLVMValueRef RHS, |
| 313 | const char *Name); |
| 314 | LLVMValueRef LLVMBuildSub(LLVMBuilderRef, LLVMValueRef LHS, LLVMValueRef RHS, |
| 315 | const char *Name); |
| 316 | LLVMValueRef LLVMBuildMul(LLVMBuilderRef, LLVMValueRef LHS, LLVMValueRef RHS, |
| 317 | const char *Name); |
| 318 | LLVMValueRef LLVMBuildUDiv(LLVMBuilderRef, LLVMValueRef LHS, LLVMValueRef RHS, |
| 319 | const char *Name); |
| 320 | LLVMValueRef LLVMBuildSDiv(LLVMBuilderRef, LLVMValueRef LHS, LLVMValueRef RHS, |
| 321 | const char *Name); |
| 322 | LLVMValueRef LLVMBuildFDiv(LLVMBuilderRef, LLVMValueRef LHS, LLVMValueRef RHS, |
| 323 | const char *Name); |
| 324 | LLVMValueRef LLVMBuildURem(LLVMBuilderRef, LLVMValueRef LHS, LLVMValueRef RHS, |
| 325 | const char *Name); |
| 326 | LLVMValueRef LLVMBuildSRem(LLVMBuilderRef, LLVMValueRef LHS, LLVMValueRef RHS, |
| 327 | const char *Name); |
| 328 | LLVMValueRef LLVMBuildFRem(LLVMBuilderRef, LLVMValueRef LHS, LLVMValueRef RHS, |
| 329 | const char *Name); |
| 330 | LLVMValueRef LLVMBuildShl(LLVMBuilderRef, LLVMValueRef LHS, LLVMValueRef RHS, |
| 331 | const char *Name); |
| 332 | LLVMValueRef LLVMBuildLShr(LLVMBuilderRef, LLVMValueRef LHS, LLVMValueRef RHS, |
| 333 | const char *Name); |
| 334 | LLVMValueRef LLVMBuildAShr(LLVMBuilderRef, LLVMValueRef LHS, LLVMValueRef RHS, |
| 335 | const char *Name); |
| 336 | LLVMValueRef LLVMBuildAnd(LLVMBuilderRef, LLVMValueRef LHS, LLVMValueRef RHS, |
| 337 | const char *Name); |
| 338 | LLVMValueRef LLVMBuildOr(LLVMBuilderRef, LLVMValueRef LHS, LLVMValueRef RHS, |
| 339 | const char *Name); |
| 340 | LLVMValueRef LLVMBuildXor(LLVMBuilderRef, LLVMValueRef LHS, LLVMValueRef RHS, |
| 341 | const char *Name); |
| 342 | LLVMValueRef LLVMBuildNeg(LLVMBuilderRef, LLVMValueRef V, const char *Name); |
| 343 | LLVMValueRef LLVMBuildNot(LLVMBuilderRef, LLVMValueRef V, const char *Name); |
| 344 | |
| 345 | /* Memory */ |
| 346 | LLVMValueRef LLVMBuildMalloc(LLVMBuilderRef, LLVMTypeRef Ty, const char *Name); |
| 347 | LLVMValueRef LLVMBuildArrayMalloc(LLVMBuilderRef, LLVMTypeRef Ty, |
| 348 | LLVMValueRef Val, const char *Name); |
| 349 | LLVMValueRef LLVMBuildAlloca(LLVMBuilderRef, LLVMTypeRef Ty, const char *Name); |
| 350 | LLVMValueRef LLVMBuildArrayAlloca(LLVMBuilderRef, LLVMTypeRef Ty, |
| 351 | LLVMValueRef Val, const char *Name); |
| 352 | LLVMValueRef LLVMBuildFree(LLVMBuilderRef, LLVMValueRef PointerVal); |
| 353 | LLVMValueRef LLVMBuildLoad(LLVMBuilderRef, LLVMValueRef PointerVal, |
| 354 | const char *Name); |
| 355 | LLVMValueRef LLVMBuildStore(LLVMBuilderRef, LLVMValueRef Val, LLVMValueRef Ptr); |
| 356 | LLVMValueRef LLVMBuildGEP(LLVMBuilderRef B, LLVMValueRef Pointer, |
| 357 | LLVMValueRef *Indices, unsigned NumIndices, |
| 358 | const char *Name); |
| 359 | |
| 360 | /* Casts */ |
| 361 | LLVMValueRef LLVMBuildTrunc(LLVMBuilderRef, LLVMValueRef Val, |
| 362 | LLVMTypeRef DestTy, const char *Name); |
| 363 | LLVMValueRef LLVMBuildZExt(LLVMBuilderRef, LLVMValueRef Val, |
| 364 | LLVMTypeRef DestTy, const char *Name); |
| 365 | LLVMValueRef LLVMBuildSExt(LLVMBuilderRef, LLVMValueRef Val, |
| 366 | LLVMTypeRef DestTy, const char *Name); |
| 367 | LLVMValueRef LLVMBuildFPToUI(LLVMBuilderRef, LLVMValueRef Val, |
| 368 | LLVMTypeRef DestTy, const char *Name); |
| 369 | LLVMValueRef LLVMBuildFPToSI(LLVMBuilderRef, LLVMValueRef Val, |
| 370 | LLVMTypeRef DestTy, const char *Name); |
| 371 | LLVMValueRef LLVMBuildUIToFP(LLVMBuilderRef, LLVMValueRef Val, |
| 372 | LLVMTypeRef DestTy, const char *Name); |
| 373 | LLVMValueRef LLVMBuildSIToFP(LLVMBuilderRef, LLVMValueRef Val, |
| 374 | LLVMTypeRef DestTy, const char *Name); |
| 375 | LLVMValueRef LLVMBuildFPTrunc(LLVMBuilderRef, LLVMValueRef Val, |
| 376 | LLVMTypeRef DestTy, const char *Name); |
| 377 | LLVMValueRef LLVMBuildFPExt(LLVMBuilderRef, LLVMValueRef Val, |
| 378 | LLVMTypeRef DestTy, const char *Name); |
| 379 | LLVMValueRef LLVMBuildPtrToInt(LLVMBuilderRef, LLVMValueRef Val, |
| 380 | LLVMTypeRef DestTy, const char *Name); |
| 381 | LLVMValueRef LLVMBuildIntToPtr(LLVMBuilderRef, LLVMValueRef Val, |
| 382 | LLVMTypeRef DestTy, const char *Name); |
| 383 | LLVMValueRef LLVMBuildBitCast(LLVMBuilderRef, LLVMValueRef Val, |
| 384 | LLVMTypeRef DestTy, const char *Name); |
| 385 | |
| 386 | /* Comparisons */ |
| 387 | LLVMValueRef LLVMBuildICmp(LLVMBuilderRef, LLVMIntPredicate Op, |
| 388 | LLVMValueRef LHS, LLVMValueRef RHS, |
| 389 | const char *Name); |
| 390 | LLVMValueRef LLVMBuildFCmp(LLVMBuilderRef, LLVMRealPredicate Op, |
| 391 | LLVMValueRef LHS, LLVMValueRef RHS, |
| 392 | const char *Name); |
| 393 | |
| 394 | /* Miscellaneous instructions */ |
| 395 | LLVMValueRef LLVMBuildPhi(LLVMBuilderRef, LLVMTypeRef Ty, const char *Name); |
| 396 | LLVMValueRef LLVMBuildCall(LLVMBuilderRef, LLVMValueRef Fn, |
| 397 | LLVMValueRef *Args, unsigned NumArgs, |
| 398 | const char *Name); |
| 399 | LLVMValueRef LLVMBuildSelect(LLVMBuilderRef, LLVMValueRef If, |
| 400 | LLVMValueRef Then, LLVMValueRef Else, |
| 401 | const char *Name); |
| 402 | LLVMValueRef LLVMBuildVAArg(LLVMBuilderRef, LLVMValueRef List, LLVMTypeRef Ty, |
| 403 | const char *Name); |
| 404 | LLVMValueRef LLVMBuildExtractElement(LLVMBuilderRef, LLVMValueRef VecVal, |
| 405 | LLVMValueRef Index, const char *Name); |
| 406 | LLVMValueRef LLVMBuildInsertElement(LLVMBuilderRef, LLVMValueRef VecVal, |
| 407 | LLVMValueRef EltVal, LLVMValueRef Index, |
| 408 | const char *Name); |
| 409 | LLVMValueRef LLVMBuildShuffleVector(LLVMBuilderRef, LLVMValueRef V1, |
| 410 | LLVMValueRef V2, LLVMValueRef Mask, |
| 411 | const char *Name); |
Gordon Henriksen | 76a0374 | 2007-09-18 03:18:57 +0000 | [diff] [blame] | 412 | |
| 413 | #ifdef __cplusplus |
| 414 | } |
| 415 | #endif |
| 416 | |
| 417 | #endif |