• Home
  • History
  • Annotate
  • Raw
  • Download
  • only in /freebsd-13-stable/contrib/llvm-project/llvm/lib/IR/

Lines Matching refs:unwrap

56   initializeCore(*unwrap(R));
87 unwrap(C)->setDiagnosticHandlerCallBack(
95 unwrap(C)->getDiagnosticHandlerCallBack());
99 return unwrap(C)->getDiagnosticContext();
106 unwrap(C)->setYieldCallback(YieldCallback, OpaqueHandle);
110 return unwrap(C)->shouldDiscardValueNames();
114 unwrap(C)->setDiscardValueNames(Discard);
118 delete unwrap(C);
123 return unwrap(C)->getMDKindID(StringRef(Name, SLen));
140 auto &Ctx = *unwrap(C);
153 return unwrap(A).getKindAsEnum();
157 auto Attr = unwrap(A);
166 return wrap(Attribute::get(*unwrap(C), StringRef(K, KLength),
172 auto S = unwrap(A).getKindAsString();
179 auto S = unwrap(A).getValueAsString();
185 auto Attr = unwrap(A);
190 return unwrap(A).isStringAttribute();
198 unwrap(DI)->print(DP);
207 switch(unwrap(DI)->getSeverity()) {
233 return wrap(new Module(ModuleID, *unwrap(C)));
237 delete unwrap(M);
241 auto &Str = unwrap(M)->getModuleIdentifier();
247 unwrap(M)->setModuleIdentifier(StringRef(Ident, Len));
251 auto &Str = unwrap(M)->getSourceFileName();
257 unwrap(M)->setSourceFileName(StringRef(Name, Len));
262 return unwrap(M)->getDataLayoutStr().c_str();
270 unwrap(M)->setDataLayout(DataLayoutStr);
275 return unwrap(M)->getTargetTriple().c_str();
279 unwrap(M)->setTargetTriple(Triple);
331 unwrap(M)->getModuleFlagsMetadata(MFEs);
375 return wrap(unwrap(M)->getModuleFlag({Key, KeyLen}));
381 unwrap(M)->addModuleFlag(map_to_llvmModFlagBehavior(Behavior),
382 {Key, KeyLen}, unwrap(Val));
388 unwrap(M)->print(errs(), nullptr,
401 unwrap(M)->print(dest, nullptr);
418 unwrap(M)->print(os, nullptr);
426 unwrap(M)->setModuleInlineAsm(StringRef(Asm, Len));
430 unwrap(M)->setModuleInlineAsm(StringRef(Asm));
434 unwrap(M)->appendModuleInlineAsm(StringRef(Asm, Len));
438 auto &Str = unwrap(M)->getModuleInlineAsm();
457 return wrap(InlineAsm::get(unwrap<FunctionType>(Ty),
466 return wrap(&unwrap(M)->getContext());
475 switch (unwrap(Ty)->getTypeID()) {
520 return unwrap(Ty)->isSized();
524 return wrap(&unwrap(Ty)->getContext());
528 return unwrap(Ty)->print(errs(), /*IsForDebug=*/true);
535 if (unwrap(Ty))
536 unwrap(Ty)->print(os);
548 return (LLVMTypeRef) Type::getInt1Ty(*unwrap(C));
551 return (LLVMTypeRef) Type::getInt8Ty(*unwrap(C));
554 return (LLVMTypeRef) Type::getInt16Ty(*unwrap(C));
557 return (LLVMTypeRef) Type::getInt32Ty(*unwrap(C));
560 return (LLVMTypeRef) Type::getInt64Ty(*unwrap(C));
563 return (LLVMTypeRef) Type::getInt128Ty(*unwrap(C));
566 return wrap(IntegerType::get(*unwrap(C), NumBits));
592 return unwrap<IntegerType>(IntegerTy)->getBitWidth();
598 return (LLVMTypeRef) Type::getHalfTy(*unwrap(C));
601 return (LLVMTypeRef) Type::getBFloatTy(*unwrap(C));
604 return (LLVMTypeRef) Type::getFloatTy(*unwrap(C));
607 return (LLVMTypeRef) Type::getDoubleTy(*unwrap(C));
610 return (LLVMTypeRef) Type::getX86_FP80Ty(*unwrap(C));
613 return (LLVMTypeRef) Type::getFP128Ty(*unwrap(C));
616 return (LLVMTypeRef) Type::getPPC_FP128Ty(*unwrap(C));
619 return (LLVMTypeRef) Type::getX86_MMXTy(*unwrap(C));
652 ArrayRef<Type*> Tys(unwrap(ParamTypes), ParamCount);
653 return wrap(FunctionType::get(unwrap(ReturnType), Tys, IsVarArg != 0));
657 return unwrap<FunctionType>(FunctionTy)->isVarArg();
661 return wrap(unwrap<FunctionType>(FunctionTy)->getReturnType());
665 return unwrap<FunctionType>(FunctionTy)->getNumParams();
669 FunctionType *Ty = unwrap<FunctionType>(FunctionTy);
679 ArrayRef<Type*> Tys(unwrap(ElementTypes), ElementCount);
680 return wrap(StructType::get(*unwrap(C), Tys, Packed != 0));
691 return wrap(StructType::create(*unwrap(C), Name));
696 StructType *Type = unwrap<StructType>(Ty);
704 ArrayRef<Type*> Tys(unwrap(ElementTypes), ElementCount);
705 unwrap<StructType>(StructTy)->setBody(Tys, Packed != 0);
709 return unwrap<StructType>(StructTy)->getNumElements();
713 StructType *Ty = unwrap<StructType>(StructTy);
720 StructType *Ty = unwrap<StructType>(StructTy);
725 return unwrap<StructType>(StructTy)->isPacked();
729 return unwrap<StructType>(StructTy)->isOpaque();
733 return unwrap<StructType>(StructTy)->isLiteral();
737 return wrap(unwrap(M)->getTypeByName(Name));
744 for (auto *T : unwrap(Tp)->subtypes()) {
751 return wrap(ArrayType::get(unwrap(ElementType), ElementCount));
755 return wrap(PointerType::get(unwrap(ElementType), AddressSpace));
759 return wrap(FixedVectorType::get(unwrap(ElementType), ElementCount));
763 auto *Ty = unwrap<Type>(WrappedTy);
772 return unwrap(Tp)->getNumContainedTypes();
776 return unwrap<ArrayType>(ArrayTy)->getNumElements();
780 return unwrap<PointerType>(PointerTy)->getAddressSpace();
784 return unwrap<VectorType>(VectorTy)->getNumElements();
790 return wrap(Type::getVoidTy(*unwrap(C)));
793 return wrap(Type::getLabelTy(*unwrap(C)));
796 return wrap(Type::getTokenTy(*unwrap(C)));
799 return wrap(Type::getMetadataTy(*unwrap(C)));
814 return wrap(unwrap(Val)->getType());
818 switch(unwrap(Val)->getValueID()) {
829 auto *V = unwrap(Val);
835 unwrap(Val)->setName(StringRef(Name, NameLen));
839 return unwrap(Val)->getName().data();
843 unwrap(Val)->setName(Name);
847 unwrap(Val)->print(errs(), /*IsForDebug=*/true);
854 if (unwrap(Val))
855 unwrap(Val)->print(os);
865 unwrap(OldVal)->replaceAllUsesWith(unwrap(NewVal));
869 return unwrap<Instruction>(Inst)->hasMetadata();
873 auto *I = unwrap<Instruction>(Inst);
895 MDNode *N = Val ? extractMDNode(unwrap<MetadataAsValue>(Val)) : nullptr;
897 unwrap<Instruction>(Inst)->setMetadata(KindID, N);
928 unwrap<Instruction>(Value)->getAllMetadata(Entries);
936 return wrap(static_cast<Value*>(dyn_cast_or_null<name>(unwrap(Val)))); \
942 if (auto *MD = dyn_cast_or_null<MetadataAsValue>(unwrap(Val)))
950 if (auto *MD = dyn_cast_or_null<MetadataAsValue>(unwrap(Val)))
958 Value *V = unwrap(Val);
966 Use *Next = unwrap(U)->getNext();
973 return wrap(unwrap(U)->getUser());
977 return wrap(unwrap(U)->get());
993 Value *V = unwrap(Val);
1007 Value *V = unwrap(Val);
1012 unwrap<User>(Val)->setOperand(Index, unwrap(Op));
1016 Value *V = unwrap(Val);
1026 return wrap(Constant::getNullValue(unwrap(Ty)));
1030 return wrap(Constant::getAllOnesValue(unwrap(Ty)));
1034 return wrap(UndefValue::get(unwrap(Ty)));
1038 return isa<Constant>(unwrap(Ty));
1042 if (Constant *C = dyn_cast<Constant>(unwrap(Val)))
1048 return isa<UndefValue>(unwrap(Val));
1052 return wrap(ConstantPointerNull::get(unwrap<PointerType>(Ty)));
1059 return wrap(MDString::get(*unwrap(C), StringRef(Str, SLen)));
1064 return wrap(MDNode::get(*unwrap(C), ArrayRef<Metadata*>(unwrap(MDs), Count)));
1069 LLVMContext &Context = *unwrap(C);
1080 LLVMContext &Context = *unwrap(C);
1083 Value *V = unwrap(OV);
1110 return wrap(MetadataAsValue::get(*unwrap(C), unwrap(MD)));
1114 auto *V = unwrap(Val);
1123 if (const auto *MD = dyn_cast<MetadataAsValue>(unwrap(V)))
1133 auto *MD = cast<MetadataAsValue>(unwrap(V));
1140 Module *Mod = unwrap(M);
1148 Module *Mod = unwrap(M);
1156 NamedMDNode *NamedNode = unwrap<NamedMDNode>(NMD);
1164 NamedMDNode *NamedNode = unwrap<NamedMDNode>(NMD);
1173 return wrap(unwrap(M)->getNamedMetadata(StringRef(Name, NameLen)));
1178 return wrap(unwrap(M)->getOrInsertNamedMetadata({Name, NameLen}));
1182 NamedMDNode *NamedNode = unwrap<NamedMDNode>(NMD);
1188 auto *MD = cast<MetadataAsValue>(unwrap(V));
1195 LLVMContext &Context = unwrap(V)->getContext();
1201 if (NamedMDNode *N = unwrap(M)->getNamedMetadata(Name)) {
1209 NamedMDNode *N = unwrap(M)->getNamedMetadata(Name);
1212 LLVMContext &Context = unwrap(M)->getContext();
1219 NamedMDNode *N = unwrap(M)->getOrInsertNamedMetadata(Name);
1224 N->addOperand(extractMDNode(unwrap<MetadataAsValue>(Val)));
1230 if (const auto *I = dyn_cast<Instruction>(unwrap(Val))) {
1234 } else if (const auto *GV = dyn_cast<GlobalVariable>(unwrap(Val))) {
1240 } else if (const auto *F = dyn_cast<Function>(unwrap(Val))) {
1254 if (const auto *I = dyn_cast<Instruction>(unwrap(Val))) {
1258 } else if (const auto *GV = dyn_cast<GlobalVariable>(unwrap(Val))) {
1264 } else if (const auto *F = dyn_cast<Function>(unwrap(Val))) {
1277 if (const auto *I = dyn_cast<Instruction>(unwrap(Val))) {
1281 } else if (const auto *GV = dyn_cast<GlobalVariable>(unwrap(Val))) {
1287 } else if (const auto *F = dyn_cast<Function>(unwrap(Val))) {
1299 if (const auto *I = dyn_cast<Instruction>(unwrap(Val)))
1309 return wrap(ConstantInt::get(unwrap<IntegerType>(IntTy), N, SignExtend != 0));
1315 IntegerType *Ty = unwrap<IntegerType>(IntTy);
1323 return wrap(ConstantInt::get(unwrap<IntegerType>(IntTy), StringRef(Str),
1329 return wrap(ConstantInt::get(unwrap<IntegerType>(IntTy), StringRef(Str, SLen),
1334 return wrap(ConstantFP::get(unwrap(RealTy), N));
1338 return wrap(ConstantFP::get(unwrap(RealTy), StringRef(Text)));
1343 return wrap(ConstantFP::get(unwrap(RealTy), StringRef(Str, SLen)));
1347 return unwrap<ConstantInt>(ConstantVal)->getZExtValue();
1351 return unwrap<ConstantInt>(ConstantVal)->getSExtValue();
1355 ConstantFP *cFP = unwrap<ConstantFP>(ConstantVal) ;
1382 return wrap(ConstantDataArray::getString(*unwrap(C), StringRef(Str, Length),
1393 return wrap(unwrap<ConstantDataSequential>(C)->getElementAsConstant(idx));
1397 return unwrap<ConstantDataSequential>(C)->isString();
1401 StringRef Str = unwrap<ConstantDataSequential>(C)->getAsString();
1408 ArrayRef<Constant*> V(unwrap<Constant>(ConstantVals, Length), Length);
1409 return wrap(ConstantArray::get(ArrayType::get(unwrap(ElementTy), Length), V));
1415 Constant **Elements = unwrap<Constant>(ConstantVals, Count);
1416 return wrap(ConstantStruct::getAnon(*unwrap(C), makeArrayRef(Elements, Count),
1429 Constant **Elements = unwrap<Constant>(ConstantVals, Count);
1430 StructType *Ty = cast<StructType>(unwrap(StructTy));
1437 unwrap<Constant>(ScalarConstantVals, Size), Size)));
1465 return map_to_llvmopcode(unwrap<ConstantExpr>(ConstantVal)->getOpcode());
1469 return wrap(ConstantExpr::getAlignOf(unwrap(Ty)));
1473 return wrap(ConstantExpr::getSizeOf(unwrap(Ty)));
1477 return wrap(ConstantExpr::getNeg(unwrap<Constant>(ConstantVal)));
1481 return wrap(ConstantExpr::getNSWNeg(unwrap<Constant>(ConstantVal)));
1485 return wrap(ConstantExpr::getNUWNeg(unwrap<Constant>(ConstantVal)));
1490 return wrap(ConstantExpr::getFNeg(unwrap<Constant>(ConstantVal)));
1494 return wrap(ConstantExpr::getNot(unwrap<Constant>(ConstantVal)));
1498 return wrap(ConstantExpr::getAdd(unwrap<Constant>(LHSConstant),
1499 unwrap<Constant>(RHSConstant)));
1504 return wrap(ConstantExpr::getNSWAdd(unwrap<Constant>(LHSConstant),
1505 unwrap<Constant>(RHSConstant)));
1510 return wrap(ConstantExpr::getNUWAdd(unwrap<Constant>(LHSConstant),
1511 unwrap<Constant>(RHSConstant)));
1515 return wrap(ConstantExpr::getFAdd(unwrap<Constant>(LHSConstant),
1516 unwrap<Constant>(RHSConstant)));
1520 return wrap(ConstantExpr::getSub(unwrap<Constant>(LHSConstant),
1521 unwrap<Constant>(RHSConstant)));
1526 return wrap(ConstantExpr::getNSWSub(unwrap<Constant>(LHSConstant),
1527 unwrap<Constant>(RHSConstant)));
1532 return wrap(ConstantExpr::getNUWSub(unwrap<Constant>(LHSConstant),
1533 unwrap<Constant>(RHSConstant)));
1537 return wrap(ConstantExpr::getFSub(unwrap<Constant>(LHSConstant),
1538 unwrap<Constant>(RHSConstant)));
1542 return wrap(ConstantExpr::getMul(unwrap<Constant>(LHSConstant),
1543 unwrap<Constant>(RHSConstant)));
1548 return wrap(ConstantExpr::getNSWMul(unwrap<Constant>(LHSConstant),
1549 unwrap<Constant>(RHSConstant)));
1554 return wrap(ConstantExpr::getNUWMul(unwrap<Constant>(LHSConstant),
1555 unwrap<Constant>(RHSConstant)));
1559 return wrap(ConstantExpr::getFMul(unwrap<Constant>(LHSConstant),
1560 unwrap<Constant>(RHSConstant)));
1564 return wrap(ConstantExpr::getUDiv(unwrap<Constant>(LHSConstant),
1565 unwrap<Constant>(RHSConstant)));
1570 return wrap(ConstantExpr::getExactUDiv(unwrap<Constant>(LHSConstant),
1571 unwrap<Constant>(RHSConstant)));
1575 return wrap(ConstantExpr::getSDiv(unwrap<Constant>(LHSConstant),
1576 unwrap<Constant>(RHSConstant)));
1581 return wrap(ConstantExpr::getExactSDiv(unwrap<Constant>(LHSConstant),
1582 unwrap<Constant>(RHSConstant)));
1586 return wrap(ConstantExpr::getFDiv(unwrap<Constant>(LHSConstant),
1587 unwrap<Constant>(RHSConstant)));
1591 return wrap(ConstantExpr::getURem(unwrap<Constant>(LHSConstant),
1592 unwrap<Constant>(RHSConstant)));
1596 return wrap(ConstantExpr::getSRem(unwrap<Constant>(LHSConstant),
1597 unwrap<Constant>(RHSConstant)));
1601 return wrap(ConstantExpr::getFRem(unwrap<Constant>(LHSConstant),
1602 unwrap<Constant>(RHSConstant)));
1606 return wrap(ConstantExpr::getAnd(unwrap<Constant>(LHSConstant),
1607 unwrap<Constant>(RHSConstant)));
1611 return wrap(ConstantExpr::getOr(unwrap<Constant>(LHSConstant),
1612 unwrap<Constant>(RHSConstant)));
1616 return wrap(ConstantExpr::getXor(unwrap<Constant>(LHSConstant),
1617 unwrap<Constant>(RHSConstant)));
1623 unwrap<Constant>(LHSConstant),
1624 unwrap<Constant>(RHSConstant)));
1630 unwrap<Constant>(LHSConstant),
1631 unwrap<Constant>(RHSConstant)));
1635 return wrap(ConstantExpr::getShl(unwrap<Constant>(LHSConstant),
1636 unwrap<Constant>(RHSConstant)));
1640 return wrap(ConstantExpr::getLShr(unwrap<Constant>(LHSConstant),
1641 unwrap<Constant>(RHSConstant)));
1645 return wrap(ConstantExpr::getAShr(unwrap<Constant>(LHSConstant),
1646 unwrap<Constant>(RHSConstant)));
1651 ArrayRef<Constant *> IdxList(unwrap<Constant>(ConstantIndices, NumIndices),
1653 Constant *Val = unwrap<Constant>(ConstantVal);
1662 ArrayRef<Constant *> IdxList(unwrap<Constant>(ConstantIndices, NumIndices),
1664 Constant *Val = unwrap<Constant>(ConstantVal);
1671 return wrap(ConstantExpr::getTrunc(unwrap<Constant>(ConstantVal),
1672 unwrap(ToType)));
1676 return wrap(ConstantExpr::getSExt(unwrap<Constant>(ConstantVal),
1677 unwrap(ToType)));
1681 return wrap(ConstantExpr::getZExt(unwrap<Constant>(ConstantVal),
1682 unwrap(ToType)));
1686 return wrap(ConstantExpr::getFPTrunc(unwrap<Constant>(ConstantVal),
1687 unwrap(ToType)));
1691 return wrap(ConstantExpr::getFPExtend(unwrap<Constant>(ConstantVal),
1692 unwrap(ToType)));
1696 return wrap(ConstantExpr::getUIToFP(unwrap<Constant>(ConstantVal),
1697 unwrap(ToType)));
1701 return wrap(ConstantExpr::getSIToFP(unwrap<Constant>(ConstantVal),
1702 unwrap(ToType)));
1706 return wrap(ConstantExpr::getFPToUI(unwrap<Constant>(ConstantVal),
1707 unwrap(ToType)));
1711 return wrap(ConstantExpr::getFPToSI(unwrap<Constant>(ConstantVal),
1712 unwrap(ToType)));
1716 return wrap(ConstantExpr::getPtrToInt(unwrap<Constant>(ConstantVal),
1717 unwrap(ToType)));
1721 return wrap(ConstantExpr::getIntToPtr(unwrap<Constant>(ConstantVal),
1722 unwrap(ToType)));
1726 return wrap(ConstantExpr::getBitCast(unwrap<Constant>(ConstantVal),
1727 unwrap(ToType)));
1732 return wrap(ConstantExpr::getAddrSpaceCast(unwrap<Constant>(ConstantVal),
1733 unwrap(ToType)));
1738 return wrap(ConstantExpr::getZExtOrBitCast(unwrap<Constant>(ConstantVal),
1739 unwrap(ToType)));
1744 return wrap(ConstantExpr::getSExtOrBitCast(unwrap<Constant>(ConstantVal),
1745 unwrap(ToType)));
1750 return wrap(ConstantExpr::getTruncOrBitCast(unwrap<Constant>(ConstantVal),
1751 unwrap(ToType)));
1756 return wrap(ConstantExpr::getPointerCast(unwrap<Constant>(ConstantVal),
1757 unwrap(ToType)));
1762 return wrap(ConstantExpr::getIntegerCast(unwrap<Constant>(ConstantVal),
1763 unwrap(ToType), isSigned));
1767 return wrap(ConstantExpr::getFPCast(unwrap<Constant>(ConstantVal),
1768 unwrap(ToType)));
1774 return wrap(ConstantExpr::getSelect(unwrap<Constant>(ConstantCondition),
1775 unwrap<Constant>(ConstantIfTrue),
1776 unwrap<Constant>(ConstantIfFalse)));
1781 return wrap(ConstantExpr::getExtractElement(unwrap<Constant>(VectorConstant),
1782 unwrap<Constant>(IndexConstant)));
1788 return wrap(ConstantExpr::getInsertElement(unwrap<Constant>(VectorConstant),
1789 unwrap<Constant>(ElementValueConstant),
1790 unwrap<Constant>(IndexConstant)));
1797 ShuffleVectorInst::getShuffleMask(unwrap<Constant>(MaskConstant), IntMask);
1798 return wrap(ConstantExpr::getShuffleVector(unwrap<Constant>(VectorAConstant),
1799 unwrap<Constant>(VectorBConstant),
1805 return wrap(ConstantExpr::getExtractValue(unwrap<Constant>(AggConstant),
1812 return wrap(ConstantExpr::getInsertValue(unwrap<Constant>(AggConstant),
1813 unwrap<Constant>(ElementValueConstant),
1821 return wrap(InlineAsm::get(dyn_cast<FunctionType>(unwrap(Ty)), AsmString,
1826 return wrap(BlockAddress::get(unwrap<Function>(F), unwrap(BB)));
1832 return wrap(unwrap<GlobalValue>(Global)->getParent());
1836 return unwrap<GlobalValue>(Global)->isDeclaration();
1840 switch (unwrap<GlobalValue>(Global)->getLinkage()) {
1869 GlobalValue *GV = unwrap<GlobalValue>(Global);
1936 return unwrap<GlobalValue>(Global)->getSection().data();
1940 unwrap<GlobalObject>(Global)->setSection(Section);
1945 unwrap<GlobalValue>(Global)->getVisibility());
1949 unwrap<GlobalValue>(Global)
1955 unwrap<GlobalValue>(Global)->getDLLStorageClass());
1959 unwrap<GlobalValue>(Global)->setDLLStorageClass(
1964 switch (unwrap<GlobalValue>(Global)->getUnnamedAddr()) {
1976 GlobalValue *GV = unwrap<GlobalValue>(Global);
1989 return unwrap<GlobalValue>(Global)->hasGlobalUnnamedAddr();
1993 unwrap<GlobalValue>(Global)->setUnnamedAddr(
1999 return wrap(unwrap<GlobalValue>(Global)->getValueType());
2005 Value *P = unwrap<Value>(V);
2020 Value *P = unwrap<Value>(V);
2037 if (Instruction *Instr = dyn_cast<Instruction>(unwrap(Value))) {
2040 unwrap<GlobalObject>(Value)->getAllMetadata(Entries);
2066 unwrap<GlobalObject>(Global)->setMetadata(Kind, unwrap<MDNode>(MD));
2070 unwrap<GlobalObject>(Global)->eraseMetadata(Kind);
2074 unwrap<GlobalObject>(Global)->clearMetadata();
2080 return wrap(new GlobalVariable(*unwrap(M), unwrap(Ty), false,
2087 return wrap(new GlobalVariable(*unwrap(M), unwrap(Ty), false,
2094 return wrap(unwrap(M)->getNamedGlobal(Name));
2098 Module *Mod = unwrap(M);
2106 Module *Mod = unwrap(M);
2114 GlobalVariable *GV = unwrap<GlobalVariable>(GlobalVar);
2122 GlobalVariable *GV = unwrap<GlobalVariable>(GlobalVar);
2130 unwrap<GlobalVariable>(GlobalVar)->eraseFromParent();
2134 GlobalVariable* GV = unwrap<GlobalVariable>(GlobalVar);
2141 unwrap<GlobalVariable>(GlobalVar)
2142 ->setInitializer(unwrap<Constant>(ConstantVal));
2146 return unwrap<GlobalVariable>(GlobalVar)->isThreadLocal();
2150 unwrap<GlobalVariable>(GlobalVar)->setThreadLocal(IsThreadLocal != 0);
2154 return unwrap<GlobalVariable>(GlobalVar)->isConstant();
2158 unwrap<GlobalVariable>(GlobalVar)->setConstant(IsConstant != 0);
2162 switch (unwrap<GlobalVariable>(GlobalVar)->getThreadLocalMode()) {
2179 GlobalVariable *GV = unwrap<GlobalVariable>(GlobalVar);
2201 return unwrap<GlobalVariable>(GlobalVar)->isExternallyInitialized();
2205 unwrap<GlobalVariable>(GlobalVar)->setExternallyInitialized(IsExtInit);
2212 auto *PTy = cast<PointerType>(unwrap(Ty));
2215 unwrap<Constant>(Aliasee), unwrap(M)));
2220 return wrap(unwrap(M)->getNamedAlias(Name));
2224 Module *Mod = unwrap(M);
2232 Module *Mod = unwrap(M);
2240 GlobalAlias *Alias = unwrap<GlobalAlias>(GA);
2248 GlobalAlias *Alias = unwrap<GlobalAlias>(GA);
2256 return wrap(unwrap<GlobalAlias>(Alias)->getAliasee());
2260 unwrap<GlobalAlias>(Alias)->setAliasee(unwrap<Constant>(Aliasee));
2267 return wrap(Function::Create(unwrap<FunctionType>(FunctionTy),
2268 GlobalValue::ExternalLinkage, Name, unwrap(M)));
2272 return wrap(unwrap(M)->getFunction(Name));
2276 Module *Mod = unwrap(M);
2284 Module *Mod = unwrap(M);
2292 Function *Func = unwrap<Function>(Fn);
2300 Function *Func = unwrap<Function>(Fn);
2308 unwrap<Function>(Fn)->eraseFromParent();
2312 return unwrap<Function>(Fn)->hasPersonalityFn();
2316 return wrap(unwrap<Function>(Fn)->getPersonalityFn());
2320 unwrap<Function>(Fn)->setPersonalityFn(unwrap<Constant>(PersonalityFn));
2324 if (Function *F = dyn_cast<Function>(unwrap(Fn)))
2338 ArrayRef<Type*> Tys(unwrap(ParamTypes), ParamCount);
2340 return wrap(llvm::Intrinsic::getDeclaration(unwrap(Mod), IID, Tys));
2353 ArrayRef<Type*> Tys(unwrap(ParamTypes), ParamCount);
2354 return wrap(llvm::Intrinsic::getType(*unwrap(Ctx), IID, Tys));
2362 ArrayRef<Type*> Tys(unwrap(ParamTypes), ParamCount);
2378 return unwrap<Function>(Fn)->getCallingConv();
2382 return unwrap<Function>(Fn)->setCallingConv(
2387 Function *F = unwrap<Function>(Fn);
2392 Function *F = unwrap<Function>(Fn);
2401 unwrap<Function>(F)->addAttribute(Idx, unwrap(A));
2405 auto AS = unwrap<Function>(F)->getAttributes().getAttributes(Idx);
2411 auto AS = unwrap<Function>(F)->getAttributes().getAttributes(Idx);
2419 return wrap(unwrap<Function>(F)->getAttribute(Idx,
2426 return wrap(unwrap<Function>(F)->getAttribute(Idx, StringRef(K, KLen)));
2431 unwrap<Function>(F)->removeAttribute(Idx, (Attribute::AttrKind)KindID);
2436 unwrap<Function>(F)->removeAttribute(Idx, StringRef(K, KLen));
2441 Function *Func = unwrap<Function>(Fn);
2451 return unwrap<Function>(FnRef)->arg_size();
2455 Function *Fn = unwrap<Function>(FnRef);
2462 Function *Fn = unwrap<Function>(FnRef);
2467 return wrap(unwrap<Argument>(V)->getParent());
2471 Function *Func = unwrap<Function>(Fn);
2479 Function *Func = unwrap<Function>(Fn);
2487 Argument *A = unwrap<Argument>(Arg);
2495 Argument *A = unwrap<Argument>(Arg);
2502 Argument *A = unwrap<Argument>(Arg);
2512 return wrap(GlobalIFunc::create(unwrap(Ty), AddrSpace,
2515 unwrap<Constant>(Resolver), unwrap(M)));
2520 return wrap(unwrap(M)->getNamedIFunc(StringRef(Name, NameLen)));
2524 Module *Mod = unwrap(M);
2532 Module *Mod = unwrap(M);
2540 GlobalIFunc *GIF = unwrap<GlobalIFunc>(IFunc);
2548 GlobalIFunc *GIF = unwrap<GlobalIFunc>(IFunc);
2556 return wrap(unwrap<GlobalIFunc>(IFunc)->getResolver());
2560 unwrap<GlobalIFunc>(IFunc)->setResolver(unwrap<Constant>(Resolver));
2564 unwrap<GlobalIFunc>(IFunc)->eraseFromParent();
2568 unwrap<GlobalIFunc>(IFunc)->removeFromParent();
2574 return wrap(static_cast<Value*>(unwrap(BB)));
2578 return isa<BasicBlock>(unwrap(Val));
2582 return wrap(unwrap<BasicBlock>(Val));
2586 return unwrap(BB)->getName().data();
2590 return wrap(unwrap(BB)->getParent());
2594 return wrap(unwrap(BB)->getTerminator());
2598 return unwrap<Function>(FnRef)->size();
2602 Function *Fn = unwrap<Function>(FnRef);
2608 return wrap(&unwrap<Function>(Fn)->getEntryBlock());
2612 Function *Func = unwrap<Function>(Fn);
2620 Function *Func = unwrap<Function>(Fn);
2628 BasicBlock *Block = unwrap(BB);
2636 BasicBlock *Block = unwrap(BB);
2645 return wrap(llvm::BasicBlock::Create(*unwrap(C), Name));
2650 BasicBlock *ToInsert = unwrap(BB);
2651 BasicBlock *CurBB = unwrap(Builder)->GetInsertBlock();
2659 unwrap<Function>(Fn)->getBasicBlockList().push_back(unwrap(BB));
2665 return wrap(BasicBlock::Create(*unwrap(C), Name, unwrap<Function>(FnRef)));
2675 BasicBlock *BB = unwrap(BBRef);
2676 return wrap(BasicBlock::Create(*unwrap(C), Name, BB->getParent(), BB));
2685 unwrap(BBRef)->eraseFromParent();
2689 unwrap(BBRef)->removeFromParent();
2693 unwrap(BB)->moveBefore(unwrap(MovePos));
2697 unwrap(BB)->moveAfter(unwrap(MovePos));
2703 return wrap(unwrap<Instruction>(Inst)->getParent());
2707 BasicBlock *Block = unwrap(BB);
2715 BasicBlock *Block = unwrap(BB);
2723 Instruction *Instr = unwrap<Instruction>(Inst);
2731 Instruction *Instr = unwrap<Instruction>(Inst);
2739 unwrap<Instruction>(Inst)->removeFromParent();
2743 unwrap<Instruction>(Inst)->eraseFromParent();
2747 if (ICmpInst *I = dyn_cast<ICmpInst>(unwrap(Inst)))
2749 if (ConstantExpr *CE = dyn_cast<ConstantExpr>(unwrap(Inst)))
2756 if (FCmpInst *I = dyn_cast<FCmpInst>(unwrap(Inst)))
2758 if (ConstantExpr *CE = dyn_cast<ConstantExpr>(unwrap(Inst)))
2765 if (Instruction *C = dyn_cast<Instruction>(unwrap(Inst)))
2771 if (Instruction *C = dyn_cast<Instruction>(unwrap(Inst)))
2777 Instruction *I = dyn_cast<Instruction>(unwrap(Inst));
2782 if (FuncletPadInst *FPI = dyn_cast<FuncletPadInst>(unwrap(Instr))) {
2785 return unwrap<CallBase>(Instr)->getNumArgOperands();
2791 return unwrap<CallBase>(Instr)->getCallingConv();
2795 return unwrap<CallBase>(Instr)->setCallingConv(
2801 auto *Call = unwrap<CallBase>(Instr);
2809 unwrap<CallBase>(C)->addAttribute(Idx, unwrap(A));
2814 auto *Call = unwrap<CallBase>(C);
2821 auto *Call = unwrap<CallBase>(C);
2831 unwrap<CallBase>(C)->getAttribute(Idx, (Attribute::AttrKind)KindID));
2837 return wrap(unwrap<CallBase>(C)->getAttribute(Idx, StringRef(K, KLen)));
2842 unwrap<CallBase>(C)->removeAttribute(Idx, (Attribute::AttrKind)KindID);
2847 unwrap<CallBase>(C)->removeAttribute(Idx, StringRef(K, KLen));
2851 return wrap(unwrap<CallBase>(Instr)->getCalledOperand());
2855 return wrap(unwrap<CallBase>(Instr)->getFunctionType());
2861 return unwrap<CallInst>(Call)->isTailCall();
2865 unwrap<CallInst>(Call)->setTailCall(isTailCall);
2871 return wrap(unwrap<InvokeInst>(Invoke)->getNormalDest());
2875 if (CleanupReturnInst *CRI = dyn_cast<CleanupReturnInst>(unwrap(Invoke))) {
2877 } else if (CatchSwitchInst *CSI = dyn_cast<CatchSwitchInst>(unwrap(Invoke))) {
2880 return wrap(unwrap<InvokeInst>(Invoke)->getUnwindDest());
2884 unwrap<InvokeInst>(Invoke)->setNormalDest(unwrap(B));
2888 if (CleanupReturnInst *CRI = dyn_cast<CleanupReturnInst>(unwrap(Invoke))) {
2889 return CRI->setUnwindDest(unwrap(B));
2890 } else if (CatchSwitchInst *CSI = dyn_cast<CatchSwitchInst>(unwrap(Invoke))) {
2891 return CSI->setUnwindDest(unwrap(B));
2893 unwrap<InvokeInst>(Invoke)->setUnwindDest(unwrap(B));
2899 return unwrap<Instruction>(Term)->getNumSuccessors();
2903 return wrap(unwrap<Instruction>(Term)->getSuccessor(i));
2907 return unwrap<Instruction>(Term)->setSuccessor(i, unwrap(block));
2913 return unwrap<BranchInst>(Branch)->isConditional();
2917 return wrap(unwrap<BranchInst>(Branch)->getCondition());
2921 return unwrap<BranchInst>(Branch)->setCondition(unwrap(Cond));
2927 return wrap(unwrap<SwitchInst>(Switch)->getDefaultDest());
2933 return wrap(unwrap<AllocaInst>(Alloca)->getAllocatedType());
2939 return unwrap<GetElementPtrInst>(GEP)->isInBounds();
2943 return unwrap<GetElementPtrInst>(GEP)->setIsInBounds(InBounds);
2950 PHINode *PhiVal = unwrap<PHINode>(PhiNode);
2952 PhiVal->addIncoming(unwrap(IncomingValues[I]), unwrap(IncomingBlocks[I]));
2956 return unwrap<PHINode>(PhiNode)->getNumIncomingValues();
2960 return wrap(unwrap<PHINode>(PhiNode)->getIncomingValue(Index));
2964 return wrap(unwrap<PHINode>(PhiNode)->getIncomingBlock(Index));
2970 auto *I = unwrap(Inst);
2984 auto *I = unwrap(Inst);
2999 return wrap(new IRBuilder<>(*unwrap(C)));
3008 BasicBlock *BB = unwrap(Block);
3009 auto I = Instr ? unwrap<Instruction>(Instr)->getIterator() : BB->end();
3010 unwrap(Builder)->SetInsertPoint(BB, I);
3014 Instruction *I = unwrap<Instruction>(Instr);
3015 unwrap(Builder)->SetInsertPoint(I->getParent(), I->getIterator());
3019 BasicBlock *BB = unwrap(Block);
3020 unwrap(Builder)->SetInsertPoint(BB);
3024 return wrap(unwrap(Builder)->GetInsertBlock());
3028 unwrap(Builder)->ClearInsertionPoint();
3032 unwrap(Builder)->Insert(unwrap<Instruction>(Instr));
3037 unwrap(Builder)->Insert(unwrap<Instruction>(Instr), Name);
3041 delete unwrap(Builder);
3047 return wrap(unwrap(Builder)->getCurrentDebugLocation().getAsMDNode());
3052 unwrap(Builder)->SetCurrentDebugLocation(DebugLoc(unwrap<MDNode>(Loc)));
3054 unwrap(Builder)->SetCurrentDebugLocation(DebugLoc());
3059 L ? cast<MDNode>(unwrap<MetadataAsValue>(L)->getMetadata()) : nullptr;
3060 unwrap(Builder)->SetCurrentDebugLocation(DebugLoc(Loc));
3064 LLVMContext &Context = unwrap(Builder)->getContext();
3066 Context, unwrap(Builder)->getCurrentDebugLocation().getAsMDNode()));
3070 unwrap(Builder)->SetInstDebugLocation(unwrap<Instruction>(Inst));
3076 unwrap(Builder)->setDefaultFPMathTag(FPMathTag
3077 ? unwrap<MDNode>(FPMathTag)
3082 return wrap(unwrap(Builder)->getDefaultFPMathTag());
3088 return wrap(unwrap(B)->CreateRetVoid());
3092 return wrap(unwrap(B)->CreateRet(unwrap(V)));
3097 return wrap(unwrap(B)->CreateAggregateRet(unwrap(RetVals), N));
3101 return wrap(unwrap(B)->CreateBr(unwrap(Dest)));
3106 return wrap(unwrap(B)->CreateCondBr(unwrap(If), unwrap(Then), unwrap(Else)));
3111 return wrap(unwrap(B)->CreateSwitch(unwrap(V), unwrap(Else), NumCases));
3116 return wrap(unwrap(B)->CreateIndirectBr(unwrap(Addr), NumDests));
3123 Value *V = unwrap(Fn);
3128 unwrap(B)->CreateInvoke(FnT, unwrap(Fn), unwrap(Then), unwrap(Catch),
3129 makeArrayRef(unwrap(Args), NumArgs), Name));
3136 return wrap(unwrap(B)->CreateInvoke(
3137 unwrap<FunctionType>(Ty), unwrap(Fn), unwrap(Then), unwrap(Catch),
3138 makeArrayRef(unwrap(Args), NumArgs), Name));
3148 unwrap(B)->GetInsertBlock()->getParent()->setPersonalityFn(
3149 cast<Function>(unwrap(PersFn)));
3150 return wrap(unwrap(B)->CreateLandingPad(unwrap(Ty), NumClauses, Name));
3156 return wrap(unwrap(B)->CreateCatchPad(unwrap(ParentPad),
3157 makeArrayRef(unwrap(Args), NumArgs),
3165 Type *Ty = Type::getTokenTy(unwrap(B)->getContext());
3168 return wrap(unwrap(B)->CreateCleanupPad(unwrap(ParentPad),
3169 makeArrayRef(unwrap(Args), NumArgs),
3174 return wrap(unwrap(B)->CreateResume(unwrap(Exn)));
3181 Type *Ty = Type::getTokenTy(unwrap(B)->getContext());
3184 return wrap(unwrap(B)->CreateCatchSwitch(unwrap(ParentPad), unwrap(UnwindBB),
3190 return wrap(unwrap(B)->CreateCatchRet(unwrap<CatchPadInst>(CatchPad),
3191 unwrap(BB)));
3196 return wrap(unwrap(B)->CreateCleanupRet(unwrap<CleanupPadInst>(CatchPad),
3197 unwrap(BB)));
3201 return wrap(unwrap(B)->CreateUnreachable());
3206 unwrap<SwitchInst>(Switch)->addCase(unwrap<ConstantInt>(OnVal), unwrap(Dest));
3210 unwrap<IndirectBrInst>(IndirectBr)->addDestination(unwrap(Dest));
3214 return unwrap<LandingPadInst>(LandingPad)->getNumClauses();
3218 return wrap(unwrap<LandingPadInst>(LandingPad)->getClause(Idx));
3222 unwrap<LandingPadInst>(LandingPad)->
3223 addClause(cast<Constant>(unwrap(ClauseVal)));
3227 return unwrap<LandingPadInst>(LandingPad)->isCleanup();
3231 unwrap<LandingPadInst>(LandingPad)->setCleanup(Val);
3235 unwrap<CatchSwitchInst>(CatchSwitch)->addHandler(unwrap(Dest));
3239 return unwrap<CatchSwitchInst>(CatchSwitch)->getNumHandlers();
3243 CatchSwitchInst *CSI = unwrap<CatchSwitchInst>(CatchSwitch);
3250 return wrap(unwrap<CatchPadInst>(CatchPad)->getCatchSwitch());
3254 unwrap<CatchPadInst>(CatchPad)
3255 ->setCatchSwitch(unwrap<CatchSwitchInst>(CatchSwitch));
3261 return wrap(unwrap<FuncletPadInst>(Funclet)->getArgOperand(i));
3265 unwrap<FuncletPadInst>(Funclet)->setArgOperand(i, unwrap(value));
3272 return wrap(unwrap(B)->CreateAdd(unwrap(LHS), unwrap(RHS), Name));
3277 return wrap(unwrap(B)->CreateNSWAdd(unwrap(LHS), unwrap(RHS), Name));
3282 return wrap(unwrap(B)->CreateNUWAdd(unwrap(LHS), unwrap(RHS), Name));
3287 return wrap(unwrap(B)->CreateFAdd(unwrap(LHS), unwrap(RHS), Name));
3292 return wrap(unwrap(B)->CreateSub(unwrap(LHS), unwrap(RHS), Name));
3297 return wrap(unwrap(B)->CreateNSWSub(unwrap(LHS), unwrap(RHS), Name));
3302 return wrap(unwrap(B)->CreateNUWSub(unwrap(LHS), unwrap(RHS), Name));
3307 return wrap(unwrap(B)->CreateFSub(unwrap(LHS), unwrap(RHS), Name));
3312 return wrap(unwrap(B)->CreateMul(unwrap(LHS), unwrap(RHS), Name));
3317 return wrap(unwrap(B)->CreateNSWMul(unwrap(LHS), unwrap(RHS), Name));
3322 return wrap(unwrap(B)->CreateNUWMul(unwrap(LHS), unwrap(RHS), Name));
3327 return wrap(unwrap(B)->CreateFMul(unwrap(LHS), unwrap(RHS), Name));
3332 return wrap(unwrap(B)->CreateUDiv(unwrap(LHS), unwrap(RHS), Name));
3337 return wrap(unwrap(B)->CreateExactUDiv(unwrap(LHS), unwrap(RHS), Name));
3342 return wrap(unwrap(B)->CreateSDiv(unwrap(LHS), unwrap(RHS), Name));
3347 return wrap(unwrap(B)->CreateExactSDiv(unwrap(LHS), unwrap(RHS), Name));
3352 return wrap(unwrap(B)->CreateFDiv(unwrap(LHS), unwrap(RHS), Name));
3357 return wrap(unwrap(B)->CreateURem(unwrap(LHS), unwrap(RHS), Name));
3362 return wrap(unwrap(B)->CreateSRem(unwrap(LHS), unwrap(RHS), Name));
3367 return wrap(unwrap(B)->CreateFRem(unwrap(LHS), unwrap(RHS), Name));
3372 return wrap(unwrap(B)->CreateShl(unwrap(LHS), unwrap(RHS), Name));
3377 return wrap(unwrap(B)->CreateLShr(unwrap(LHS), unwrap(RHS), Name));
3382 return wrap(unwrap(B)->CreateAShr(unwrap(LHS), unwrap(RHS), Name));
3387 return wrap(unwrap(B)->CreateAnd(unwrap(LHS), unwrap(RHS), Name));
3392 return wrap(unwrap(B)->CreateOr(unwrap(LHS), unwrap(RHS), Name));
3397 return wrap(unwrap(B)->CreateXor(unwrap(LHS), unwrap(RHS), Name));
3403 return wrap(unwrap(B)->CreateBinOp(Instruction::BinaryOps(map_from_llvmopcode(Op)), unwrap(LHS),
3404 unwrap(RHS), Name));
3408 return wrap(unwrap(B)->CreateNeg(unwrap(V), Name));
3413 return wrap(unwrap(B)->CreateNSWNeg(unwrap(V), Name));
3418 return wrap(unwrap(B)->CreateNUWNeg(unwrap(V), Name));
3422 return wrap(unwrap(B)->CreateFNeg(unwrap(V), Name));
3426 return wrap(unwrap(B)->CreateNot(unwrap(V), Name));
3433 Type* ITy = Type::getInt32Ty(unwrap(B)->GetInsertBlock()->getContext());
3434 Constant* AllocSize = ConstantExpr::getSizeOf(unwrap(Ty));
3436 Instruction* Malloc = CallInst::CreateMalloc(unwrap(B)->GetInsertBlock(),
3437 ITy, unwrap(Ty), AllocSize,
3439 return wrap(unwrap(B)->Insert(Malloc, Twine(Name)));
3444 Type* ITy = Type::getInt32Ty(unwrap(B)->GetInsertBlock()->getContext());
3445 Constant* AllocSize = ConstantExpr::getSizeOf(unwrap(Ty));
3447 Instruction* Malloc = CallInst::CreateMalloc(unwrap(B)->GetInsertBlock(),
3448 ITy, unwrap(Ty), AllocSize,
3449 unwrap(Val), nullptr, "");
3450 return wrap(unwrap(B)->Insert(Malloc, Twine(Name)));
3456 return wrap(unwrap(B)->CreateMemSet(unwrap(Ptr), unwrap(Val), unwrap(Len),
3464 return wrap(unwrap(B)->CreateMemCpy(unwrap(Dst), MaybeAlign(DstAlign),
3465 unwrap(Src), MaybeAlign(SrcAlign),
3466 unwrap(Size)));
3473 return wrap(unwrap(B)->CreateMemMove(unwrap(Dst), MaybeAlign(DstAlign),
3474 unwrap(Src), MaybeAlign(SrcAlign),
3475 unwrap(Size)));
3480 return wrap(unwrap(B)->CreateAlloca(unwrap(Ty), nullptr, Name));
3485 return wrap(unwrap(B)->CreateAlloca(unwrap(Ty), unwrap(Val), Name));
3489 return wrap(unwrap(B)->Insert(
3490 CallInst::CreateFree(unwrap(PointerVal), unwrap(B)->GetInsertBlock())));
3495 Value *V = unwrap(PointerVal);
3498 return wrap(unwrap(B)->CreateLoad(Ty->getElementType(), V, Name));
3503 return wrap(unwrap(B)->CreateLoad(unwrap(Ty), unwrap(PointerVal), Name));
3508 return wrap(unwrap(B)->CreateStore(unwrap(Val), unwrap(PointerVal)));
3589 unwrap(B)->CreateFence(mapFromLLVMOrdering(Ordering),
3598 ArrayRef<Value *> IdxList(unwrap(Indices), NumIndices);
3599 Value *Val = unwrap(Pointer);
3602 return wrap(unwrap(B)->CreateGEP(Ty, Val, IdxList, Name));
3608 ArrayRef<Value *> IdxList(unwrap(Indices), NumIndices);
3609 return wrap(unwrap(B)->CreateGEP(unwrap(Ty), unwrap(Pointer), IdxList, Name));
3615 ArrayRef<Value *> IdxList(unwrap(Indices), NumIndices);
3616 Value *Val = unwrap(Pointer);
3619 return wrap(unwrap(B)->CreateInBoundsGEP(Ty, Val, IdxList, Name));
3625 ArrayRef<Value *> IdxList(unwrap(Indices), NumIndices);
3627 unwrap(B)->CreateInBoundsGEP(unwrap(Ty), unwrap(Pointer), IdxList, Name));
3632 Value *Val = unwrap(Pointer);
3635 return wrap(unwrap(B)->CreateStructGEP(Ty, Val, Idx, Name));
3642 unwrap(B)->CreateStructGEP(unwrap(Ty), unwrap(Pointer), Idx, Name));
3647 return wrap(unwrap(B)->CreateGlobalString(Str, Name));
3652 return wrap(unwrap(B)->CreateGlobalStringPtr(Str, Name));
3656 Value *P = unwrap<Value>(MemAccessInst);
3667 Value *P = unwrap<Value>(MemAccessInst);
3678 return unwrap<AtomicCmpXchgInst>(CmpXchgInst)->isWeak();
3682 return unwrap<AtomicCmpXchgInst>(CmpXchgInst)->setWeak(isWeak);
3686 Value *P = unwrap<Value>(MemAccessInst);
3698 Value *P = unwrap<Value>(MemAccessInst);
3707 return mapToLLVMRMWBinOp(unwrap<AtomicRMWInst>(Inst)->getOperation());
3711 unwrap<AtomicRMWInst>(Inst)->setOperation(mapFromLLVMRMWBinOp(BinOp));
3718 return wrap(unwrap(B)->CreateTrunc(unwrap(Val), unwrap(DestTy), Name));
3723 return wrap(unwrap(B)->CreateZExt(unwrap(Val), unwrap(DestTy), Name));
3728 return wrap(unwrap(B)->CreateSExt(unwrap(Val), unwrap(DestTy), Name));
3733 return wrap(unwrap(B)->CreateFPToUI(unwrap(Val), unwrap(DestTy), Name));
3738 return wrap(unwrap(B)->CreateFPToSI(unwrap(Val), unwrap(DestTy), Name));
3743 return wrap(unwrap(B)->CreateUIToFP(unwrap(Val), unwrap(DestTy), Name));
3748 return wrap(unwrap(B)->CreateSIToFP(unwrap(Val), unwrap(DestTy), Name));
3753 return wrap(unwrap(B)->CreateFPTrunc(unwrap(Val), unwrap(DestTy), Name));
3758 return wrap(unwrap(B)->CreateFPExt(unwrap(Val), unwrap(DestTy), Name));
3763 return wrap(unwrap(B)->CreatePtrToInt(unwrap(Val), unwrap(DestTy), Name));
3768 return wrap(unwrap(B)->CreateIntToPtr(unwrap(Val), unwrap(DestTy), Name));
3773 return wrap(unwrap(B)->CreateBitCast(unwrap(Val), unwrap(DestTy), Name));
3778 return wrap(unwrap(B)->CreateAddrSpaceCast(unwrap(Val), unwrap(DestTy), Name));
3783 return wrap(unwrap(B)->CreateZExtOrBitCast(unwrap(Val), unwrap(DestTy),
3789 return wrap(unwrap(B)->CreateSExtOrBitCast(unwrap(Val), unwrap(DestTy),
3795 return wrap(unwrap(B)->CreateTruncOrBitCast(unwrap(Val), unwrap(DestTy),
3801 return wrap(unwrap(B)->CreateCast(Instruction::CastOps(map_from_llvmopcode(Op)), unwrap(Val),
3802 unwrap(DestTy), Name));
3807 return wrap(unwrap(B)->CreatePointerCast(unwrap(Val), unwrap(DestTy), Name));
3814 unwrap(B)->CreateIntCast(unwrap(Val), unwrap(DestTy), IsSigned, Name));
3819 return wrap(unwrap(B)->CreateIntCast(unwrap(Val), unwrap(DestTy),
3825 return wrap(unwrap(B)->CreateFPCast(unwrap(Val), unwrap(DestTy), Name));
3833 return wrap(unwrap(B)->CreateICmp(static_cast<ICmpInst::Predicate>(Op),
3834 unwrap(LHS), unwrap(RHS), Name));
3840 return wrap(unwrap(B)->CreateFCmp(static_cast<FCmpInst::Predicate>(Op),
3841 unwrap(LHS), unwrap(RHS), Name));
3847 return wrap(unwrap(B)->CreatePHI(unwrap(Ty), 0, Name));
3853 Value *V = unwrap(Fn);
3857 return wrap(unwrap(B)->CreateCall(FnT, unwrap(Fn),
3858 makeArrayRef(unwrap(Args), NumArgs), Name));
3864 FunctionType *FTy = unwrap<FunctionType>(Ty);
3865 return wrap(unwrap(B)->CreateCall(FTy, unwrap(Fn),
3866 makeArrayRef(unwrap(Args), NumArgs), Name));
3872 return wrap(unwrap(B)->CreateSelect(unwrap(If), unwrap(Then), unwrap(Else),
3878 return wrap(unwrap(B)->CreateVAArg(unwrap(List), unwrap(Ty), Name));
3883 return wrap(unwrap(B)->CreateExtractElement(unwrap(VecVal), unwrap(Index),
3890 return wrap(unwrap(B)->CreateInsertElement(unwrap(VecVal), unwrap(EltVal),
3891 unwrap(Index), Name));
3897 return wrap(unwrap(B)->CreateShuffleVector(unwrap(V1), unwrap(V2),
3898 unwrap(Mask), Name));
3903 return wrap(unwrap(B)->CreateExtractValue(unwrap(AggVal), Index, Name));
3909 return wrap(unwrap(B)->CreateInsertValue(unwrap(AggVal), unwrap(EltVal),
3915 return wrap(unwrap(B)->CreateFreeze(unwrap(Val), Name));
3920 return wrap(unwrap(B)->CreateIsNull(unwrap(Val), Name));
3925 return wrap(unwrap(B)->CreateIsNotNull(unwrap(Val), Name));
3930 return wrap(unwrap(B)->CreatePtrDiff(unwrap(LHS), unwrap(RHS), Name));
3938 return wrap(unwrap(B)->CreateAtomicRMW(intop, unwrap(PTR), unwrap(Val),
3949 return wrap(unwrap(B)->CreateAtomicCmpXchg(unwrap(Ptr), unwrap(Cmp),
3950 unwrap(New), mapFromLLVMOrdering(SuccessOrdering),
3956 Value *P = unwrap<Value>(SVInst);
3962 Value *P = unwrap<Value>(SVInst);
3970 Value *P = unwrap<Value>(AtomicInst);
3979 Value *P = unwrap<Value>(AtomicInst);
3988 Value *P = unwrap<Value>(CmpXchgInst);
3994 Value *P = unwrap<Value>(CmpXchgInst);
4001 Value *P = unwrap<Value>(CmpXchgInst);
4007 Value *P = unwrap<Value>(CmpXchgInst);
4021 delete unwrap(MP);
4074 return unwrap(MemBuf)->getBufferStart();
4078 return unwrap(MemBuf)->getBufferSize();
4082 delete unwrap(MemBuf);
4098 return wrap(new legacy::FunctionPassManager(unwrap(M)));
4107 return unwrap<legacy::PassManager>(PM)->run(*unwrap(M));
4111 return unwrap<legacy::FunctionPassManager>(FPM)->doInitialization();
4115 return unwrap<legacy::FunctionPassManager>(FPM)->run(*unwrap<Function>(F));
4119 return unwrap<legacy::FunctionPassManager>(FPM)->doFinalization();
4123 delete unwrap(PM);