Lines Matching refs:unwrap
57 initializeCore(*unwrap(R)); in LLVMInitializeCore()
91 unwrap(C)->setDiagnosticHandlerCallBack( in LLVMContextSetDiagnosticHandler()
99 unwrap(C)->getDiagnosticHandlerCallBack()); in LLVMContextGetDiagnosticHandler()
103 return unwrap(C)->getDiagnosticContext(); in LLVMContextGetDiagnosticContext()
110 unwrap(C)->setYieldCallback(YieldCallback, OpaqueHandle); in LLVMContextSetYieldCallback()
114 return unwrap(C)->shouldDiscardValueNames(); in LLVMContextShouldDiscardValueNames()
118 unwrap(C)->setDiscardValueNames(Discard); in LLVMContextSetDiscardValueNames()
122 unwrap(C)->setOpaquePointers(OpaquePointers); in LLVMContextSetOpaquePointers()
126 delete unwrap(C); in LLVMContextDispose()
131 return unwrap(C)->getMDKindID(StringRef(Name, SLen)); in LLVMGetMDKindIDInContext()
148 auto &Ctx = *unwrap(C); in LLVMCreateEnumAttribute()
166 return unwrap(A).getKindAsEnum(); in LLVMGetEnumAttributeKind()
170 auto Attr = unwrap(A); in LLVMGetEnumAttributeValue()
178 auto &Ctx = *unwrap(C); in LLVMCreateTypeAttribute()
180 return wrap(Attribute::get(Ctx, AttrKind, unwrap(type_ref))); in LLVMCreateTypeAttribute()
184 auto Attr = unwrap(A); in LLVMGetTypeAttributeValue()
191 return wrap(Attribute::get(*unwrap(C), StringRef(K, KLength), in LLVMCreateStringAttribute()
197 auto S = unwrap(A).getKindAsString(); in LLVMGetStringAttributeKind()
204 auto S = unwrap(A).getValueAsString(); in LLVMGetStringAttributeValue()
210 auto Attr = unwrap(A); in LLVMIsEnumAttribute()
215 return unwrap(A).isStringAttribute(); in LLVMIsStringAttribute()
219 return unwrap(A).isTypeAttribute(); in LLVMIsTypeAttribute()
227 unwrap(DI)->print(DP); in LLVMGetDiagInfoDescription()
236 switch(unwrap(DI)->getSeverity()) { in LLVMGetDiagInfoSeverity()
262 return wrap(new Module(ModuleID, *unwrap(C))); in LLVMModuleCreateWithNameInContext()
266 delete unwrap(M); in LLVMDisposeModule()
270 auto &Str = unwrap(M)->getModuleIdentifier(); in LLVMGetModuleIdentifier()
276 unwrap(M)->setModuleIdentifier(StringRef(Ident, Len)); in LLVMSetModuleIdentifier()
280 auto &Str = unwrap(M)->getSourceFileName(); in LLVMGetSourceFileName()
286 unwrap(M)->setSourceFileName(StringRef(Name, Len)); in LLVMSetSourceFileName()
291 return unwrap(M)->getDataLayoutStr().c_str(); in LLVMGetDataLayoutStr()
299 unwrap(M)->setDataLayout(DataLayoutStr); in LLVMSetDataLayout()
304 return unwrap(M)->getTargetTriple().c_str(); in LLVMGetTarget()
308 unwrap(M)->setTargetTriple(Triple); in LLVMSetTarget()
360 unwrap(M)->getModuleFlagsMetadata(MFEs); in LLVMCopyModuleFlagsMetadata()
404 return wrap(unwrap(M)->getModuleFlag({Key, KeyLen})); in LLVMGetModuleFlag()
410 unwrap(M)->addModuleFlag(map_to_llvmModFlagBehavior(Behavior), in LLVMAddModuleFlag()
411 {Key, KeyLen}, unwrap(Val)); in LLVMAddModuleFlag()
417 unwrap(M)->print(errs(), nullptr, in LLVMDumpModule()
430 unwrap(M)->print(dest, nullptr); in LLVMPrintModuleToFile()
447 unwrap(M)->print(os, nullptr); in LLVMPrintModuleToString()
455 unwrap(M)->setModuleInlineAsm(StringRef(Asm, Len)); in LLVMSetModuleInlineAsm2()
459 unwrap(M)->setModuleInlineAsm(StringRef(Asm)); in LLVMSetModuleInlineAsm()
463 unwrap(M)->appendModuleInlineAsm(StringRef(Asm, Len)); in LLVMAppendModuleInlineAsm()
467 auto &Str = unwrap(M)->getModuleInlineAsm(); in LLVMGetModuleInlineAsm()
486 return wrap(InlineAsm::get(unwrap<FunctionType>(Ty), in LLVMGetInlineAsm()
494 return wrap(&unwrap(M)->getContext()); in LLVMGetModuleContext()
503 switch (unwrap(Ty)->getTypeID()) { in LLVMGetTypeKind()
552 return unwrap(Ty)->isSized(); in LLVMTypeIsSized()
556 return wrap(&unwrap(Ty)->getContext()); in LLVMGetTypeContext()
560 return unwrap(Ty)->print(errs(), /*IsForDebug=*/true); in LLVMDumpType()
567 if (unwrap(Ty)) in LLVMPrintTypeToString()
568 unwrap(Ty)->print(os); in LLVMPrintTypeToString()
580 return (LLVMTypeRef) Type::getInt1Ty(*unwrap(C)); in LLVMInt1TypeInContext()
583 return (LLVMTypeRef) Type::getInt8Ty(*unwrap(C)); in LLVMInt8TypeInContext()
586 return (LLVMTypeRef) Type::getInt16Ty(*unwrap(C)); in LLVMInt16TypeInContext()
589 return (LLVMTypeRef) Type::getInt32Ty(*unwrap(C)); in LLVMInt32TypeInContext()
592 return (LLVMTypeRef) Type::getInt64Ty(*unwrap(C)); in LLVMInt64TypeInContext()
595 return (LLVMTypeRef) Type::getInt128Ty(*unwrap(C)); in LLVMInt128TypeInContext()
598 return wrap(IntegerType::get(*unwrap(C), NumBits)); in LLVMIntTypeInContext()
624 return unwrap<IntegerType>(IntegerTy)->getBitWidth(); in LLVMGetIntTypeWidth()
630 return (LLVMTypeRef) Type::getHalfTy(*unwrap(C)); in LLVMHalfTypeInContext()
633 return (LLVMTypeRef) Type::getBFloatTy(*unwrap(C)); in LLVMBFloatTypeInContext()
636 return (LLVMTypeRef) Type::getFloatTy(*unwrap(C)); in LLVMFloatTypeInContext()
639 return (LLVMTypeRef) Type::getDoubleTy(*unwrap(C)); in LLVMDoubleTypeInContext()
642 return (LLVMTypeRef) Type::getX86_FP80Ty(*unwrap(C)); in LLVMX86FP80TypeInContext()
645 return (LLVMTypeRef) Type::getFP128Ty(*unwrap(C)); in LLVMFP128TypeInContext()
648 return (LLVMTypeRef) Type::getPPC_FP128Ty(*unwrap(C)); in LLVMPPCFP128TypeInContext()
651 return (LLVMTypeRef) Type::getX86_MMXTy(*unwrap(C)); in LLVMX86MMXTypeInContext()
654 return (LLVMTypeRef) Type::getX86_AMXTy(*unwrap(C)); in LLVMX86AMXTypeInContext()
690 ArrayRef<Type*> Tys(unwrap(ParamTypes), ParamCount); in LLVMFunctionType()
691 return wrap(FunctionType::get(unwrap(ReturnType), Tys, IsVarArg != 0)); in LLVMFunctionType()
695 return unwrap<FunctionType>(FunctionTy)->isVarArg(); in LLVMIsFunctionVarArg()
699 return wrap(unwrap<FunctionType>(FunctionTy)->getReturnType()); in LLVMGetReturnType()
703 return unwrap<FunctionType>(FunctionTy)->getNumParams(); in LLVMCountParamTypes()
707 FunctionType *Ty = unwrap<FunctionType>(FunctionTy); in LLVMGetParamTypes()
716 ArrayRef<Type*> Tys(unwrap(ElementTypes), ElementCount); in LLVMStructTypeInContext()
717 return wrap(StructType::get(*unwrap(C), Tys, Packed != 0)); in LLVMStructTypeInContext()
728 return wrap(StructType::create(*unwrap(C), Name)); in LLVMStructCreateNamed()
733 StructType *Type = unwrap<StructType>(Ty); in LLVMGetStructName()
741 ArrayRef<Type*> Tys(unwrap(ElementTypes), ElementCount); in LLVMStructSetBody()
742 unwrap<StructType>(StructTy)->setBody(Tys, Packed != 0); in LLVMStructSetBody()
746 return unwrap<StructType>(StructTy)->getNumElements(); in LLVMCountStructElementTypes()
750 StructType *Ty = unwrap<StructType>(StructTy); in LLVMGetStructElementTypes()
756 StructType *Ty = unwrap<StructType>(StructTy); in LLVMStructGetTypeAtIndex()
761 return unwrap<StructType>(StructTy)->isPacked(); in LLVMIsPackedStruct()
765 return unwrap<StructType>(StructTy)->isOpaque(); in LLVMIsOpaqueStruct()
769 return unwrap<StructType>(StructTy)->isLiteral(); in LLVMIsLiteralStruct()
773 return wrap(StructType::getTypeByName(unwrap(M)->getContext(), Name)); in LLVMGetTypeByName()
777 return wrap(StructType::getTypeByName(*unwrap(C), Name)); in LLVMGetTypeByName2()
784 for (auto *T : unwrap(Tp)->subtypes()) { in LLVMGetSubtypes()
791 return wrap(ArrayType::get(unwrap(ElementType), ElementCount)); in LLVMArrayType()
795 return wrap(PointerType::get(unwrap(ElementType), AddressSpace)); in LLVMPointerType()
799 return unwrap(Ty)->isOpaquePointerTy(); in LLVMPointerTypeIsOpaque()
803 return wrap(FixedVectorType::get(unwrap(ElementType), ElementCount)); in LLVMVectorType()
808 return wrap(ScalableVectorType::get(unwrap(ElementType), ElementCount)); in LLVMScalableVectorType()
812 auto *Ty = unwrap<Type>(WrappedTy); in LLVMGetElementType()
821 return unwrap(Tp)->getNumContainedTypes(); in LLVMGetNumContainedTypes()
825 return unwrap<ArrayType>(ArrayTy)->getNumElements(); in LLVMGetArrayLength()
829 return unwrap<PointerType>(PointerTy)->getAddressSpace(); in LLVMGetPointerAddressSpace()
833 return unwrap<VectorType>(VectorTy)->getElementCount().getKnownMinValue(); in LLVMGetVectorSize()
839 return wrap(PointerType::get(*unwrap(C), AddressSpace)); in LLVMPointerTypeInContext()
843 return wrap(Type::getVoidTy(*unwrap(C))); in LLVMVoidTypeInContext()
846 return wrap(Type::getLabelTy(*unwrap(C))); in LLVMLabelTypeInContext()
849 return wrap(Type::getTokenTy(*unwrap(C))); in LLVMTokenTypeInContext()
852 return wrap(Type::getMetadataTy(*unwrap(C))); in LLVMMetadataTypeInContext()
867 return wrap(unwrap(Val)->getType()); in LLVMTypeOf()
871 switch(unwrap(Val)->getValueID()) { in LLVMGetValueKind()
883 auto *V = unwrap(Val); in LLVMGetValueName2()
889 unwrap(Val)->setName(StringRef(Name, NameLen)); in LLVMSetValueName2()
893 return unwrap(Val)->getName().data(); in LLVMGetValueName()
897 unwrap(Val)->setName(Name); in LLVMSetValueName()
901 unwrap(Val)->print(errs(), /*IsForDebug=*/true); in LLVMDumpValue()
908 if (unwrap(Val)) in LLVMPrintValueToString()
909 unwrap(Val)->print(os); in LLVMPrintValueToString()
919 unwrap(OldVal)->replaceAllUsesWith(unwrap(NewVal)); in LLVMReplaceAllUsesWith()
923 return unwrap<Instruction>(Inst)->hasMetadata(); in LLVMHasMetadata()
927 auto *I = unwrap<Instruction>(Inst); in LLVMGetMetadata()
949 MDNode *N = Val ? extractMDNode(unwrap<MetadataAsValue>(Val)) : nullptr; in LLVMSetMetadata()
951 unwrap<Instruction>(Inst)->setMetadata(KindID, N); in LLVMSetMetadata()
983 unwrap<Instruction>(Value)->getAllMetadata(Entries); in LLVMInstructionGetAllMetadataOtherThanDebugLoc()
991 return wrap(static_cast<Value*>(dyn_cast_or_null<name>(unwrap(Val)))); \
997 if (auto *MD = dyn_cast_or_null<MetadataAsValue>(unwrap(Val))) in LLVM_FOR_EACH_VALUE_SUBCLASS()
1005 if (auto *MD = dyn_cast_or_null<MetadataAsValue>(unwrap(Val))) in LLVMIsAMDString()
1013 Value *V = unwrap(Val); in LLVMGetFirstUse()
1021 Use *Next = unwrap(U)->getNext(); in LLVMGetNextUse()
1028 return wrap(unwrap(U)->getUser()); in LLVMGetUser()
1032 return wrap(unwrap(U)->get()); in LLVMGetUsedValue()
1048 Value *V = unwrap(Val); in LLVMGetOperand()
1062 Value *V = unwrap(Val); in LLVMGetOperandUse()
1067 unwrap<User>(Val)->setOperand(Index, unwrap(Op)); in LLVMSetOperand()
1071 Value *V = unwrap(Val); in LLVMGetNumOperands()
1081 return wrap(Constant::getNullValue(unwrap(Ty))); in LLVMConstNull()
1085 return wrap(Constant::getAllOnesValue(unwrap(Ty))); in LLVMConstAllOnes()
1089 return wrap(UndefValue::get(unwrap(Ty))); in LLVMGetUndef()
1093 return wrap(PoisonValue::get(unwrap(Ty))); in LLVMGetPoison()
1097 return isa<Constant>(unwrap(Ty)); in LLVMIsConstant()
1101 if (Constant *C = dyn_cast<Constant>(unwrap(Val))) in LLVMIsNull()
1107 return isa<UndefValue>(unwrap(Val)); in LLVMIsUndef()
1111 return isa<PoisonValue>(unwrap(Val)); in LLVMIsPoison()
1115 return wrap(ConstantPointerNull::get(unwrap<PointerType>(Ty))); in LLVMConstPointerNull()
1122 return wrap(MDString::get(*unwrap(C), StringRef(Str, SLen))); in LLVMMDStringInContext2()
1127 return wrap(MDNode::get(*unwrap(C), ArrayRef<Metadata*>(unwrap(MDs), Count))); in LLVMMDNodeInContext2()
1132 LLVMContext &Context = *unwrap(C); in LLVMMDStringInContext()
1143 LLVMContext &Context = *unwrap(C); in LLVMMDNodeInContext()
1146 Value *V = unwrap(OV); in LLVMMDNodeInContext()
1173 return wrap(MetadataAsValue::get(*unwrap(C), unwrap(MD))); in LLVMMetadataAsValue()
1177 auto *V = unwrap(Val); in LLVMValueAsMetadata()
1186 if (const auto *MD = dyn_cast<MetadataAsValue>(unwrap(V))) in LLVMGetMDString()
1196 auto *MD = cast<MetadataAsValue>(unwrap(V)); in LLVMGetMDNodeNumOperands()
1203 Module *Mod = unwrap(M); in LLVMGetFirstNamedMetadata()
1211 Module *Mod = unwrap(M); in LLVMGetLastNamedMetadata()
1219 NamedMDNode *NamedNode = unwrap<NamedMDNode>(NMD); in LLVMGetNextNamedMetadata()
1227 NamedMDNode *NamedNode = unwrap<NamedMDNode>(NMD); in LLVMGetPreviousNamedMetadata()
1236 return wrap(unwrap(M)->getNamedMetadata(StringRef(Name, NameLen))); in LLVMGetNamedMetadata()
1241 return wrap(unwrap(M)->getOrInsertNamedMetadata({Name, NameLen})); in LLVMGetOrInsertNamedMetadata()
1245 NamedMDNode *NamedNode = unwrap<NamedMDNode>(NMD); in LLVMGetNamedMetadataName()
1251 auto *MD = cast<MetadataAsValue>(unwrap(V)); in LLVMGetMDNodeOperands()
1258 LLVMContext &Context = unwrap(V)->getContext(); in LLVMGetMDNodeOperands()
1264 if (NamedMDNode *N = unwrap(M)->getNamedMetadata(Name)) { in LLVMGetNamedMetadataNumOperands()
1272 NamedMDNode *N = unwrap(M)->getNamedMetadata(Name); in LLVMGetNamedMetadataOperands()
1275 LLVMContext &Context = unwrap(M)->getContext(); in LLVMGetNamedMetadataOperands()
1282 NamedMDNode *N = unwrap(M)->getOrInsertNamedMetadata(Name); in LLVMAddNamedMetadataOperand()
1287 N->addOperand(extractMDNode(unwrap<MetadataAsValue>(Val))); in LLVMAddNamedMetadataOperand()
1293 if (const auto *I = dyn_cast<Instruction>(unwrap(Val))) { in LLVMGetDebugLocDirectory()
1297 } else if (const auto *GV = dyn_cast<GlobalVariable>(unwrap(Val))) { in LLVMGetDebugLocDirectory()
1303 } else if (const auto *F = dyn_cast<Function>(unwrap(Val))) { in LLVMGetDebugLocDirectory()
1317 if (const auto *I = dyn_cast<Instruction>(unwrap(Val))) { in LLVMGetDebugLocFilename()
1321 } else if (const auto *GV = dyn_cast<GlobalVariable>(unwrap(Val))) { in LLVMGetDebugLocFilename()
1327 } else if (const auto *F = dyn_cast<Function>(unwrap(Val))) { in LLVMGetDebugLocFilename()
1340 if (const auto *I = dyn_cast<Instruction>(unwrap(Val))) { in LLVMGetDebugLocLine()
1344 } else if (const auto *GV = dyn_cast<GlobalVariable>(unwrap(Val))) { in LLVMGetDebugLocLine()
1350 } else if (const auto *F = dyn_cast<Function>(unwrap(Val))) { in LLVMGetDebugLocLine()
1362 if (const auto *I = dyn_cast<Instruction>(unwrap(Val))) in LLVMGetDebugLocColumn()
1372 return wrap(ConstantInt::get(unwrap<IntegerType>(IntTy), N, SignExtend != 0)); in LLVMConstInt()
1378 IntegerType *Ty = unwrap<IntegerType>(IntTy); in LLVMConstIntOfArbitraryPrecision()
1386 return wrap(ConstantInt::get(unwrap<IntegerType>(IntTy), StringRef(Str), in LLVMConstIntOfString()
1392 return wrap(ConstantInt::get(unwrap<IntegerType>(IntTy), StringRef(Str, SLen), in LLVMConstIntOfStringAndSize()
1397 return wrap(ConstantFP::get(unwrap(RealTy), N)); in LLVMConstReal()
1401 return wrap(ConstantFP::get(unwrap(RealTy), StringRef(Text))); in LLVMConstRealOfString()
1406 return wrap(ConstantFP::get(unwrap(RealTy), StringRef(Str, SLen))); in LLVMConstRealOfStringAndSize()
1410 return unwrap<ConstantInt>(ConstantVal)->getZExtValue(); in LLVMConstIntGetZExtValue()
1414 return unwrap<ConstantInt>(ConstantVal)->getSExtValue(); in LLVMConstIntGetSExtValue()
1418 ConstantFP *cFP = unwrap<ConstantFP>(ConstantVal) ; in LLVMConstRealGetDouble()
1441 return wrap(ConstantDataArray::getString(*unwrap(C), StringRef(Str, Length), in LLVMConstStringInContext()
1452 return wrap(unwrap<Constant>(C)->getAggregateElement(Idx)); in LLVMGetAggregateElement()
1456 return wrap(unwrap<ConstantDataSequential>(C)->getElementAsConstant(idx)); in LLVMGetElementAsConstant()
1460 return unwrap<ConstantDataSequential>(C)->isString(); in LLVMIsConstantString()
1464 StringRef Str = unwrap<ConstantDataSequential>(C)->getAsString(); in LLVMGetAsString()
1471 ArrayRef<Constant*> V(unwrap<Constant>(ConstantVals, Length), Length); in LLVMConstArray()
1472 return wrap(ConstantArray::get(ArrayType::get(unwrap(ElementTy), Length), V)); in LLVMConstArray()
1478 Constant **Elements = unwrap<Constant>(ConstantVals, Count); in LLVMConstStructInContext()
1479 return wrap(ConstantStruct::getAnon(*unwrap(C), makeArrayRef(Elements, Count), in LLVMConstStructInContext()
1492 Constant **Elements = unwrap<Constant>(ConstantVals, Count); in LLVMConstNamedStruct()
1493 StructType *Ty = cast<StructType>(unwrap(StructTy)); in LLVMConstNamedStruct()
1500 unwrap<Constant>(ScalarConstantVals, Size), Size))); in LLVMConstVector()
1528 return map_to_llvmopcode(unwrap<ConstantExpr>(ConstantVal)->getOpcode()); in LLVMGetConstOpcode()
1532 return wrap(ConstantExpr::getAlignOf(unwrap(Ty))); in LLVMAlignOf()
1536 return wrap(ConstantExpr::getSizeOf(unwrap(Ty))); in LLVMSizeOf()
1540 return wrap(ConstantExpr::getNeg(unwrap<Constant>(ConstantVal))); in LLVMConstNeg()
1544 return wrap(ConstantExpr::getNSWNeg(unwrap<Constant>(ConstantVal))); in LLVMConstNSWNeg()
1548 return wrap(ConstantExpr::getNUWNeg(unwrap<Constant>(ConstantVal))); in LLVMConstNUWNeg()
1553 return wrap(ConstantExpr::getFNeg(unwrap<Constant>(ConstantVal))); in LLVMConstFNeg()
1557 return wrap(ConstantExpr::getNot(unwrap<Constant>(ConstantVal))); in LLVMConstNot()
1561 return wrap(ConstantExpr::getAdd(unwrap<Constant>(LHSConstant), in LLVMConstAdd()
1562 unwrap<Constant>(RHSConstant))); in LLVMConstAdd()
1567 return wrap(ConstantExpr::getNSWAdd(unwrap<Constant>(LHSConstant), in LLVMConstNSWAdd()
1568 unwrap<Constant>(RHSConstant))); in LLVMConstNSWAdd()
1573 return wrap(ConstantExpr::getNUWAdd(unwrap<Constant>(LHSConstant), in LLVMConstNUWAdd()
1574 unwrap<Constant>(RHSConstant))); in LLVMConstNUWAdd()
1578 return wrap(ConstantExpr::getSub(unwrap<Constant>(LHSConstant), in LLVMConstSub()
1579 unwrap<Constant>(RHSConstant))); in LLVMConstSub()
1584 return wrap(ConstantExpr::getNSWSub(unwrap<Constant>(LHSConstant), in LLVMConstNSWSub()
1585 unwrap<Constant>(RHSConstant))); in LLVMConstNSWSub()
1590 return wrap(ConstantExpr::getNUWSub(unwrap<Constant>(LHSConstant), in LLVMConstNUWSub()
1591 unwrap<Constant>(RHSConstant))); in LLVMConstNUWSub()
1595 return wrap(ConstantExpr::getMul(unwrap<Constant>(LHSConstant), in LLVMConstMul()
1596 unwrap<Constant>(RHSConstant))); in LLVMConstMul()
1601 return wrap(ConstantExpr::getNSWMul(unwrap<Constant>(LHSConstant), in LLVMConstNSWMul()
1602 unwrap<Constant>(RHSConstant))); in LLVMConstNSWMul()
1607 return wrap(ConstantExpr::getNUWMul(unwrap<Constant>(LHSConstant), in LLVMConstNUWMul()
1608 unwrap<Constant>(RHSConstant))); in LLVMConstNUWMul()
1612 return wrap(ConstantExpr::getAnd(unwrap<Constant>(LHSConstant), in LLVMConstAnd()
1613 unwrap<Constant>(RHSConstant))); in LLVMConstAnd()
1617 return wrap(ConstantExpr::getOr(unwrap<Constant>(LHSConstant), in LLVMConstOr()
1618 unwrap<Constant>(RHSConstant))); in LLVMConstOr()
1622 return wrap(ConstantExpr::getXor(unwrap<Constant>(LHSConstant), in LLVMConstXor()
1623 unwrap<Constant>(RHSConstant))); in LLVMConstXor()
1629 unwrap<Constant>(LHSConstant), in LLVMConstICmp()
1630 unwrap<Constant>(RHSConstant))); in LLVMConstICmp()
1636 unwrap<Constant>(LHSConstant), in LLVMConstFCmp()
1637 unwrap<Constant>(RHSConstant))); in LLVMConstFCmp()
1641 return wrap(ConstantExpr::getShl(unwrap<Constant>(LHSConstant), in LLVMConstShl()
1642 unwrap<Constant>(RHSConstant))); in LLVMConstShl()
1646 return wrap(ConstantExpr::getLShr(unwrap<Constant>(LHSConstant), in LLVMConstLShr()
1647 unwrap<Constant>(RHSConstant))); in LLVMConstLShr()
1651 return wrap(ConstantExpr::getAShr(unwrap<Constant>(LHSConstant), in LLVMConstAShr()
1652 unwrap<Constant>(RHSConstant))); in LLVMConstAShr()
1657 ArrayRef<Constant *> IdxList(unwrap<Constant>(ConstantIndices, NumIndices), in LLVMConstGEP()
1659 Constant *Val = unwrap<Constant>(ConstantVal); in LLVMConstGEP()
1666 ArrayRef<Constant *> IdxList(unwrap<Constant>(ConstantIndices, NumIndices), in LLVMConstGEP2()
1668 Constant *Val = unwrap<Constant>(ConstantVal); in LLVMConstGEP2()
1669 return wrap(ConstantExpr::getGetElementPtr(unwrap(Ty), Val, IdxList)); in LLVMConstGEP2()
1675 ArrayRef<Constant *> IdxList(unwrap<Constant>(ConstantIndices, NumIndices), in LLVMConstInBoundsGEP()
1677 Constant *Val = unwrap<Constant>(ConstantVal); in LLVMConstInBoundsGEP()
1685 ArrayRef<Constant *> IdxList(unwrap<Constant>(ConstantIndices, NumIndices), in LLVMConstInBoundsGEP2()
1687 Constant *Val = unwrap<Constant>(ConstantVal); in LLVMConstInBoundsGEP2()
1688 return wrap(ConstantExpr::getInBoundsGetElementPtr(unwrap(Ty), Val, IdxList)); in LLVMConstInBoundsGEP2()
1692 return wrap(ConstantExpr::getTrunc(unwrap<Constant>(ConstantVal), in LLVMConstTrunc()
1693 unwrap(ToType))); in LLVMConstTrunc()
1697 return wrap(ConstantExpr::getSExt(unwrap<Constant>(ConstantVal), in LLVMConstSExt()
1698 unwrap(ToType))); in LLVMConstSExt()
1702 return wrap(ConstantExpr::getZExt(unwrap<Constant>(ConstantVal), in LLVMConstZExt()
1703 unwrap(ToType))); in LLVMConstZExt()
1707 return wrap(ConstantExpr::getFPTrunc(unwrap<Constant>(ConstantVal), in LLVMConstFPTrunc()
1708 unwrap(ToType))); in LLVMConstFPTrunc()
1712 return wrap(ConstantExpr::getFPExtend(unwrap<Constant>(ConstantVal), in LLVMConstFPExt()
1713 unwrap(ToType))); in LLVMConstFPExt()
1717 return wrap(ConstantExpr::getUIToFP(unwrap<Constant>(ConstantVal), in LLVMConstUIToFP()
1718 unwrap(ToType))); in LLVMConstUIToFP()
1722 return wrap(ConstantExpr::getSIToFP(unwrap<Constant>(ConstantVal), in LLVMConstSIToFP()
1723 unwrap(ToType))); in LLVMConstSIToFP()
1727 return wrap(ConstantExpr::getFPToUI(unwrap<Constant>(ConstantVal), in LLVMConstFPToUI()
1728 unwrap(ToType))); in LLVMConstFPToUI()
1732 return wrap(ConstantExpr::getFPToSI(unwrap<Constant>(ConstantVal), in LLVMConstFPToSI()
1733 unwrap(ToType))); in LLVMConstFPToSI()
1737 return wrap(ConstantExpr::getPtrToInt(unwrap<Constant>(ConstantVal), in LLVMConstPtrToInt()
1738 unwrap(ToType))); in LLVMConstPtrToInt()
1742 return wrap(ConstantExpr::getIntToPtr(unwrap<Constant>(ConstantVal), in LLVMConstIntToPtr()
1743 unwrap(ToType))); in LLVMConstIntToPtr()
1747 return wrap(ConstantExpr::getBitCast(unwrap<Constant>(ConstantVal), in LLVMConstBitCast()
1748 unwrap(ToType))); in LLVMConstBitCast()
1753 return wrap(ConstantExpr::getAddrSpaceCast(unwrap<Constant>(ConstantVal), in LLVMConstAddrSpaceCast()
1754 unwrap(ToType))); in LLVMConstAddrSpaceCast()
1759 return wrap(ConstantExpr::getZExtOrBitCast(unwrap<Constant>(ConstantVal), in LLVMConstZExtOrBitCast()
1760 unwrap(ToType))); in LLVMConstZExtOrBitCast()
1765 return wrap(ConstantExpr::getSExtOrBitCast(unwrap<Constant>(ConstantVal), in LLVMConstSExtOrBitCast()
1766 unwrap(ToType))); in LLVMConstSExtOrBitCast()
1771 return wrap(ConstantExpr::getTruncOrBitCast(unwrap<Constant>(ConstantVal), in LLVMConstTruncOrBitCast()
1772 unwrap(ToType))); in LLVMConstTruncOrBitCast()
1777 return wrap(ConstantExpr::getPointerCast(unwrap<Constant>(ConstantVal), in LLVMConstPointerCast()
1778 unwrap(ToType))); in LLVMConstPointerCast()
1783 return wrap(ConstantExpr::getIntegerCast(unwrap<Constant>(ConstantVal), in LLVMConstIntCast()
1784 unwrap(ToType), isSigned)); in LLVMConstIntCast()
1788 return wrap(ConstantExpr::getFPCast(unwrap<Constant>(ConstantVal), in LLVMConstFPCast()
1789 unwrap(ToType))); in LLVMConstFPCast()
1795 return wrap(ConstantExpr::getSelect(unwrap<Constant>(ConstantCondition), in LLVMConstSelect()
1796 unwrap<Constant>(ConstantIfTrue), in LLVMConstSelect()
1797 unwrap<Constant>(ConstantIfFalse))); in LLVMConstSelect()
1802 return wrap(ConstantExpr::getExtractElement(unwrap<Constant>(VectorConstant), in LLVMConstExtractElement()
1803 unwrap<Constant>(IndexConstant))); in LLVMConstExtractElement()
1809 return wrap(ConstantExpr::getInsertElement(unwrap<Constant>(VectorConstant), in LLVMConstInsertElement()
1810 unwrap<Constant>(ElementValueConstant), in LLVMConstInsertElement()
1811 unwrap<Constant>(IndexConstant))); in LLVMConstInsertElement()
1818 ShuffleVectorInst::getShuffleMask(unwrap<Constant>(MaskConstant), IntMask); in LLVMConstShuffleVector()
1819 return wrap(ConstantExpr::getShuffleVector(unwrap<Constant>(VectorAConstant), in LLVMConstShuffleVector()
1820 unwrap<Constant>(VectorBConstant), in LLVMConstShuffleVector()
1828 return wrap(InlineAsm::get(dyn_cast<FunctionType>(unwrap(Ty)), AsmString, in LLVMConstInlineAsm()
1833 return wrap(BlockAddress::get(unwrap<Function>(F), unwrap(BB))); in LLVMBlockAddress()
1839 return wrap(unwrap<GlobalValue>(Global)->getParent()); in LLVMGetGlobalParent()
1843 return unwrap<GlobalValue>(Global)->isDeclaration(); in LLVMIsDeclaration()
1847 switch (unwrap<GlobalValue>(Global)->getLinkage()) { in LLVMGetLinkage()
1876 GlobalValue *GV = unwrap<GlobalValue>(Global); in LLVMSetLinkage()
1943 return unwrap<GlobalValue>(Global)->getSection().data(); in LLVMGetSection()
1947 unwrap<GlobalObject>(Global)->setSection(Section); in LLVMSetSection()
1952 unwrap<GlobalValue>(Global)->getVisibility()); in LLVMGetVisibility()
1956 unwrap<GlobalValue>(Global) in LLVMSetVisibility()
1962 unwrap<GlobalValue>(Global)->getDLLStorageClass()); in LLVMGetDLLStorageClass()
1966 unwrap<GlobalValue>(Global)->setDLLStorageClass( in LLVMSetDLLStorageClass()
1971 switch (unwrap<GlobalValue>(Global)->getUnnamedAddr()) { in LLVMGetUnnamedAddress()
1983 GlobalValue *GV = unwrap<GlobalValue>(Global); in LLVMSetUnnamedAddress()
1996 return unwrap<GlobalValue>(Global)->hasGlobalUnnamedAddr(); in LLVMHasUnnamedAddr()
2000 unwrap<GlobalValue>(Global)->setUnnamedAddr( in LLVMSetUnnamedAddr()
2006 return wrap(unwrap<GlobalValue>(Global)->getValueType()); in LLVMGlobalGetValueType()
2012 Value *P = unwrap<Value>(V); in LLVMGetAlignment()
2032 Value *P = unwrap<Value>(V); in LLVMSetAlignment()
2055 if (Instruction *Instr = dyn_cast<Instruction>(unwrap(Value))) { in LLVMGlobalCopyAllMetadata()
2058 unwrap<GlobalObject>(Value)->getAllMetadata(Entries); in LLVMGlobalCopyAllMetadata()
2084 unwrap<GlobalObject>(Global)->setMetadata(Kind, unwrap<MDNode>(MD)); in LLVMGlobalSetMetadata()
2088 unwrap<GlobalObject>(Global)->eraseMetadata(Kind); in LLVMGlobalEraseMetadata()
2092 unwrap<GlobalObject>(Global)->clearMetadata(); in LLVMGlobalClearMetadata()
2098 return wrap(new GlobalVariable(*unwrap(M), unwrap(Ty), false, in LLVMAddGlobal()
2105 return wrap(new GlobalVariable(*unwrap(M), unwrap(Ty), false, in LLVMAddGlobalInAddressSpace()
2112 return wrap(unwrap(M)->getNamedGlobal(Name)); in LLVMGetNamedGlobal()
2116 Module *Mod = unwrap(M); in LLVMGetFirstGlobal()
2124 Module *Mod = unwrap(M); in LLVMGetLastGlobal()
2132 GlobalVariable *GV = unwrap<GlobalVariable>(GlobalVar); in LLVMGetNextGlobal()
2140 GlobalVariable *GV = unwrap<GlobalVariable>(GlobalVar); in LLVMGetPreviousGlobal()
2148 unwrap<GlobalVariable>(GlobalVar)->eraseFromParent(); in LLVMDeleteGlobal()
2152 GlobalVariable* GV = unwrap<GlobalVariable>(GlobalVar); in LLVMGetInitializer()
2159 unwrap<GlobalVariable>(GlobalVar) in LLVMSetInitializer()
2160 ->setInitializer(unwrap<Constant>(ConstantVal)); in LLVMSetInitializer()
2164 return unwrap<GlobalVariable>(GlobalVar)->isThreadLocal(); in LLVMIsThreadLocal()
2168 unwrap<GlobalVariable>(GlobalVar)->setThreadLocal(IsThreadLocal != 0); in LLVMSetThreadLocal()
2172 return unwrap<GlobalVariable>(GlobalVar)->isConstant(); in LLVMIsGlobalConstant()
2176 unwrap<GlobalVariable>(GlobalVar)->setConstant(IsConstant != 0); in LLVMSetGlobalConstant()
2180 switch (unwrap<GlobalVariable>(GlobalVar)->getThreadLocalMode()) { in LLVMGetThreadLocalMode()
2197 GlobalVariable *GV = unwrap<GlobalVariable>(GlobalVar); in LLVMSetThreadLocalMode()
2219 return unwrap<GlobalVariable>(GlobalVar)->isExternallyInitialized(); in LLVMIsExternallyInitialized()
2223 unwrap<GlobalVariable>(GlobalVar)->setExternallyInitialized(IsExtInit); in LLVMSetExternallyInitialized()
2230 auto *PTy = cast<PointerType>(unwrap(Ty)); in LLVMAddAlias()
2234 unwrap<Constant>(Aliasee), unwrap(M))); in LLVMAddAlias()
2240 return wrap(GlobalAlias::create(unwrap(ValueTy), AddrSpace, in LLVMAddAlias2()
2242 unwrap<Constant>(Aliasee), unwrap(M))); in LLVMAddAlias2()
2247 return wrap(unwrap(M)->getNamedAlias(StringRef(Name, NameLen))); in LLVMGetNamedGlobalAlias()
2251 Module *Mod = unwrap(M); in LLVMGetFirstGlobalAlias()
2259 Module *Mod = unwrap(M); in LLVMGetLastGlobalAlias()
2267 GlobalAlias *Alias = unwrap<GlobalAlias>(GA); in LLVMGetNextGlobalAlias()
2275 GlobalAlias *Alias = unwrap<GlobalAlias>(GA); in LLVMGetPreviousGlobalAlias()
2283 return wrap(unwrap<GlobalAlias>(Alias)->getAliasee()); in LLVMAliasGetAliasee()
2287 unwrap<GlobalAlias>(Alias)->setAliasee(unwrap<Constant>(Aliasee)); in LLVMAliasSetAliasee()
2294 return wrap(Function::Create(unwrap<FunctionType>(FunctionTy), in LLVMAddFunction()
2295 GlobalValue::ExternalLinkage, Name, unwrap(M))); in LLVMAddFunction()
2299 return wrap(unwrap(M)->getFunction(Name)); in LLVMGetNamedFunction()
2303 Module *Mod = unwrap(M); in LLVMGetFirstFunction()
2311 Module *Mod = unwrap(M); in LLVMGetLastFunction()
2319 Function *Func = unwrap<Function>(Fn); in LLVMGetNextFunction()
2327 Function *Func = unwrap<Function>(Fn); in LLVMGetPreviousFunction()
2335 unwrap<Function>(Fn)->eraseFromParent(); in LLVMDeleteFunction()
2339 return unwrap<Function>(Fn)->hasPersonalityFn(); in LLVMHasPersonalityFn()
2343 return wrap(unwrap<Function>(Fn)->getPersonalityFn()); in LLVMGetPersonalityFn()
2347 unwrap<Function>(Fn)->setPersonalityFn(unwrap<Constant>(PersonalityFn)); in LLVMSetPersonalityFn()
2351 if (Function *F = dyn_cast<Function>(unwrap(Fn))) in LLVMGetIntrinsicID()
2365 ArrayRef<Type*> Tys(unwrap(ParamTypes), ParamCount); in LLVMGetIntrinsicDeclaration()
2367 return wrap(llvm::Intrinsic::getDeclaration(unwrap(Mod), IID, Tys)); in LLVMGetIntrinsicDeclaration()
2380 ArrayRef<Type*> Tys(unwrap(ParamTypes), ParamCount); in LLVMIntrinsicGetType()
2381 return wrap(llvm::Intrinsic::getType(*unwrap(Ctx), IID, Tys)); in LLVMIntrinsicGetType()
2389 ArrayRef<Type*> Tys(unwrap(ParamTypes), ParamCount); in LLVMIntrinsicCopyOverloadedName()
2400 ArrayRef<Type *> Tys(unwrap(ParamTypes), ParamCount); in LLVMIntrinsicCopyOverloadedName2()
2401 auto Str = llvm::Intrinsic::getName(IID, Tys, unwrap(Mod)); in LLVMIntrinsicCopyOverloadedName2()
2416 return unwrap<Function>(Fn)->getCallingConv(); in LLVMGetFunctionCallConv()
2420 return unwrap<Function>(Fn)->setCallingConv( in LLVMSetFunctionCallConv()
2425 Function *F = unwrap<Function>(Fn); in LLVMGetGC()
2430 Function *F = unwrap<Function>(Fn); in LLVMSetGC()
2439 unwrap<Function>(F)->addAttributeAtIndex(Idx, unwrap(A)); in LLVMAddAttributeAtIndex()
2443 auto AS = unwrap<Function>(F)->getAttributes().getAttributes(Idx); in LLVMGetAttributeCountAtIndex()
2449 auto AS = unwrap<Function>(F)->getAttributes().getAttributes(Idx); in LLVMGetAttributesAtIndex()
2457 return wrap(unwrap<Function>(F)->getAttributeAtIndex( in LLVMGetEnumAttributeAtIndex()
2465 unwrap<Function>(F)->getAttributeAtIndex(Idx, StringRef(K, KLen))); in LLVMGetStringAttributeAtIndex()
2470 unwrap<Function>(F)->removeAttributeAtIndex(Idx, (Attribute::AttrKind)KindID); in LLVMRemoveEnumAttributeAtIndex()
2475 unwrap<Function>(F)->removeAttributeAtIndex(Idx, StringRef(K, KLen)); in LLVMRemoveStringAttributeAtIndex()
2480 Function *Func = unwrap<Function>(Fn); in LLVMAddTargetDependentFunctionAttr()
2490 return unwrap<Function>(FnRef)->arg_size(); in LLVMCountParams()
2494 Function *Fn = unwrap<Function>(FnRef); in LLVMGetParams()
2500 Function *Fn = unwrap<Function>(FnRef); in LLVMGetParam()
2505 return wrap(unwrap<Argument>(V)->getParent()); in LLVMGetParamParent()
2509 Function *Func = unwrap<Function>(Fn); in LLVMGetFirstParam()
2517 Function *Func = unwrap<Function>(Fn); in LLVMGetLastParam()
2525 Argument *A = unwrap<Argument>(Arg); in LLVMGetNextParam()
2533 Argument *A = unwrap<Argument>(Arg); in LLVMGetPreviousParam()
2540 Argument *A = unwrap<Argument>(Arg); in LLVMSetParamAlignment()
2550 return wrap(GlobalIFunc::create(unwrap(Ty), AddrSpace, in LLVMAddGlobalIFunc()
2553 unwrap<Constant>(Resolver), unwrap(M))); in LLVMAddGlobalIFunc()
2558 return wrap(unwrap(M)->getNamedIFunc(StringRef(Name, NameLen))); in LLVMGetNamedGlobalIFunc()
2562 Module *Mod = unwrap(M); in LLVMGetFirstGlobalIFunc()
2570 Module *Mod = unwrap(M); in LLVMGetLastGlobalIFunc()
2578 GlobalIFunc *GIF = unwrap<GlobalIFunc>(IFunc); in LLVMGetNextGlobalIFunc()
2586 GlobalIFunc *GIF = unwrap<GlobalIFunc>(IFunc); in LLVMGetPreviousGlobalIFunc()
2594 return wrap(unwrap<GlobalIFunc>(IFunc)->getResolver()); in LLVMGetGlobalIFuncResolver()
2598 unwrap<GlobalIFunc>(IFunc)->setResolver(unwrap<Constant>(Resolver)); in LLVMSetGlobalIFuncResolver()
2602 unwrap<GlobalIFunc>(IFunc)->eraseFromParent(); in LLVMEraseGlobalIFunc()
2606 unwrap<GlobalIFunc>(IFunc)->removeFromParent(); in LLVMRemoveGlobalIFunc()
2612 return wrap(static_cast<Value*>(unwrap(BB))); in LLVMBasicBlockAsValue()
2616 return isa<BasicBlock>(unwrap(Val)); in LLVMValueIsBasicBlock()
2620 return wrap(unwrap<BasicBlock>(Val)); in LLVMValueAsBasicBlock()
2624 return unwrap(BB)->getName().data(); in LLVMGetBasicBlockName()
2628 return wrap(unwrap(BB)->getParent()); in LLVMGetBasicBlockParent()
2632 return wrap(unwrap(BB)->getTerminator()); in LLVMGetBasicBlockTerminator()
2636 return unwrap<Function>(FnRef)->size(); in LLVMCountBasicBlocks()
2640 Function *Fn = unwrap<Function>(FnRef); in LLVMGetBasicBlocks()
2646 return wrap(&unwrap<Function>(Fn)->getEntryBlock()); in LLVMGetEntryBasicBlock()
2650 Function *Func = unwrap<Function>(Fn); in LLVMGetFirstBasicBlock()
2658 Function *Func = unwrap<Function>(Fn); in LLVMGetLastBasicBlock()
2666 BasicBlock *Block = unwrap(BB); in LLVMGetNextBasicBlock()
2674 BasicBlock *Block = unwrap(BB); in LLVMGetPreviousBasicBlock()
2683 return wrap(llvm::BasicBlock::Create(*unwrap(C), Name)); in LLVMCreateBasicBlockInContext()
2688 BasicBlock *ToInsert = unwrap(BB); in LLVMInsertExistingBasicBlockAfterInsertBlock()
2689 BasicBlock *CurBB = unwrap(Builder)->GetInsertBlock(); in LLVMInsertExistingBasicBlockAfterInsertBlock()
2697 unwrap<Function>(Fn)->getBasicBlockList().push_back(unwrap(BB)); in LLVMAppendExistingBasicBlock()
2703 return wrap(BasicBlock::Create(*unwrap(C), Name, unwrap<Function>(FnRef))); in LLVMAppendBasicBlockInContext()
2713 BasicBlock *BB = unwrap(BBRef); in LLVMInsertBasicBlockInContext()
2714 return wrap(BasicBlock::Create(*unwrap(C), Name, BB->getParent(), BB)); in LLVMInsertBasicBlockInContext()
2723 unwrap(BBRef)->eraseFromParent(); in LLVMDeleteBasicBlock()
2727 unwrap(BBRef)->removeFromParent(); in LLVMRemoveBasicBlockFromParent()
2731 unwrap(BB)->moveBefore(unwrap(MovePos)); in LLVMMoveBasicBlockBefore()
2735 unwrap(BB)->moveAfter(unwrap(MovePos)); in LLVMMoveBasicBlockAfter()
2741 return wrap(unwrap<Instruction>(Inst)->getParent()); in LLVMGetInstructionParent()
2745 BasicBlock *Block = unwrap(BB); in LLVMGetFirstInstruction()
2753 BasicBlock *Block = unwrap(BB); in LLVMGetLastInstruction()
2761 Instruction *Instr = unwrap<Instruction>(Inst); in LLVMGetNextInstruction()
2769 Instruction *Instr = unwrap<Instruction>(Inst); in LLVMGetPreviousInstruction()
2777 unwrap<Instruction>(Inst)->removeFromParent(); in LLVMInstructionRemoveFromParent()
2781 unwrap<Instruction>(Inst)->eraseFromParent(); in LLVMInstructionEraseFromParent()
2785 unwrap<Instruction>(Inst)->deleteValue(); in LLVMDeleteInstruction()
2789 if (ICmpInst *I = dyn_cast<ICmpInst>(unwrap(Inst))) in LLVMGetICmpPredicate()
2791 if (ConstantExpr *CE = dyn_cast<ConstantExpr>(unwrap(Inst))) in LLVMGetICmpPredicate()
2798 if (FCmpInst *I = dyn_cast<FCmpInst>(unwrap(Inst))) in LLVMGetFCmpPredicate()
2800 if (ConstantExpr *CE = dyn_cast<ConstantExpr>(unwrap(Inst))) in LLVMGetFCmpPredicate()
2807 if (Instruction *C = dyn_cast<Instruction>(unwrap(Inst))) in LLVMGetInstructionOpcode()
2813 if (Instruction *C = dyn_cast<Instruction>(unwrap(Inst))) in LLVMInstructionClone()
2819 Instruction *I = dyn_cast<Instruction>(unwrap(Inst)); in LLVMIsATerminatorInst()
2824 if (FuncletPadInst *FPI = dyn_cast<FuncletPadInst>(unwrap(Instr))) { in LLVMGetNumArgOperands()
2827 return unwrap<CallBase>(Instr)->arg_size(); in LLVMGetNumArgOperands()
2833 return unwrap<CallBase>(Instr)->getCallingConv(); in LLVMGetInstructionCallConv()
2837 return unwrap<CallBase>(Instr)->setCallingConv( in LLVMSetInstructionCallConv()
2843 auto *Call = unwrap<CallBase>(Instr); in LLVMSetInstrParamAlignment()
2851 unwrap<CallBase>(C)->addAttributeAtIndex(Idx, unwrap(A)); in LLVMAddCallSiteAttribute()
2856 auto *Call = unwrap<CallBase>(C); in LLVMGetCallSiteAttributeCount()
2863 auto *Call = unwrap<CallBase>(C); in LLVMGetCallSiteAttributes()
2872 return wrap(unwrap<CallBase>(C)->getAttributeAtIndex( in LLVMGetCallSiteEnumAttribute()
2880 unwrap<CallBase>(C)->getAttributeAtIndex(Idx, StringRef(K, KLen))); in LLVMGetCallSiteStringAttribute()
2885 unwrap<CallBase>(C)->removeAttributeAtIndex(Idx, (Attribute::AttrKind)KindID); in LLVMRemoveCallSiteEnumAttribute()
2890 unwrap<CallBase>(C)->removeAttributeAtIndex(Idx, StringRef(K, KLen)); in LLVMRemoveCallSiteStringAttribute()
2894 return wrap(unwrap<CallBase>(Instr)->getCalledOperand()); in LLVMGetCalledValue()
2898 return wrap(unwrap<CallBase>(Instr)->getFunctionType()); in LLVMGetCalledFunctionType()
2904 return unwrap<CallInst>(Call)->isTailCall(); in LLVMIsTailCall()
2908 unwrap<CallInst>(Call)->setTailCall(isTailCall); in LLVMSetTailCall()
2914 return wrap(unwrap<InvokeInst>(Invoke)->getNormalDest()); in LLVMGetNormalDest()
2918 if (CleanupReturnInst *CRI = dyn_cast<CleanupReturnInst>(unwrap(Invoke))) { in LLVMGetUnwindDest()
2920 } else if (CatchSwitchInst *CSI = dyn_cast<CatchSwitchInst>(unwrap(Invoke))) { in LLVMGetUnwindDest()
2923 return wrap(unwrap<InvokeInst>(Invoke)->getUnwindDest()); in LLVMGetUnwindDest()
2927 unwrap<InvokeInst>(Invoke)->setNormalDest(unwrap(B)); in LLVMSetNormalDest()
2931 if (CleanupReturnInst *CRI = dyn_cast<CleanupReturnInst>(unwrap(Invoke))) { in LLVMSetUnwindDest()
2932 return CRI->setUnwindDest(unwrap(B)); in LLVMSetUnwindDest()
2933 } else if (CatchSwitchInst *CSI = dyn_cast<CatchSwitchInst>(unwrap(Invoke))) { in LLVMSetUnwindDest()
2934 return CSI->setUnwindDest(unwrap(B)); in LLVMSetUnwindDest()
2936 unwrap<InvokeInst>(Invoke)->setUnwindDest(unwrap(B)); in LLVMSetUnwindDest()
2942 return unwrap<Instruction>(Term)->getNumSuccessors(); in LLVMGetNumSuccessors()
2946 return wrap(unwrap<Instruction>(Term)->getSuccessor(i)); in LLVMGetSuccessor()
2950 return unwrap<Instruction>(Term)->setSuccessor(i, unwrap(block)); in LLVMSetSuccessor()
2956 return unwrap<BranchInst>(Branch)->isConditional(); in LLVMIsConditional()
2960 return wrap(unwrap<BranchInst>(Branch)->getCondition()); in LLVMGetCondition()
2964 return unwrap<BranchInst>(Branch)->setCondition(unwrap(Cond)); in LLVMSetCondition()
2970 return wrap(unwrap<SwitchInst>(Switch)->getDefaultDest()); in LLVMGetSwitchDefaultDest()
2976 return wrap(unwrap<AllocaInst>(Alloca)->getAllocatedType()); in LLVMGetAllocatedType()
2982 return unwrap<GEPOperator>(GEP)->isInBounds(); in LLVMIsInBounds()
2986 return unwrap<GetElementPtrInst>(GEP)->setIsInBounds(InBounds); in LLVMSetIsInBounds()
2990 return wrap(unwrap<GEPOperator>(GEP)->getSourceElementType()); in LLVMGetGEPSourceElementType()
2997 PHINode *PhiVal = unwrap<PHINode>(PhiNode); in LLVMAddIncoming()
2999 PhiVal->addIncoming(unwrap(IncomingValues[I]), unwrap(IncomingBlocks[I])); in LLVMAddIncoming()
3003 return unwrap<PHINode>(PhiNode)->getNumIncomingValues(); in LLVMCountIncoming()
3007 return wrap(unwrap<PHINode>(PhiNode)->getIncomingValue(Index)); in LLVMGetIncomingValue()
3011 return wrap(unwrap<PHINode>(PhiNode)->getIncomingBlock(Index)); in LLVMGetIncomingBlock()
3017 auto *I = unwrap(Inst); in LLVMGetNumIndices()
3029 auto *I = unwrap(Inst); in LLVMGetIndices()
3042 return wrap(new IRBuilder<>(*unwrap(C))); in LLVMCreateBuilderInContext()
3051 BasicBlock *BB = unwrap(Block); in LLVMPositionBuilder()
3052 auto I = Instr ? unwrap<Instruction>(Instr)->getIterator() : BB->end(); in LLVMPositionBuilder()
3053 unwrap(Builder)->SetInsertPoint(BB, I); in LLVMPositionBuilder()
3057 Instruction *I = unwrap<Instruction>(Instr); in LLVMPositionBuilderBefore()
3058 unwrap(Builder)->SetInsertPoint(I->getParent(), I->getIterator()); in LLVMPositionBuilderBefore()
3062 BasicBlock *BB = unwrap(Block); in LLVMPositionBuilderAtEnd()
3063 unwrap(Builder)->SetInsertPoint(BB); in LLVMPositionBuilderAtEnd()
3067 return wrap(unwrap(Builder)->GetInsertBlock()); in LLVMGetInsertBlock()
3071 unwrap(Builder)->ClearInsertionPoint(); in LLVMClearInsertionPosition()
3075 unwrap(Builder)->Insert(unwrap<Instruction>(Instr)); in LLVMInsertIntoBuilder()
3080 unwrap(Builder)->Insert(unwrap<Instruction>(Instr), Name); in LLVMInsertIntoBuilderWithName()
3084 delete unwrap(Builder); in LLVMDisposeBuilder()
3090 return wrap(unwrap(Builder)->getCurrentDebugLocation().getAsMDNode()); in LLVMGetCurrentDebugLocation2()
3095 unwrap(Builder)->SetCurrentDebugLocation(DebugLoc(unwrap<MDNode>(Loc))); in LLVMSetCurrentDebugLocation2()
3097 unwrap(Builder)->SetCurrentDebugLocation(DebugLoc()); in LLVMSetCurrentDebugLocation2()
3102 L ? cast<MDNode>(unwrap<MetadataAsValue>(L)->getMetadata()) : nullptr; in LLVMSetCurrentDebugLocation()
3103 unwrap(Builder)->SetCurrentDebugLocation(DebugLoc(Loc)); in LLVMSetCurrentDebugLocation()
3107 LLVMContext &Context = unwrap(Builder)->getContext(); in LLVMGetCurrentDebugLocation()
3109 Context, unwrap(Builder)->getCurrentDebugLocation().getAsMDNode())); in LLVMGetCurrentDebugLocation()
3113 unwrap(Builder)->SetInstDebugLocation(unwrap<Instruction>(Inst)); in LLVMSetInstDebugLocation()
3117 unwrap(Builder)->AddMetadataToInst(unwrap<Instruction>(Inst)); in LLVMAddMetadataToInst()
3123 unwrap(Builder)->setDefaultFPMathTag(FPMathTag in LLVMBuilderSetDefaultFPMathTag()
3124 ? unwrap<MDNode>(FPMathTag) in LLVMBuilderSetDefaultFPMathTag()
3129 return wrap(unwrap(Builder)->getDefaultFPMathTag()); in LLVMBuilderGetDefaultFPMathTag()
3135 return wrap(unwrap(B)->CreateRetVoid()); in LLVMBuildRetVoid()
3139 return wrap(unwrap(B)->CreateRet(unwrap(V))); in LLVMBuildRet()
3144 return wrap(unwrap(B)->CreateAggregateRet(unwrap(RetVals), N)); in LLVMBuildAggregateRet()
3148 return wrap(unwrap(B)->CreateBr(unwrap(Dest))); in LLVMBuildBr()
3153 return wrap(unwrap(B)->CreateCondBr(unwrap(If), unwrap(Then), unwrap(Else))); in LLVMBuildCondBr()
3158 return wrap(unwrap(B)->CreateSwitch(unwrap(V), unwrap(Else), NumCases)); in LLVMBuildSwitch()
3163 return wrap(unwrap(B)->CreateIndirectBr(unwrap(Addr), NumDests)); in LLVMBuildIndirectBr()
3170 Value *V = unwrap(Fn); in LLVMBuildInvoke()
3175 unwrap(B)->CreateInvoke(FnT, unwrap(Fn), unwrap(Then), unwrap(Catch), in LLVMBuildInvoke()
3176 makeArrayRef(unwrap(Args), NumArgs), Name)); in LLVMBuildInvoke()
3183 return wrap(unwrap(B)->CreateInvoke( in LLVMBuildInvoke2()
3184 unwrap<FunctionType>(Ty), unwrap(Fn), unwrap(Then), unwrap(Catch), in LLVMBuildInvoke2()
3185 makeArrayRef(unwrap(Args), NumArgs), Name)); in LLVMBuildInvoke2()
3195 unwrap(B)->GetInsertBlock()->getParent()->setPersonalityFn( in LLVMBuildLandingPad()
3196 cast<Function>(unwrap(PersFn))); in LLVMBuildLandingPad()
3197 return wrap(unwrap(B)->CreateLandingPad(unwrap(Ty), NumClauses, Name)); in LLVMBuildLandingPad()
3203 return wrap(unwrap(B)->CreateCatchPad(unwrap(ParentPad), in LLVMBuildCatchPad()
3204 makeArrayRef(unwrap(Args), NumArgs), in LLVMBuildCatchPad()
3212 Type *Ty = Type::getTokenTy(unwrap(B)->getContext()); in LLVMBuildCleanupPad()
3215 return wrap(unwrap(B)->CreateCleanupPad(unwrap(ParentPad), in LLVMBuildCleanupPad()
3216 makeArrayRef(unwrap(Args), NumArgs), in LLVMBuildCleanupPad()
3221 return wrap(unwrap(B)->CreateResume(unwrap(Exn))); in LLVMBuildResume()
3228 Type *Ty = Type::getTokenTy(unwrap(B)->getContext()); in LLVMBuildCatchSwitch()
3231 return wrap(unwrap(B)->CreateCatchSwitch(unwrap(ParentPad), unwrap(UnwindBB), in LLVMBuildCatchSwitch()
3237 return wrap(unwrap(B)->CreateCatchRet(unwrap<CatchPadInst>(CatchPad), in LLVMBuildCatchRet()
3238 unwrap(BB))); in LLVMBuildCatchRet()
3243 return wrap(unwrap(B)->CreateCleanupRet(unwrap<CleanupPadInst>(CatchPad), in LLVMBuildCleanupRet()
3244 unwrap(BB))); in LLVMBuildCleanupRet()
3248 return wrap(unwrap(B)->CreateUnreachable()); in LLVMBuildUnreachable()
3253 unwrap<SwitchInst>(Switch)->addCase(unwrap<ConstantInt>(OnVal), unwrap(Dest)); in LLVMAddCase()
3257 unwrap<IndirectBrInst>(IndirectBr)->addDestination(unwrap(Dest)); in LLVMAddDestination()
3261 return unwrap<LandingPadInst>(LandingPad)->getNumClauses(); in LLVMGetNumClauses()
3265 return wrap(unwrap<LandingPadInst>(LandingPad)->getClause(Idx)); in LLVMGetClause()
3269 unwrap<LandingPadInst>(LandingPad)-> in LLVMAddClause()
3270 addClause(cast<Constant>(unwrap(ClauseVal))); in LLVMAddClause()
3274 return unwrap<LandingPadInst>(LandingPad)->isCleanup(); in LLVMIsCleanup()
3278 unwrap<LandingPadInst>(LandingPad)->setCleanup(Val); in LLVMSetCleanup()
3282 unwrap<CatchSwitchInst>(CatchSwitch)->addHandler(unwrap(Dest)); in LLVMAddHandler()
3286 return unwrap<CatchSwitchInst>(CatchSwitch)->getNumHandlers(); in LLVMGetNumHandlers()
3290 CatchSwitchInst *CSI = unwrap<CatchSwitchInst>(CatchSwitch); in LLVMGetHandlers()
3296 return wrap(unwrap<CatchPadInst>(CatchPad)->getCatchSwitch()); in LLVMGetParentCatchSwitch()
3300 unwrap<CatchPadInst>(CatchPad) in LLVMSetParentCatchSwitch()
3301 ->setCatchSwitch(unwrap<CatchSwitchInst>(CatchSwitch)); in LLVMSetParentCatchSwitch()
3307 return wrap(unwrap<FuncletPadInst>(Funclet)->getArgOperand(i)); in LLVMGetArgOperand()
3311 unwrap<FuncletPadInst>(Funclet)->setArgOperand(i, unwrap(value)); in LLVMSetArgOperand()
3318 return wrap(unwrap(B)->CreateAdd(unwrap(LHS), unwrap(RHS), Name)); in LLVMBuildAdd()
3323 return wrap(unwrap(B)->CreateNSWAdd(unwrap(LHS), unwrap(RHS), Name)); in LLVMBuildNSWAdd()
3328 return wrap(unwrap(B)->CreateNUWAdd(unwrap(LHS), unwrap(RHS), Name)); in LLVMBuildNUWAdd()
3333 return wrap(unwrap(B)->CreateFAdd(unwrap(LHS), unwrap(RHS), Name)); in LLVMBuildFAdd()
3338 return wrap(unwrap(B)->CreateSub(unwrap(LHS), unwrap(RHS), Name)); in LLVMBuildSub()
3343 return wrap(unwrap(B)->CreateNSWSub(unwrap(LHS), unwrap(RHS), Name)); in LLVMBuildNSWSub()
3348 return wrap(unwrap(B)->CreateNUWSub(unwrap(LHS), unwrap(RHS), Name)); in LLVMBuildNUWSub()
3353 return wrap(unwrap(B)->CreateFSub(unwrap(LHS), unwrap(RHS), Name)); in LLVMBuildFSub()
3358 return wrap(unwrap(B)->CreateMul(unwrap(LHS), unwrap(RHS), Name)); in LLVMBuildMul()
3363 return wrap(unwrap(B)->CreateNSWMul(unwrap(LHS), unwrap(RHS), Name)); in LLVMBuildNSWMul()
3368 return wrap(unwrap(B)->CreateNUWMul(unwrap(LHS), unwrap(RHS), Name)); in LLVMBuildNUWMul()
3373 return wrap(unwrap(B)->CreateFMul(unwrap(LHS), unwrap(RHS), Name)); in LLVMBuildFMul()
3378 return wrap(unwrap(B)->CreateUDiv(unwrap(LHS), unwrap(RHS), Name)); in LLVMBuildUDiv()
3383 return wrap(unwrap(B)->CreateExactUDiv(unwrap(LHS), unwrap(RHS), Name)); in LLVMBuildExactUDiv()
3388 return wrap(unwrap(B)->CreateSDiv(unwrap(LHS), unwrap(RHS), Name)); in LLVMBuildSDiv()
3393 return wrap(unwrap(B)->CreateExactSDiv(unwrap(LHS), unwrap(RHS), Name)); in LLVMBuildExactSDiv()
3398 return wrap(unwrap(B)->CreateFDiv(unwrap(LHS), unwrap(RHS), Name)); in LLVMBuildFDiv()
3403 return wrap(unwrap(B)->CreateURem(unwrap(LHS), unwrap(RHS), Name)); in LLVMBuildURem()
3408 return wrap(unwrap(B)->CreateSRem(unwrap(LHS), unwrap(RHS), Name)); in LLVMBuildSRem()
3413 return wrap(unwrap(B)->CreateFRem(unwrap(LHS), unwrap(RHS), Name)); in LLVMBuildFRem()
3418 return wrap(unwrap(B)->CreateShl(unwrap(LHS), unwrap(RHS), Name)); in LLVMBuildShl()
3423 return wrap(unwrap(B)->CreateLShr(unwrap(LHS), unwrap(RHS), Name)); in LLVMBuildLShr()
3428 return wrap(unwrap(B)->CreateAShr(unwrap(LHS), unwrap(RHS), Name)); in LLVMBuildAShr()
3433 return wrap(unwrap(B)->CreateAnd(unwrap(LHS), unwrap(RHS), Name)); in LLVMBuildAnd()
3438 return wrap(unwrap(B)->CreateOr(unwrap(LHS), unwrap(RHS), Name)); in LLVMBuildOr()
3443 return wrap(unwrap(B)->CreateXor(unwrap(LHS), unwrap(RHS), Name)); in LLVMBuildXor()
3449 return wrap(unwrap(B)->CreateBinOp(Instruction::BinaryOps(map_from_llvmopcode(Op)), unwrap(LHS), in LLVMBuildBinOp()
3450 unwrap(RHS), Name)); in LLVMBuildBinOp()
3454 return wrap(unwrap(B)->CreateNeg(unwrap(V), Name)); in LLVMBuildNeg()
3459 return wrap(unwrap(B)->CreateNSWNeg(unwrap(V), Name)); in LLVMBuildNSWNeg()
3464 return wrap(unwrap(B)->CreateNUWNeg(unwrap(V), Name)); in LLVMBuildNUWNeg()
3468 return wrap(unwrap(B)->CreateFNeg(unwrap(V), Name)); in LLVMBuildFNeg()
3472 return wrap(unwrap(B)->CreateNot(unwrap(V), Name)); in LLVMBuildNot()
3479 Type* ITy = Type::getInt32Ty(unwrap(B)->GetInsertBlock()->getContext()); in LLVMBuildMalloc()
3480 Constant* AllocSize = ConstantExpr::getSizeOf(unwrap(Ty)); in LLVMBuildMalloc()
3482 Instruction* Malloc = CallInst::CreateMalloc(unwrap(B)->GetInsertBlock(), in LLVMBuildMalloc()
3483 ITy, unwrap(Ty), AllocSize, in LLVMBuildMalloc()
3485 return wrap(unwrap(B)->Insert(Malloc, Twine(Name))); in LLVMBuildMalloc()
3490 Type* ITy = Type::getInt32Ty(unwrap(B)->GetInsertBlock()->getContext()); in LLVMBuildArrayMalloc()
3491 Constant* AllocSize = ConstantExpr::getSizeOf(unwrap(Ty)); in LLVMBuildArrayMalloc()
3493 Instruction* Malloc = CallInst::CreateMalloc(unwrap(B)->GetInsertBlock(), in LLVMBuildArrayMalloc()
3494 ITy, unwrap(Ty), AllocSize, in LLVMBuildArrayMalloc()
3495 unwrap(Val), nullptr, ""); in LLVMBuildArrayMalloc()
3496 return wrap(unwrap(B)->Insert(Malloc, Twine(Name))); in LLVMBuildArrayMalloc()
3502 return wrap(unwrap(B)->CreateMemSet(unwrap(Ptr), unwrap(Val), unwrap(Len), in LLVMBuildMemSet()
3510 return wrap(unwrap(B)->CreateMemCpy(unwrap(Dst), MaybeAlign(DstAlign), in LLVMBuildMemCpy()
3511 unwrap(Src), MaybeAlign(SrcAlign), in LLVMBuildMemCpy()
3512 unwrap(Size))); in LLVMBuildMemCpy()
3519 return wrap(unwrap(B)->CreateMemMove(unwrap(Dst), MaybeAlign(DstAlign), in LLVMBuildMemMove()
3520 unwrap(Src), MaybeAlign(SrcAlign), in LLVMBuildMemMove()
3521 unwrap(Size))); in LLVMBuildMemMove()
3526 return wrap(unwrap(B)->CreateAlloca(unwrap(Ty), nullptr, Name)); in LLVMBuildAlloca()
3531 return wrap(unwrap(B)->CreateAlloca(unwrap(Ty), unwrap(Val), Name)); in LLVMBuildArrayAlloca()
3535 return wrap(unwrap(B)->Insert( in LLVMBuildFree()
3536 CallInst::CreateFree(unwrap(PointerVal), unwrap(B)->GetInsertBlock()))); in LLVMBuildFree()
3541 Value *V = unwrap(PointerVal); in LLVMBuildLoad()
3545 unwrap(B)->CreateLoad(Ty->getNonOpaquePointerElementType(), V, Name)); in LLVMBuildLoad()
3550 return wrap(unwrap(B)->CreateLoad(unwrap(Ty), unwrap(PointerVal), Name)); in LLVMBuildLoad2()
3555 return wrap(unwrap(B)->CreateStore(unwrap(Val), unwrap(PointerVal))); in LLVMBuildStore()
3640 unwrap(B)->CreateFence(mapFromLLVMOrdering(Ordering), in LLVMBuildFence()
3649 ArrayRef<Value *> IdxList(unwrap(Indices), NumIndices); in LLVMBuildGEP()
3650 Value *Val = unwrap(Pointer); in LLVMBuildGEP()
3652 return wrap(unwrap(B)->CreateGEP(Ty, Val, IdxList, Name)); in LLVMBuildGEP()
3658 ArrayRef<Value *> IdxList(unwrap(Indices), NumIndices); in LLVMBuildGEP2()
3659 return wrap(unwrap(B)->CreateGEP(unwrap(Ty), unwrap(Pointer), IdxList, Name)); in LLVMBuildGEP2()
3665 ArrayRef<Value *> IdxList(unwrap(Indices), NumIndices); in LLVMBuildInBoundsGEP()
3666 Value *Val = unwrap(Pointer); in LLVMBuildInBoundsGEP()
3668 return wrap(unwrap(B)->CreateInBoundsGEP(Ty, Val, IdxList, Name)); in LLVMBuildInBoundsGEP()
3674 ArrayRef<Value *> IdxList(unwrap(Indices), NumIndices); in LLVMBuildInBoundsGEP2()
3676 unwrap(B)->CreateInBoundsGEP(unwrap(Ty), unwrap(Pointer), IdxList, Name)); in LLVMBuildInBoundsGEP2()
3681 Value *Val = unwrap(Pointer); in LLVMBuildStructGEP()
3683 return wrap(unwrap(B)->CreateStructGEP(Ty, Val, Idx, Name)); in LLVMBuildStructGEP()
3690 unwrap(B)->CreateStructGEP(unwrap(Ty), unwrap(Pointer), Idx, Name)); in LLVMBuildStructGEP2()
3695 return wrap(unwrap(B)->CreateGlobalString(Str, Name)); in LLVMBuildGlobalString()
3700 return wrap(unwrap(B)->CreateGlobalStringPtr(Str, Name)); in LLVMBuildGlobalStringPtr()
3704 Value *P = unwrap<Value>(MemAccessInst); in LLVMGetVolatile()
3715 Value *P = unwrap<Value>(MemAccessInst); in LLVMSetVolatile()
3726 return unwrap<AtomicCmpXchgInst>(CmpXchgInst)->isWeak(); in LLVMGetWeak()
3730 return unwrap<AtomicCmpXchgInst>(CmpXchgInst)->setWeak(isWeak); in LLVMSetWeak()
3734 Value *P = unwrap<Value>(MemAccessInst); in LLVMGetOrdering()
3746 Value *P = unwrap<Value>(MemAccessInst); in LLVMSetOrdering()
3755 return mapToLLVMRMWBinOp(unwrap<AtomicRMWInst>(Inst)->getOperation()); in LLVMGetAtomicRMWBinOp()
3759 unwrap<AtomicRMWInst>(Inst)->setOperation(mapFromLLVMRMWBinOp(BinOp)); in LLVMSetAtomicRMWBinOp()
3766 return wrap(unwrap(B)->CreateTrunc(unwrap(Val), unwrap(DestTy), Name)); in LLVMBuildTrunc()
3771 return wrap(unwrap(B)->CreateZExt(unwrap(Val), unwrap(DestTy), Name)); in LLVMBuildZExt()
3776 return wrap(unwrap(B)->CreateSExt(unwrap(Val), unwrap(DestTy), Name)); in LLVMBuildSExt()
3781 return wrap(unwrap(B)->CreateFPToUI(unwrap(Val), unwrap(DestTy), Name)); in LLVMBuildFPToUI()
3786 return wrap(unwrap(B)->CreateFPToSI(unwrap(Val), unwrap(DestTy), Name)); in LLVMBuildFPToSI()
3791 return wrap(unwrap(B)->CreateUIToFP(unwrap(Val), unwrap(DestTy), Name)); in LLVMBuildUIToFP()
3796 return wrap(unwrap(B)->CreateSIToFP(unwrap(Val), unwrap(DestTy), Name)); in LLVMBuildSIToFP()
3801 return wrap(unwrap(B)->CreateFPTrunc(unwrap(Val), unwrap(DestTy), Name)); in LLVMBuildFPTrunc()
3806 return wrap(unwrap(B)->CreateFPExt(unwrap(Val), unwrap(DestTy), Name)); in LLVMBuildFPExt()
3811 return wrap(unwrap(B)->CreatePtrToInt(unwrap(Val), unwrap(DestTy), Name)); in LLVMBuildPtrToInt()
3816 return wrap(unwrap(B)->CreateIntToPtr(unwrap(Val), unwrap(DestTy), Name)); in LLVMBuildIntToPtr()
3821 return wrap(unwrap(B)->CreateBitCast(unwrap(Val), unwrap(DestTy), Name)); in LLVMBuildBitCast()
3826 return wrap(unwrap(B)->CreateAddrSpaceCast(unwrap(Val), unwrap(DestTy), Name)); in LLVMBuildAddrSpaceCast()
3831 return wrap(unwrap(B)->CreateZExtOrBitCast(unwrap(Val), unwrap(DestTy), in LLVMBuildZExtOrBitCast()
3837 return wrap(unwrap(B)->CreateSExtOrBitCast(unwrap(Val), unwrap(DestTy), in LLVMBuildSExtOrBitCast()
3843 return wrap(unwrap(B)->CreateTruncOrBitCast(unwrap(Val), unwrap(DestTy), in LLVMBuildTruncOrBitCast()
3849 return wrap(unwrap(B)->CreateCast(Instruction::CastOps(map_from_llvmopcode(Op)), unwrap(Val), in LLVMBuildCast()
3850 unwrap(DestTy), Name)); in LLVMBuildCast()
3855 return wrap(unwrap(B)->CreatePointerCast(unwrap(Val), unwrap(DestTy), Name)); in LLVMBuildPointerCast()
3862 unwrap(B)->CreateIntCast(unwrap(Val), unwrap(DestTy), IsSigned, Name)); in LLVMBuildIntCast2()
3867 return wrap(unwrap(B)->CreateIntCast(unwrap(Val), unwrap(DestTy), in LLVMBuildIntCast()
3873 return wrap(unwrap(B)->CreateFPCast(unwrap(Val), unwrap(DestTy), Name)); in LLVMBuildFPCast()
3879 unwrap(Src), SrcIsSigned, unwrap(DestTy), DestIsSigned)); in LLVMGetCastOpcode()
3887 return wrap(unwrap(B)->CreateICmp(static_cast<ICmpInst::Predicate>(Op), in LLVMBuildICmp()
3888 unwrap(LHS), unwrap(RHS), Name)); in LLVMBuildICmp()
3894 return wrap(unwrap(B)->CreateFCmp(static_cast<FCmpInst::Predicate>(Op), in LLVMBuildFCmp()
3895 unwrap(LHS), unwrap(RHS), Name)); in LLVMBuildFCmp()
3901 return wrap(unwrap(B)->CreatePHI(unwrap(Ty), 0, Name)); in LLVMBuildPhi()
3907 Value *V = unwrap(Fn); in LLVMBuildCall()
3911 return wrap(unwrap(B)->CreateCall(FnT, unwrap(Fn), in LLVMBuildCall()
3912 makeArrayRef(unwrap(Args), NumArgs), Name)); in LLVMBuildCall()
3918 FunctionType *FTy = unwrap<FunctionType>(Ty); in LLVMBuildCall2()
3919 return wrap(unwrap(B)->CreateCall(FTy, unwrap(Fn), in LLVMBuildCall2()
3920 makeArrayRef(unwrap(Args), NumArgs), Name)); in LLVMBuildCall2()
3926 return wrap(unwrap(B)->CreateSelect(unwrap(If), unwrap(Then), unwrap(Else), in LLVMBuildSelect()
3932 return wrap(unwrap(B)->CreateVAArg(unwrap(List), unwrap(Ty), Name)); in LLVMBuildVAArg()
3937 return wrap(unwrap(B)->CreateExtractElement(unwrap(VecVal), unwrap(Index), in LLVMBuildExtractElement()
3944 return wrap(unwrap(B)->CreateInsertElement(unwrap(VecVal), unwrap(EltVal), in LLVMBuildInsertElement()
3945 unwrap(Index), Name)); in LLVMBuildInsertElement()
3951 return wrap(unwrap(B)->CreateShuffleVector(unwrap(V1), unwrap(V2), in LLVMBuildShuffleVector()
3952 unwrap(Mask), Name)); in LLVMBuildShuffleVector()
3957 return wrap(unwrap(B)->CreateExtractValue(unwrap(AggVal), Index, Name)); in LLVMBuildExtractValue()
3963 return wrap(unwrap(B)->CreateInsertValue(unwrap(AggVal), unwrap(EltVal), in LLVMBuildInsertValue()
3969 return wrap(unwrap(B)->CreateFreeze(unwrap(Val), Name)); in LLVMBuildFreeze()
3974 return wrap(unwrap(B)->CreateIsNull(unwrap(Val), Name)); in LLVMBuildIsNull()
3979 return wrap(unwrap(B)->CreateIsNotNull(unwrap(Val), Name)); in LLVMBuildIsNotNull()
3984 Value *L = unwrap(LHS); in LLVMBuildPtrDiff()
3986 return wrap(unwrap(B)->CreatePtrDiff(ElemTy, L, unwrap(RHS), Name)); in LLVMBuildPtrDiff()
3992 return wrap(unwrap(B)->CreatePtrDiff(unwrap(ElemTy), unwrap(LHS), in LLVMBuildPtrDiff2()
3993 unwrap(RHS), Name)); in LLVMBuildPtrDiff2()
4001 return wrap(unwrap(B)->CreateAtomicRMW( in LLVMBuildAtomicRMW()
4002 intop, unwrap(PTR), unwrap(Val), MaybeAlign(), in LLVMBuildAtomicRMW()
4013 return wrap(unwrap(B)->CreateAtomicCmpXchg( in LLVMBuildAtomicCmpXchg()
4014 unwrap(Ptr), unwrap(Cmp), unwrap(New), MaybeAlign(), in LLVMBuildAtomicCmpXchg()
4021 Value *P = unwrap<Value>(SVInst); in LLVMGetNumMaskElements()
4027 Value *P = unwrap<Value>(SVInst); in LLVMGetMaskValue()
4035 Value *P = unwrap<Value>(AtomicInst); in LLVMIsAtomicSingleThread()
4044 Value *P = unwrap<Value>(AtomicInst); in LLVMSetAtomicSingleThread()
4053 Value *P = unwrap<Value>(CmpXchgInst); in LLVMGetCmpXchgSuccessOrdering()
4059 Value *P = unwrap<Value>(CmpXchgInst); in LLVMSetCmpXchgSuccessOrdering()
4066 Value *P = unwrap<Value>(CmpXchgInst); in LLVMGetCmpXchgFailureOrdering()
4072 Value *P = unwrap<Value>(CmpXchgInst); in LLVMSetCmpXchgFailureOrdering()
4086 delete unwrap(MP); in LLVMDisposeModuleProvider()
4139 return unwrap(MemBuf)->getBufferStart(); in LLVMGetBufferStart()
4143 return unwrap(MemBuf)->getBufferSize(); in LLVMGetBufferSize()
4147 delete unwrap(MemBuf); in LLVMDisposeMemoryBuffer()
4163 return wrap(new legacy::FunctionPassManager(unwrap(M))); in LLVMCreateFunctionPassManagerForModule()
4172 return unwrap<legacy::PassManager>(PM)->run(*unwrap(M)); in LLVMRunPassManager()
4176 return unwrap<legacy::FunctionPassManager>(FPM)->doInitialization(); in LLVMInitializeFunctionPassManager()
4180 return unwrap<legacy::FunctionPassManager>(FPM)->run(*unwrap<Function>(F)); in LLVMRunFunctionPassManager()
4184 return unwrap<legacy::FunctionPassManager>(FPM)->doFinalization(); in LLVMFinalizeFunctionPassManager()
4188 delete unwrap(PM); in LLVMDisposePassManager()