111 return unwrap(M)->getDataLayout().c_str();
115 unwrap(M)->setDataLayout(Triple);
120 return unwrap(M)->getTargetTriple().c_str();
124 unwrap(M)->setTargetTriple(Triple);
132 char **ErrorMessage) {
135 if (!error.empty()) {
136 *ErrorMessage =
strdup(error.c_str());
140 unwrap(M)->print(dest, NULL);
142 if (!error.empty()) {
143 *ErrorMessage =
strdup(error.c_str());
154 unwrap(M)->print(os, NULL);
157 return strdup(buf.c_str());
216 return unwrap(Ty)->isSized();
224 return unwrap(Ty)->dump();
234 return strdup(buf.c_str());
278 return unwrap<IntegerType>(IntegerTy)->
getBitWidth();
337 return unwrap<FunctionType>(FunctionTy)->isVarArg();
341 return wrap(unwrap<FunctionType>(FunctionTy)->getReturnType());
345 return unwrap<FunctionType>(FunctionTy)->getNumParams();
358 unsigned ElementCount,
LLVMBool Packed) {
364 unsigned ElementCount,
LLVMBool Packed) {
366 ElementCount, Packed);
383 unsigned ElementCount,
LLVMBool Packed) {
385 unwrap<StructType>(StructTy)->setBody(Tys, Packed != 0);
389 return unwrap<StructType>(StructTy)->getNumElements();
393 StructType *Ty = unwrap<StructType>(StructTy);
400 return unwrap<StructType>(StructTy)->isPacked();
404 return unwrap<StructType>(StructTy)->isOpaque();
426 return wrap(unwrap<SequentialType>(Ty)->getElementType());
430 return unwrap<ArrayType>(ArrayTy)->getNumElements();
434 return unwrap<PointerType>(
PointerTy)->getAddressSpace();
438 return unwrap<VectorType>(VectorTy)->getNumElements();
466 return unwrap(Val)->getName().data();
470 unwrap(Val)->setName(Name);
484 return strdup(buf.c_str());
492 return unwrap<Instruction>(Inst)->hasMetadata();
496 return wrap(unwrap<Instruction>(Inst)->getMetadata(KindID));
500 unwrap<Instruction>(Inst)->setMetadata(KindID, MD? unwrap<MDNode>(MD) : NULL);
505 #define LLVM_DEFINE_VALUE_CAST(name) \
506 LLVMValueRef LLVMIsA##name(LLVMValueRef Val) { \
507 return wrap(static_cast<Value*>(dyn_cast_or_null<name>(unwrap(Val)))); \
539 if (
MDNode *MD = dyn_cast<MDNode>(V))
540 return wrap(MD->getOperand(Index));
541 return wrap(cast<User>(V)->getOperand(Index));
545 unwrap<User>(Val)->setOperand(Index,
unwrap(Op));
550 if (
MDNode *MD = dyn_cast<MDNode>(V))
551 return MD->getNumOperands();
552 return cast<User>(V)->getNumOperands();
570 return isa<Constant>(
unwrap(Ty));
575 return C->isNullValue();
580 return isa<UndefValue>(
unwrap(Val));
611 *Len = S->getString().size();
612 return S->getString().data();
620 return cast<MDNode>(
unwrap(V))->getNumOperands();
627 for (
unsigned i = 0; i < numOperands; i++)
634 return N->getNumOperands();
654 MDNode *Op = Val ? unwrap<MDNode>(Val) : NULL;
668 const uint64_t Words[]) {
682 unsigned SLen, uint8_t Radix) {
701 return unwrap<ConstantInt>(ConstantVal)->getZExtValue();
705 return unwrap<ConstantInt>(ConstantVal)->getSExtValue();
716 DontNullTerminate == 0));
721 Constant **Elements = unwrap<Constant>(ConstantVals, Count);
745 Constant **Elements = unwrap<Constant>(ConstantVals, Count);
753 unwrap<Constant>(ScalarConstantVals, Size), Size)));
762 #define HANDLE_INST(num, opc, clas) case num: return LLVM##opc;
763 #include "llvm/IR/Instruction.def"
771 #define HANDLE_INST(num, opc, clas) case LLVM##opc: return num;
772 #include "llvm/IR/Instruction.def"
815 unwrap<Constant>(RHSConstant)));
821 unwrap<Constant>(RHSConstant)));
827 unwrap<Constant>(RHSConstant)));
832 unwrap<Constant>(RHSConstant)));
837 unwrap<Constant>(RHSConstant)));
843 unwrap<Constant>(RHSConstant)));
849 unwrap<Constant>(RHSConstant)));
854 unwrap<Constant>(RHSConstant)));
859 unwrap<Constant>(RHSConstant)));
865 unwrap<Constant>(RHSConstant)));
871 unwrap<Constant>(RHSConstant)));
876 unwrap<Constant>(RHSConstant)));
881 unwrap<Constant>(RHSConstant)));
886 unwrap<Constant>(RHSConstant)));
892 unwrap<Constant>(RHSConstant)));
897 unwrap<Constant>(RHSConstant)));
902 unwrap<Constant>(RHSConstant)));
907 unwrap<Constant>(RHSConstant)));
912 unwrap<Constant>(RHSConstant)));
917 unwrap<Constant>(RHSConstant)));
922 unwrap<Constant>(RHSConstant)));
927 unwrap<Constant>(RHSConstant)));
933 unwrap<Constant>(LHSConstant),
934 unwrap<Constant>(RHSConstant)));
940 unwrap<Constant>(LHSConstant),
941 unwrap<Constant>(RHSConstant)));
946 unwrap<Constant>(RHSConstant)));
951 unwrap<Constant>(RHSConstant)));
956 unwrap<Constant>(RHSConstant)));
969 unsigned NumIndices) {
970 Constant* Val = unwrap<Constant>(ConstantVal);
1069 unwrap(ToType), isSigned));
1081 unwrap<Constant>(ConstantIfTrue),
1082 unwrap<Constant>(ConstantIfFalse)));
1088 unwrap<Constant>(IndexConstant)));
1095 unwrap<Constant>(ElementValueConstant),
1096 unwrap<Constant>(IndexConstant)));
1103 unwrap<Constant>(VectorBConstant),
1104 unwrap<Constant>(MaskConstant)));
1115 unsigned *IdxList,
unsigned NumIdx) {
1117 unwrap<Constant>(ElementValueConstant),
1122 const char *Constraints,
1126 Constraints, HasSideEffects, IsAlignStack));
1144 switch (unwrap<GlobalValue>(Global)->getLinkage()) {
1197 DEBUG(
errs() <<
"LLVMSetLinkage(): LLVMLinkOnceODRAutoHideLinkage is no "
1198 "longer supported.");
1232 <<
"LLVMSetLinkage(): LLVMGhostLinkage is no longer supported.");
1241 return unwrap<GlobalValue>(Global)->getSection().c_str();
1245 unwrap<GlobalValue>(Global)->setSection(Section);
1250 unwrap<GlobalValue>(Global)->getVisibility());
1254 unwrap<GlobalValue>(Global)
1255 ->setVisibility(static_cast<GlobalValue::VisibilityTypes>(Viz));
1261 Value *
P = unwrap<Value>(V);
1263 return GV->getAlignment();
1265 return LI->getAlignment();
1266 if (
StoreInst *SI = dyn_cast<StoreInst>(P))
1267 return SI->getAlignment();
1269 llvm_unreachable(
"only GlobalValue, LoadInst and StoreInst have alignment");
1273 Value *
P = unwrap<Value>(V);
1275 GV->setAlignment(Bytes);
1276 else if (
LoadInst *
LI = dyn_cast<LoadInst>(P))
1277 LI->setAlignment(Bytes);
1278 else if (
StoreInst *SI = dyn_cast<StoreInst>(P))
1279 SI->setAlignment(Bytes);
1281 llvm_unreachable(
"only GlobalValue, LoadInst and StoreInst have alignment");
1300 return wrap(
unwrap(M)->getNamedGlobal(Name));
1336 unwrap<GlobalVariable>(
GlobalVar)->eraseFromParent();
1348 ->setInitializer(unwrap<Constant>(ConstantVal));
1352 return unwrap<GlobalVariable>(
GlobalVar)->isThreadLocal();
1356 unwrap<GlobalVariable>(
GlobalVar)->setThreadLocal(IsThreadLocal != 0);
1360 return unwrap<GlobalVariable>(
GlobalVar)->isConstant();
1364 unwrap<GlobalVariable>(
GlobalVar)->setConstant(IsConstant != 0);
1368 switch (unwrap<GlobalVariable>(GlobalVar)->getThreadLocalMode()) {
1407 return unwrap<GlobalVariable>(
GlobalVar)->isExternallyInitialized();
1411 unwrap<GlobalVariable>(
GlobalVar)->setExternallyInitialized(IsExtInit);
1419 unwrap<Constant>(Aliasee),
unwrap (M)));
1437 if (I == Mod->
end())
1445 if (I == Mod->
begin())
1467 unwrap<Function>(Fn)->eraseFromParent();
1472 return F->getIntrinsicID();
1477 return unwrap<Function>(Fn)->getCallingConv();
1481 return unwrap<Function>(Fn)->setCallingConv(
1482 static_cast<CallingConv::ID>(CC));
1505 AttributeSet::FunctionIndex, B));
1512 AttributeSet::AttrIndex Idx =
1513 AttributeSet::AttrIndex(AttributeSet::FunctionIndex);
1528 AttributeSet::FunctionIndex, B));
1543 return unwrap<Function>(FnRef)->arg_size();
1547 Function *Fn = unwrap<Function>(FnRef);
1550 *ParamRefs++ =
wrap(
I);
1625 return wrap(static_cast<Value*>(
unwrap(BB)));
1629 return isa<BasicBlock>(
unwrap(Val));
1633 return wrap(unwrap<BasicBlock>(Val));
1645 return unwrap<Function>(FnRef)->size();
1649 Function *Fn = unwrap<Function>(FnRef);
1651 *BasicBlocksRefs++ =
wrap(
I);
1655 return wrap(&unwrap<Function>(Fn)->getEntryBlock());
1661 if (I == Func->
end())
1669 if (I == Func->
begin())
1713 unwrap(BBRef)->eraseFromParent();
1717 unwrap(BBRef)->removeFromParent();
1737 if (I == Block->
end())
1745 if (I == Block->
begin())
1767 unwrap<Instruction>(Inst)->eraseFromParent();
1774 if (CE->getOpcode() == Instruction::ICmp)
1789 if (
CallInst *CI = dyn_cast<CallInst>(V))
1790 return CI->getCallingConv();
1791 if (
InvokeInst *II = dyn_cast<InvokeInst>(V))
1792 return II->getCallingConv();
1793 llvm_unreachable(
"LLVMGetInstructionCallConv applies only to call and invoke!");
1798 if (
CallInst *CI = dyn_cast<CallInst>(V))
1799 return CI->setCallingConv(static_cast<CallingConv::ID>(CC));
1800 else if (
InvokeInst *II = dyn_cast<InvokeInst>(V))
1801 return II->setCallingConv(static_cast<CallingConv::ID>(CC));
1802 llvm_unreachable(
"LLVMSetInstructionCallConv applies only to call and invoke!");
1811 AttributeSet::get(Call->getContext(),
1821 AttributeSet::get(Call->getContext(),
1832 AttributeSet::get(Call->getContext(),
1839 return unwrap<CallInst>(
Call)->isTailCall();
1843 unwrap<CallInst>(
Call)->setTailCall(isTailCall);
1849 return wrap(unwrap<SwitchInst>(Switch)->getDefaultDest());
1856 PHINode *PhiVal = unwrap<PHINode>(PhiNode);
1857 for (
unsigned I = 0;
I != Count; ++
I)
1862 return unwrap<PHINode>(PhiNode)->getNumIncomingValues();
1866 return wrap(unwrap<PHINode>(PhiNode)->getIncomingValue(Index));
1870 return wrap(unwrap<PHINode>(PhiNode)->getIncomingBlock(Index));
1888 unwrap(Builder)->SetInsertPoint(BB, I);
1898 unwrap(Builder)->SetInsertPoint(BB);
1902 return wrap(
unwrap(Builder)->GetInsertBlock());
1906 unwrap(Builder)->ClearInsertionPoint();
1910 unwrap(Builder)->Insert(unwrap<Instruction>(Instr));
1915 unwrap(Builder)->Insert(unwrap<Instruction>(Instr), Name);
1925 MDNode *Loc = L ? unwrap<MDNode>(L) : NULL;
1930 return wrap(
unwrap(Builder)->getCurrentDebugLocation()
1931 .getAsMDNode(
unwrap(Builder)->getContext()));
1935 unwrap(Builder)->SetInstDebugLocation(unwrap<Instruction>(Inst));
1969 unsigned NumDests) {
1986 cast<Function>(
unwrap(PersFn)),
2000 unwrap<SwitchInst>(Switch)->addCase(unwrap<ConstantInt>(OnVal),
unwrap(Dest));
2004 unwrap<IndirectBrInst>(IndirectBr)->addDestination(
unwrap(Dest));
2008 unwrap<LandingPadInst>(LandingPad)->
2009 addClause(cast<Constant>(
unwrap(ClauseVal)));
2013 unwrap<LandingPadInst>(LandingPad)->setCleanup(Val);
2180 ITy,
unwrap(Ty), AllocSize,
2191 ITy,
unwrap(Ty), AllocSize,
2237 unsigned Idx,
const char *
Name) {
2243 return wrap(
unwrap(B)->CreateGlobalString(Str, Name));
2248 return wrap(
unwrap(B)->CreateGlobalStringPtr(Str, Name));
2252 Value *
P = unwrap<Value>(MemAccessInst);
2254 return LI->isVolatile();
2255 return cast<StoreInst>(
P)->isVolatile();
2259 Value *
P = unwrap<Value>(MemAccessInst);
2261 return LI->setVolatile(isVolatile);
2262 return cast<StoreInst>(
P)->setVolatile(isVolatile);
2377 return wrap(
unwrap(B)->CreateICmp(static_cast<ICmpInst::Predicate>(Op),
2384 return wrap(
unwrap(B)->CreateFCmp(static_cast<FCmpInst::Predicate>(Op),
2435 unsigned Index,
const char *
Name) {
2515 char **OutMessage) {
2529 char **OutMessage) {
2542 const char *InputData,
2543 size_t InputDataLength,
2544 const char *BufferName,
2550 RequiresNullTerminator));
2554 const char *InputData,
2555 size_t InputDataLength,
2556 const char *BufferName) {
2564 return unwrap(MemBuf)->getBufferStart();
2568 return unwrap(MemBuf)->getBufferSize();
2584 return wrap(
new PassManager());
2593 reinterpret_cast<LLVMModuleRef>(P));
2597 return unwrap<PassManager>(PM)->run(*
unwrap(M));
2601 return unwrap<FunctionPassManager>(FPM)->doInitialization();
2605 return unwrap<FunctionPassManager>(FPM)->run(*unwrap<Function>(F));
2609 return unwrap<FunctionPassManager>(FPM)->doFinalization();
LLVMValueRef LLVMConstExactSDiv(LLVMValueRef LHSConstant, LLVMValueRef RHSConstant)
LLVMValueRef LLVMConstInlineAsm(LLVMTypeRef Ty, const char *AsmString, const char *Constraints, LLVMBool HasSideEffects, LLVMBool IsAlignStack)
const char * LLVMGetBufferStart(LLVMMemoryBufferRef MemBuf)
static MemoryBuffer * getMemBuffer(StringRef InputData, StringRef BufferName="", bool RequiresNullTerminator=true)
void LLVMDisposeBuilder(LLVMBuilderRef Builder)
LLVMValueRef LLVMConstNamedStruct(LLVMTypeRef StructTy, LLVMValueRef *ConstantVals, unsigned Count)
struct LLVMOpaqueType * LLVMTypeRef
LLVMBasicBlockRef LLVMInsertBasicBlockInContext(LLVMContextRef C, LLVMBasicBlockRef BBRef, const char *Name)
void LLVMGetStructElementTypes(LLVMTypeRef StructTy, LLVMTypeRef *Dest)
void LLVMGetParams(LLVMValueRef FnRef, LLVMValueRef *ParamRefs)
LLVMValueRef LLVMGetInitializer(LLVMValueRef GlobalVar)
LLVMValueRef LLVMBuildICmp(LLVMBuilderRef B, LLVMIntPredicate Op, LLVMValueRef LHS, LLVMValueRef RHS, const char *Name)
static Constant * getString(LLVMContext &Context, StringRef Initializer, bool AddNull=true)
static Constant * getSIToFP(Constant *C, Type *Ty)
Like Private, but linker removes.
static Type * getDoubleTy(LLVMContext &C)
static IntegerType * getInt1Ty(LLVMContext &C)
unsigned LLVMGetPointerAddressSpace(LLVMTypeRef PointerTy)
static Constant * getFAdd(Constant *C1, Constant *C2)
static Constant * getShuffleVector(Constant *V1, Constant *V2, Constant *Mask)
void addIncoming(Value *V, BasicBlock *BB)
Special purpose, only applies to global arrays.
static PassRegistry * getPassRegistry()
LLVMContext & getContext() const
*p = old <signed v ? old : v
LLVMValueRef LLVMBuildArrayAlloca(LLVMBuilderRef B, LLVMTypeRef Ty, LLVMValueRef Val, const char *Name)
LLVMValueRef LLVMConstXor(LLVMValueRef LHSConstant, LLVMValueRef RHSConstant)
LLVMValueRef LLVMBuildZExt(LLVMBuilderRef B, LLVMValueRef Val, LLVMTypeRef DestTy, const char *Name)
const AttributeSet & getAttributes() const
LLVMBasicBlockRef LLVMGetEntryBasicBlock(LLVMValueRef Fn)
LLVMValueRef LLVMGetLastFunction(LLVMModuleRef M)
LLVMValueRef LLVMConstBitCast(LLVMValueRef ConstantVal, LLVMTypeRef ToType)
LLVM Argument representation.
LLVMValueRef LLVMConstUDiv(LLVMValueRef LHSConstant, LLVMValueRef RHSConstant)
void initializeVerifierPass(PassRegistry &)
LLVMBool LLVMTypeIsSized(LLVMTypeRef Ty)
LLVMValueRef LLVMConstSDiv(LLVMValueRef LHSConstant, LLVMValueRef RHSConstant)
void LLVMSetSection(LLVMValueRef Global, const char *Section)
void LLVMSetParamAlignment(LLVMValueRef Arg, unsigned align)
LLVMMemoryBufferRef LLVMCreateMemoryBufferWithMemoryRangeCopy(const char *InputData, size_t InputDataLength, const char *BufferName)
LLVMValueRef LLVMGetIncomingValue(LLVMValueRef PhiNode, unsigned Index)
static Constant * getNSWAdd(Constant *C1, Constant *C2)
The main container class for the LLVM Intermediate Representation.
LLVMValueRef LLVMBuildAdd(LLVMBuilderRef B, LLVMValueRef LHS, LLVMValueRef RHS, const char *Name)
LLVMBuilderRef LLVMCreateBuilder(void)
LLVMValueRef LLVMGetNextParam(LLVMValueRef Arg)
2: 32-bit floating point type
Same, but only replaced by something equivalent.
LLVMValueRef LLVMBuildNUWAdd(LLVMBuilderRef B, LLVMValueRef LHS, LLVMValueRef RHS, const char *Name)
static MDString * get(LLVMContext &Context, StringRef Str)
LLVMValueRef LLVMBuildStructGEP(LLVMBuilderRef B, LLVMValueRef Pointer, unsigned Idx, const char *Name)
LLVMValueRef LLVMGetNamedGlobal(LLVMModuleRef M, const char *Name)
static Constant * getSelect(Constant *C, Constant *V1, Constant *V2)
LLVMBool LLVMIsOpaqueStruct(LLVMTypeRef StructTy)
LLVMMemoryBufferRef LLVMCreateMemoryBufferWithMemoryRange(const char *InputData, size_t InputDataLength, const char *BufferName, LLVMBool RequiresNullTerminator)
static Constant * getAnon(ArrayRef< Constant * > V, bool Packed=false)
LLVMValueRef LLVMGetFirstParam(LLVMValueRef Fn)
LLVMValueRef LLVMBuildSExt(LLVMBuilderRef B, LLVMValueRef Val, LLVMTypeRef DestTy, const char *Name)
LLVMValueRef LLVMAddAlias(LLVMModuleRef M, LLVMTypeRef Ty, LLVMValueRef Aliasee, const char *Name)
LLVMValueRef LLVMAlignOf(LLVMTypeRef Ty)
Available for inspection, not emission.
unsigned getNumOperands() const
getNumOperands - Return number of MDNode operands.
void LLVMStopMultithreaded()
LLVMValueRef LLVMConstRealOfStringAndSize(LLVMTypeRef RealTy, const char Str[], unsigned SLen)
void LLVMSetValueName(LLVMValueRef Val, const char *Name)
LLVMValueRef LLVMConstFPToUI(LLVMValueRef ConstantVal, LLVMTypeRef ToType)
static Constant * getFPToUI(Constant *C, Type *Ty)
Type::subtype_iterator param_iterator
const char * LLVMGetGC(LLVMValueRef Fn)
LLVMPassManagerRef LLVMCreateFunctionPassManager(LLVMModuleProviderRef P)
LLVMValueRef LLVMAddGlobal(LLVMModuleRef M, LLVMTypeRef Ty, const char *Name)
static Constant * getGetElementPtr(Constant *C, ArrayRef< Constant * > IdxList, bool InBounds=false)
void LLVMAddAttribute(LLVMValueRef Arg, LLVMAttribute PA)
LLVMTypeRef LLVMHalfType(void)
LLVMValueRef LLVMBuildRet(LLVMBuilderRef B, LLVMValueRef V)
LLVMBasicBlockRef LLVMGetNextBasicBlock(LLVMBasicBlockRef BB)
LLVMBool LLVMCreateMemoryBufferWithContentsOfFile(const char *Path, LLVMMemoryBufferRef *OutMemBuf, char **OutMessage)
char * LLVMCreateMessage(const char *Message)
LLVMPassManagerRef LLVMCreatePassManager()
const char * getGC() const
void addOperand(MDNode *M)
addOperand - Add metadata operand.
LLVMTypeRef LLVMFP128Type(void)
static Constant * getExactSDiv(Constant *C1, Constant *C2)
LLVMValueRef LLVMBuildFPToUI(LLVMBuilderRef B, LLVMValueRef Val, LLVMTypeRef DestTy, const char *Name)
static PointerType * get(Type *ElementType, unsigned AddressSpace)
#define LLVM_FOR_EACH_VALUE_SUBCLASS(macro)
unsigned LLVMGetVectorSize(LLVMTypeRef VectorTy)
*p = old <unsigned v ? old : v
static Constant * getExtractElement(Constant *Vec, Constant *Idx)
LLVMValueRef LLVMBuildCondBr(LLVMBuilderRef B, LLVMValueRef If, LLVMBasicBlockRef Then, LLVMBasicBlockRef Else)
Like Internal, but omit from symbol table.
LLVMTypeRef LLVMX86MMXType(void)
*p = old >unsigned v ? old : v
Externally visible function.
LLVMValueRef LLVMBuildFNeg(LLVMBuilderRef B, LLVMValueRef V, const char *Name)
LLVMValueRef LLVMBuildTruncOrBitCast(LLVMBuilderRef B, LLVMValueRef Val, LLVMTypeRef DestTy, const char *Name)
const Function * getParent() const
Return the enclosing method, or null if none.
LLVMValueRef LLVMBuildSDiv(LLVMBuilderRef B, LLVMValueRef LHS, LLVMValueRef RHS, const char *Name)
LLVMTypeRef LLVMX86FP80Type(void)
LLVMUseRef LLVMGetFirstUse(LLVMValueRef Val)
static Constant * getUIToFP(Constant *C, Type *Ty)
MDNode - a tuple of other values.
void LLVMClearInsertionPosition(LLVMBuilderRef Builder)
LLVMValueRef LLVMGetNextGlobal(LLVMValueRef GlobalVar)
4: 80-bit floating point type (X87)
LLVMTypeRef LLVMVectorType(LLVMTypeRef ElementType, unsigned ElementCount)
LLVMValueRef LLVMConstAnd(LLVMValueRef LHSConstant, LLVMValueRef RHSConstant)
unsigned LLVMGetMDKindIDInContext(LLVMContextRef C, const char *Name, unsigned SLen)
LLVMPassRegistryRef LLVMGetGlobalPassRegistry(void)
LLVMValueRef LLVMBuildCast(LLVMBuilderRef B, LLVMOpcode Op, LLVMValueRef Val, LLVMTypeRef DestTy, const char *Name)
LLVMValueRef LLVMBuildFRem(LLVMBuilderRef B, LLVMValueRef LHS, LLVMValueRef RHS, const char *Name)
LLVMContext ** unwrap(LLVMContextRef *Tys)
LLVMValueRef LLVMConstSelect(LLVMValueRef ConstantCondition, LLVMValueRef ConstantIfTrue, LLVMValueRef ConstantIfFalse)
1: 16-bit floating point type
LLVMValueRef LLVMConstTrunc(LLVMValueRef ConstantVal, LLVMTypeRef ToType)
unsigned getBitWidth() const
Get the number of bits in this IntegerType.
LLVMBool LLVMValueIsBasicBlock(LLVMValueRef Val)
static IntegerType * getInt64Ty(LLVMContext &C)
FunctionType * getType(LLVMContext &Context, ID id, ArrayRef< Type * > Tys=None)
LLVMTypeRef LLVMStructTypeInContext(LLVMContextRef C, LLVMTypeRef *ElementTypes, unsigned ElementCount, LLVMBool Packed)
AttrBuilder & addAttribute(Attribute::AttrKind Val)
Add an attribute to the builder.
static Constant * getFCmp(unsigned short pred, Constant *LHS, Constant *RHS)
LLVMBasicBlockRef LLVMInsertBasicBlock(LLVMBasicBlockRef BBRef, const char *Name)
int LLVMHasMetadata(LLVMValueRef Inst)
static Constant * getSub(Constant *C1, Constant *C2, bool HasNUW=false, bool HasNSW=false)
const char * LLVMGetSection(LLVMValueRef Global)
static Instruction * CreateFree(Value *Source, Instruction *InsertBefore)
CreateFree - Generate the IR for a call to the builtin free function.
LLVMTypeRef LLVMInt16TypeInContext(LLVMContextRef C)
void initializeDominatorTreePass(PassRegistry &)
void initializeCore(PassRegistry &)
static IntegerType * getInt16Ty(LLVMContext &C)
const Constant * getInitializer() const
static Type * getX86_MMXTy(LLVMContext &C)
LLVMValueRef LLVMConstIntOfString(LLVMTypeRef IntTy, const char Str[], uint8_t Radix)
*p = old >signed v ? old : v
void LLVMGetNamedMetadataOperands(LLVMModuleRef M, const char *name, LLVMValueRef *Dest)
LLVMValueRef LLVMConstAddrSpaceCast(LLVMValueRef ConstantVal, LLVMTypeRef ToType)
void LLVMRemoveFunctionAttr(LLVMValueRef Fn, LLVMAttribute PA)
bool llvm_start_multithreaded()
static Type * getX86_FP80Ty(LLVMContext &C)
void LLVMContextDispose(LLVMContextRef C)
void LLVMSetGlobalConstant(LLVMValueRef GlobalVar, LLVMBool IsConstant)
void LLVMSetThreadLocal(LLVMValueRef GlobalVar, LLVMBool IsThreadLocal)
LoopInfoBase< BlockT, LoopT > * LI
LLVMValueRef LLVMConstNull(LLVMTypeRef Ty)
static MDNode * get(LLVMContext &Context, ArrayRef< Value * > Vals)
LLVMValueRef LLVMConstReal(LLVMTypeRef RealTy, double N)
LLVMValueRef LLVMBuildPointerCast(LLVMBuilderRef B, LLVMValueRef Val, LLVMTypeRef DestTy, const char *Name)
static Constant * getNullValue(Type *Ty)
LLVMBool LLVMInitializeFunctionPassManager(LLVMPassManagerRef FPM)
void LLVMSetOperand(LLVMValueRef Val, unsigned Index, LLVMValueRef Op)
long long LLVMConstIntGetSExtValue(LLVMValueRef ConstantVal)
static Constant * getAdd(Constant *C1, Constant *C2, bool HasNUW=false, bool HasNSW=false)
static Constant * getFMul(Constant *C1, Constant *C2)
void addAttr(AttributeSet AS)
Add a Attribute to an argument.
Value * getOperand(unsigned i) const LLVM_READONLY
getOperand - Return specified operand.
element_iterator element_end() const
LLVMOpcode LLVMGetInstructionOpcode(LLVMValueRef Inst)
LLVMTypeRef LLVMFP128TypeInContext(LLVMContextRef C)
const char * LLVMGetStructName(LLVMTypeRef Ty)
LLVMBasicBlockRef LLVMGetLastBasicBlock(LLVMValueRef Fn)
LLVMValueRef LLVMBasicBlockAsValue(LLVMBasicBlockRef BB)
void LLVMAddFunctionAttr(LLVMValueRef Fn, LLVMAttribute PA)
static Constant * getIntegerCast(Constant *C, Type *Ty, bool isSigned)
Create a ZExt, Bitcast or Trunc for integer -> integer casts.
LLVMTypeRef LLVMLabelTypeInContext(LLVMContextRef C)
LLVMTypeRef LLVMDoubleTypeInContext(LLVMContextRef C)
static unsigned getBitWidth(Type *Ty, const DataLayout *TD)
LLVMValueRef LLVMConstVector(LLVMValueRef *ScalarConstantVals, unsigned Size)
void initializePrintFunctionPassPass(PassRegistry &)
LLVMValueRef LLVMBuildExactSDiv(LLVMBuilderRef B, LLVMValueRef LHS, LLVMValueRef RHS, const char *Name)
Type::subtype_iterator element_iterator
LLVMValueRef LLVMSizeOf(LLVMTypeRef Ty)
LLVMBool LLVMIsNull(LLVMValueRef Val)
static Type * getFloatTy(LLVMContext &C)
LLVMValueRef LLVMConstShuffleVector(LLVMValueRef VectorAConstant, LLVMValueRef VectorBConstant, LLVMValueRef MaskConstant)
ArrayRef< T > makeArrayRef(const T &OneElt)
Construct an ArrayRef from a single element.
LLVMValueRef LLVMConstRealOfString(LLVMTypeRef RealTy, const char *Text)
LLVMValueRef LLVMBuildAggregateRet(LLVMBuilderRef B, LLVMValueRef *RetVals, unsigned N)
#define llvm_unreachable(msg)
static Constant * getLShr(Constant *C1, Constant *C2, bool isExact=false)
static bool isDeclaration(const GlobalValue &V)
isDeclaration - Return 'true' if the global value is a declaration.
param_iterator param_end() const
static Constant * getNUWNeg(Constant *C)
LLVMValueRef LLVMConstIntOfStringAndSize(LLVMTypeRef IntTy, const char Str[], unsigned SLen, uint8_t Radix)
void LLVMPositionBuilder(LLVMBuilderRef Builder, LLVMBasicBlockRef Block, LLVMValueRef Instr)
LLVMTypeRef LLVMInt8TypeInContext(LLVMContextRef C)
unsigned LLVMGetFunctionCallConv(LLVMValueRef Fn)
LLVMValueRef LLVMConstIntCast(LLVMValueRef ConstantVal, LLVMTypeRef ToType, LLVMBool isSigned)
LLVMValueRef LLVMConstNUWAdd(LLVMValueRef LHSConstant, LLVMValueRef RHSConstant)
static Constant * get(ArrayRef< Constant * > V)
This provides a uniform API for creating instructions and inserting them into a basic block: either a...
LLVMValueRef LLVMConstFSub(LLVMValueRef LHSConstant, LLVMValueRef RHSConstant)
unsigned LLVMGetIntTypeWidth(LLVMTypeRef IntegerTy)
This file contains the simple types necessary to represent the attributes associated with functions a...
LLVMBool LLVMIsExternallyInitialized(LLVMValueRef GlobalVar)
LLVMValueRef LLVMConstAShr(LLVMValueRef LHSConstant, LLVMValueRef RHSConstant)
LLVMValueRef LLVMGetBasicBlockParent(LLVMBasicBlockRef BB)
LLVMValueRef LLVMGetLastParam(LLVMValueRef Fn)
static Constant * getExtractValue(Constant *Agg, ArrayRef< unsigned > Idxs)
LLVMValueRef LLVMConstICmp(LLVMIntPredicate Predicate, LLVMValueRef LHSConstant, LLVMValueRef RHSConstant)
struct LLVMOpaqueMemoryBuffer * LLVMMemoryBufferRef
element_iterator element_begin() const
LLVMValueRef LLVMGetUndef(LLVMTypeRef Ty)
void LLVMSetVisibility(LLVMValueRef Global, LLVMVisibility Viz)
void LLVMAddNamedMetadataOperand(LLVMModuleRef M, const char *name, LLVMValueRef Val)
static Type * getPPC_FP128Ty(LLVMContext &C)
LLVMValueRef LLVMConstSExt(LLVMValueRef ConstantVal, LLVMTypeRef ToType)
LLVMValueRef LLVMGetPreviousGlobal(LLVMValueRef GlobalVar)
LLVMValueRef LLVMBuildNSWAdd(LLVMBuilderRef B, LLVMValueRef LHS, LLVMValueRef RHS, const char *Name)
void removeAttr(AttributeSet AS)
Remove a Attribute from an argument.
LLVMValueRef LLVMGetFirstInstruction(LLVMBasicBlockRef BB)
LLVMTypeRef LLVMFloatType(void)
global_iterator global_begin()
void LLVMDisposeMessage(char *Message)
LLVMValueRef LLVMConstFPCast(LLVMValueRef ConstantVal, LLVMTypeRef ToType)
struct LLVMOpaqueModuleProvider * LLVMModuleProviderRef
LLVMValueRef LLVMBuildSRem(LLVMBuilderRef B, LLVMValueRef LHS, LLVMValueRef RHS, const char *Name)
LLVMValueRef LLVMGetPreviousInstruction(LLVMValueRef Inst)
void LLVMMoveBasicBlockBefore(LLVMBasicBlockRef BB, LLVMBasicBlockRef MovePos)
static Constant * getSizeOf(Type *Ty)
LLVMValueRef LLVMConstInsertElement(LLVMValueRef VectorConstant, LLVMValueRef ElementValueConstant, LLVMValueRef IndexConstant)
void LLVMGetParamTypes(LLVMTypeRef FunctionTy, LLVMTypeRef *Dest)
char * LLVMPrintModuleToString(LLVMModuleRef M)
static Type * getLabelTy(LLVMContext &C)
void LLVMDisposeModule(LLVMModuleRef M)
void LLVMSetInstDebugLocation(LLVMBuilderRef Builder, LLVMValueRef Inst)
LLVMBool LLVMIsGlobalConstant(LLVMValueRef GlobalVar)
LLVMContext & getContext() const
getContext - Return the LLVMContext in which this type was uniqued.
LLVMValueRef LLVMConstStructInContext(LLVMContextRef C, LLVMValueRef *ConstantVals, unsigned Count, LLVMBool Packed)
static Constant * getFPCast(Constant *C, Type *Ty)
Create a FPExt, Bitcast or FPTrunc for fp -> fp casts.
LLVMBool LLVMIsTailCall(LLVMValueRef Call)
LLVMValueRef LLVMBlockAddress(LLVMValueRef F, LLVMBasicBlockRef BB)
void llvm_shutdown()
llvm_shutdown - Deallocate and destroy all ManagedStatic variables.
LLVMValueRef LLVMConstZExtOrBitCast(LLVMValueRef ConstantVal, LLVMTypeRef ToType)
const char * data() const
LLVMValueRef LLVMConstGEP(LLVMValueRef ConstantVal, LLVMValueRef *ConstantIndices, unsigned NumIndices)
LLVMValueRef LLVMConstInBoundsGEP(LLVMValueRef ConstantVal, LLVMValueRef *ConstantIndices, unsigned NumIndices)
static Constant * getAShr(Constant *C1, Constant *C2, bool isExact=false)
LLVMValueRef LLVMBuildOr(LLVMBuilderRef B, LLVMValueRef LHS, LLVMValueRef RHS, const char *Name)
void LLVMDeleteFunction(LLVMValueRef Fn)
LLVMValueRef LLVMBuildFDiv(LLVMBuilderRef B, LLVMValueRef LHS, LLVMValueRef RHS, const char *Name)
static Constant * getICmp(unsigned short pred, Constant *LHS, Constant *RHS)
Function to be imported from DLL.
LLVMValueRef LLVMConstFPToSI(LLVMValueRef ConstantVal, LLVMTypeRef ToType)
static Constant * getAddrSpaceCast(Constant *C, Type *Ty)
LLVMBasicBlockRef LLVMGetPreviousBasicBlock(LLVMBasicBlockRef BB)
LLVMValueRef LLVMGetFirstGlobal(LLVMModuleRef M)
void LLVMDumpModule(LLVMModuleRef M)
static Constant * getPtrToInt(Constant *C, Type *Ty)
static FunctionType * get(Type *Result, ArrayRef< Type * > Params, bool isVarArg)
unsigned LLVMCountIncoming(LLVMValueRef PhiNode)
LLVMValueRef LLVMBuildIntCast(LLVMBuilderRef B, LLVMValueRef Val, LLVMTypeRef DestTy, const char *Name)
LLVMTypeRef LLVMFloatTypeInContext(LLVMContextRef C)
unsigned long long LLVMConstIntGetZExtValue(LLVMValueRef ConstantVal)
static int map_from_llvmopcode(LLVMOpcode code)
LLVMValueRef LLVMConstFMul(LLVMValueRef LHSConstant, LLVMValueRef RHSConstant)
LLVMValueRef LLVMGetLastInstruction(LLVMBasicBlockRef BB)
LLVMValueRef LLVMBuildSub(LLVMBuilderRef B, LLVMValueRef LHS, LLVMValueRef RHS, const char *Name)
void initializePrintModulePassPass(PassRegistry &)
LLVMUseRef LLVMGetNextUse(LLVMUseRef U)
LLVMValueRef LLVMAddFunction(LLVMModuleRef M, const char *Name, LLVMTypeRef FunctionTy)
LLVMValueRef LLVMBuildFAdd(LLVMBuilderRef B, LLVMValueRef LHS, LLVMValueRef RHS, const char *Name)
static Constant * getUDiv(Constant *C1, Constant *C2, bool isExact=false)
static Constant * getNSWNeg(Constant *C)
unsigned LLVMCountParamTypes(LLVMTypeRef FunctionTy)
static Constant * getIntToPtr(Constant *C, Type *Ty)
LLVMValueRef LLVMBuildNUWSub(LLVMBuilderRef B, LLVMValueRef LHS, LLVMValueRef RHS, const char *Name)
LLVMValueRef LLVMBuildPtrToInt(LLVMBuilderRef B, LLVMValueRef Val, LLVMTypeRef DestTy, const char *Name)
static Constant * getFDiv(Constant *C1, Constant *C2)
LLVMTypeRef LLVMStructCreateNamed(LLVMContextRef C, const char *Name)
LLVMValueRef LLVMConstInt(LLVMTypeRef IntTy, unsigned long long N, LLVMBool SignExtend)
size_t LLVMGetBufferSize(LLVMMemoryBufferRef MemBuf)
LLVMValueRef LLVMBuildAnd(LLVMBuilderRef B, LLVMValueRef LHS, LLVMValueRef RHS, const char *Name)
void LLVMSetLinkage(LLVMValueRef Global, LLVMLinkage Linkage)
void initializePrintBasicBlockPassPass(PassRegistry &)
unsigned LLVMGetIntrinsicID(LLVMValueRef Fn)
void LLVMAddTargetDependentFunctionAttr(LLVMValueRef Fn, const char *A, const char *V)
LLVMBasicBlockRef LLVMGetInstructionParent(LLVMValueRef Inst)
LLVMTypeRef LLVMInt64TypeInContext(LLVMContextRef C)
LLVMValueRef LLVMGetLastGlobal(LLVMModuleRef M)
LLVMValueRef LLVMConstAdd(LLVMValueRef LHSConstant, LLVMValueRef RHSConstant)
unsigned LLVMGetArrayLength(LLVMTypeRef ArrayTy)
void LLVMDisposePassManager(LLVMPassManagerRef PM)
LLVMValueRef LLVMBuildIsNull(LLVMBuilderRef B, LLVMValueRef Val, const char *Name)
void LLVMSetVolatile(LLVMValueRef MemAccessInst, LLVMBool isVolatile)
LLVMTypeRef LLVMVoidTypeInContext(LLVMContextRef C)
10: Arbitrary bit width integers
#define LLVM_DEFINE_VALUE_CAST(name)
ExternalWeak linkage description.
LLVMValueRef LLVMConstNSWAdd(LLVMValueRef LHSConstant, LLVMValueRef RHSConstant)
LLVMValueRef LLVMConstNSWNeg(LLVMValueRef ConstantVal)
void LLVMSetTarget(LLVMModuleRef M, const char *Triple)
Same, but only replaced by something equivalent.
static Constant * getFNeg(Constant *C)
LLVMBasicBlockRef LLVMGetFirstBasicBlock(LLVMValueRef Fn)
LLVMValueRef LLVMBuildNUWNeg(LLVMBuilderRef B, LLVMValueRef V, const char *Name)
void LLVMSetCurrentDebugLocation(LLVMBuilderRef Builder, LLVMValueRef L)
static Constant * getFRem(Constant *C1, Constant *C2)
void LLVMPositionBuilderAtEnd(LLVMBuilderRef Builder, LLVMBasicBlockRef Block)
void LLVMStructSetBody(LLVMTypeRef StructTy, LLVMTypeRef *ElementTypes, unsigned ElementCount, LLVMBool Packed)
LLVMValueRef LLVMBuildShl(LLVMBuilderRef B, LLVMValueRef LHS, LLVMValueRef RHS, const char *Name)
LLVMValueRef LLVMBuildInsertElement(LLVMBuilderRef B, LLVMValueRef VecVal, LLVMValueRef EltVal, LLVMValueRef Index, const char *Name)
static ConstantPointerNull * get(PointerType *T)
get() - Static factory methods - Return objects of the specified value
LLVMValueRef LLVMBuildAlloca(LLVMBuilderRef B, LLVMTypeRef Ty, const char *Name)
LLVMTypeRef LLVMInt32Type(void)
LLVMValueRef LLVMBuildPhi(LLVMBuilderRef B, LLVMTypeRef Ty, const char *Name)
LLVM Basic Block Representation.
LLVMValueRef LLVMGetMetadata(LLVMValueRef Inst, unsigned KindID)
void LLVMAddClause(LLVMValueRef LandingPad, LLVMValueRef ClauseVal)
unsigned LLVMCountBasicBlocks(LLVMValueRef FnRef)
const Function * getParent() const
LLVMBool LLVMIsPackedStruct(LLVMTypeRef StructTy)
void LLVMReplaceAllUsesWith(LLVMValueRef OldVal, LLVMValueRef NewVal)
LLVMValueRef LLVMBuildFPToSI(LLVMBuilderRef B, LLVMValueRef Val, LLVMTypeRef DestTy, const char *Name)
LLVMBool LLVMStartMultithreaded()
void initializePreVerifierPass(PassRegistry &)
LLVMContextRef LLVMGetModuleContext(LLVMModuleRef M)
LLVMValueRef LLVMConstFDiv(LLVMValueRef LHSConstant, LLVMValueRef RHSConstant)
static BlockAddress * get(Function *F, BasicBlock *BB)
get - Return a BlockAddress for the specified function and basic block.
LLVM Constant Representation.
LLVMValueRef LLVMBuildNSWSub(LLVMBuilderRef B, LLVMValueRef LHS, LLVMValueRef RHS, const char *Name)
LLVMValueRef LLVMGetNamedFunction(LLVMModuleRef M, const char *Name)
LLVMValueRef LLVMConstFNeg(LLVMValueRef ConstantVal)
unsigned LLVMCountStructElementTypes(LLVMTypeRef StructTy)
param_iterator param_begin() const
LLVMThreadLocalMode LLVMGetThreadLocalMode(LLVMValueRef GlobalVar)
LLVMValueRef LLVMBuildSIToFP(LLVMBuilderRef B, LLVMValueRef Val, LLVMTypeRef DestTy, const char *Name)
char * LLVMPrintValueToString(LLVMValueRef Val)
LLVMValueRef LLVMBuildExtractElement(LLVMBuilderRef B, LLVMValueRef VecVal, LLVMValueRef Index, const char *Name)
LLVMValueRef LLVMBuildFMul(LLVMBuilderRef B, LLVMValueRef LHS, LLVMValueRef RHS, const char *Name)
static Constant * getAnd(Constant *C1, Constant *C2)
static Constant * get(ArrayType *T, ArrayRef< Constant * > V)
LLVMTypeRef LLVMPPCFP128TypeInContext(LLVMContextRef C)
LLVMValueRef LLVMBuildPtrDiff(LLVMBuilderRef B, LLVMValueRef LHS, LLVMValueRef RHS, const char *Name)
LLVMValueRef LLVMBuildInBoundsGEP(LLVMBuilderRef B, LLVMValueRef Pointer, LLVMValueRef *Indices, unsigned NumIndices, const char *Name)
static Constant * getSExtOrBitCast(Constant *C, Type *Ty)
LLVMValueRef LLVMConstNUWMul(LLVMValueRef LHSConstant, LLVMValueRef RHSConstant)
bool llvm_is_multithreaded()
LLVMValueRef LLVMConstExtractValue(LLVMValueRef AggConstant, unsigned *IdxList, unsigned NumIdx)
void LLVMAddDestination(LLVMValueRef IndirectBr, LLVMBasicBlockRef Dest)
LLVMValueRef LLVMConstOr(LLVMValueRef LHSConstant, LLVMValueRef RHSConstant)
void LLVMInstructionEraseFromParent(LLVMValueRef Inst)
void LLVMSetInstrParamAlignment(LLVMValueRef Instr, unsigned index, unsigned align)
void LLVMMoveBasicBlockAfter(LLVMBasicBlockRef BB, LLVMBasicBlockRef MovePos)
LLVMValueRef LLVMGetUsedValue(LLVMUseRef U)
static Type * getVoidTy(LLVMContext &C)
LLVMTypeRef LLVMArrayType(LLVMTypeRef ElementType, unsigned ElementCount)
LLVMBool LLVMIsUndef(LLVMValueRef Val)
LLVMValueRef LLVMBuildResume(LLVMBuilderRef B, LLVMValueRef Exn)
struct LLVMOpaqueContext * LLVMContextRef
LLVMValueRef LLVMConstString(const char *Str, unsigned Length, LLVMBool DontNullTerminate)
Represent an integer comparison operator.
LLVMTypeRef LLVMIntTypeInContext(LLVMContextRef C, unsigned NumBits)
MDNode * getOperand(unsigned i) const
getOperand - Return specified operand.
6: 128-bit floating point type (two 64-bits, PowerPC)
unsigned getMDKindID(StringRef Name) const
getMDKindID - Return a unique non-zero ID for the specified metadata kind.
LLVMValueRef LLVMConstSRem(LLVMValueRef LHSConstant, LLVMValueRef RHSConstant)
LLVMValueRef LLVMBuildUnreachable(LLVMBuilderRef B)
LLVMValueRef LLVMBuildInvoke(LLVMBuilderRef B, LLVMValueRef Fn, LLVMValueRef *Args, unsigned NumArgs, LLVMBasicBlockRef Then, LLVMBasicBlockRef Catch, const char *Name)
LLVMTypeRef LLVMPPCFP128Type(void)
Function to be accessible from DLL.
Integer representation type.
static Constant * getFPTrunc(Constant *C, Type *Ty)
LLVMValueRef LLVMConstIntToPtr(LLVMValueRef ConstantVal, LLVMTypeRef ToType)
LLVMValueRef LLVMConstPointerCast(LLVMValueRef ConstantVal, LLVMTypeRef ToType)
LLVMValueRef LLVMBuildNot(LLVMBuilderRef B, LLVMValueRef V, const char *Name)
LLVMBasicBlockRef LLVMGetInsertBlock(LLVMBuilderRef Builder)
const char * LLVMGetTarget(LLVMModuleRef M)
static Constant * get(StructType *T, ArrayRef< Constant * > V)
LLVMTypeRef LLVMInt16Type(void)
static Constant * getNot(Constant *C)
void LLVMPositionBuilderBefore(LLVMBuilderRef Builder, LLVMValueRef Instr)
static Constant * getAllOnesValue(Type *Ty)
Get the all ones value.
LLVMTypeRef LLVMGetTypeByName(LLVMModuleRef M, const char *Name)
LLVMOpcode LLVMGetConstOpcode(LLVMValueRef ConstantVal)
unsigned LLVMGetInstructionCallConv(LLVMValueRef Instr)
void LLVMDumpValue(LLVMValueRef Val)
LLVMValueRef LLVMConstSub(LLVMValueRef LHSConstant, LLVMValueRef RHSConstant)
LLVMValueRef LLVMConstUIToFP(LLVMValueRef ConstantVal, LLVMTypeRef ToType)
int LLVMGetNumOperands(LLVMValueRef Val)
static UndefValue * get(Type *T)
static Constant * getFPExtend(Constant *C, Type *Ty)
LLVMValueRef LLVMBuildGEP(LLVMBuilderRef B, LLVMValueRef Pointer, LLVMValueRef *Indices, unsigned NumIndices, const char *Name)
LLVMValueRef LLVMAddGlobalInAddressSpace(LLVMModuleRef M, LLVMTypeRef Ty, const char *Name, unsigned AddressSpace)
LLVMContext & getContext() const
All values hold a context through their type.
LLVMValueRef LLVMBuildTrunc(LLVMBuilderRef B, LLVMValueRef Val, LLVMTypeRef DestTy, const char *Name)
const char * LLVMGetDataLayout(LLVMModuleRef M)
void setThreadLocalMode(ThreadLocalMode Val)
LLVMValueRef LLVMGetParam(LLVMValueRef FnRef, unsigned index)
struct LLVMOpaqueValue * LLVMValueRef
LLVMValueRef LLVMConstStringInContext(LLVMContextRef C, const char *Str, unsigned Length, LLVMBool DontNullTerminate)
LLVMValueRef LLVMConstURem(LLVMValueRef LHSConstant, LLVMValueRef RHSConstant)
LLVMTypeRef LLVMVoidType(void)
LLVMValueRef LLVMBuildCall(LLVMBuilderRef B, LLVMValueRef Fn, LLVMValueRef *Args, unsigned NumArgs, const char *Name)
static Type * getFP128Ty(LLVMContext &C)
LLVMBasicBlockRef LLVMAppendBasicBlockInContext(LLVMContextRef C, LLVMValueRef FnRef, const char *Name)
LLVMTypeRef LLVMGetElementType(LLVMTypeRef Ty)
LLVMValueRef LLVMBuildNeg(LLVMBuilderRef B, LLVMValueRef V, const char *Name)
void LLVMDisposeMemoryBuffer(LLVMMemoryBufferRef MemBuf)
LLVMValueRef LLVMBuildUIToFP(LLVMBuilderRef B, LLVMValueRef Val, LLVMTypeRef DestTy, const char *Name)
void LLVMSetFunctionCallConv(LLVMValueRef Fn, unsigned CC)
char *strdup(const char *s1);
void LLVMGetBasicBlocks(LLVMValueRef FnRef, LLVMBasicBlockRef *BasicBlocksRefs)
global_iterator global_end()
unsigned LLVMGetNamedMetadataNumOperands(LLVMModuleRef M, const char *name)
LLVMContextRef LLVMGetTypeContext(LLVMTypeRef Ty)
static Constant * getPointerCast(Constant *C, Type *Ty)
Create a BitCast or a PtrToInt cast constant expression.
LLVMValueRef LLVMGetOperand(LLVMValueRef Val, unsigned Index)
LLVMValueRef LLVMConstTruncOrBitCast(LLVMValueRef ConstantVal, LLVMTypeRef ToType)
static Type * getHalfTy(LLVMContext &C)
unsigned LLVMCountParams(LLVMValueRef FnRef)
static IntegerType * get(LLVMContext &C, unsigned NumBits)
Get or create an IntegerType instance.
static Constant * getBitCast(Constant *C, Type *Ty)
static error_code getFile(Twine Filename, OwningPtr< MemoryBuffer > &result, int64_t FileSize=-1, bool RequiresNullTerminator=true)
LLVMModuleProviderRef LLVMCreateModuleProviderForExistingModule(LLVMModuleRef M)
void LLVMInsertIntoBuilder(LLVMBuilderRef Builder, LLVMValueRef Instr)
LLVMValueRef LLVMBuildFPCast(LLVMBuilderRef B, LLVMValueRef Val, LLVMTypeRef DestTy, const char *Name)
LLVMBasicBlockRef LLVMGetSwitchDefaultDest(LLVMValueRef Switch)
LLVMValueRef LLVMBuildRetVoid(LLVMBuilderRef B)
LLVMValueRef LLVMBuildGlobalString(LLVMBuilderRef B, const char *Str, const char *Name)
LLVMValueRef LLVMConstPointerNull(LLVMTypeRef Ty)
void LLVMSetInitializer(LLVMValueRef GlobalVar, LLVMValueRef ConstantVal)
LLVMVisibility LLVMGetVisibility(LLVMValueRef Global)
LLVMValueRef LLVMConstNUWSub(LLVMValueRef LHSConstant, LLVMValueRef RHSConstant)
static MemoryBuffer * getMemBufferCopy(StringRef InputData, StringRef BufferName="")
void LLVMInitializeCore(LLVMPassRegistryRef R)
LLVMContextRef LLVMContextCreate()
struct LLVMOpaquePassRegistry * LLVMPassRegistryRef
LLVMTypeKind LLVMGetTypeKind(LLVMTypeRef Ty)
LLVMTypeRef LLVMTypeOf(LLVMValueRef Val)
LLVMValueRef LLVMConstAllOnes(LLVMTypeRef Ty)
15: SIMD 'packed' format, or other vector type
LLVMValueRef LLVMConstFPTrunc(LLVMValueRef ConstantVal, LLVMTypeRef ToType)
static StructType * get(LLVMContext &Context, ArrayRef< Type * > Elements, bool isPacked=false)
static Constant * getSDiv(Constant *C1, Constant *C2, bool isExact=false)
struct LLVMOpaqueBasicBlock * LLVMBasicBlockRef
LLVMValueRef LLVMConstInsertValue(LLVMValueRef AggConstant, LLVMValueRef ElementValueConstant, unsigned *IdxList, unsigned NumIdx)
LLVMValueRef LLVMBuildURem(LLVMBuilderRef B, LLVMValueRef LHS, LLVMValueRef RHS, const char *Name)
bool hasName() const
hasName - Return true if this is a named struct that has a non-empty name.
LLVMTypeRef LLVMLabelType(void)
Keep one copy of function when linking (inline)
LLVMValueRef LLVMBuildFCmp(LLVMBuilderRef B, LLVMRealPredicate Op, LLVMValueRef LHS, LLVMValueRef RHS, const char *Name)
LLVMContextRef * wrap(const LLVMContext **Tys)
static Constant * getNUWMul(Constant *C1, Constant *C2)
LLVMValueRef LLVMGetNextInstruction(LLVMValueRef Inst)
void LLVMDeleteGlobal(LLVMValueRef GlobalVar)
LLVMValueRef LLVMConstSExtOrBitCast(LLVMValueRef ConstantVal, LLVMTypeRef ToType)
LLVMValueRef LLVMBuildXor(LLVMBuilderRef B, LLVMValueRef LHS, LLVMValueRef RHS, const char *Name)
LLVMValueRef LLVMBuildUDiv(LLVMBuilderRef B, LLVMValueRef LHS, LLVMValueRef RHS, const char *Name)
static Constant * getNSWSub(Constant *C1, Constant *C2)
void LLVMRemoveInstrAttribute(LLVMValueRef Instr, unsigned index, LLVMAttribute PA)
static Constant * get(Type *Ty, uint64_t V, bool isSigned=false)
LLVMBool LLVMIsFunctionVarArg(LLVMTypeRef FunctionTy)
LLVMValueRef LLVMGetCurrentDebugLocation(LLVMBuilderRef Builder)
static Constant * getTrunc(Constant *C, Type *Ty)
static Constant * get(Type *Ty, double V)
LLVMTypeRef LLVMDoubleType(void)
void LLVMSetDataLayout(LLVMModuleRef M, const char *Triple)
LLVMValueRef LLVMBuildInsertValue(LLVMBuilderRef B, LLVMValueRef AggVal, LLVMValueRef EltVal, unsigned Index, const char *Name)
LLVMValueRef LLVMGetUser(LLVMUseRef U)
void setLinkage(LinkageTypes LT)
LLVMValueRef LLVMConstFPExt(LLVMValueRef ConstantVal, LLVMTypeRef ToType)
static Constant * getFPToSI(Constant *C, Type *Ty)
AttributeSet getAttributes() const
Return the attribute list for this Function.
static LLVMOpcode map_to_llvmopcode(int opcode)
AttributeSet removeAttributes(LLVMContext &C, unsigned Index, AttributeSet Attrs) const
Remove the specified attributes at the specified index from this attribute list. Since attribute list...
LLVMTypeRef LLVMStructType(LLVMTypeRef *ElementTypes, unsigned ElementCount, LLVMBool Packed)
std::string message() const
LLVMValueRef LLVMBuildShuffleVector(LLVMBuilderRef B, LLVMValueRef V1, LLVMValueRef V2, LLVMValueRef Mask, const char *Name)
LLVMValueRef LLVMBuildGlobalStringPtr(LLVMBuilderRef B, const char *Str, const char *Name)
void LLVMSetExternallyInitialized(LLVMValueRef GlobalVar, LLVMBool IsExtInit)
bool hasInitializer() const
Class for arbitrary precision integers.
void LLVMRemoveAttribute(LLVMValueRef Arg, LLVMAttribute PA)
LLVMValueRef LLVMBuildMalloc(LLVMBuilderRef B, LLVMTypeRef Ty, const char *Name)
LLVMValueRef LLVMBuildFree(LLVMBuilderRef B, LLVMValueRef PointerVal)
LLVMTypeRef LLVMFunctionType(LLVMTypeRef ReturnType, LLVMTypeRef *ParamTypes, unsigned ParamCount, LLVMBool IsVarArg)
StringRef getName() const
LLVMValueRef LLVMBuildBitCast(LLVMBuilderRef B, LLVMValueRef Val, LLVMTypeRef DestTy, const char *Name)
LLVMBool LLVMIsThreadLocal(LLVMValueRef GlobalVar)
LLVMValueRef LLVMConstPtrToInt(LLVMValueRef ConstantVal, LLVMTypeRef ToType)
static char getTypeID(Type *Ty)
void setGC(const char *Str)
LLVMBool LLVMRunPassManager(LLVMPassManagerRef PM, LLVMModuleRef M)
LLVMValueRef LLVMGetBasicBlockTerminator(LLVMBasicBlockRef BB)
LLVMValueRef LLVMConstStruct(LLVMValueRef *ConstantVals, unsigned Count, LLVMBool Packed)
static Constant * getZExtOrBitCast(Constant *C, Type *Ty)
LLVMValueRef LLVMConstFCmp(LLVMRealPredicate Predicate, LLVMValueRef LHSConstant, LLVMValueRef RHSConstant)
LLVMTypeRef LLVMX86MMXTypeInContext(LLVMContextRef C)
LLVMValueRef LLVMConstMul(LLVMValueRef LHSConstant, LLVMValueRef RHSConstant)
LLVMBool LLVMIsDeclaration(LLVMValueRef Global)
Like LinkerPrivate, but weak.
LLVMValueRef LLVMBuildFPExt(LLVMBuilderRef B, LLVMValueRef Val, LLVMTypeRef DestTy, const char *Name)
LLVMValueRef LLVMConstNeg(LLVMValueRef ConstantVal)
void LLVMAddIncoming(LLVMValueRef PhiNode, LLVMValueRef *IncomingValues, LLVMBasicBlockRef *IncomingBlocks, unsigned Count)
static Constant * getFSub(Constant *C1, Constant *C2)
LLVMValueRef LLVMBuildExtractValue(LLVMBuilderRef B, LLVMValueRef AggVal, unsigned Index, const char *Name)
LLVMValueRef LLVMBuildAShr(LLVMBuilderRef B, LLVMValueRef LHS, LLVMValueRef RHS, const char *Name)
static Constant * getTruncOrBitCast(Constant *C, Type *Ty)
void LLVMRemoveBasicBlockFromParent(LLVMBasicBlockRef BBRef)
LLVMValueRef LLVMConstFAdd(LLVMValueRef LHSConstant, LLVMValueRef RHSConstant)
static Constant * getNeg(Constant *C, bool HasNUW=false, bool HasNSW=false)
LLVMValueRef LLVMConstNSWSub(LLVMValueRef LHSConstant, LLVMValueRef RHSConstant)
LLVMValueRef LLVMBuildMul(LLVMBuilderRef B, LLVMValueRef LHS, LLVMValueRef RHS, const char *Name)
LLVMValueRef LLVMGetPreviousParam(LLVMValueRef Arg)
LLVMModuleRef LLVMModuleCreateWithName(const char *ModuleID)
void LLVMAddCase(LLVMValueRef Switch, LLVMValueRef OnVal, LLVMBasicBlockRef Dest)
static Constant * getNSWMul(Constant *C1, Constant *C2)
LLVMValueRef LLVMBuildArrayMalloc(LLVMBuilderRef B, LLVMTypeRef Ty, LLVMValueRef Val, const char *Name)
static Constant * getSExt(Constant *C, Type *Ty)
static Constant * getInBoundsGetElementPtr(Constant *C, ArrayRef< Constant * > IdxList)
struct LLVMOpaquePassManager * LLVMPassManagerRef
char * LLVMPrintTypeToString(LLVMTypeRef Ty)
LLVMValueRef LLVMBuildIntToPtr(LLVMBuilderRef B, LLVMValueRef Val, LLVMTypeRef DestTy, const char *Name)
static IntegerType * getInt32Ty(LLVMContext &C)
LLVMValueRef LLVMConstIntOfArbitraryPrecision(LLVMTypeRef IntTy, unsigned NumWords, const uint64_t Words[])
LLVMTypeRef LLVMInt64Type(void)
static Constant * getZExt(Constant *C, Type *Ty)
LLVMTypeRef LLVMHalfTypeInContext(LLVMContextRef C)
LLVMBasicBlockRef LLVMAppendBasicBlock(LLVMValueRef FnRef, const char *Name)
LLVMValueRef LLVMConstNUWNeg(LLVMValueRef ConstantVal)
LLVMValueRef LLVMBuildAtomicRMW(LLVMBuilderRef B, LLVMAtomicRMWBinOp op, LLVMValueRef PTR, LLVMValueRef Val, LLVMAtomicOrdering ordering, LLVMBool singleThread)
void LLVMDeleteBasicBlock(LLVMBasicBlockRef BBRef)
LLVMValueRef LLVMBuildLShr(LLVMBuilderRef B, LLVMValueRef LHS, LLVMValueRef RHS, const char *Name)
LLVMValueRef LLVMBuildIsNotNull(LLVMBuilderRef B, LLVMValueRef Val, const char *Name)
unsigned LLVMGetMDKindID(const char *Name, unsigned SLen)
LLVMBool LLVMIsConstant(LLVMValueRef Ty)
void setAttributes(const AttributeSet &PAL)
LLVMValueRef LLVMBuildFSub(LLVMBuilderRef B, LLVMValueRef LHS, LLVMValueRef RHS, const char *Name)
static Constant * getOr(Constant *C1, Constant *C2)
LLVMBasicBlockRef LLVMGetIncomingBlock(LLVMValueRef PhiNode, unsigned Index)
LLVMTypeRef LLVMInt1TypeInContext(LLVMContextRef C)
LLVMBool LLVMGetVolatile(LLVMValueRef MemAccessInst)
LLVMTypeRef LLVMInt1Type(void)
LLVMTypeRef LLVMIntType(unsigned NumBits)
void LLVMSetInstructionCallConv(LLVMValueRef Instr, unsigned CC)
LLVMPassManagerRef LLVMCreateFunctionPassManagerForModule(LLVMModuleRef M)
LLVMModuleRef LLVMModuleCreateWithNameInContext(const char *ModuleID, LLVMContextRef C)
static BasicBlock * Create(LLVMContext &Context, const Twine &Name="", Function *Parent=0, BasicBlock *InsertBefore=0)
Creates a new BasicBlock.
LLVMValueRef LLVMBuildSwitch(LLVMBuilderRef B, LLVMValueRef V, LLVMBasicBlockRef Else, unsigned NumCases)
LLVMValueRef LLVMConstArray(LLVMTypeRef ElementTy, LLVMValueRef *ConstantVals, unsigned Length)
static DebugLoc getFromDILocation(MDNode *N)
getFromDILocation - Translate the DILocation quad into a DebugLoc.
struct LLVMOpaqueUse * LLVMUseRef
static ArrayType * get(Type *ElementType, uint64_t NumElements)
void LLVMDumpType(LLVMTypeRef Ty)
static Constant * getShl(Constant *C1, Constant *C2, bool HasNUW=false, bool HasNSW=false)
Keep one copy of named function when linking (weak)
Rename collisions when linking (static functions).
LLVMTypeRef LLVMInt8Type(void)
static Constant * getInsertValue(Constant *Agg, Constant *Val, ArrayRef< unsigned > Idxs)
static InlineAsm * get(FunctionType *Ty, StringRef AsmString, StringRef Constraints, bool hasSideEffects, bool isAlignStack=false, AsmDialect asmDialect=AD_ATT)
LLVMValueRef LLVMConstSIToFP(LLVMValueRef ConstantVal, LLVMTypeRef ToType)
void setAttributes(AttributeSet attrs)
Set the attribute list for this Function.
LLVMValueRef LLVMConstLShr(LLVMValueRef LHSConstant, LLVMValueRef RHSConstant)
LLVMBool LLVMFinalizeFunctionPassManager(LLVMPassManagerRef FPM)
LLVMIntPredicate LLVMGetICmpPredicate(LLVMValueRef Inst)
void LLVMSetCleanup(LLVMValueRef LandingPad, LLVMBool Val)
LLVMValueRef LLVMConstShl(LLVMValueRef LHSConstant, LLVMValueRef RHSConstant)
struct LLVMOpaqueModule * LLVMModuleRef
LLVMValueRef LLVMBuildNUWMul(LLVMBuilderRef B, LLVMValueRef LHS, LLVMValueRef RHS, const char *Name)
LLVMValueRef LLVMConstNot(LLVMValueRef ConstantVal)
LLVMValueRef LLVMBuildLandingPad(LLVMBuilderRef B, LLVMTypeRef Ty, LLVMValueRef PersFn, unsigned NumClauses, const char *Name)
3: 64-bit floating point type
LLVMValueRef LLVMGetFirstFunction(LLVMModuleRef M)
LLVMAttribute LLVMGetAttribute(LLVMValueRef Arg)
LLVMBool LLVMPrintModuleToFile(LLVMModuleRef M, const char *Filename, char **ErrorMessage)
LLVMValueRef LLVMBuildVAArg(LLVMBuilderRef B, LLVMValueRef List, LLVMTypeRef Ty, const char *Name)
void LLVMSetThreadLocalMode(LLVMValueRef GlobalVar, LLVMThreadLocalMode Mode)
static Constant * getSRem(Constant *C1, Constant *C2)
LLVMBuilderRef LLVMCreateBuilderInContext(LLVMContextRef C)
void LLVMSetMetadata(LLVMValueRef Inst, unsigned KindID, LLVMValueRef MD)
LLVMValueRef LLVMGetParamParent(LLVMValueRef V)
const char * LLVMGetValueName(LLVMValueRef Val)
LLVMValueRef LLVMBuildSExtOrBitCast(LLVMBuilderRef B, LLVMValueRef Val, LLVMTypeRef DestTy, const char *Name)
LLVMValueRef LLVMBuildBr(LLVMBuilderRef B, LLVMBasicBlockRef Dest)
void llvm_stop_multithreaded()
LLVM Value Representation.
uint64_t Raw(unsigned Index) const
LLVMValueRef LLVMBuildZExtOrBitCast(LLVMBuilderRef B, LLVMValueRef Val, LLVMTypeRef DestTy, const char *Name)
LLVMBool LLVMCreateMemoryBufferWithSTDIN(LLVMMemoryBufferRef *OutMemBuf, char **OutMessage)
LLVMLinkage LLVMGetLinkage(LLVMValueRef Global)
static Constant * getURem(Constant *C1, Constant *C2)
unsigned getArgNo() const
Return the index of this formal argument in its containing function.
static VectorType * get(Type *ElementType, unsigned NumElements)
static StructType * create(LLVMContext &Context, StringRef Name)
StructType::create - This creates an identified struct.
LLVMBasicBlockRef LLVMValueAsBasicBlock(LLVMValueRef Val)
LLVMValueRef LLVMGetPreviousFunction(LLVMValueRef Fn)
static const Function * getParent(const Value *V)
LLVMValueRef LLVMBuildIndirectBr(LLVMBuilderRef B, LLVMValueRef Addr, unsigned NumDests)
void LLVMSetGC(LLVMValueRef Fn, const char *GC)
LLVMValueRef LLVMBuildNSWNeg(LLVMBuilderRef B, LLVMValueRef V, const char *Name)
LLVMTypeRef LLVMGetReturnType(LLVMTypeRef FunctionTy)
unsigned getNumOperands() const
getNumOperands - Return the number of NamedMDNode operands.
LLVMValueRef LLVMBuildNSWMul(LLVMBuilderRef B, LLVMValueRef LHS, LLVMValueRef RHS, const char *Name)
LLVMValueRef LLVMBuildStore(LLVMBuilderRef B, LLVMValueRef Val, LLVMValueRef PointerVal)
LLVMValueRef LLVMBuildBinOp(LLVMBuilderRef B, LLVMOpcode Op, LLVMValueRef LHS, LLVMValueRef RHS, const char *Name)
struct LLVMOpaqueBuilder * LLVMBuilderRef
LLVMValueRef LLVMConstZExt(LLVMValueRef ConstantVal, LLVMTypeRef ToType)
LLVMBool LLVMIsMultithreaded()
AttrBuilder & addAlignmentAttr(unsigned Align)
This turns an int alignment (which must be a power of 2) into the form used internally in Attribute...
LLVMContextRef LLVMGetGlobalContext()
LLVMValueRef LLVMConstNSWMul(LLVMValueRef LHSConstant, LLVMValueRef RHSConstant)
LLVMTypeRef LLVMInt32TypeInContext(LLVMContextRef C)
LLVMBool LLVMRunFunctionPassManager(LLVMPassManagerRef FPM, LLVMValueRef F)
void addAttributes(unsigned i, AttributeSet attrs)
adds the attributes to the list of attributes.
9: MMX vectors (64 bits, X86 specific)
static Constant * getAlignOf(Type *Ty)
LLVMTypeRef LLVMPointerType(LLVMTypeRef ElementType, unsigned AddressSpace)
static Constant * getMul(Constant *C1, Constant *C2, bool HasNUW=false, bool HasNSW=false)
LLVMValueRef LLVMBuildLoad(LLVMBuilderRef B, LLVMValueRef PointerVal, const char *Name)
void LLVMAddInstrAttribute(LLVMValueRef Instr, unsigned index, LLVMAttribute PA)
LLVMValueRef LLVMConstExtractElement(LLVMValueRef VectorConstant, LLVMValueRef IndexConstant)
void LLVMSetTailCall(LLVMValueRef Call, LLVMBool isTailCall)
static Constant * getNUWSub(Constant *C1, Constant *C2)
void LLVMSetModuleInlineAsm(LLVMModuleRef M, const char *Asm)
LLVMValueRef LLVMBuildAddrSpaceCast(LLVMBuilderRef B, LLVMValueRef Val, LLVMTypeRef DestTy, const char *Name)
AttributeSet addAttributes(LLVMContext &C, unsigned Index, AttributeSet Attrs) const
Add attributes to the attribute set at the given index. Since attribute sets are immutable, this returns a new set.
LLVMValueRef LLVMConstFRem(LLVMValueRef LHSConstant, LLVMValueRef RHSConstant)
static Constant * getNUWAdd(Constant *C1, Constant *C2)
unsigned LLVMGetAlignment(LLVMValueRef V)
LLVMValueRef LLVMGetNextFunction(LLVMValueRef Fn)
static IntegerType * getInt8Ty(LLVMContext &C)
void LLVMDisposeModuleProvider(LLVMModuleProviderRef MP)
LLVMValueRef LLVMBuildSelect(LLVMBuilderRef B, LLVMValueRef If, LLVMValueRef Then, LLVMValueRef Else, const char *Name)
const BasicBlock * getParent() const
static Instruction * CreateMalloc(Instruction *InsertBefore, Type *IntPtrTy, Type *AllocTy, Value *AllocSize, Value *ArraySize=0, Function *MallocF=0, const Twine &Name="")
LLVMContext & getGlobalContext()
static error_code getSTDIN(OwningPtr< MemoryBuffer > &result)
LLVMTypeRef LLVMX86FP80TypeInContext(LLVMContextRef C)
static Constant * getInsertElement(Constant *Vec, Constant *Elt, Constant *Idx)
LLVMAttribute LLVMGetFunctionAttr(LLVMValueRef Fn)
void LLVMInsertIntoBuilderWithName(LLVMBuilderRef Builder, LLVMValueRef Instr, const char *Name)
static Function * Create(FunctionType *Ty, LinkageTypes Linkage, const Twine &N="", Module *M=0)
static Constant * getXor(Constant *C1, Constant *C2)
LLVMValueRef LLVMBuildFPTrunc(LLVMBuilderRef B, LLVMValueRef Val, LLVMTypeRef DestTy, const char *Name)
5: 128-bit floating point type (112-bit mantissa)
void LLVMSetAlignment(LLVMValueRef V, unsigned Bytes)
LLVMModuleRef LLVMGetGlobalParent(LLVMValueRef Global)