Lines Matching refs:unwrap
100 unwrap(C)->setDiagnosticHandlerCallBack( in LLVMContextSetDiagnosticHandler()
108 unwrap(C)->getDiagnosticHandlerCallBack()); in LLVMContextGetDiagnosticHandler()
112 return unwrap(C)->getDiagnosticContext(); in LLVMContextGetDiagnosticContext()
119 unwrap(C)->setYieldCallback(YieldCallback, OpaqueHandle); in LLVMContextSetYieldCallback()
123 return unwrap(C)->shouldDiscardValueNames(); in LLVMContextShouldDiscardValueNames()
127 unwrap(C)->setDiscardValueNames(Discard); in LLVMContextSetDiscardValueNames()
131 delete unwrap(C); in LLVMContextDispose()
136 return unwrap(C)->getMDKindID(StringRef(Name, SLen)); in LLVMGetMDKindIDInContext()
153 auto &Ctx = *unwrap(C); in LLVMCreateEnumAttribute()
159 return unwrap(A).getKindAsEnum(); in LLVMGetEnumAttributeKind()
163 auto Attr = unwrap(A); in LLVMGetEnumAttributeValue()
171 auto &Ctx = *unwrap(C); in LLVMCreateTypeAttribute()
173 return wrap(Attribute::get(Ctx, AttrKind, unwrap(type_ref))); in LLVMCreateTypeAttribute()
177 auto Attr = unwrap(A); in LLVMGetTypeAttributeValue()
184 return wrap(Attribute::get(*unwrap(C), StringRef(K, KLength), in LLVMCreateStringAttribute()
190 auto S = unwrap(A).getKindAsString(); in LLVMGetStringAttributeKind()
197 auto S = unwrap(A).getValueAsString(); in LLVMGetStringAttributeValue()
203 auto Attr = unwrap(A); in LLVMIsEnumAttribute()
208 return unwrap(A).isStringAttribute(); in LLVMIsStringAttribute()
212 return unwrap(A).isTypeAttribute(); in LLVMIsTypeAttribute()
220 unwrap(DI)->print(DP); in LLVMGetDiagInfoDescription()
229 switch(unwrap(DI)->getSeverity()) { in LLVMGetDiagInfoSeverity()
255 return wrap(new Module(ModuleID, *unwrap(C))); in LLVMModuleCreateWithNameInContext()
259 delete unwrap(M); in LLVMDisposeModule()
263 auto &Str = unwrap(M)->getModuleIdentifier(); in LLVMGetModuleIdentifier()
269 unwrap(M)->setModuleIdentifier(StringRef(Ident, Len)); in LLVMSetModuleIdentifier()
273 auto &Str = unwrap(M)->getSourceFileName(); in LLVMGetSourceFileName()
279 unwrap(M)->setSourceFileName(StringRef(Name, Len)); in LLVMSetSourceFileName()
284 return unwrap(M)->getDataLayoutStr().c_str(); in LLVMGetDataLayoutStr()
292 unwrap(M)->setDataLayout(DataLayoutStr); in LLVMSetDataLayout()
297 return unwrap(M)->getTargetTriple().c_str(); in LLVMGetTarget()
301 unwrap(M)->setTargetTriple(Triple); in LLVMSetTarget()
353 unwrap(M)->getModuleFlagsMetadata(MFEs); in LLVMCopyModuleFlagsMetadata()
397 return wrap(unwrap(M)->getModuleFlag({Key, KeyLen})); in LLVMGetModuleFlag()
403 unwrap(M)->addModuleFlag(map_to_llvmModFlagBehavior(Behavior), in LLVMAddModuleFlag()
404 {Key, KeyLen}, unwrap(Val)); in LLVMAddModuleFlag()
410 unwrap(M)->print(errs(), nullptr, in LLVMDumpModule()
423 unwrap(M)->print(dest, nullptr); in LLVMPrintModuleToFile()
440 unwrap(M)->print(os, nullptr); in LLVMPrintModuleToString()
448 unwrap(M)->setModuleInlineAsm(StringRef(Asm, Len)); in LLVMSetModuleInlineAsm2()
452 unwrap(M)->setModuleInlineAsm(StringRef(Asm)); in LLVMSetModuleInlineAsm()
456 unwrap(M)->appendModuleInlineAsm(StringRef(Asm, Len)); in LLVMAppendModuleInlineAsm()
460 auto &Str = unwrap(M)->getModuleInlineAsm(); in LLVMGetModuleInlineAsm()
479 return wrap(InlineAsm::get(unwrap<FunctionType>(Ty), in LLVMGetInlineAsm()
487 Value *Val = unwrap<Value>(InlineAsmVal); in LLVMGetInlineAsmAsmString()
496 Value *Val = unwrap<Value>(InlineAsmVal); in LLVMGetInlineAsmConstraintString()
506 Value *Val = unwrap<Value>(InlineAsmVal); in LLVMGetInlineAsmDialect()
521 Value *Val = unwrap<Value>(InlineAsmVal); in LLVMGetInlineAsmFunctionType()
526 Value *Val = unwrap<Value>(InlineAsmVal); in LLVMGetInlineAsmHasSideEffects()
531 Value *Val = unwrap<Value>(InlineAsmVal); in LLVMGetInlineAsmNeedsAlignedStack()
536 Value *Val = unwrap<Value>(InlineAsmVal); in LLVMGetInlineAsmCanUnwind()
542 return wrap(&unwrap(M)->getContext()); in LLVMGetModuleContext()
551 switch (unwrap(Ty)->getTypeID()) { in LLVMGetTypeKind()
602 return unwrap(Ty)->isSized(); in LLVMTypeIsSized()
606 return wrap(&unwrap(Ty)->getContext()); in LLVMGetTypeContext()
610 return unwrap(Ty)->print(errs(), /*IsForDebug=*/true); in LLVMDumpType()
617 if (unwrap(Ty)) in LLVMPrintTypeToString()
618 unwrap(Ty)->print(os); in LLVMPrintTypeToString()
630 return (LLVMTypeRef) Type::getInt1Ty(*unwrap(C)); in LLVMInt1TypeInContext()
633 return (LLVMTypeRef) Type::getInt8Ty(*unwrap(C)); in LLVMInt8TypeInContext()
636 return (LLVMTypeRef) Type::getInt16Ty(*unwrap(C)); in LLVMInt16TypeInContext()
639 return (LLVMTypeRef) Type::getInt32Ty(*unwrap(C)); in LLVMInt32TypeInContext()
642 return (LLVMTypeRef) Type::getInt64Ty(*unwrap(C)); in LLVMInt64TypeInContext()
645 return (LLVMTypeRef) Type::getInt128Ty(*unwrap(C)); in LLVMInt128TypeInContext()
648 return wrap(IntegerType::get(*unwrap(C), NumBits)); in LLVMIntTypeInContext()
674 return unwrap<IntegerType>(IntegerTy)->getBitWidth(); in LLVMGetIntTypeWidth()
680 return (LLVMTypeRef) Type::getHalfTy(*unwrap(C)); in LLVMHalfTypeInContext()
683 return (LLVMTypeRef) Type::getBFloatTy(*unwrap(C)); in LLVMBFloatTypeInContext()
686 return (LLVMTypeRef) Type::getFloatTy(*unwrap(C)); in LLVMFloatTypeInContext()
689 return (LLVMTypeRef) Type::getDoubleTy(*unwrap(C)); in LLVMDoubleTypeInContext()
692 return (LLVMTypeRef) Type::getX86_FP80Ty(*unwrap(C)); in LLVMX86FP80TypeInContext()
695 return (LLVMTypeRef) Type::getFP128Ty(*unwrap(C)); in LLVMFP128TypeInContext()
698 return (LLVMTypeRef) Type::getPPC_FP128Ty(*unwrap(C)); in LLVMPPCFP128TypeInContext()
701 return (LLVMTypeRef) Type::getX86_MMXTy(*unwrap(C)); in LLVMX86MMXTypeInContext()
704 return (LLVMTypeRef) Type::getX86_AMXTy(*unwrap(C)); in LLVMX86AMXTypeInContext()
740 ArrayRef<Type*> Tys(unwrap(ParamTypes), ParamCount); in LLVMFunctionType()
741 return wrap(FunctionType::get(unwrap(ReturnType), Tys, IsVarArg != 0)); in LLVMFunctionType()
745 return unwrap<FunctionType>(FunctionTy)->isVarArg(); in LLVMIsFunctionVarArg()
749 return wrap(unwrap<FunctionType>(FunctionTy)->getReturnType()); in LLVMGetReturnType()
753 return unwrap<FunctionType>(FunctionTy)->getNumParams(); in LLVMCountParamTypes()
757 FunctionType *Ty = unwrap<FunctionType>(FunctionTy); in LLVMGetParamTypes()
766 ArrayRef<Type*> Tys(unwrap(ElementTypes), ElementCount); in LLVMStructTypeInContext()
767 return wrap(StructType::get(*unwrap(C), Tys, Packed != 0)); in LLVMStructTypeInContext()
778 return wrap(StructType::create(*unwrap(C), Name)); in LLVMStructCreateNamed()
783 StructType *Type = unwrap<StructType>(Ty); in LLVMGetStructName()
791 ArrayRef<Type*> Tys(unwrap(ElementTypes), ElementCount); in LLVMStructSetBody()
792 unwrap<StructType>(StructTy)->setBody(Tys, Packed != 0); in LLVMStructSetBody()
796 return unwrap<StructType>(StructTy)->getNumElements(); in LLVMCountStructElementTypes()
800 StructType *Ty = unwrap<StructType>(StructTy); in LLVMGetStructElementTypes()
806 StructType *Ty = unwrap<StructType>(StructTy); in LLVMStructGetTypeAtIndex()
811 return unwrap<StructType>(StructTy)->isPacked(); in LLVMIsPackedStruct()
815 return unwrap<StructType>(StructTy)->isOpaque(); in LLVMIsOpaqueStruct()
819 return unwrap<StructType>(StructTy)->isLiteral(); in LLVMIsLiteralStruct()
823 return wrap(StructType::getTypeByName(unwrap(M)->getContext(), Name)); in LLVMGetTypeByName()
827 return wrap(StructType::getTypeByName(*unwrap(C), Name)); in LLVMGetTypeByName2()
834 for (auto *T : unwrap(Tp)->subtypes()) { in LLVMGetSubtypes()
841 return wrap(ArrayType::get(unwrap(ElementType), ElementCount)); in LLVMArrayType()
845 return wrap(ArrayType::get(unwrap(ElementType), ElementCount)); in LLVMArrayType2()
849 return wrap(PointerType::get(unwrap(ElementType), AddressSpace)); in LLVMPointerType()
857 return wrap(FixedVectorType::get(unwrap(ElementType), ElementCount)); in LLVMVectorType()
862 return wrap(ScalableVectorType::get(unwrap(ElementType), ElementCount)); in LLVMScalableVectorType()
866 auto *Ty = unwrap(WrappedTy); in LLVMGetElementType()
873 return unwrap(Tp)->getNumContainedTypes(); in LLVMGetNumContainedTypes()
877 return unwrap<ArrayType>(ArrayTy)->getNumElements(); in LLVMGetArrayLength()
881 return unwrap<ArrayType>(ArrayTy)->getNumElements(); in LLVMGetArrayLength2()
885 return unwrap<PointerType>(PointerTy)->getAddressSpace(); in LLVMGetPointerAddressSpace()
889 return unwrap<VectorType>(VectorTy)->getElementCount().getKnownMinValue(); in LLVMGetVectorSize()
895 return wrap(PointerType::get(*unwrap(C), AddressSpace)); in LLVMPointerTypeInContext()
899 return wrap(Type::getVoidTy(*unwrap(C))); in LLVMVoidTypeInContext()
902 return wrap(Type::getLabelTy(*unwrap(C))); in LLVMLabelTypeInContext()
905 return wrap(Type::getTokenTy(*unwrap(C))); in LLVMTokenTypeInContext()
908 return wrap(Type::getMetadataTy(*unwrap(C))); in LLVMMetadataTypeInContext()
923 ArrayRef<Type *> TypeParamArray(unwrap(TypeParams), TypeParamCount); in LLVMTargetExtTypeInContext()
926 TargetExtType::get(*unwrap(C), Name, TypeParamArray, IntParamArray)); in LLVMTargetExtTypeInContext()
934 return wrap(unwrap(Val)->getType()); in LLVMTypeOf()
938 switch(unwrap(Val)->getValueID()) { in LLVMGetValueKind()
950 auto *V = unwrap(Val); in LLVMGetValueName2()
956 unwrap(Val)->setName(StringRef(Name, NameLen)); in LLVMSetValueName2()
960 return unwrap(Val)->getName().data(); in LLVMGetValueName()
964 unwrap(Val)->setName(Name); in LLVMSetValueName()
968 unwrap(Val)->print(errs(), /*IsForDebug=*/true); in LLVMDumpValue()
975 if (unwrap(Val)) in LLVMPrintValueToString()
976 unwrap(Val)->print(os); in LLVMPrintValueToString()
986 unwrap(OldVal)->replaceAllUsesWith(unwrap(NewVal)); in LLVMReplaceAllUsesWith()
990 return unwrap<Instruction>(Inst)->hasMetadata(); in LLVMHasMetadata()
994 auto *I = unwrap<Instruction>(Inst); in LLVMGetMetadata()
1016 MDNode *N = Val ? extractMDNode(unwrap<MetadataAsValue>(Val)) : nullptr; in LLVMSetMetadata()
1018 unwrap<Instruction>(Inst)->setMetadata(KindID, N); in LLVMSetMetadata()
1050 unwrap<Instruction>(Value)->getAllMetadata(Entries); in LLVMInstructionGetAllMetadataOtherThanDebugLoc()
1058 return wrap(static_cast<Value*>(dyn_cast_or_null<name>(unwrap(Val)))); \
1064 if (auto *MD = dyn_cast_or_null<MetadataAsValue>(unwrap(Val))) in LLVM_FOR_EACH_VALUE_SUBCLASS()
1072 if (auto *MD = dyn_cast_or_null<MetadataAsValue>(unwrap(Val))) in LLVMIsAValueAsMetadata()
1079 if (auto *MD = dyn_cast_or_null<MetadataAsValue>(unwrap(Val))) in LLVMIsAMDString()
1087 Value *V = unwrap(Val); in LLVMGetFirstUse()
1095 Use *Next = unwrap(U)->getNext(); in LLVMGetNextUse()
1102 return wrap(unwrap(U)->getUser()); in LLVMGetUser()
1106 return wrap(unwrap(U)->get()); in LLVMGetUsedValue()
1122 Value *V = unwrap(Val); in LLVMGetOperand()
1136 Value *V = unwrap(Val); in LLVMGetOperandUse()
1141 unwrap<User>(Val)->setOperand(Index, unwrap(Op)); in LLVMSetOperand()
1145 Value *V = unwrap(Val); in LLVMGetNumOperands()
1155 return wrap(Constant::getNullValue(unwrap(Ty))); in LLVMConstNull()
1159 return wrap(Constant::getAllOnesValue(unwrap(Ty))); in LLVMConstAllOnes()
1163 return wrap(UndefValue::get(unwrap(Ty))); in LLVMGetUndef()
1167 return wrap(PoisonValue::get(unwrap(Ty))); in LLVMGetPoison()
1171 return isa<Constant>(unwrap(Ty)); in LLVMIsConstant()
1175 if (Constant *C = dyn_cast<Constant>(unwrap(Val))) in LLVMIsNull()
1181 return isa<UndefValue>(unwrap(Val)); in LLVMIsUndef()
1185 return isa<PoisonValue>(unwrap(Val)); in LLVMIsPoison()
1189 return wrap(ConstantPointerNull::get(unwrap<PointerType>(Ty))); in LLVMConstPointerNull()
1196 return wrap(MDString::get(*unwrap(C), StringRef(Str, SLen))); in LLVMMDStringInContext2()
1201 return wrap(MDNode::get(*unwrap(C), ArrayRef<Metadata*>(unwrap(MDs), Count))); in LLVMMDNodeInContext2()
1206 LLVMContext &Context = *unwrap(C); in LLVMMDStringInContext()
1217 LLVMContext &Context = *unwrap(C); in LLVMMDNodeInContext()
1220 Value *V = unwrap(OV); in LLVMMDNodeInContext()
1247 return wrap(MetadataAsValue::get(*unwrap(C), unwrap(MD))); in LLVMMetadataAsValue()
1251 auto *V = unwrap(Val); in LLVMValueAsMetadata()
1260 if (const auto *MD = dyn_cast<MetadataAsValue>(unwrap(V))) in LLVMGetMDString()
1270 auto *MD = unwrap<MetadataAsValue>(V); in LLVMGetMDNodeNumOperands()
1277 Module *Mod = unwrap(M); in LLVMGetFirstNamedMetadata()
1285 Module *Mod = unwrap(M); in LLVMGetLastNamedMetadata()
1293 NamedMDNode *NamedNode = unwrap(NMD); in LLVMGetNextNamedMetadata()
1301 NamedMDNode *NamedNode = unwrap(NMD); in LLVMGetPreviousNamedMetadata()
1310 return wrap(unwrap(M)->getNamedMetadata(StringRef(Name, NameLen))); in LLVMGetNamedMetadata()
1315 return wrap(unwrap(M)->getOrInsertNamedMetadata({Name, NameLen})); in LLVMGetOrInsertNamedMetadata()
1319 NamedMDNode *NamedNode = unwrap(NMD); in LLVMGetNamedMetadataName()
1325 auto *MD = unwrap<MetadataAsValue>(V); in LLVMGetMDNodeOperands()
1332 LLVMContext &Context = unwrap(V)->getContext(); in LLVMGetMDNodeOperands()
1339 auto *MD = cast<MetadataAsValue>(unwrap(V)); in LLVMReplaceMDNodeOperandWith()
1341 N->replaceOperandWith(Index, unwrap<Metadata>(Replacement)); in LLVMReplaceMDNodeOperandWith()
1345 if (NamedMDNode *N = unwrap(M)->getNamedMetadata(Name)) { in LLVMGetNamedMetadataNumOperands()
1353 NamedMDNode *N = unwrap(M)->getNamedMetadata(Name); in LLVMGetNamedMetadataOperands()
1356 LLVMContext &Context = unwrap(M)->getContext(); in LLVMGetNamedMetadataOperands()
1363 NamedMDNode *N = unwrap(M)->getOrInsertNamedMetadata(Name); in LLVMAddNamedMetadataOperand()
1368 N->addOperand(extractMDNode(unwrap<MetadataAsValue>(Val))); in LLVMAddNamedMetadataOperand()
1374 if (const auto *I = dyn_cast<Instruction>(unwrap(Val))) { in LLVMGetDebugLocDirectory()
1378 } else if (const auto *GV = dyn_cast<GlobalVariable>(unwrap(Val))) { in LLVMGetDebugLocDirectory()
1384 } else if (const auto *F = dyn_cast<Function>(unwrap(Val))) { in LLVMGetDebugLocDirectory()
1398 if (const auto *I = dyn_cast<Instruction>(unwrap(Val))) { in LLVMGetDebugLocFilename()
1402 } else if (const auto *GV = dyn_cast<GlobalVariable>(unwrap(Val))) { in LLVMGetDebugLocFilename()
1408 } else if (const auto *F = dyn_cast<Function>(unwrap(Val))) { in LLVMGetDebugLocFilename()
1421 if (const auto *I = dyn_cast<Instruction>(unwrap(Val))) { in LLVMGetDebugLocLine()
1425 } else if (const auto *GV = dyn_cast<GlobalVariable>(unwrap(Val))) { in LLVMGetDebugLocLine()
1431 } else if (const auto *F = dyn_cast<Function>(unwrap(Val))) { in LLVMGetDebugLocLine()
1443 if (const auto *I = dyn_cast<Instruction>(unwrap(Val))) in LLVMGetDebugLocColumn()
1453 return wrap(ConstantInt::get(unwrap<IntegerType>(IntTy), N, SignExtend != 0)); in LLVMConstInt()
1459 IntegerType *Ty = unwrap<IntegerType>(IntTy); in LLVMConstIntOfArbitraryPrecision()
1466 return wrap(ConstantInt::get(unwrap<IntegerType>(IntTy), StringRef(Str), in LLVMConstIntOfString()
1472 return wrap(ConstantInt::get(unwrap<IntegerType>(IntTy), StringRef(Str, SLen), in LLVMConstIntOfStringAndSize()
1477 return wrap(ConstantFP::get(unwrap(RealTy), N)); in LLVMConstReal()
1481 return wrap(ConstantFP::get(unwrap(RealTy), StringRef(Text))); in LLVMConstRealOfString()
1486 return wrap(ConstantFP::get(unwrap(RealTy), StringRef(Str, SLen))); in LLVMConstRealOfStringAndSize()
1490 return unwrap<ConstantInt>(ConstantVal)->getZExtValue(); in LLVMConstIntGetZExtValue()
1494 return unwrap<ConstantInt>(ConstantVal)->getSExtValue(); in LLVMConstIntGetSExtValue()
1498 ConstantFP *cFP = unwrap<ConstantFP>(ConstantVal) ; in LLVMConstRealGetDouble()
1521 return wrap(ConstantDataArray::getString(*unwrap(C), StringRef(Str, Length), in LLVMConstStringInContext()
1532 return wrap(unwrap<Constant>(C)->getAggregateElement(Idx)); in LLVMGetAggregateElement()
1536 return wrap(unwrap<ConstantDataSequential>(C)->getElementAsConstant(idx)); in LLVMGetElementAsConstant()
1540 return unwrap<ConstantDataSequential>(C)->isString(); in LLVMIsConstantString()
1544 StringRef Str = unwrap<ConstantDataSequential>(C)->getAsString(); in LLVMGetAsString()
1551 ArrayRef<Constant*> V(unwrap<Constant>(ConstantVals, Length), Length); in LLVMConstArray()
1552 return wrap(ConstantArray::get(ArrayType::get(unwrap(ElementTy), Length), V)); in LLVMConstArray()
1557 ArrayRef<Constant *> V(unwrap<Constant>(ConstantVals, Length), Length); in LLVMConstArray2()
1558 return wrap(ConstantArray::get(ArrayType::get(unwrap(ElementTy), Length), V)); in LLVMConstArray2()
1564 Constant **Elements = unwrap<Constant>(ConstantVals, Count); in LLVMConstStructInContext()
1565 return wrap(ConstantStruct::getAnon(*unwrap(C), ArrayRef(Elements, Count), in LLVMConstStructInContext()
1578 Constant **Elements = unwrap<Constant>(ConstantVals, Count); in LLVMConstNamedStruct()
1579 StructType *Ty = unwrap<StructType>(StructTy); in LLVMConstNamedStruct()
1586 ArrayRef(unwrap<Constant>(ScalarConstantVals, Size), Size))); in LLVMConstVector()
1614 return map_to_llvmopcode(unwrap<ConstantExpr>(ConstantVal)->getOpcode()); in LLVMGetConstOpcode()
1618 return wrap(ConstantExpr::getAlignOf(unwrap(Ty))); in LLVMAlignOf()
1622 return wrap(ConstantExpr::getSizeOf(unwrap(Ty))); in LLVMSizeOf()
1626 return wrap(ConstantExpr::getNeg(unwrap<Constant>(ConstantVal))); in LLVMConstNeg()
1630 return wrap(ConstantExpr::getNSWNeg(unwrap<Constant>(ConstantVal))); in LLVMConstNSWNeg()
1634 return wrap(ConstantExpr::getNUWNeg(unwrap<Constant>(ConstantVal))); in LLVMConstNUWNeg()
1639 return wrap(ConstantExpr::getNot(unwrap<Constant>(ConstantVal))); in LLVMConstNot()
1643 return wrap(ConstantExpr::getAdd(unwrap<Constant>(LHSConstant), in LLVMConstAdd()
1644 unwrap<Constant>(RHSConstant))); in LLVMConstAdd()
1649 return wrap(ConstantExpr::getNSWAdd(unwrap<Constant>(LHSConstant), in LLVMConstNSWAdd()
1650 unwrap<Constant>(RHSConstant))); in LLVMConstNSWAdd()
1655 return wrap(ConstantExpr::getNUWAdd(unwrap<Constant>(LHSConstant), in LLVMConstNUWAdd()
1656 unwrap<Constant>(RHSConstant))); in LLVMConstNUWAdd()
1660 return wrap(ConstantExpr::getSub(unwrap<Constant>(LHSConstant), in LLVMConstSub()
1661 unwrap<Constant>(RHSConstant))); in LLVMConstSub()
1666 return wrap(ConstantExpr::getNSWSub(unwrap<Constant>(LHSConstant), in LLVMConstNSWSub()
1667 unwrap<Constant>(RHSConstant))); in LLVMConstNSWSub()
1672 return wrap(ConstantExpr::getNUWSub(unwrap<Constant>(LHSConstant), in LLVMConstNUWSub()
1673 unwrap<Constant>(RHSConstant))); in LLVMConstNUWSub()
1677 return wrap(ConstantExpr::getMul(unwrap<Constant>(LHSConstant), in LLVMConstMul()
1678 unwrap<Constant>(RHSConstant))); in LLVMConstMul()
1683 return wrap(ConstantExpr::getNSWMul(unwrap<Constant>(LHSConstant), in LLVMConstNSWMul()
1684 unwrap<Constant>(RHSConstant))); in LLVMConstNSWMul()
1689 return wrap(ConstantExpr::getNUWMul(unwrap<Constant>(LHSConstant), in LLVMConstNUWMul()
1690 unwrap<Constant>(RHSConstant))); in LLVMConstNUWMul()
1694 return wrap(ConstantExpr::getXor(unwrap<Constant>(LHSConstant), in LLVMConstXor()
1695 unwrap<Constant>(RHSConstant))); in LLVMConstXor()
1701 unwrap<Constant>(LHSConstant), in LLVMConstICmp()
1702 unwrap<Constant>(RHSConstant))); in LLVMConstICmp()
1708 unwrap<Constant>(LHSConstant), in LLVMConstFCmp()
1709 unwrap<Constant>(RHSConstant))); in LLVMConstFCmp()
1713 return wrap(ConstantExpr::getShl(unwrap<Constant>(LHSConstant), in LLVMConstShl()
1714 unwrap<Constant>(RHSConstant))); in LLVMConstShl()
1719 ArrayRef<Constant *> IdxList(unwrap<Constant>(ConstantIndices, NumIndices), in LLVMConstGEP2()
1721 Constant *Val = unwrap<Constant>(ConstantVal); in LLVMConstGEP2()
1722 return wrap(ConstantExpr::getGetElementPtr(unwrap(Ty), Val, IdxList)); in LLVMConstGEP2()
1728 ArrayRef<Constant *> IdxList(unwrap<Constant>(ConstantIndices, NumIndices), in LLVMConstInBoundsGEP2()
1730 Constant *Val = unwrap<Constant>(ConstantVal); in LLVMConstInBoundsGEP2()
1731 return wrap(ConstantExpr::getInBoundsGetElementPtr(unwrap(Ty), Val, IdxList)); in LLVMConstInBoundsGEP2()
1735 return wrap(ConstantExpr::getTrunc(unwrap<Constant>(ConstantVal), in LLVMConstTrunc()
1736 unwrap(ToType))); in LLVMConstTrunc()
1740 return wrap(ConstantExpr::getPtrToInt(unwrap<Constant>(ConstantVal), in LLVMConstPtrToInt()
1741 unwrap(ToType))); in LLVMConstPtrToInt()
1745 return wrap(ConstantExpr::getIntToPtr(unwrap<Constant>(ConstantVal), in LLVMConstIntToPtr()
1746 unwrap(ToType))); in LLVMConstIntToPtr()
1750 return wrap(ConstantExpr::getBitCast(unwrap<Constant>(ConstantVal), in LLVMConstBitCast()
1751 unwrap(ToType))); in LLVMConstBitCast()
1756 return wrap(ConstantExpr::getAddrSpaceCast(unwrap<Constant>(ConstantVal), in LLVMConstAddrSpaceCast()
1757 unwrap(ToType))); in LLVMConstAddrSpaceCast()
1762 return wrap(ConstantExpr::getTruncOrBitCast(unwrap<Constant>(ConstantVal), in LLVMConstTruncOrBitCast()
1763 unwrap(ToType))); in LLVMConstTruncOrBitCast()
1768 return wrap(ConstantExpr::getPointerCast(unwrap<Constant>(ConstantVal), in LLVMConstPointerCast()
1769 unwrap(ToType))); in LLVMConstPointerCast()
1774 return wrap(ConstantExpr::getExtractElement(unwrap<Constant>(VectorConstant), in LLVMConstExtractElement()
1775 unwrap<Constant>(IndexConstant))); in LLVMConstExtractElement()
1781 return wrap(ConstantExpr::getInsertElement(unwrap<Constant>(VectorConstant), in LLVMConstInsertElement()
1782 unwrap<Constant>(ElementValueConstant), in LLVMConstInsertElement()
1783 unwrap<Constant>(IndexConstant))); in LLVMConstInsertElement()
1790 ShuffleVectorInst::getShuffleMask(unwrap<Constant>(MaskConstant), IntMask); in LLVMConstShuffleVector()
1791 return wrap(ConstantExpr::getShuffleVector(unwrap<Constant>(VectorAConstant), in LLVMConstShuffleVector()
1792 unwrap<Constant>(VectorBConstant), in LLVMConstShuffleVector()
1800 return wrap(InlineAsm::get(dyn_cast<FunctionType>(unwrap(Ty)), AsmString, in LLVMConstInlineAsm()
1805 return wrap(BlockAddress::get(unwrap<Function>(F), unwrap(BB))); in LLVMBlockAddress()
1811 return wrap(unwrap<GlobalValue>(Global)->getParent()); in LLVMGetGlobalParent()
1815 return unwrap<GlobalValue>(Global)->isDeclaration(); in LLVMIsDeclaration()
1819 switch (unwrap<GlobalValue>(Global)->getLinkage()) { in LLVMGetLinkage()
1848 GlobalValue *GV = unwrap<GlobalValue>(Global); in LLVMSetLinkage()
1915 return unwrap<GlobalValue>(Global)->getSection().data(); in LLVMGetSection()
1919 unwrap<GlobalObject>(Global)->setSection(Section); in LLVMSetSection()
1924 unwrap<GlobalValue>(Global)->getVisibility()); in LLVMGetVisibility()
1928 unwrap<GlobalValue>(Global) in LLVMSetVisibility()
1934 unwrap<GlobalValue>(Global)->getDLLStorageClass()); in LLVMGetDLLStorageClass()
1938 unwrap<GlobalValue>(Global)->setDLLStorageClass( in LLVMSetDLLStorageClass()
1943 switch (unwrap<GlobalValue>(Global)->getUnnamedAddr()) { in LLVMGetUnnamedAddress()
1955 GlobalValue *GV = unwrap<GlobalValue>(Global); in LLVMSetUnnamedAddress()
1968 return unwrap<GlobalValue>(Global)->hasGlobalUnnamedAddr(); in LLVMHasUnnamedAddr()
1972 unwrap<GlobalValue>(Global)->setUnnamedAddr( in LLVMSetUnnamedAddr()
1978 return wrap(unwrap<GlobalValue>(Global)->getValueType()); in LLVMGlobalGetValueType()
1984 Value *P = unwrap(V); in LLVMGetAlignment()
2004 Value *P = unwrap(V); in LLVMSetAlignment()
2027 if (Instruction *Instr = dyn_cast<Instruction>(unwrap(Value))) { in LLVMGlobalCopyAllMetadata()
2030 unwrap<GlobalObject>(Value)->getAllMetadata(Entries); in LLVMGlobalCopyAllMetadata()
2056 unwrap<GlobalObject>(Global)->setMetadata(Kind, unwrap<MDNode>(MD)); in LLVMGlobalSetMetadata()
2060 unwrap<GlobalObject>(Global)->eraseMetadata(Kind); in LLVMGlobalEraseMetadata()
2064 unwrap<GlobalObject>(Global)->clearMetadata(); in LLVMGlobalClearMetadata()
2070 return wrap(new GlobalVariable(*unwrap(M), unwrap(Ty), false, in LLVMAddGlobal()
2077 return wrap(new GlobalVariable(*unwrap(M), unwrap(Ty), false, in LLVMAddGlobalInAddressSpace()
2084 return wrap(unwrap(M)->getNamedGlobal(Name)); in LLVMGetNamedGlobal()
2088 Module *Mod = unwrap(M); in LLVMGetFirstGlobal()
2096 Module *Mod = unwrap(M); in LLVMGetLastGlobal()
2104 GlobalVariable *GV = unwrap<GlobalVariable>(GlobalVar); in LLVMGetNextGlobal()
2112 GlobalVariable *GV = unwrap<GlobalVariable>(GlobalVar); in LLVMGetPreviousGlobal()
2120 unwrap<GlobalVariable>(GlobalVar)->eraseFromParent(); in LLVMDeleteGlobal()
2124 GlobalVariable* GV = unwrap<GlobalVariable>(GlobalVar); in LLVMGetInitializer()
2131 unwrap<GlobalVariable>(GlobalVar) in LLVMSetInitializer()
2132 ->setInitializer(unwrap<Constant>(ConstantVal)); in LLVMSetInitializer()
2136 return unwrap<GlobalVariable>(GlobalVar)->isThreadLocal(); in LLVMIsThreadLocal()
2140 unwrap<GlobalVariable>(GlobalVar)->setThreadLocal(IsThreadLocal != 0); in LLVMSetThreadLocal()
2144 return unwrap<GlobalVariable>(GlobalVar)->isConstant(); in LLVMIsGlobalConstant()
2148 unwrap<GlobalVariable>(GlobalVar)->setConstant(IsConstant != 0); in LLVMSetGlobalConstant()
2152 switch (unwrap<GlobalVariable>(GlobalVar)->getThreadLocalMode()) { in LLVMGetThreadLocalMode()
2169 GlobalVariable *GV = unwrap<GlobalVariable>(GlobalVar); in LLVMSetThreadLocalMode()
2191 return unwrap<GlobalVariable>(GlobalVar)->isExternallyInitialized(); in LLVMIsExternallyInitialized()
2195 unwrap<GlobalVariable>(GlobalVar)->setExternallyInitialized(IsExtInit); in LLVMSetExternallyInitialized()
2203 return wrap(GlobalAlias::create(unwrap(ValueTy), AddrSpace, in LLVMAddAlias2()
2205 unwrap<Constant>(Aliasee), unwrap(M))); in LLVMAddAlias2()
2210 return wrap(unwrap(M)->getNamedAlias(StringRef(Name, NameLen))); in LLVMGetNamedGlobalAlias()
2214 Module *Mod = unwrap(M); in LLVMGetFirstGlobalAlias()
2222 Module *Mod = unwrap(M); in LLVMGetLastGlobalAlias()
2230 GlobalAlias *Alias = unwrap<GlobalAlias>(GA); in LLVMGetNextGlobalAlias()
2238 GlobalAlias *Alias = unwrap<GlobalAlias>(GA); in LLVMGetPreviousGlobalAlias()
2246 return wrap(unwrap<GlobalAlias>(Alias)->getAliasee()); in LLVMAliasGetAliasee()
2250 unwrap<GlobalAlias>(Alias)->setAliasee(unwrap<Constant>(Aliasee)); in LLVMAliasSetAliasee()
2257 return wrap(Function::Create(unwrap<FunctionType>(FunctionTy), in LLVMAddFunction()
2258 GlobalValue::ExternalLinkage, Name, unwrap(M))); in LLVMAddFunction()
2262 return wrap(unwrap(M)->getFunction(Name)); in LLVMGetNamedFunction()
2266 Module *Mod = unwrap(M); in LLVMGetFirstFunction()
2274 Module *Mod = unwrap(M); in LLVMGetLastFunction()
2282 Function *Func = unwrap<Function>(Fn); in LLVMGetNextFunction()
2290 Function *Func = unwrap<Function>(Fn); in LLVMGetPreviousFunction()
2298 unwrap<Function>(Fn)->eraseFromParent(); in LLVMDeleteFunction()
2302 return unwrap<Function>(Fn)->hasPersonalityFn(); in LLVMHasPersonalityFn()
2306 return wrap(unwrap<Function>(Fn)->getPersonalityFn()); in LLVMGetPersonalityFn()
2310 unwrap<Function>(Fn)->setPersonalityFn(unwrap<Constant>(PersonalityFn)); in LLVMSetPersonalityFn()
2314 if (Function *F = dyn_cast<Function>(unwrap(Fn))) in LLVMGetIntrinsicID()
2328 ArrayRef<Type*> Tys(unwrap(ParamTypes), ParamCount); in LLVMGetIntrinsicDeclaration()
2330 return wrap(llvm::Intrinsic::getDeclaration(unwrap(Mod), IID, Tys)); in LLVMGetIntrinsicDeclaration()
2343 ArrayRef<Type*> Tys(unwrap(ParamTypes), ParamCount); in LLVMIntrinsicGetType()
2344 return wrap(llvm::Intrinsic::getType(*unwrap(Ctx), IID, Tys)); in LLVMIntrinsicGetType()
2352 ArrayRef<Type*> Tys(unwrap(ParamTypes), ParamCount); in LLVMIntrinsicCopyOverloadedName()
2363 ArrayRef<Type *> Tys(unwrap(ParamTypes), ParamCount); in LLVMIntrinsicCopyOverloadedName2()
2364 auto Str = llvm::Intrinsic::getName(IID, Tys, unwrap(Mod)); in LLVMIntrinsicCopyOverloadedName2()
2379 return unwrap<Function>(Fn)->getCallingConv(); in LLVMGetFunctionCallConv()
2383 return unwrap<Function>(Fn)->setCallingConv( in LLVMSetFunctionCallConv()
2388 Function *F = unwrap<Function>(Fn); in LLVMGetGC()
2393 Function *F = unwrap<Function>(Fn); in LLVMSetGC()
2402 unwrap<Function>(F)->addAttributeAtIndex(Idx, unwrap(A)); in LLVMAddAttributeAtIndex()
2406 auto AS = unwrap<Function>(F)->getAttributes().getAttributes(Idx); in LLVMGetAttributeCountAtIndex()
2412 auto AS = unwrap<Function>(F)->getAttributes().getAttributes(Idx); in LLVMGetAttributesAtIndex()
2420 return wrap(unwrap<Function>(F)->getAttributeAtIndex( in LLVMGetEnumAttributeAtIndex()
2428 unwrap<Function>(F)->getAttributeAtIndex(Idx, StringRef(K, KLen))); in LLVMGetStringAttributeAtIndex()
2433 unwrap<Function>(F)->removeAttributeAtIndex(Idx, (Attribute::AttrKind)KindID); in LLVMRemoveEnumAttributeAtIndex()
2438 unwrap<Function>(F)->removeAttributeAtIndex(Idx, StringRef(K, KLen)); in LLVMRemoveStringAttributeAtIndex()
2443 Function *Func = unwrap<Function>(Fn); in LLVMAddTargetDependentFunctionAttr()
2453 return unwrap<Function>(FnRef)->arg_size(); in LLVMCountParams()
2457 Function *Fn = unwrap<Function>(FnRef); in LLVMGetParams()
2463 Function *Fn = unwrap<Function>(FnRef); in LLVMGetParam()
2468 return wrap(unwrap<Argument>(V)->getParent()); in LLVMGetParamParent()
2472 Function *Func = unwrap<Function>(Fn); in LLVMGetFirstParam()
2480 Function *Func = unwrap<Function>(Fn); in LLVMGetLastParam()
2488 Argument *A = unwrap<Argument>(Arg); in LLVMGetNextParam()
2496 Argument *A = unwrap<Argument>(Arg); in LLVMGetPreviousParam()
2503 Argument *A = unwrap<Argument>(Arg); in LLVMSetParamAlignment()
2513 return wrap(GlobalIFunc::create(unwrap(Ty), AddrSpace, in LLVMAddGlobalIFunc()
2516 unwrap<Constant>(Resolver), unwrap(M))); in LLVMAddGlobalIFunc()
2521 return wrap(unwrap(M)->getNamedIFunc(StringRef(Name, NameLen))); in LLVMGetNamedGlobalIFunc()
2525 Module *Mod = unwrap(M); in LLVMGetFirstGlobalIFunc()
2533 Module *Mod = unwrap(M); in LLVMGetLastGlobalIFunc()
2541 GlobalIFunc *GIF = unwrap<GlobalIFunc>(IFunc); in LLVMGetNextGlobalIFunc()
2549 GlobalIFunc *GIF = unwrap<GlobalIFunc>(IFunc); in LLVMGetPreviousGlobalIFunc()
2557 return wrap(unwrap<GlobalIFunc>(IFunc)->getResolver()); in LLVMGetGlobalIFuncResolver()
2561 unwrap<GlobalIFunc>(IFunc)->setResolver(unwrap<Constant>(Resolver)); in LLVMSetGlobalIFuncResolver()
2565 unwrap<GlobalIFunc>(IFunc)->eraseFromParent(); in LLVMEraseGlobalIFunc()
2569 unwrap<GlobalIFunc>(IFunc)->removeFromParent(); in LLVMRemoveGlobalIFunc()
2578 ArrayRef(unwrap(Args), NumArgs))); in LLVMCreateOperandBundle()
2582 delete unwrap(Bundle); in LLVMDisposeOperandBundle()
2586 StringRef Str = unwrap(Bundle)->getTag(); in LLVMGetOperandBundleTag()
2592 return unwrap(Bundle)->inputs().size(); in LLVMGetNumOperandBundleArgs()
2597 return wrap(unwrap(Bundle)->inputs()[Index]); in LLVMGetOperandBundleArgAtIndex()
2603 return wrap(static_cast<Value*>(unwrap(BB))); in LLVMBasicBlockAsValue()
2607 return isa<BasicBlock>(unwrap(Val)); in LLVMValueIsBasicBlock()
2611 return wrap(unwrap<BasicBlock>(Val)); in LLVMValueAsBasicBlock()
2615 return unwrap(BB)->getName().data(); in LLVMGetBasicBlockName()
2619 return wrap(unwrap(BB)->getParent()); in LLVMGetBasicBlockParent()
2623 return wrap(unwrap(BB)->getTerminator()); in LLVMGetBasicBlockTerminator()
2627 return unwrap<Function>(FnRef)->size(); in LLVMCountBasicBlocks()
2631 Function *Fn = unwrap<Function>(FnRef); in LLVMGetBasicBlocks()
2637 return wrap(&unwrap<Function>(Fn)->getEntryBlock()); in LLVMGetEntryBasicBlock()
2641 Function *Func = unwrap<Function>(Fn); in LLVMGetFirstBasicBlock()
2649 Function *Func = unwrap<Function>(Fn); in LLVMGetLastBasicBlock()
2657 BasicBlock *Block = unwrap(BB); in LLVMGetNextBasicBlock()
2665 BasicBlock *Block = unwrap(BB); in LLVMGetPreviousBasicBlock()
2674 return wrap(llvm::BasicBlock::Create(*unwrap(C), Name)); in LLVMCreateBasicBlockInContext()
2679 BasicBlock *ToInsert = unwrap(BB); in LLVMInsertExistingBasicBlockAfterInsertBlock()
2680 BasicBlock *CurBB = unwrap(Builder)->GetInsertBlock(); in LLVMInsertExistingBasicBlockAfterInsertBlock()
2687 unwrap<Function>(Fn)->insert(unwrap<Function>(Fn)->end(), unwrap(BB)); in LLVMAppendExistingBasicBlock()
2693 return wrap(BasicBlock::Create(*unwrap(C), Name, unwrap<Function>(FnRef))); in LLVMAppendBasicBlockInContext()
2703 BasicBlock *BB = unwrap(BBRef); in LLVMInsertBasicBlockInContext()
2704 return wrap(BasicBlock::Create(*unwrap(C), Name, BB->getParent(), BB)); in LLVMInsertBasicBlockInContext()
2713 unwrap(BBRef)->eraseFromParent(); in LLVMDeleteBasicBlock()
2717 unwrap(BBRef)->removeFromParent(); in LLVMRemoveBasicBlockFromParent()
2721 unwrap(BB)->moveBefore(unwrap(MovePos)); in LLVMMoveBasicBlockBefore()
2725 unwrap(BB)->moveAfter(unwrap(MovePos)); in LLVMMoveBasicBlockAfter()
2731 return wrap(unwrap<Instruction>(Inst)->getParent()); in LLVMGetInstructionParent()
2735 BasicBlock *Block = unwrap(BB); in LLVMGetFirstInstruction()
2743 BasicBlock *Block = unwrap(BB); in LLVMGetLastInstruction()
2751 Instruction *Instr = unwrap<Instruction>(Inst); in LLVMGetNextInstruction()
2759 Instruction *Instr = unwrap<Instruction>(Inst); in LLVMGetPreviousInstruction()
2767 unwrap<Instruction>(Inst)->removeFromParent(); in LLVMInstructionRemoveFromParent()
2771 unwrap<Instruction>(Inst)->eraseFromParent(); in LLVMInstructionEraseFromParent()
2775 unwrap<Instruction>(Inst)->deleteValue(); in LLVMDeleteInstruction()
2779 if (ICmpInst *I = dyn_cast<ICmpInst>(unwrap(Inst))) in LLVMGetICmpPredicate()
2781 if (ConstantExpr *CE = dyn_cast<ConstantExpr>(unwrap(Inst))) in LLVMGetICmpPredicate()
2788 if (FCmpInst *I = dyn_cast<FCmpInst>(unwrap(Inst))) in LLVMGetFCmpPredicate()
2790 if (ConstantExpr *CE = dyn_cast<ConstantExpr>(unwrap(Inst))) in LLVMGetFCmpPredicate()
2797 if (Instruction *C = dyn_cast<Instruction>(unwrap(Inst))) in LLVMGetInstructionOpcode()
2803 if (Instruction *C = dyn_cast<Instruction>(unwrap(Inst))) in LLVMInstructionClone()
2809 Instruction *I = dyn_cast<Instruction>(unwrap(Inst)); in LLVMIsATerminatorInst()
2814 if (FuncletPadInst *FPI = dyn_cast<FuncletPadInst>(unwrap(Instr))) { in LLVMGetNumArgOperands()
2817 return unwrap<CallBase>(Instr)->arg_size(); in LLVMGetNumArgOperands()
2823 return unwrap<CallBase>(Instr)->getCallingConv(); in LLVMGetInstructionCallConv()
2827 return unwrap<CallBase>(Instr)->setCallingConv( in LLVMSetInstructionCallConv()
2833 auto *Call = unwrap<CallBase>(Instr); in LLVMSetInstrParamAlignment()
2841 unwrap<CallBase>(C)->addAttributeAtIndex(Idx, unwrap(A)); in LLVMAddCallSiteAttribute()
2846 auto *Call = unwrap<CallBase>(C); in LLVMGetCallSiteAttributeCount()
2853 auto *Call = unwrap<CallBase>(C); in LLVMGetCallSiteAttributes()
2862 return wrap(unwrap<CallBase>(C)->getAttributeAtIndex( in LLVMGetCallSiteEnumAttribute()
2870 unwrap<CallBase>(C)->getAttributeAtIndex(Idx, StringRef(K, KLen))); in LLVMGetCallSiteStringAttribute()
2875 unwrap<CallBase>(C)->removeAttributeAtIndex(Idx, (Attribute::AttrKind)KindID); in LLVMRemoveCallSiteEnumAttribute()
2880 unwrap<CallBase>(C)->removeAttributeAtIndex(Idx, StringRef(K, KLen)); in LLVMRemoveCallSiteStringAttribute()
2884 return wrap(unwrap<CallBase>(Instr)->getCalledOperand()); in LLVMGetCalledValue()
2888 return wrap(unwrap<CallBase>(Instr)->getFunctionType()); in LLVMGetCalledFunctionType()
2892 return unwrap<CallBase>(C)->getNumOperandBundles(); in LLVMGetNumOperandBundles()
2898 new OperandBundleDef(unwrap<CallBase>(C)->getOperandBundleAt(Index))); in LLVMGetOperandBundleAtIndex()
2904 return unwrap<CallInst>(Call)->isTailCall(); in LLVMIsTailCall()
2908 unwrap<CallInst>(Call)->setTailCall(isTailCall); in LLVMSetTailCall()
2912 return (LLVMTailCallKind)unwrap<CallInst>(Call)->getTailCallKind(); in LLVMGetTailCallKind()
2916 unwrap<CallInst>(Call)->setTailCallKind((CallInst::TailCallKind)kind); in LLVMSetTailCallKind()
2922 return wrap(unwrap<InvokeInst>(Invoke)->getNormalDest()); in LLVMGetNormalDest()
2926 if (CleanupReturnInst *CRI = dyn_cast<CleanupReturnInst>(unwrap(Invoke))) { in LLVMGetUnwindDest()
2928 } else if (CatchSwitchInst *CSI = dyn_cast<CatchSwitchInst>(unwrap(Invoke))) { in LLVMGetUnwindDest()
2931 return wrap(unwrap<InvokeInst>(Invoke)->getUnwindDest()); in LLVMGetUnwindDest()
2935 unwrap<InvokeInst>(Invoke)->setNormalDest(unwrap(B)); in LLVMSetNormalDest()
2939 if (CleanupReturnInst *CRI = dyn_cast<CleanupReturnInst>(unwrap(Invoke))) { in LLVMSetUnwindDest()
2940 return CRI->setUnwindDest(unwrap(B)); in LLVMSetUnwindDest()
2941 } else if (CatchSwitchInst *CSI = dyn_cast<CatchSwitchInst>(unwrap(Invoke))) { in LLVMSetUnwindDest()
2942 return CSI->setUnwindDest(unwrap(B)); in LLVMSetUnwindDest()
2944 unwrap<InvokeInst>(Invoke)->setUnwindDest(unwrap(B)); in LLVMSetUnwindDest()
2950 return unwrap<Instruction>(Term)->getNumSuccessors(); in LLVMGetNumSuccessors()
2954 return wrap(unwrap<Instruction>(Term)->getSuccessor(i)); in LLVMGetSuccessor()
2958 return unwrap<Instruction>(Term)->setSuccessor(i, unwrap(block)); in LLVMSetSuccessor()
2964 return unwrap<BranchInst>(Branch)->isConditional(); in LLVMIsConditional()
2968 return wrap(unwrap<BranchInst>(Branch)->getCondition()); in LLVMGetCondition()
2972 return unwrap<BranchInst>(Branch)->setCondition(unwrap(Cond)); in LLVMSetCondition()
2978 return wrap(unwrap<SwitchInst>(Switch)->getDefaultDest()); in LLVMGetSwitchDefaultDest()
2984 return wrap(unwrap<AllocaInst>(Alloca)->getAllocatedType()); in LLVMGetAllocatedType()
2990 return unwrap<GEPOperator>(GEP)->isInBounds(); in LLVMIsInBounds()
2994 return unwrap<GetElementPtrInst>(GEP)->setIsInBounds(InBounds); in LLVMSetIsInBounds()
2998 return wrap(unwrap<GEPOperator>(GEP)->getSourceElementType()); in LLVMGetGEPSourceElementType()
3005 PHINode *PhiVal = unwrap<PHINode>(PhiNode); in LLVMAddIncoming()
3007 PhiVal->addIncoming(unwrap(IncomingValues[I]), unwrap(IncomingBlocks[I])); in LLVMAddIncoming()
3011 return unwrap<PHINode>(PhiNode)->getNumIncomingValues(); in LLVMCountIncoming()
3015 return wrap(unwrap<PHINode>(PhiNode)->getIncomingValue(Index)); in LLVMGetIncomingValue()
3019 return wrap(unwrap<PHINode>(PhiNode)->getIncomingBlock(Index)); in LLVMGetIncomingBlock()
3025 auto *I = unwrap(Inst); in LLVMGetNumIndices()
3037 auto *I = unwrap(Inst); in LLVMGetIndices()
3050 return wrap(new IRBuilder<>(*unwrap(C))); in LLVMCreateBuilderInContext()
3059 BasicBlock *BB = unwrap(Block); in LLVMPositionBuilder()
3060 auto I = Instr ? unwrap<Instruction>(Instr)->getIterator() : BB->end(); in LLVMPositionBuilder()
3061 unwrap(Builder)->SetInsertPoint(BB, I); in LLVMPositionBuilder()
3065 Instruction *I = unwrap<Instruction>(Instr); in LLVMPositionBuilderBefore()
3066 unwrap(Builder)->SetInsertPoint(I->getParent(), I->getIterator()); in LLVMPositionBuilderBefore()
3070 BasicBlock *BB = unwrap(Block); in LLVMPositionBuilderAtEnd()
3071 unwrap(Builder)->SetInsertPoint(BB); in LLVMPositionBuilderAtEnd()
3075 return wrap(unwrap(Builder)->GetInsertBlock()); in LLVMGetInsertBlock()
3079 unwrap(Builder)->ClearInsertionPoint(); in LLVMClearInsertionPosition()
3083 unwrap(Builder)->Insert(unwrap<Instruction>(Instr)); in LLVMInsertIntoBuilder()
3088 unwrap(Builder)->Insert(unwrap<Instruction>(Instr), Name); in LLVMInsertIntoBuilderWithName()
3092 delete unwrap(Builder); in LLVMDisposeBuilder()
3098 return wrap(unwrap(Builder)->getCurrentDebugLocation().getAsMDNode()); in LLVMGetCurrentDebugLocation2()
3103 unwrap(Builder)->SetCurrentDebugLocation(DebugLoc(unwrap<MDNode>(Loc))); in LLVMSetCurrentDebugLocation2()
3105 unwrap(Builder)->SetCurrentDebugLocation(DebugLoc()); in LLVMSetCurrentDebugLocation2()
3110 L ? cast<MDNode>(unwrap<MetadataAsValue>(L)->getMetadata()) : nullptr; in LLVMSetCurrentDebugLocation()
3111 unwrap(Builder)->SetCurrentDebugLocation(DebugLoc(Loc)); in LLVMSetCurrentDebugLocation()
3115 LLVMContext &Context = unwrap(Builder)->getContext(); in LLVMGetCurrentDebugLocation()
3117 Context, unwrap(Builder)->getCurrentDebugLocation().getAsMDNode())); in LLVMGetCurrentDebugLocation()
3121 unwrap(Builder)->SetInstDebugLocation(unwrap<Instruction>(Inst)); in LLVMSetInstDebugLocation()
3125 unwrap(Builder)->AddMetadataToInst(unwrap<Instruction>(Inst)); in LLVMAddMetadataToInst()
3131 unwrap(Builder)->setDefaultFPMathTag(FPMathTag in LLVMBuilderSetDefaultFPMathTag()
3132 ? unwrap<MDNode>(FPMathTag) in LLVMBuilderSetDefaultFPMathTag()
3137 return wrap(unwrap(Builder)->getDefaultFPMathTag()); in LLVMBuilderGetDefaultFPMathTag()
3143 return wrap(unwrap(B)->CreateRetVoid()); in LLVMBuildRetVoid()
3147 return wrap(unwrap(B)->CreateRet(unwrap(V))); in LLVMBuildRet()
3152 return wrap(unwrap(B)->CreateAggregateRet(unwrap(RetVals), N)); in LLVMBuildAggregateRet()
3156 return wrap(unwrap(B)->CreateBr(unwrap(Dest))); in LLVMBuildBr()
3161 return wrap(unwrap(B)->CreateCondBr(unwrap(If), unwrap(Then), unwrap(Else))); in LLVMBuildCondBr()
3166 return wrap(unwrap(B)->CreateSwitch(unwrap(V), unwrap(Else), NumCases)); in LLVMBuildSwitch()
3171 return wrap(unwrap(B)->CreateIndirectBr(unwrap(Addr), NumDests)); in LLVMBuildIndirectBr()
3178 return wrap(unwrap(B)->CreateInvoke(unwrap<FunctionType>(Ty), unwrap(Fn), in LLVMBuildInvoke2()
3179 unwrap(Then), unwrap(Catch), in LLVMBuildInvoke2()
3180 ArrayRef(unwrap(Args), NumArgs), Name)); in LLVMBuildInvoke2()
3189 OperandBundleDef *OB = unwrap(Bundle); in LLVMBuildInvokeWithOperandBundles()
3192 return wrap(unwrap(B)->CreateInvoke( in LLVMBuildInvokeWithOperandBundles()
3193 unwrap<FunctionType>(Ty), unwrap(Fn), unwrap(Then), unwrap(Catch), in LLVMBuildInvokeWithOperandBundles()
3194 ArrayRef(unwrap(Args), NumArgs), OBs, Name)); in LLVMBuildInvokeWithOperandBundles()
3204 unwrap(B)->GetInsertBlock()->getParent()->setPersonalityFn( in LLVMBuildLandingPad()
3205 unwrap<Function>(PersFn)); in LLVMBuildLandingPad()
3206 return wrap(unwrap(B)->CreateLandingPad(unwrap(Ty), NumClauses, Name)); in LLVMBuildLandingPad()
3212 return wrap(unwrap(B)->CreateCatchPad(unwrap(ParentPad), in LLVMBuildCatchPad()
3213 ArrayRef(unwrap(Args), NumArgs), Name)); in LLVMBuildCatchPad()
3220 Type *Ty = Type::getTokenTy(unwrap(B)->getContext()); in LLVMBuildCleanupPad()
3223 return wrap(unwrap(B)->CreateCleanupPad( in LLVMBuildCleanupPad()
3224 unwrap(ParentPad), ArrayRef(unwrap(Args), NumArgs), Name)); in LLVMBuildCleanupPad()
3228 return wrap(unwrap(B)->CreateResume(unwrap(Exn))); in LLVMBuildResume()
3235 Type *Ty = Type::getTokenTy(unwrap(B)->getContext()); in LLVMBuildCatchSwitch()
3238 return wrap(unwrap(B)->CreateCatchSwitch(unwrap(ParentPad), unwrap(UnwindBB), in LLVMBuildCatchSwitch()
3244 return wrap(unwrap(B)->CreateCatchRet(unwrap<CatchPadInst>(CatchPad), in LLVMBuildCatchRet()
3245 unwrap(BB))); in LLVMBuildCatchRet()
3250 return wrap(unwrap(B)->CreateCleanupRet(unwrap<CleanupPadInst>(CatchPad), in LLVMBuildCleanupRet()
3251 unwrap(BB))); in LLVMBuildCleanupRet()
3255 return wrap(unwrap(B)->CreateUnreachable()); in LLVMBuildUnreachable()
3260 unwrap<SwitchInst>(Switch)->addCase(unwrap<ConstantInt>(OnVal), unwrap(Dest)); in LLVMAddCase()
3264 unwrap<IndirectBrInst>(IndirectBr)->addDestination(unwrap(Dest)); in LLVMAddDestination()
3268 return unwrap<LandingPadInst>(LandingPad)->getNumClauses(); in LLVMGetNumClauses()
3272 return wrap(unwrap<LandingPadInst>(LandingPad)->getClause(Idx)); in LLVMGetClause()
3276 unwrap<LandingPadInst>(LandingPad)->addClause(unwrap<Constant>(ClauseVal)); in LLVMAddClause()
3280 return unwrap<LandingPadInst>(LandingPad)->isCleanup(); in LLVMIsCleanup()
3284 unwrap<LandingPadInst>(LandingPad)->setCleanup(Val); in LLVMSetCleanup()
3288 unwrap<CatchSwitchInst>(CatchSwitch)->addHandler(unwrap(Dest)); in LLVMAddHandler()
3292 return unwrap<CatchSwitchInst>(CatchSwitch)->getNumHandlers(); in LLVMGetNumHandlers()
3296 CatchSwitchInst *CSI = unwrap<CatchSwitchInst>(CatchSwitch); in LLVMGetHandlers()
3302 return wrap(unwrap<CatchPadInst>(CatchPad)->getCatchSwitch()); in LLVMGetParentCatchSwitch()
3306 unwrap<CatchPadInst>(CatchPad) in LLVMSetParentCatchSwitch()
3307 ->setCatchSwitch(unwrap<CatchSwitchInst>(CatchSwitch)); in LLVMSetParentCatchSwitch()
3313 return wrap(unwrap<FuncletPadInst>(Funclet)->getArgOperand(i)); in LLVMGetArgOperand()
3317 unwrap<FuncletPadInst>(Funclet)->setArgOperand(i, unwrap(value)); in LLVMSetArgOperand()
3357 return wrap(unwrap(B)->CreateAdd(unwrap(LHS), unwrap(RHS), Name)); in LLVMBuildAdd()
3362 return wrap(unwrap(B)->CreateNSWAdd(unwrap(LHS), unwrap(RHS), Name)); in LLVMBuildNSWAdd()
3367 return wrap(unwrap(B)->CreateNUWAdd(unwrap(LHS), unwrap(RHS), Name)); in LLVMBuildNUWAdd()
3372 return wrap(unwrap(B)->CreateFAdd(unwrap(LHS), unwrap(RHS), Name)); in LLVMBuildFAdd()
3377 return wrap(unwrap(B)->CreateSub(unwrap(LHS), unwrap(RHS), Name)); in LLVMBuildSub()
3382 return wrap(unwrap(B)->CreateNSWSub(unwrap(LHS), unwrap(RHS), Name)); in LLVMBuildNSWSub()
3387 return wrap(unwrap(B)->CreateNUWSub(unwrap(LHS), unwrap(RHS), Name)); in LLVMBuildNUWSub()
3392 return wrap(unwrap(B)->CreateFSub(unwrap(LHS), unwrap(RHS), Name)); in LLVMBuildFSub()
3397 return wrap(unwrap(B)->CreateMul(unwrap(LHS), unwrap(RHS), Name)); in LLVMBuildMul()
3402 return wrap(unwrap(B)->CreateNSWMul(unwrap(LHS), unwrap(RHS), Name)); in LLVMBuildNSWMul()
3407 return wrap(unwrap(B)->CreateNUWMul(unwrap(LHS), unwrap(RHS), Name)); in LLVMBuildNUWMul()
3412 return wrap(unwrap(B)->CreateFMul(unwrap(LHS), unwrap(RHS), Name)); in LLVMBuildFMul()
3417 return wrap(unwrap(B)->CreateUDiv(unwrap(LHS), unwrap(RHS), Name)); in LLVMBuildUDiv()
3422 return wrap(unwrap(B)->CreateExactUDiv(unwrap(LHS), unwrap(RHS), Name)); in LLVMBuildExactUDiv()
3427 return wrap(unwrap(B)->CreateSDiv(unwrap(LHS), unwrap(RHS), Name)); in LLVMBuildSDiv()
3432 return wrap(unwrap(B)->CreateExactSDiv(unwrap(LHS), unwrap(RHS), Name)); in LLVMBuildExactSDiv()
3437 return wrap(unwrap(B)->CreateFDiv(unwrap(LHS), unwrap(RHS), Name)); in LLVMBuildFDiv()
3442 return wrap(unwrap(B)->CreateURem(unwrap(LHS), unwrap(RHS), Name)); in LLVMBuildURem()
3447 return wrap(unwrap(B)->CreateSRem(unwrap(LHS), unwrap(RHS), Name)); in LLVMBuildSRem()
3452 return wrap(unwrap(B)->CreateFRem(unwrap(LHS), unwrap(RHS), Name)); in LLVMBuildFRem()
3457 return wrap(unwrap(B)->CreateShl(unwrap(LHS), unwrap(RHS), Name)); in LLVMBuildShl()
3462 return wrap(unwrap(B)->CreateLShr(unwrap(LHS), unwrap(RHS), Name)); in LLVMBuildLShr()
3467 return wrap(unwrap(B)->CreateAShr(unwrap(LHS), unwrap(RHS), Name)); in LLVMBuildAShr()
3472 return wrap(unwrap(B)->CreateAnd(unwrap(LHS), unwrap(RHS), Name)); in LLVMBuildAnd()
3477 return wrap(unwrap(B)->CreateOr(unwrap(LHS), unwrap(RHS), Name)); in LLVMBuildOr()
3482 return wrap(unwrap(B)->CreateXor(unwrap(LHS), unwrap(RHS), Name)); in LLVMBuildXor()
3488 return wrap(unwrap(B)->CreateBinOp(Instruction::BinaryOps(map_from_llvmopcode(Op)), unwrap(LHS), in LLVMBuildBinOp()
3489 unwrap(RHS), Name)); in LLVMBuildBinOp()
3493 return wrap(unwrap(B)->CreateNeg(unwrap(V), Name)); in LLVMBuildNeg()
3498 return wrap(unwrap(B)->CreateNSWNeg(unwrap(V), Name)); in LLVMBuildNSWNeg()
3503 return wrap(unwrap(B)->CreateNUWNeg(unwrap(V), Name)); in LLVMBuildNUWNeg()
3507 return wrap(unwrap(B)->CreateFNeg(unwrap(V), Name)); in LLVMBuildFNeg()
3511 return wrap(unwrap(B)->CreateNot(unwrap(V), Name)); in LLVMBuildNot()
3515 Value *P = unwrap<Value>(ArithInst); in LLVMGetNUW()
3520 Value *P = unwrap<Value>(ArithInst); in LLVMSetNUW()
3525 Value *P = unwrap<Value>(ArithInst); in LLVMGetNSW()
3530 Value *P = unwrap<Value>(ArithInst); in LLVMSetNSW()
3535 Value *P = unwrap<Value>(DivOrShrInst); in LLVMGetExact()
3540 Value *P = unwrap<Value>(DivOrShrInst); in LLVMSetExact()
3545 Value *P = unwrap<Value>(NonNegInst); in LLVMGetNNeg()
3550 Value *P = unwrap<Value>(NonNegInst); in LLVMSetNNeg()
3555 Value *P = unwrap<Value>(FPMathInst); in LLVMGetFastMathFlags()
3561 Value *P = unwrap<Value>(FPMathInst); in LLVMSetFastMathFlags()
3566 Value *Val = unwrap<Value>(V); in LLVMCanValueUseFastMathFlags()
3571 Value *P = unwrap<Value>(Inst); in LLVMGetIsDisjoint()
3576 Value *P = unwrap<Value>(Inst); in LLVMSetIsDisjoint()
3584 Type* ITy = Type::getInt32Ty(unwrap(B)->GetInsertBlock()->getContext()); in LLVMBuildMalloc()
3585 Constant* AllocSize = ConstantExpr::getSizeOf(unwrap(Ty)); in LLVMBuildMalloc()
3587 return wrap(unwrap(B)->CreateMalloc(ITy, unwrap(Ty), AllocSize, nullptr, in LLVMBuildMalloc()
3593 Type* ITy = Type::getInt32Ty(unwrap(B)->GetInsertBlock()->getContext()); in LLVMBuildArrayMalloc()
3594 Constant* AllocSize = ConstantExpr::getSizeOf(unwrap(Ty)); in LLVMBuildArrayMalloc()
3596 return wrap(unwrap(B)->CreateMalloc(ITy, unwrap(Ty), AllocSize, unwrap(Val), in LLVMBuildArrayMalloc()
3603 return wrap(unwrap(B)->CreateMemSet(unwrap(Ptr), unwrap(Val), unwrap(Len), in LLVMBuildMemSet()
3611 return wrap(unwrap(B)->CreateMemCpy(unwrap(Dst), MaybeAlign(DstAlign), in LLVMBuildMemCpy()
3612 unwrap(Src), MaybeAlign(SrcAlign), in LLVMBuildMemCpy()
3613 unwrap(Size))); in LLVMBuildMemCpy()
3620 return wrap(unwrap(B)->CreateMemMove(unwrap(Dst), MaybeAlign(DstAlign), in LLVMBuildMemMove()
3621 unwrap(Src), MaybeAlign(SrcAlign), in LLVMBuildMemMove()
3622 unwrap(Size))); in LLVMBuildMemMove()
3627 return wrap(unwrap(B)->CreateAlloca(unwrap(Ty), nullptr, Name)); in LLVMBuildAlloca()
3632 return wrap(unwrap(B)->CreateAlloca(unwrap(Ty), unwrap(Val), Name)); in LLVMBuildArrayAlloca()
3636 return wrap(unwrap(B)->CreateFree(unwrap(PointerVal))); in LLVMBuildFree()
3641 return wrap(unwrap(B)->CreateLoad(unwrap(Ty), unwrap(PointerVal), Name)); in LLVMBuildLoad2()
3646 return wrap(unwrap(B)->CreateStore(unwrap(Val), unwrap(PointerVal))); in LLVMBuildStore()
3731 unwrap(B)->CreateFence(mapFromLLVMOrdering(Ordering), in LLVMBuildFence()
3740 ArrayRef<Value *> IdxList(unwrap(Indices), NumIndices); in LLVMBuildGEP2()
3741 return wrap(unwrap(B)->CreateGEP(unwrap(Ty), unwrap(Pointer), IdxList, Name)); in LLVMBuildGEP2()
3747 ArrayRef<Value *> IdxList(unwrap(Indices), NumIndices); in LLVMBuildInBoundsGEP2()
3749 unwrap(B)->CreateInBoundsGEP(unwrap(Ty), unwrap(Pointer), IdxList, Name)); in LLVMBuildInBoundsGEP2()
3756 unwrap(B)->CreateStructGEP(unwrap(Ty), unwrap(Pointer), Idx, Name)); in LLVMBuildStructGEP2()
3761 return wrap(unwrap(B)->CreateGlobalString(Str, Name)); in LLVMBuildGlobalString()
3766 return wrap(unwrap(B)->CreateGlobalStringPtr(Str, Name)); in LLVMBuildGlobalStringPtr()
3770 Value *P = unwrap(MemAccessInst); in LLVMGetVolatile()
3781 Value *P = unwrap(MemAccessInst); in LLVMSetVolatile()
3792 return unwrap<AtomicCmpXchgInst>(CmpXchgInst)->isWeak(); in LLVMGetWeak()
3796 return unwrap<AtomicCmpXchgInst>(CmpXchgInst)->setWeak(isWeak); in LLVMSetWeak()
3800 Value *P = unwrap(MemAccessInst); in LLVMGetOrdering()
3814 Value *P = unwrap(MemAccessInst); in LLVMSetOrdering()
3827 return mapToLLVMRMWBinOp(unwrap<AtomicRMWInst>(Inst)->getOperation()); in LLVMGetAtomicRMWBinOp()
3831 unwrap<AtomicRMWInst>(Inst)->setOperation(mapFromLLVMRMWBinOp(BinOp)); in LLVMSetAtomicRMWBinOp()
3838 return wrap(unwrap(B)->CreateTrunc(unwrap(Val), unwrap(DestTy), Name)); in LLVMBuildTrunc()
3843 return wrap(unwrap(B)->CreateZExt(unwrap(Val), unwrap(DestTy), Name)); in LLVMBuildZExt()
3848 return wrap(unwrap(B)->CreateSExt(unwrap(Val), unwrap(DestTy), Name)); in LLVMBuildSExt()
3853 return wrap(unwrap(B)->CreateFPToUI(unwrap(Val), unwrap(DestTy), Name)); in LLVMBuildFPToUI()
3858 return wrap(unwrap(B)->CreateFPToSI(unwrap(Val), unwrap(DestTy), Name)); in LLVMBuildFPToSI()
3863 return wrap(unwrap(B)->CreateUIToFP(unwrap(Val), unwrap(DestTy), Name)); in LLVMBuildUIToFP()
3868 return wrap(unwrap(B)->CreateSIToFP(unwrap(Val), unwrap(DestTy), Name)); in LLVMBuildSIToFP()
3873 return wrap(unwrap(B)->CreateFPTrunc(unwrap(Val), unwrap(DestTy), Name)); in LLVMBuildFPTrunc()
3878 return wrap(unwrap(B)->CreateFPExt(unwrap(Val), unwrap(DestTy), Name)); in LLVMBuildFPExt()
3883 return wrap(unwrap(B)->CreatePtrToInt(unwrap(Val), unwrap(DestTy), Name)); in LLVMBuildPtrToInt()
3888 return wrap(unwrap(B)->CreateIntToPtr(unwrap(Val), unwrap(DestTy), Name)); in LLVMBuildIntToPtr()
3893 return wrap(unwrap(B)->CreateBitCast(unwrap(Val), unwrap(DestTy), Name)); in LLVMBuildBitCast()
3898 return wrap(unwrap(B)->CreateAddrSpaceCast(unwrap(Val), unwrap(DestTy), Name)); in LLVMBuildAddrSpaceCast()
3903 return wrap(unwrap(B)->CreateZExtOrBitCast(unwrap(Val), unwrap(DestTy), in LLVMBuildZExtOrBitCast()
3909 return wrap(unwrap(B)->CreateSExtOrBitCast(unwrap(Val), unwrap(DestTy), in LLVMBuildSExtOrBitCast()
3915 return wrap(unwrap(B)->CreateTruncOrBitCast(unwrap(Val), unwrap(DestTy), in LLVMBuildTruncOrBitCast()
3921 return wrap(unwrap(B)->CreateCast(Instruction::CastOps(map_from_llvmopcode(Op)), unwrap(Val), in LLVMBuildCast()
3922 unwrap(DestTy), Name)); in LLVMBuildCast()
3927 return wrap(unwrap(B)->CreatePointerCast(unwrap(Val), unwrap(DestTy), Name)); in LLVMBuildPointerCast()
3934 unwrap(B)->CreateIntCast(unwrap(Val), unwrap(DestTy), IsSigned, Name)); in LLVMBuildIntCast2()
3939 return wrap(unwrap(B)->CreateIntCast(unwrap(Val), unwrap(DestTy), in LLVMBuildIntCast()
3945 return wrap(unwrap(B)->CreateFPCast(unwrap(Val), unwrap(DestTy), Name)); in LLVMBuildFPCast()
3951 unwrap(Src), SrcIsSigned, unwrap(DestTy), DestIsSigned)); in LLVMGetCastOpcode()
3959 return wrap(unwrap(B)->CreateICmp(static_cast<ICmpInst::Predicate>(Op), in LLVMBuildICmp()
3960 unwrap(LHS), unwrap(RHS), Name)); in LLVMBuildICmp()
3966 return wrap(unwrap(B)->CreateFCmp(static_cast<FCmpInst::Predicate>(Op), in LLVMBuildFCmp()
3967 unwrap(LHS), unwrap(RHS), Name)); in LLVMBuildFCmp()
3973 return wrap(unwrap(B)->CreatePHI(unwrap(Ty), 0, Name)); in LLVMBuildPhi()
3979 FunctionType *FTy = unwrap<FunctionType>(Ty); in LLVMBuildCall2()
3980 return wrap(unwrap(B)->CreateCall(FTy, unwrap(Fn), in LLVMBuildCall2()
3981 ArrayRef(unwrap(Args), NumArgs), Name)); in LLVMBuildCall2()
3989 FunctionType *FTy = unwrap<FunctionType>(Ty); in LLVMBuildCallWithOperandBundles()
3992 OperandBundleDef *OB = unwrap(Bundle); in LLVMBuildCallWithOperandBundles()
3995 return wrap(unwrap(B)->CreateCall( in LLVMBuildCallWithOperandBundles()
3996 FTy, unwrap(Fn), ArrayRef(unwrap(Args), NumArgs), OBs, Name)); in LLVMBuildCallWithOperandBundles()
4002 return wrap(unwrap(B)->CreateSelect(unwrap(If), unwrap(Then), unwrap(Else), in LLVMBuildSelect()
4008 return wrap(unwrap(B)->CreateVAArg(unwrap(List), unwrap(Ty), Name)); in LLVMBuildVAArg()
4013 return wrap(unwrap(B)->CreateExtractElement(unwrap(VecVal), unwrap(Index), in LLVMBuildExtractElement()
4020 return wrap(unwrap(B)->CreateInsertElement(unwrap(VecVal), unwrap(EltVal), in LLVMBuildInsertElement()
4021 unwrap(Index), Name)); in LLVMBuildInsertElement()
4027 return wrap(unwrap(B)->CreateShuffleVector(unwrap(V1), unwrap(V2), in LLVMBuildShuffleVector()
4028 unwrap(Mask), Name)); in LLVMBuildShuffleVector()
4033 return wrap(unwrap(B)->CreateExtractValue(unwrap(AggVal), Index, Name)); in LLVMBuildExtractValue()
4039 return wrap(unwrap(B)->CreateInsertValue(unwrap(AggVal), unwrap(EltVal), in LLVMBuildInsertValue()
4045 return wrap(unwrap(B)->CreateFreeze(unwrap(Val), Name)); in LLVMBuildFreeze()
4050 return wrap(unwrap(B)->CreateIsNull(unwrap(Val), Name)); in LLVMBuildIsNull()
4055 return wrap(unwrap(B)->CreateIsNotNull(unwrap(Val), Name)); in LLVMBuildIsNotNull()
4061 return wrap(unwrap(B)->CreatePtrDiff(unwrap(ElemTy), unwrap(LHS), in LLVMBuildPtrDiff2()
4062 unwrap(RHS), Name)); in LLVMBuildPtrDiff2()
4070 return wrap(unwrap(B)->CreateAtomicRMW( in LLVMBuildAtomicRMW()
4071 intop, unwrap(PTR), unwrap(Val), MaybeAlign(), in LLVMBuildAtomicRMW()
4082 return wrap(unwrap(B)->CreateAtomicCmpXchg( in LLVMBuildAtomicCmpXchg()
4083 unwrap(Ptr), unwrap(Cmp), unwrap(New), MaybeAlign(), in LLVMBuildAtomicCmpXchg()
4090 Value *P = unwrap(SVInst); in LLVMGetNumMaskElements()
4096 Value *P = unwrap(SVInst); in LLVMGetMaskValue()
4104 Value *P = unwrap(AtomicInst); in LLVMIsAtomicSingleThread()
4119 Value *P = unwrap(AtomicInst); in LLVMSetAtomicSingleThread()
4134 Value *P = unwrap(CmpXchgInst); in LLVMGetCmpXchgSuccessOrdering()
4140 Value *P = unwrap(CmpXchgInst); in LLVMSetCmpXchgSuccessOrdering()
4147 Value *P = unwrap(CmpXchgInst); in LLVMGetCmpXchgFailureOrdering()
4153 Value *P = unwrap(CmpXchgInst); in LLVMSetCmpXchgFailureOrdering()
4167 delete unwrap(MP); in LLVMDisposeModuleProvider()
4220 return unwrap(MemBuf)->getBufferStart(); in LLVMGetBufferStart()
4224 return unwrap(MemBuf)->getBufferSize(); in LLVMGetBufferSize()
4228 delete unwrap(MemBuf); in LLVMDisposeMemoryBuffer()
4238 return wrap(new legacy::FunctionPassManager(unwrap(M))); in LLVMCreateFunctionPassManagerForModule()
4247 return unwrap<legacy::PassManager>(PM)->run(*unwrap(M)); in LLVMRunPassManager()
4251 return unwrap<legacy::FunctionPassManager>(FPM)->doInitialization(); in LLVMInitializeFunctionPassManager()
4255 return unwrap<legacy::FunctionPassManager>(FPM)->run(*unwrap<Function>(F)); in LLVMRunFunctionPassManager()
4259 return unwrap<legacy::FunctionPassManager>(FPM)->doFinalization(); in LLVMFinalizeFunctionPassManager()
4263 delete unwrap(PM); in LLVMDisposePassManager()