Lines Matching refs:CB

189   bool expandCall(Module &M, IRBuilder<> &Builder, CallBase *CB, FunctionType *,
271 bool expansionApplicableToFunctionCall(CallBase *CB) { in expansionApplicableToFunctionCall() argument
272 if (CallInst *CI = dyn_cast<CallInst>(CB)) { in expansionApplicableToFunctionCall()
284 if (isa<InvokeInst>(CB)) { in expansionApplicableToFunctionCall()
405 if (CallBase *CB = dyn_cast<CallBase>(&I)) { in runOnModule() local
406 if (CB->isIndirectCall()) { in runOnModule()
407 FunctionType *FTy = CB->getFunctionType(); in runOnModule()
409 Changed |= expandCall(M, Builder, CB, FTy, 0); in runOnModule()
458 if (CallBase *CB = dyn_cast<CallBase>(U)) { in runOnFunction() local
459 Value *CalledOperand = CB->getCalledOperand(); in runOnFunction()
462 expandCall(M, Builder, CB, VariadicWrapper->getFunctionType(), in runOnFunction()
631 bool ExpandVariadics::expandCall(Module &M, IRBuilder<> &Builder, CallBase *CB, in expandCall() argument
637 if (!expansionApplicableToFunctionCall(CB)) { in expandCall()
646 FunctionType *FuncType = CB->getFunctionType(); in expandCall()
653 auto &Ctx = CB->getContext(); in expandCall()
663 Function *CBF = CB->getParent()->getParent(); in expandCall()
669 for (unsigned I = FuncType->getNumParams(), E = CB->arg_size(); I < E; ++I) { in expandCall()
670 Value *ArgVal = CB->getArgOperand(I); in expandCall()
671 const bool IsByVal = CB->paramHasAttr(I, Attribute::ByVal); in expandCall()
672 const bool IsByRef = CB->paramHasAttr(I, Attribute::ByRef); in expandCall()
676 Type *const UnderlyingType = IsByVal ? CB->getParamByValType(I) in expandCall()
677 : IsByRef ? CB->getParamByRefType(I) in expandCall()
694 Builder.SetCurrentDebugLocation(CB->getStableDebugLoc()); in expandCall()
698 Builder.SetInsertPoint(CB); in expandCall()
760 Builder.SetCurrentDebugLocation(CB->getStableDebugLoc()); in expandCall()
770 Builder.SetInsertPoint(CB); in expandCall()
775 SmallVector<Value *> Args(CB->arg_begin(), CB->arg_begin() + NumArgs); in expandCall()
784 Builder.SetCurrentDebugLocation(CB->getStableDebugLoc()); in expandCall()
786 Builder.SetInsertPoint(CB); in expandCall()
789 Builder.SetInsertPoint(CB); in expandCall()
794 AttributeList PAL = CB->getAttributes(); in expandCall()
804 CB->getOperandBundlesAsDefs(OpBundles); in expandCall()
808 if (CallInst *CI = dyn_cast<CallInst>(CB)) { in expandCall()
832 NewCB->takeName(CB); in expandCall()
833 NewCB->setCallingConv(CB->getCallingConv()); in expandCall()
837 NewCB->copyMetadata(*CB, {LLVMContext::MD_prof, LLVMContext::MD_dbg}); in expandCall()
839 CB->replaceAllUsesWith(NewCB); in expandCall()
840 CB->eraseFromParent(); in expandCall()