Lines Matching refs:unwrap

57   initializeCore(*unwrap(R));
88 unwrap(C)->setDiagnosticHandler(
96 unwrap(C)->getDiagnosticHandler());
100 return unwrap(C)->getDiagnosticContext();
107 unwrap(C)->setYieldCallback(YieldCallback, OpaqueHandle);
111 delete unwrap(C);
116 return unwrap(C)->getMDKindID(StringRef(Name, SLen));
136 return wrap(Attribute::get(*unwrap(C), (Attribute::AttrKind)KindID, Val));
140 return unwrap(A).getKindAsEnum();
144 auto Attr = unwrap(A);
153 return wrap(Attribute::get(*unwrap(C), StringRef(K, KLength),
159 auto S = unwrap(A).getKindAsString();
166 auto S = unwrap(A).getValueAsString();
172 auto Attr = unwrap(A);
177 return unwrap(A).isStringAttribute();
185 unwrap(DI)->print(DP);
194 switch(unwrap(DI)->getSeverity()) {
220 return wrap(new Module(ModuleID, *unwrap(C)));
224 delete unwrap(M);
228 auto &Str = unwrap(M)->getModuleIdentifier();
234 unwrap(M)->setModuleIdentifier(StringRef(Ident, Len));
240 return unwrap(M)->getDataLayoutStr().c_str();
248 unwrap(M)->setDataLayout(DataLayoutStr);
253 return unwrap(M)->getTargetTriple().c_str();
257 unwrap(M)->setTargetTriple(Triple);
261 unwrap(M)->dump();
273 unwrap(M)->print(dest, nullptr);
289 unwrap(M)->print(os, nullptr);
297 unwrap(M)->setModuleInlineAsm(StringRef(Asm));
303 return wrap(&unwrap(M)->getContext());
312 switch (unwrap(Ty)->getTypeID()) {
353 return unwrap(Ty)->isSized();
357 return wrap(&unwrap(Ty)->getContext());
361 return unwrap(Ty)->dump();
368 if (unwrap(Ty))
369 unwrap(Ty)->print(os);
381 return (LLVMTypeRef) Type::getInt1Ty(*unwrap(C));
384 return (LLVMTypeRef) Type::getInt8Ty(*unwrap(C));
387 return (LLVMTypeRef) Type::getInt16Ty(*unwrap(C));
390 return (LLVMTypeRef) Type::getInt32Ty(*unwrap(C));
393 return (LLVMTypeRef) Type::getInt64Ty(*unwrap(C));
396 return (LLVMTypeRef) Type::getInt128Ty(*unwrap(C));
399 return wrap(IntegerType::get(*unwrap(C), NumBits));
425 return unwrap<IntegerType>(IntegerTy)->getBitWidth();
431 return (LLVMTypeRef) Type::getHalfTy(*unwrap(C));
434 return (LLVMTypeRef) Type::getFloatTy(*unwrap(C));
437 return (LLVMTypeRef) Type::getDoubleTy(*unwrap(C));
440 return (LLVMTypeRef) Type::getX86_FP80Ty(*unwrap(C));
443 return (LLVMTypeRef) Type::getFP128Ty(*unwrap(C));
446 return (LLVMTypeRef) Type::getPPC_FP128Ty(*unwrap(C));
449 return (LLVMTypeRef) Type::getX86_MMXTy(*unwrap(C));
452 return (LLVMTypeRef) Type::getTokenTy(*unwrap(C));
482 ArrayRef<Type*> Tys(unwrap(ParamTypes), ParamCount);
483 return wrap(FunctionType::get(unwrap(ReturnType), Tys, IsVarArg != 0));
487 return unwrap<FunctionType>(FunctionTy)->isVarArg();
491 return wrap(unwrap<FunctionType>(FunctionTy)->getReturnType());
495 return unwrap<FunctionType>(FunctionTy)->getNumParams();
499 FunctionType *Ty = unwrap<FunctionType>(FunctionTy);
509 ArrayRef<Type*> Tys(unwrap(ElementTypes), ElementCount);
510 return wrap(StructType::get(*unwrap(C), Tys, Packed != 0));
521 return wrap(StructType::create(*unwrap(C), Name));
526 StructType *Type = unwrap<StructType>(Ty);
534 ArrayRef<Type*> Tys(unwrap(ElementTypes), ElementCount);
535 unwrap<StructType>(StructTy)->setBody(Tys, Packed != 0);
539 return unwrap<StructType>(StructTy)->getNumElements();
543 StructType *Ty = unwrap<StructType>(StructTy);
550 StructType *Ty = unwrap<StructType>(StructTy);
555 return unwrap<StructType>(StructTy)->isPacked();
559 return unwrap<StructType>(StructTy)->isOpaque();
563 return wrap(unwrap(M)->getTypeByName(Name));
569 return wrap(ArrayType::get(unwrap(ElementType), ElementCount));
573 return wrap(PointerType::get(unwrap(ElementType), AddressSpace));
577 return wrap(VectorType::get(unwrap(ElementType), ElementCount));
581 return wrap(unwrap<SequentialType>(Ty)->getElementType());
585 return unwrap<ArrayType>(ArrayTy)->getNumElements();
589 return unwrap<PointerType>(PointerTy)->getAddressSpace();
593 return unwrap<VectorType>(VectorTy)->getNumElements();
599 return wrap(Type::getVoidTy(*unwrap(C)));
602 return wrap(Type::getLabelTy(*unwrap(C)));
617 return wrap(unwrap(Val)->getType());
621 switch(unwrap(Val)->getValueID()) {
632 return unwrap(Val)->getName().data();
636 unwrap(Val)->setName(Name);
640 unwrap(Val)->dump();
647 if (unwrap(Val))
648 unwrap(Val)->print(os);
658 unwrap(OldVal)->replaceAllUsesWith(unwrap(NewVal));
662 return unwrap<Instruction>(Inst)->hasMetadata();
666 auto *I = unwrap<Instruction>(Inst);
688 MDNode *N = Val ? extractMDNode(unwrap<MetadataAsValue>(Val)) : nullptr;
690 unwrap<Instruction>(Inst)->setMetadata(KindID, N);
697 return wrap(static_cast<Value*>(dyn_cast_or_null<name>(unwrap(Val)))); \
703 if (auto *MD = dyn_cast_or_null<MetadataAsValue>(unwrap(Val)))
711 if (auto *MD = dyn_cast_or_null<MetadataAsValue>(unwrap(Val)))
719 Value *V = unwrap(Val);
727 Use *Next = unwrap(U)->getNext();
734 return wrap(unwrap(U)->getUser());
738 return wrap(unwrap(U)->get());
754 Value *V = unwrap(Val);
768 Value *V = unwrap(Val);
773 unwrap<User>(Val)->setOperand(Index, unwrap(Op));
777 Value *V = unwrap(Val);
787 return wrap(Constant::getNullValue(unwrap(Ty)));
791 return wrap(Constant::getAllOnesValue(unwrap(Ty)));
795 return wrap(UndefValue::get(unwrap(Ty)));
799 return isa<Constant>(unwrap(Ty));
803 if (Constant *C = dyn_cast<Constant>(unwrap(Val)))
809 return isa<UndefValue>(unwrap(Val));
813 return wrap(ConstantPointerNull::get(unwrap<PointerType>(Ty)));
820 LLVMContext &Context = *unwrap(C);
831 LLVMContext &Context = *unwrap(C);
834 Value *V = unwrap(OV);
861 if (const auto *MD = dyn_cast<MetadataAsValue>(unwrap(V)))
871 auto *MD = cast<MetadataAsValue>(unwrap(V));
878 auto *MD = cast<MetadataAsValue>(unwrap(V));
885 LLVMContext &Context = unwrap(V)->getContext();
891 if (NamedMDNode *N = unwrap(M)->getNamedMetadata(Name)) {
899 NamedMDNode *N = unwrap(M)->getNamedMetadata(Name);
902 LLVMContext &Context = unwrap(M)->getContext();
909 NamedMDNode *N = unwrap(M)->getOrInsertNamedMetadata(Name);
914 N->addOperand(extractMDNode(unwrap<MetadataAsValue>(Val)));
921 return wrap(ConstantInt::get(unwrap<IntegerType>(IntTy), N, SignExtend != 0));
927 IntegerType *Ty = unwrap<IntegerType>(IntTy);
935 return wrap(ConstantInt::get(unwrap<IntegerType>(IntTy), StringRef(Str),
941 return wrap(ConstantInt::get(unwrap<IntegerType>(IntTy), StringRef(Str, SLen),
946 return wrap(ConstantFP::get(unwrap(RealTy), N));
950 return wrap(ConstantFP::get(unwrap(RealTy), StringRef(Text)));
955 return wrap(ConstantFP::get(unwrap(RealTy), StringRef(Str, SLen)));
959 return unwrap<ConstantInt>(ConstantVal)->getZExtValue();
963 return unwrap<ConstantInt>(ConstantVal)->getSExtValue();
967 ConstantFP *cFP = unwrap<ConstantFP>(ConstantVal) ;
994 return wrap(ConstantDataArray::getString(*unwrap(C), StringRef(Str, Length),
1005 return wrap(unwrap<ConstantDataSequential>(C)->getElementAsConstant(idx));
1009 return unwrap<ConstantDataSequential>(C)->isString();
1013 StringRef Str = unwrap<ConstantDataSequential>(C)->getAsString();
1020 ArrayRef<Constant*> V(unwrap<Constant>(ConstantVals, Length), Length);
1021 return wrap(ConstantArray::get(ArrayType::get(unwrap(ElementTy), Length), V));
1027 Constant **Elements = unwrap<Constant>(ConstantVals, Count);
1028 return wrap(ConstantStruct::getAnon(*unwrap(C), makeArrayRef(Elements, Count),
1041 Constant **Elements = unwrap<Constant>(ConstantVals, Count);
1042 StructType *Ty = cast<StructType>(unwrap(StructTy));
1049 unwrap<Constant>(ScalarConstantVals, Size), Size)));
1077 return map_to_llvmopcode(unwrap<ConstantExpr>(ConstantVal)->getOpcode());
1081 return wrap(ConstantExpr::getAlignOf(unwrap(Ty)));
1085 return wrap(ConstantExpr::getSizeOf(unwrap(Ty)));
1089 return wrap(ConstantExpr::getNeg(unwrap<Constant>(ConstantVal)));
1093 return wrap(ConstantExpr::getNSWNeg(unwrap<Constant>(ConstantVal)));
1097 return wrap(ConstantExpr::getNUWNeg(unwrap<Constant>(ConstantVal)));
1102 return wrap(ConstantExpr::getFNeg(unwrap<Constant>(ConstantVal)));
1106 return wrap(ConstantExpr::getNot(unwrap<Constant>(ConstantVal)));
1110 return wrap(ConstantExpr::getAdd(unwrap<Constant>(LHSConstant),
1111 unwrap<Constant>(RHSConstant)));
1116 return wrap(ConstantExpr::getNSWAdd(unwrap<Constant>(LHSConstant),
1117 unwrap<Constant>(RHSConstant)));
1122 return wrap(ConstantExpr::getNUWAdd(unwrap<Constant>(LHSConstant),
1123 unwrap<Constant>(RHSConstant)));
1127 return wrap(ConstantExpr::getFAdd(unwrap<Constant>(LHSConstant),
1128 unwrap<Constant>(RHSConstant)));
1132 return wrap(ConstantExpr::getSub(unwrap<Constant>(LHSConstant),
1133 unwrap<Constant>(RHSConstant)));
1138 return wrap(ConstantExpr::getNSWSub(unwrap<Constant>(LHSConstant),
1139 unwrap<Constant>(RHSConstant)));
1144 return wrap(ConstantExpr::getNUWSub(unwrap<Constant>(LHSConstant),
1145 unwrap<Constant>(RHSConstant)));
1149 return wrap(ConstantExpr::getFSub(unwrap<Constant>(LHSConstant),
1150 unwrap<Constant>(RHSConstant)));
1154 return wrap(ConstantExpr::getMul(unwrap<Constant>(LHSConstant),
1155 unwrap<Constant>(RHSConstant)));
1160 return wrap(ConstantExpr::getNSWMul(unwrap<Constant>(LHSConstant),
1161 unwrap<Constant>(RHSConstant)));
1166 return wrap(ConstantExpr::getNUWMul(unwrap<Constant>(LHSConstant),
1167 unwrap<Constant>(RHSConstant)));
1171 return wrap(ConstantExpr::getFMul(unwrap<Constant>(LHSConstant),
1172 unwrap<Constant>(RHSConstant)));
1176 return wrap(ConstantExpr::getUDiv(unwrap<Constant>(LHSConstant),
1177 unwrap<Constant>(RHSConstant)));
1181 return wrap(ConstantExpr::getSDiv(unwrap<Constant>(LHSConstant),
1182 unwrap<Constant>(RHSConstant)));
1187 return wrap(ConstantExpr::getExactSDiv(unwrap<Constant>(LHSConstant),
1188 unwrap<Constant>(RHSConstant)));
1192 return wrap(ConstantExpr::getFDiv(unwrap<Constant>(LHSConstant),
1193 unwrap<Constant>(RHSConstant)));
1197 return wrap(ConstantExpr::getURem(unwrap<Constant>(LHSConstant),
1198 unwrap<Constant>(RHSConstant)));
1202 return wrap(ConstantExpr::getSRem(unwrap<Constant>(LHSConstant),
1203 unwrap<Constant>(RHSConstant)));
1207 return wrap(ConstantExpr::getFRem(unwrap<Constant>(LHSConstant),
1208 unwrap<Constant>(RHSConstant)));
1212 return wrap(ConstantExpr::getAnd(unwrap<Constant>(LHSConstant),
1213 unwrap<Constant>(RHSConstant)));
1217 return wrap(ConstantExpr::getOr(unwrap<Constant>(LHSConstant),
1218 unwrap<Constant>(RHSConstant)));
1222 return wrap(ConstantExpr::getXor(unwrap<Constant>(LHSConstant),
1223 unwrap<Constant>(RHSConstant)));
1229 unwrap<Constant>(LHSConstant),
1230 unwrap<Constant>(RHSConstant)));
1236 unwrap<Constant>(LHSConstant),
1237 unwrap<Constant>(RHSConstant)));
1241 return wrap(ConstantExpr::getShl(unwrap<Constant>(LHSConstant),
1242 unwrap<Constant>(RHSConstant)));
1246 return wrap(ConstantExpr::getLShr(unwrap<Constant>(LHSConstant),
1247 unwrap<Constant>(RHSConstant)));
1251 return wrap(ConstantExpr::getAShr(unwrap<Constant>(LHSConstant),
1252 unwrap<Constant>(RHSConstant)));
1257 ArrayRef<Constant *> IdxList(unwrap<Constant>(ConstantIndices, NumIndices),
1260 nullptr, unwrap<Constant>(ConstantVal), IdxList));
1266 Constant* Val = unwrap<Constant>(ConstantVal);
1267 ArrayRef<Constant *> IdxList(unwrap<Constant>(ConstantIndices, NumIndices),
1273 return wrap(ConstantExpr::getTrunc(unwrap<Constant>(ConstantVal),
1274 unwrap(ToType)));
1278 return wrap(ConstantExpr::getSExt(unwrap<Constant>(ConstantVal),
1279 unwrap(ToType)));
1283 return wrap(ConstantExpr::getZExt(unwrap<Constant>(ConstantVal),
1284 unwrap(ToType)));
1288 return wrap(ConstantExpr::getFPTrunc(unwrap<Constant>(ConstantVal),
1289 unwrap(ToType)));
1293 return wrap(ConstantExpr::getFPExtend(unwrap<Constant>(ConstantVal),
1294 unwrap(ToType)));
1298 return wrap(ConstantExpr::getUIToFP(unwrap<Constant>(ConstantVal),
1299 unwrap(ToType)));
1303 return wrap(ConstantExpr::getSIToFP(unwrap<Constant>(ConstantVal),
1304 unwrap(ToType)));
1308 return wrap(ConstantExpr::getFPToUI(unwrap<Constant>(ConstantVal),
1309 unwrap(ToType)));
1313 return wrap(ConstantExpr::getFPToSI(unwrap<Constant>(ConstantVal),
1314 unwrap(ToType)));
1318 return wrap(ConstantExpr::getPtrToInt(unwrap<Constant>(ConstantVal),
1319 unwrap(ToType)));
1323 return wrap(ConstantExpr::getIntToPtr(unwrap<Constant>(ConstantVal),
1324 unwrap(ToType)));
1328 return wrap(ConstantExpr::getBitCast(unwrap<Constant>(ConstantVal),
1329 unwrap(ToType)));
1334 return wrap(ConstantExpr::getAddrSpaceCast(unwrap<Constant>(ConstantVal),
1335 unwrap(ToType)));
1340 return wrap(ConstantExpr::getZExtOrBitCast(unwrap<Constant>(ConstantVal),
1341 unwrap(ToType)));
1346 return wrap(ConstantExpr::getSExtOrBitCast(unwrap<Constant>(ConstantVal),
1347 unwrap(ToType)));
1352 return wrap(ConstantExpr::getTruncOrBitCast(unwrap<Constant>(ConstantVal),
1353 unwrap(ToType)));
1358 return wrap(ConstantExpr::getPointerCast(unwrap<Constant>(ConstantVal),
1359 unwrap(ToType)));
1364 return wrap(ConstantExpr::getIntegerCast(unwrap<Constant>(ConstantVal),
1365 unwrap(ToType), isSigned));
1369 return wrap(ConstantExpr::getFPCast(unwrap<Constant>(ConstantVal),
1370 unwrap(ToType)));
1376 return wrap(ConstantExpr::getSelect(unwrap<Constant>(ConstantCondition),
1377 unwrap<Constant>(ConstantIfTrue),
1378 unwrap<Constant>(ConstantIfFalse)));
1383 return wrap(ConstantExpr::getExtractElement(unwrap<Constant>(VectorConstant),
1384 unwrap<Constant>(IndexConstant)));
1390 return wrap(ConstantExpr::getInsertElement(unwrap<Constant>(VectorConstant),
1391 unwrap<Constant>(ElementValueConstant),
1392 unwrap<Constant>(IndexConstant)));
1398 return wrap(ConstantExpr::getShuffleVector(unwrap<Constant>(VectorAConstant),
1399 unwrap<Constant>(VectorBConstant),
1400 unwrap<Constant>(MaskConstant)));
1405 return wrap(ConstantExpr::getExtractValue(unwrap<Constant>(AggConstant),
1412 return wrap(ConstantExpr::getInsertValue(unwrap<Constant>(AggConstant),
1413 unwrap<Constant>(ElementValueConstant),
1421 return wrap(InlineAsm::get(dyn_cast<FunctionType>(unwrap(Ty)), AsmString,
1426 return wrap(BlockAddress::get(unwrap<Function>(F), unwrap(BB)));
1432 return wrap(unwrap<GlobalValue>(Global)->getParent());
1436 return unwrap<GlobalValue>(Global)->isDeclaration();
1440 switch (unwrap<GlobalValue>(Global)->getLinkage()) {
1469 GlobalValue *GV = unwrap<GlobalValue>(Global);
1533 return unwrap<GlobalValue>(Global)->getSection().data();
1537 unwrap<GlobalObject>(Global)->setSection(Section);
1542 unwrap<GlobalValue>(Global)->getVisibility());
1546 unwrap<GlobalValue>(Global)
1552 unwrap<GlobalValue>(Global)->getDLLStorageClass());
1556 unwrap<GlobalValue>(Global)->setDLLStorageClass(
1561 return unwrap<GlobalValue>(Global)->hasGlobalUnnamedAddr();
1565 unwrap<GlobalValue>(Global)->setUnnamedAddr(
1573 Value *P = unwrap<Value>(V);
1588 Value *P = unwrap<Value>(V);
1605 return wrap(new GlobalVariable(*unwrap(M), unwrap(Ty), false,
1612 return wrap(new GlobalVariable(*unwrap(M), unwrap(Ty), false,
1619 return wrap(unwrap(M)->getNamedGlobal(Name));
1623 Module *Mod = unwrap(M);
1631 Module *Mod = unwrap(M);
1639 GlobalVariable *GV = unwrap<GlobalVariable>(GlobalVar);
1647 GlobalVariable *GV = unwrap<GlobalVariable>(GlobalVar);
1655 unwrap<GlobalVariable>(GlobalVar)->eraseFromParent();
1659 GlobalVariable* GV = unwrap<GlobalVariable>(GlobalVar);
1666 unwrap<GlobalVariable>(GlobalVar)
1667 ->setInitializer(unwrap<Constant>(ConstantVal));
1671 return unwrap<GlobalVariable>(GlobalVar)->isThreadLocal();
1675 unwrap<GlobalVariable>(GlobalVar)->setThreadLocal(IsThreadLocal != 0);
1679 return unwrap<GlobalVariable>(GlobalVar)->isConstant();
1683 unwrap<GlobalVariable>(GlobalVar)->setConstant(IsConstant != 0);
1687 switch (unwrap<GlobalVariable>(GlobalVar)->getThreadLocalMode()) {
1704 GlobalVariable *GV = unwrap<GlobalVariable>(GlobalVar);
1726 return unwrap<GlobalVariable>(GlobalVar)->isExternallyInitialized();
1730 unwrap<GlobalVariable>(GlobalVar)->setExternallyInitialized(IsExtInit);
1737 auto *PTy = cast<PointerType>(unwrap(Ty));
1740 unwrap<Constant>(Aliasee), unwrap(M)));
1747 return wrap(Function::Create(unwrap<FunctionType>(FunctionTy),
1748 GlobalValue::ExternalLinkage, Name, unwrap(M)));
1752 return wrap(unwrap(M)->getFunction(Name));
1756 Module *Mod = unwrap(M);
1764 Module *Mod = unwrap(M);
1772 Function *Func = unwrap<Function>(Fn);
1780 Function *Func = unwrap<Function>(Fn);
1788 unwrap<Function>(Fn)->eraseFromParent();
1792 return unwrap<Function>(Fn)->hasPersonalityFn();
1796 return wrap(unwrap<Function>(Fn)->getPersonalityFn());
1800 unwrap<Function>(Fn)->setPersonalityFn(unwrap<Constant>(PersonalityFn));
1804 if (Function *F = dyn_cast<Function>(unwrap(Fn)))
1810 return unwrap<Function>(Fn)->getCallingConv();
1814 return unwrap<Function>(Fn)->setCallingConv(
1819 Function *F = unwrap<Function>(Fn);
1824 Function *F = unwrap<Function>(Fn);
1832 Function *Func = unwrap<Function>(Fn);
1844 unwrap<Function>(F)->addAttribute(Idx, unwrap(A));
1850 return wrap(unwrap<Function>(F)->getAttribute(Idx,
1857 return wrap(unwrap<Function>(F)->getAttribute(Idx, StringRef(K, KLen)));
1862 unwrap<Function>(F)->removeAttribute(Idx, (Attribute::AttrKind)KindID);
1867 unwrap<Function>(F)->removeAttribute(Idx, StringRef(K, KLen));
1872 Function *Func = unwrap<Function>(Fn);
1883 Function *Func = unwrap<Function>(Fn);
1894 Function *Func = unwrap<Function>(Fn);
1904 return unwrap<Function>(FnRef)->arg_size();
1908 Function *Fn = unwrap<Function>(FnRef);
1915 Function::arg_iterator AI = unwrap<Function>(FnRef)->arg_begin();
1922 return wrap(unwrap<Argument>(V)->getParent());
1926 Function *Func = unwrap<Function>(Fn);
1934 Function *Func = unwrap<Function>(Fn);
1942 Argument *A = unwrap<Argument>(Arg);
1950 Argument *A = unwrap<Argument>(Arg);
1958 Argument *A = unwrap<Argument>(Arg);
1964 Argument *A = unwrap<Argument>(Arg);
1970 Argument *A = unwrap<Argument>(Arg);
1976 Argument *A = unwrap<Argument>(Arg);
1985 return wrap(static_cast<Value*>(unwrap(BB)));
1989 return isa<BasicBlock>(unwrap(Val));
1993 return wrap(unwrap<BasicBlock>(Val));
1997 return unwrap(BB)->getName().data();
2001 return wrap(unwrap(BB)->getParent());
2005 return wrap(unwrap(BB)->getTerminator());
2009 return unwrap<Function>(FnRef)->size();
2013 Function *Fn = unwrap<Function>(FnRef);
2019 return wrap(&unwrap<Function>(Fn)->getEntryBlock());
2023 Function *Func = unwrap<Function>(Fn);
2031 Function *Func = unwrap<Function>(Fn);
2039 BasicBlock *Block = unwrap(BB);
2047 BasicBlock *Block = unwrap(BB);
2057 return wrap(BasicBlock::Create(*unwrap(C), Name, unwrap<Function>(FnRef)));
2067 BasicBlock *BB = unwrap(BBRef);
2068 return wrap(BasicBlock::Create(*unwrap(C), Name, BB->getParent(), BB));
2077 unwrap(BBRef)->eraseFromParent();
2081 unwrap(BBRef)->removeFromParent();
2085 unwrap(BB)->moveBefore(unwrap(MovePos));
2089 unwrap(BB)->moveAfter(unwrap(MovePos));
2095 return wrap(unwrap<Instruction>(Inst)->getParent());
2099 BasicBlock *Block = unwrap(BB);
2107 BasicBlock *Block = unwrap(BB);
2115 Instruction *Instr = unwrap<Instruction>(Inst);
2123 Instruction *Instr = unwrap<Instruction>(Inst);
2131 unwrap<Instruction>(Inst)->removeFromParent();
2135 unwrap<Instruction>(Inst)->eraseFromParent();
2139 if (ICmpInst *I = dyn_cast<ICmpInst>(unwrap(Inst)))
2141 if (ConstantExpr *CE = dyn_cast<ConstantExpr>(unwrap(Inst)))
2148 if (FCmpInst *I = dyn_cast<FCmpInst>(unwrap(Inst)))
2150 if (ConstantExpr *CE = dyn_cast<ConstantExpr>(unwrap(Inst)))
2157 if (Instruction *C = dyn_cast<Instruction>(unwrap(Inst)))
2163 if (Instruction *C = dyn_cast<Instruction>(unwrap(Inst)))
2171 return CallSite(unwrap<Instruction>(Instr)).getNumArgOperands();
2175 return CallSite(unwrap<Instruction>(Instr)).getCallingConv();
2179 return CallSite(unwrap<Instruction>(Instr))
2185 CallSite Call = CallSite(unwrap<Instruction>(Instr));
2195 CallSite Call = CallSite(unwrap<Instruction>(Instr));
2205 CallSite Call = CallSite(unwrap<Instruction>(Instr));
2216 CallSite(unwrap<Instruction>(C)).addAttribute(Idx, unwrap(A));
2222 return wrap(CallSite(unwrap<Instruction>(C))
2229 return wrap(CallSite(unwrap<Instruction>(C))
2235 CallSite(unwrap<Instruction>(C))
2241 CallSite(unwrap<Instruction>(C)).removeAttribute(Idx, StringRef(K, KLen));
2245 return wrap(CallSite(unwrap<Instruction>(Instr)).getCalledValue());
2251 return unwrap<CallInst>(Call)->isTailCall();
2255 unwrap<CallInst>(Call)->setTailCall(isTailCall);
2261 return wrap(unwrap<InvokeInst>(Invoke)->getNormalDest());
2265 return wrap(unwrap<InvokeInst>(Invoke)->getUnwindDest());
2269 unwrap<InvokeInst>(Invoke)->setNormalDest(unwrap(B));
2273 unwrap<InvokeInst>(Invoke)->setUnwindDest(unwrap(B));
2279 return unwrap<TerminatorInst>(Term)->getNumSuccessors();
2283 return wrap(unwrap<TerminatorInst>(Term)->getSuccessor(i));
2287 return unwrap<TerminatorInst>(Term)->setSuccessor(i,unwrap(block));
2293 return unwrap<BranchInst>(Branch)->isConditional();
2297 return wrap(unwrap<BranchInst>(Branch)->getCondition());
2301 return unwrap<BranchInst>(Branch)->setCondition(unwrap(Cond));
2307 return wrap(unwrap<SwitchInst>(Switch)->getDefaultDest());
2313 return wrap(unwrap<AllocaInst>(Alloca)->getAllocatedType());
2319 return unwrap<GetElementPtrInst>(GEP)->isInBounds();
2323 return unwrap<GetElementPtrInst>(GEP)->setIsInBounds(InBounds);
2330 PHINode *PhiVal = unwrap<PHINode>(PhiNode);
2332 PhiVal->addIncoming(unwrap(IncomingValues[I]), unwrap(IncomingBlocks[I]));
2336 return unwrap<PHINode>(PhiNode)->getNumIncomingValues();
2340 return wrap(unwrap<PHINode>(PhiNode)->getIncomingValue(Index));
2344 return wrap(unwrap<PHINode>(PhiNode)->getIncomingBlock(Index));
2350 auto *I = unwrap(Inst);
2362 auto *I = unwrap(Inst);
2375 return wrap(new IRBuilder<>(*unwrap(C)));
2384 BasicBlock *BB = unwrap(Block);
2385 Instruction *I = Instr? unwrap<Instruction>(Instr) : (Instruction*) BB->end();
2386 unwrap(Builder)->SetInsertPoint(BB, I->getIterator());
2390 Instruction *I = unwrap<Instruction>(Instr);
2391 unwrap(Builder)->SetInsertPoint(I->getParent(), I->getIterator());
2395 BasicBlock *BB = unwrap(Block);
2396 unwrap(Builder)->SetInsertPoint(BB);
2400 return wrap(unwrap(Builder)->GetInsertBlock());
2404 unwrap(Builder)->ClearInsertionPoint();
2408 unwrap(Builder)->Insert(unwrap<Instruction>(Instr));
2413 unwrap(Builder)->Insert(unwrap<Instruction>(Instr), Name);
2417 delete unwrap(Builder);
2424 L ? cast<MDNode>(unwrap<MetadataAsValue>(L)->getMetadata()) : nullptr;
2425 unwrap(Builder)->SetCurrentDebugLocation(DebugLoc(Loc));
2429 LLVMContext &Context = unwrap(Builder)->getContext();
2431 Context, unwrap(Builder)->getCurrentDebugLocation().getAsMDNode()));
2435 unwrap(Builder)->SetInstDebugLocation(unwrap<Instruction>(Inst));
2442 return wrap(unwrap(B)->CreateRetVoid());
2446 return wrap(unwrap(B)->CreateRet(unwrap(V)));
2451 return wrap(unwrap(B)->CreateAggregateRet(unwrap(RetVals), N));
2455 return wrap(unwrap(B)->CreateBr(unwrap(Dest)));
2460 return wrap(unwrap(B)->CreateCondBr(unwrap(If), unwrap(Then), unwrap(Else)));
2465 return wrap(unwrap(B)->CreateSwitch(unwrap(V), unwrap(Else), NumCases));
2470 return wrap(unwrap(B)->CreateIndirectBr(unwrap(Addr), NumDests));
2477 return wrap(unwrap(B)->CreateInvoke(unwrap(Fn), unwrap(Then), unwrap(Catch),
2478 makeArrayRef(unwrap(Args), NumArgs),
2489 unwrap(B)->GetInsertBlock()->getParent()->setPersonalityFn(
2490 cast<Function>(unwrap(PersFn)));
2491 return wrap(unwrap(B)->CreateLandingPad(unwrap(Ty), NumClauses, Name));
2495 return wrap(unwrap(B)->CreateResume(unwrap(Exn)));
2499 return wrap(unwrap(B)->CreateUnreachable());
2504 unwrap<SwitchInst>(Switch)->addCase(unwrap<ConstantInt>(OnVal), unwrap(Dest));
2508 unwrap<IndirectBrInst>(IndirectBr)->addDestination(unwrap(Dest));
2512 return unwrap<LandingPadInst>(LandingPad)->getNumClauses();
2516 return wrap(unwrap<LandingPadInst>(LandingPad)->getClause(Idx));
2520 unwrap<LandingPadInst>(LandingPad)->
2521 addClause(cast<Constant>(unwrap(ClauseVal)));
2525 return unwrap<LandingPadInst>(LandingPad)->isCleanup();
2529 unwrap<LandingPadInst>(LandingPad)->setCleanup(Val);
2536 return wrap(unwrap(B)->CreateAdd(unwrap(LHS), unwrap(RHS), Name));
2541 return wrap(unwrap(B)->CreateNSWAdd(unwrap(LHS), unwrap(RHS), Name));
2546 return wrap(unwrap(B)->CreateNUWAdd(unwrap(LHS), unwrap(RHS), Name));
2551 return wrap(unwrap(B)->CreateFAdd(unwrap(LHS), unwrap(RHS), Name));
2556 return wrap(unwrap(B)->CreateSub(unwrap(LHS), unwrap(RHS), Name));
2561 return wrap(unwrap(B)->CreateNSWSub(unwrap(LHS), unwrap(RHS), Name));
2566 return wrap(unwrap(B)->CreateNUWSub(unwrap(LHS), unwrap(RHS), Name));
2571 return wrap(unwrap(B)->CreateFSub(unwrap(LHS), unwrap(RHS), Name));
2576 return wrap(unwrap(B)->CreateMul(unwrap(LHS), unwrap(RHS), Name));
2581 return wrap(unwrap(B)->CreateNSWMul(unwrap(LHS), unwrap(RHS), Name));
2586 return wrap(unwrap(B)->CreateNUWMul(unwrap(LHS), unwrap(RHS), Name));
2591 return wrap(unwrap(B)->CreateFMul(unwrap(LHS), unwrap(RHS), Name));
2596 return wrap(unwrap(B)->CreateUDiv(unwrap(LHS), unwrap(RHS), Name));
2601 return wrap(unwrap(B)->CreateSDiv(unwrap(LHS), unwrap(RHS), Name));
2606 return wrap(unwrap(B)->CreateExactSDiv(unwrap(LHS), unwrap(RHS), Name));
2611 return wrap(unwrap(B)->CreateFDiv(unwrap(LHS), unwrap(RHS), Name));
2616 return wrap(unwrap(B)->CreateURem(unwrap(LHS), unwrap(RHS), Name));
2621 return wrap(unwrap(B)->CreateSRem(unwrap(LHS), unwrap(RHS), Name));
2626 return wrap(unwrap(B)->CreateFRem(unwrap(LHS), unwrap(RHS), Name));
2631 return wrap(unwrap(B)->CreateShl(unwrap(LHS), unwrap(RHS), Name));
2636 return wrap(unwrap(B)->CreateLShr(unwrap(LHS), unwrap(RHS), Name));
2641 return wrap(unwrap(B)->CreateAShr(unwrap(LHS), unwrap(RHS), Name));
2646 return wrap(unwrap(B)->CreateAnd(unwrap(LHS), unwrap(RHS), Name));
2651 return wrap(unwrap(B)->CreateOr(unwrap(LHS), unwrap(RHS), Name));
2656 return wrap(unwrap(B)->CreateXor(unwrap(LHS), unwrap(RHS), Name));
2662 return wrap(unwrap(B)->CreateBinOp(Instruction::BinaryOps(map_from_llvmopcode(Op)), unwrap(LHS),
2663 unwrap(RHS), Name));
2667 return wrap(unwrap(B)->CreateNeg(unwrap(V), Name));
2672 return wrap(unwrap(B)->CreateNSWNeg(unwrap(V), Name));
2677 return wrap(unwrap(B)->CreateNUWNeg(unwrap(V), Name));
2681 return wrap(unwrap(B)->CreateFNeg(unwrap(V), Name));
2685 return wrap(unwrap(B)->CreateNot(unwrap(V), Name));
2692 Type* ITy = Type::getInt32Ty(unwrap(B)->GetInsertBlock()->getContext());
2693 Constant* AllocSize = ConstantExpr::getSizeOf(unwrap(Ty));
2695 Instruction* Malloc = CallInst::CreateMalloc(unwrap(B)->GetInsertBlock(),
2696 ITy, unwrap(Ty), AllocSize,
2698 return wrap(unwrap(B)->Insert(Malloc, Twine(Name)));
2703 Type* ITy = Type::getInt32Ty(unwrap(B)->GetInsertBlock()->getContext());
2704 Constant* AllocSize = ConstantExpr::getSizeOf(unwrap(Ty));
2706 Instruction* Malloc = CallInst::CreateMalloc(unwrap(B)->GetInsertBlock(),
2707 ITy, unwrap(Ty), AllocSize,
2708 unwrap(Val), nullptr, "");
2709 return wrap(unwrap(B)->Insert(Malloc, Twine(Name)));
2714 return wrap(unwrap(B)->CreateAlloca(unwrap(Ty), nullptr, Name));
2719 return wrap(unwrap(B)->CreateAlloca(unwrap(Ty), unwrap(Val), Name));
2723 return wrap(unwrap(B)->Insert(
2724 CallInst::CreateFree(unwrap(PointerVal), unwrap(B)->GetInsertBlock())));
2729 return wrap(unwrap(B)->CreateLoad(unwrap(PointerVal), Name));
2734 return wrap(unwrap(B)->CreateStore(unwrap(Val), unwrap(PointerVal)));
2772 unwrap(B)->CreateFence(mapFromLLVMOrdering(Ordering),
2780 ArrayRef<Value *> IdxList(unwrap(Indices), NumIndices);
2781 return wrap(unwrap(B)->CreateGEP(nullptr, unwrap(Pointer), IdxList, Name));
2787 ArrayRef<Value *> IdxList(unwrap(Indices), NumIndices);
2789 unwrap(B)->CreateInBoundsGEP(nullptr, unwrap(Pointer), IdxList, Name));
2794 return wrap(unwrap(B)->CreateStructGEP(nullptr, unwrap(Pointer), Idx, Name));
2799 return wrap(unwrap(B)->CreateGlobalString(Str, Name));
2804 return wrap(unwrap(B)->CreateGlobalStringPtr(Str, Name));
2808 Value *P = unwrap<Value>(MemAccessInst);
2815 Value *P = unwrap<Value>(MemAccessInst);
2822 Value *P = unwrap<Value>(MemAccessInst);
2832 Value *P = unwrap<Value>(MemAccessInst);
2844 return wrap(unwrap(B)->CreateTrunc(unwrap(Val), unwrap(DestTy), Name));
2849 return wrap(unwrap(B)->CreateZExt(unwrap(Val), unwrap(DestTy), Name));
2854 return wrap(unwrap(B)->CreateSExt(unwrap(Val), unwrap(DestTy), Name));
2859 return wrap(unwrap(B)->CreateFPToUI(unwrap(Val), unwrap(DestTy), Name));
2864 return wrap(unwrap(B)->CreateFPToSI(unwrap(Val), unwrap(DestTy), Name));
2869 return wrap(unwrap(B)->CreateUIToFP(unwrap(Val), unwrap(DestTy), Name));
2874 return wrap(unwrap(B)->CreateSIToFP(unwrap(Val), unwrap(DestTy), Name));
2879 return wrap(unwrap(B)->CreateFPTrunc(unwrap(Val), unwrap(DestTy), Name));
2884 return wrap(unwrap(B)->CreateFPExt(unwrap(Val), unwrap(DestTy), Name));
2889 return wrap(unwrap(B)->CreatePtrToInt(unwrap(Val), unwrap(DestTy), Name));
2894 return wrap(unwrap(B)->CreateIntToPtr(unwrap(Val), unwrap(DestTy), Name));
2899 return wrap(unwrap(B)->CreateBitCast(unwrap(Val), unwrap(DestTy), Name));
2904 return wrap(unwrap(B)->CreateAddrSpaceCast(unwrap(Val), unwrap(DestTy), Name));
2909 return wrap(unwrap(B)->CreateZExtOrBitCast(unwrap(Val), unwrap(DestTy),
2915 return wrap(unwrap(B)->CreateSExtOrBitCast(unwrap(Val), unwrap(DestTy),
2921 return wrap(unwrap(B)->CreateTruncOrBitCast(unwrap(Val), unwrap(DestTy),
2927 return wrap(unwrap(B)->CreateCast(Instruction::CastOps(map_from_llvmopcode(Op)), unwrap(Val),
2928 unwrap(DestTy), Name));
2933 return wrap(unwrap(B)->CreatePointerCast(unwrap(Val), unwrap(DestTy), Name));
2938 return wrap(unwrap(B)->CreateIntCast(unwrap(Val), unwrap(DestTy),
2944 return wrap(unwrap(B)->CreateFPCast(unwrap(Val), unwrap(DestTy), Name));
2952 return wrap(unwrap(B)->CreateICmp(static_cast<ICmpInst::Predicate>(Op),
2953 unwrap(LHS), unwrap(RHS), Name));
2959 return wrap(unwrap(B)->CreateFCmp(static_cast<FCmpInst::Predicate>(Op),
2960 unwrap(LHS), unwrap(RHS), Name));
2966 return wrap(unwrap(B)->CreatePHI(unwrap(Ty), 0, Name));
2972 return wrap(unwrap(B)->CreateCall(unwrap(Fn),
2973 makeArrayRef(unwrap(Args), NumArgs),
2980 return wrap(unwrap(B)->CreateSelect(unwrap(If), unwrap(Then), unwrap(Else),
2986 return wrap(unwrap(B)->CreateVAArg(unwrap(List), unwrap(Ty), Name));
2991 return wrap(unwrap(B)->CreateExtractElement(unwrap(VecVal), unwrap(Index),
2998 return wrap(unwrap(B)->CreateInsertElement(unwrap(VecVal), unwrap(EltVal),
2999 unwrap(Index), Name));
3005 return wrap(unwrap(B)->CreateShuffleVector(unwrap(V1), unwrap(V2),
3006 unwrap(Mask), Name));
3011 return wrap(unwrap(B)->CreateExtractValue(unwrap(AggVal), Index, Name));
3017 return wrap(unwrap(B)->CreateInsertValue(unwrap(AggVal), unwrap(EltVal),
3023 return wrap(unwrap(B)->CreateIsNull(unwrap(Val), Name));
3028 return wrap(unwrap(B)->CreateIsNotNull(unwrap(Val), Name));
3033 return wrap(unwrap(B)->CreatePtrDiff(unwrap(LHS), unwrap(RHS), Name));
3054 return wrap(unwrap(B)->CreateAtomicRMW(intop, unwrap(PTR), unwrap(Val),
3064 return wrap(unwrap(B)->CreateAtomicCmpXchg(unwrap(Ptr), unwrap(Cmp),
3065 unwrap(New), mapFromLLVMOrdering(SuccessOrdering),
3072 Value *P = unwrap<Value>(AtomicInst);
3080 Value *P = unwrap<Value>(AtomicInst);
3089 Value *P = unwrap<Value>(CmpXchgInst);
3095 Value *P = unwrap<Value>(CmpXchgInst);
3102 Value *P = unwrap<Value>(CmpXchgInst);
3108 Value *P = unwrap<Value>(CmpXchgInst);
3122 delete unwrap(MP);
3175 return unwrap(MemBuf)->getBufferStart();
3179 return unwrap(MemBuf)->getBufferSize();
3183 delete unwrap(MemBuf);
3199 return wrap(new legacy::FunctionPassManager(unwrap(M)));
3208 return unwrap<legacy::PassManager>(PM)->run(*unwrap(M));
3212 return unwrap<legacy::FunctionPassManager>(FPM)->doInitialization();
3216 return unwrap<legacy::FunctionPassManager>(FPM)->run(*unwrap<Function>(F));
3220 return unwrap<legacy::FunctionPassManager>(FPM)->doFinalization();
3224 delete unwrap(PM);