M->getOrInsertFunction("strnlen", AttributeSet::get(M->getContext(), AS),
DL.getIntPtrType(Context), B.getInt8PtrTy(),
DL.getIntPtrType(Context), nullptr);
- CallInst *CI = B.CreateCall2(StrNLen, CastToCStr(Ptr, B), MaxLen, "strnlen");
+ CallInst *CI = B.CreateCall(StrNLen, {CastToCStr(Ptr, B), MaxLen}, "strnlen");
if (const Function *F = dyn_cast<Function>(StrNLen->stripPointerCasts()))
CI->setCallingConv(F->getCallingConv());
AttributeSet::get(M->getContext(),
AS),
I8Ptr, I8Ptr, I32Ty, nullptr);
- CallInst *CI = B.CreateCall2(StrChr, CastToCStr(Ptr, B),
- ConstantInt::get(I32Ty, C), "strchr");
+ CallInst *CI = B.CreateCall(
+ StrChr, {CastToCStr(Ptr, B), ConstantInt::get(I32Ty, C)}, "strchr");
if (const Function *F = dyn_cast<Function>(StrChr->stripPointerCasts()))
CI->setCallingConv(F->getCallingConv());
return CI;
Value *StrNCmp = M->getOrInsertFunction(
"strncmp", AttributeSet::get(M->getContext(), AS), B.getInt32Ty(),
B.getInt8PtrTy(), B.getInt8PtrTy(), DL.getIntPtrType(Context), nullptr);
- CallInst *CI = B.CreateCall3(StrNCmp, CastToCStr(Ptr1, B),
- CastToCStr(Ptr2, B), Len, "strncmp");
+ CallInst *CI = B.CreateCall(
+ StrNCmp, {CastToCStr(Ptr1, B), CastToCStr(Ptr2, B), Len}, "strncmp");
if (const Function *F = dyn_cast<Function>(StrNCmp->stripPointerCasts()))
CI->setCallingConv(F->getCallingConv());
Value *StrCpy = M->getOrInsertFunction(Name,
AttributeSet::get(M->getContext(), AS),
I8Ptr, I8Ptr, I8Ptr, nullptr);
- CallInst *CI = B.CreateCall2(StrCpy, CastToCStr(Dst, B), CastToCStr(Src, B),
- Name);
+ CallInst *CI =
+ B.CreateCall(StrCpy, {CastToCStr(Dst, B), CastToCStr(Src, B)}, Name);
if (const Function *F = dyn_cast<Function>(StrCpy->stripPointerCasts()))
CI->setCallingConv(F->getCallingConv());
return CI;
AS),
I8Ptr, I8Ptr, I8Ptr,
Len->getType(), nullptr);
- CallInst *CI = B.CreateCall3(StrNCpy, CastToCStr(Dst, B), CastToCStr(Src, B),
- Len, "strncpy");
+ CallInst *CI = B.CreateCall(
+ StrNCpy, {CastToCStr(Dst, B), CastToCStr(Src, B), Len}, "strncpy");
if (const Function *F = dyn_cast<Function>(StrNCpy->stripPointerCasts()))
CI->setCallingConv(F->getCallingConv());
return CI;
DL.getIntPtrType(Context), nullptr);
Dst = CastToCStr(Dst, B);
Src = CastToCStr(Src, B);
- CallInst *CI = B.CreateCall4(MemCpy, Dst, Src, Len, ObjSize);
+ CallInst *CI = B.CreateCall(MemCpy, {Dst, Src, Len, ObjSize});
if (const Function *F = dyn_cast<Function>(MemCpy->stripPointerCasts()))
CI->setCallingConv(F->getCallingConv());
return CI;
Value *MemChr = M->getOrInsertFunction(
"memchr", AttributeSet::get(M->getContext(), AS), B.getInt8PtrTy(),
B.getInt8PtrTy(), B.getInt32Ty(), DL.getIntPtrType(Context), nullptr);
- CallInst *CI = B.CreateCall3(MemChr, CastToCStr(Ptr, B), Val, Len, "memchr");
+ CallInst *CI = B.CreateCall(MemChr, {CastToCStr(Ptr, B), Val, Len}, "memchr");
if (const Function *F = dyn_cast<Function>(MemChr->stripPointerCasts()))
CI->setCallingConv(F->getCallingConv());
Value *MemCmp = M->getOrInsertFunction(
"memcmp", AttributeSet::get(M->getContext(), AS), B.getInt32Ty(),
B.getInt8PtrTy(), B.getInt8PtrTy(), DL.getIntPtrType(Context), nullptr);
- CallInst *CI = B.CreateCall3(MemCmp, CastToCStr(Ptr1, B), CastToCStr(Ptr2, B),
- Len, "memcmp");
+ CallInst *CI = B.CreateCall(
+ MemCmp, {CastToCStr(Ptr1, B), CastToCStr(Ptr2, B), Len}, "memcmp");
if (const Function *F = dyn_cast<Function>(MemCmp->stripPointerCasts()))
CI->setCallingConv(F->getCallingConv());
Module *M = B.GetInsertBlock()->getParent()->getParent();
Value *Callee = M->getOrInsertFunction(Name, Op1->getType(),
Op1->getType(), Op2->getType(), nullptr);
- CallInst *CI = B.CreateCall2(Callee, Op1, Op2, Name);
+ CallInst *CI = B.CreateCall(Callee, {Op1, Op2}, Name);
CI->setAttributes(Attrs);
if (const Function *F = dyn_cast<Function>(Callee->stripPointerCasts()))
CI->setCallingConv(F->getCallingConv());
File->getType(), nullptr);
Char = B.CreateIntCast(Char, B.getInt32Ty(), /*isSigned*/true,
"chari");
- CallInst *CI = B.CreateCall2(F, Char, File, "fputc");
+ CallInst *CI = B.CreateCall(F, {Char, File}, "fputc");
if (const Function *Fn = dyn_cast<Function>(F->stripPointerCasts()))
CI->setCallingConv(Fn->getCallingConv());
F = M->getOrInsertFunction(FPutsName, B.getInt32Ty(),
B.getInt8PtrTy(),
File->getType(), nullptr);
- CallInst *CI = B.CreateCall2(F, CastToCStr(Str, B), File, "fputs");
+ CallInst *CI = B.CreateCall(F, {CastToCStr(Str, B), File}, "fputs");
if (const Function *Fn = dyn_cast<Function>(F->stripPointerCasts()))
CI->setCallingConv(Fn->getCallingConv());
DL.getIntPtrType(Context), File->getType(),
nullptr);
CallInst *CI =
- B.CreateCall4(F, CastToCStr(Ptr, B), Size,
- ConstantInt::get(DL.getIntPtrType(Context), 1), File);
+ B.CreateCall(F, {CastToCStr(Ptr, B), Size,
+ ConstantInt::get(DL.getIntPtrType(Context), 1), File});
if (const Function *Fn = dyn_cast<Function>(F->stripPointerCasts()))
CI->setCallingConv(Fn->getCallingConv());