Lines Matching refs:B

29 Value *llvm::CastToCStr(Value *V, IRBuilder<> &B) {  in CastToCStr()  argument
31 return B.CreateBitCast(V, B.getInt8PtrTy(AS), "cstr"); in CastToCStr()
36 Value *llvm::EmitStrLen(Value *Ptr, IRBuilder<> &B, const DataLayout &DL, in EmitStrLen() argument
41 Module *M = B.GetInsertBlock()->getParent()->getParent(); in EmitStrLen()
47 LLVMContext &Context = B.GetInsertBlock()->getContext(); in EmitStrLen()
50 DL.getIntPtrType(Context), B.getInt8PtrTy(), nullptr); in EmitStrLen()
51 CallInst *CI = B.CreateCall(StrLen, CastToCStr(Ptr, B), "strlen"); in EmitStrLen()
61 Value *llvm::EmitStrNLen(Value *Ptr, Value *MaxLen, IRBuilder<> &B, in EmitStrNLen() argument
66 Module *M = B.GetInsertBlock()->getParent()->getParent(); in EmitStrNLen()
72 LLVMContext &Context = B.GetInsertBlock()->getContext(); in EmitStrNLen()
75 DL.getIntPtrType(Context), B.getInt8PtrTy(), in EmitStrNLen()
77 CallInst *CI = B.CreateCall2(StrNLen, CastToCStr(Ptr, B), MaxLen, "strnlen"); in EmitStrNLen()
87 Value *llvm::EmitStrChr(Value *Ptr, char C, IRBuilder<> &B, in EmitStrChr() argument
92 Module *M = B.GetInsertBlock()->getParent()->getParent(); in EmitStrChr()
97 Type *I8Ptr = B.getInt8PtrTy(); in EmitStrChr()
98 Type *I32Ty = B.getInt32Ty(); in EmitStrChr()
103 CallInst *CI = B.CreateCall2(StrChr, CastToCStr(Ptr, B), in EmitStrChr()
111 Value *llvm::EmitStrNCmp(Value *Ptr1, Value *Ptr2, Value *Len, IRBuilder<> &B, in EmitStrNCmp() argument
116 Module *M = B.GetInsertBlock()->getParent()->getParent(); in EmitStrNCmp()
123 LLVMContext &Context = B.GetInsertBlock()->getContext(); in EmitStrNCmp()
125 "strncmp", AttributeSet::get(M->getContext(), AS), B.getInt32Ty(), in EmitStrNCmp()
126 B.getInt8PtrTy(), B.getInt8PtrTy(), DL.getIntPtrType(Context), nullptr); in EmitStrNCmp()
127 CallInst *CI = B.CreateCall3(StrNCmp, CastToCStr(Ptr1, B), in EmitStrNCmp()
128 CastToCStr(Ptr2, B), Len, "strncmp"); in EmitStrNCmp()
138 Value *llvm::EmitStrCpy(Value *Dst, Value *Src, IRBuilder<> &B, in EmitStrCpy() argument
143 Module *M = B.GetInsertBlock()->getParent()->getParent(); in EmitStrCpy()
148 Type *I8Ptr = B.getInt8PtrTy(); in EmitStrCpy()
152 CallInst *CI = B.CreateCall2(StrCpy, CastToCStr(Dst, B), CastToCStr(Src, B), in EmitStrCpy()
161 Value *llvm::EmitStrNCpy(Value *Dst, Value *Src, Value *Len, IRBuilder<> &B, in EmitStrNCpy() argument
166 Module *M = B.GetInsertBlock()->getParent()->getParent(); in EmitStrNCpy()
171 Type *I8Ptr = B.getInt8PtrTy(); in EmitStrNCpy()
177 CallInst *CI = B.CreateCall3(StrNCpy, CastToCStr(Dst, B), CastToCStr(Src, B), in EmitStrNCpy()
188 IRBuilder<> &B, const DataLayout &DL, in EmitMemCpyChk() argument
193 Module *M = B.GetInsertBlock()->getParent()->getParent(); in EmitMemCpyChk()
197 LLVMContext &Context = B.GetInsertBlock()->getContext(); in EmitMemCpyChk()
199 "__memcpy_chk", AttributeSet::get(M->getContext(), AS), B.getInt8PtrTy(), in EmitMemCpyChk()
200 B.getInt8PtrTy(), B.getInt8PtrTy(), DL.getIntPtrType(Context), in EmitMemCpyChk()
202 Dst = CastToCStr(Dst, B); in EmitMemCpyChk()
203 Src = CastToCStr(Src, B); in EmitMemCpyChk()
204 CallInst *CI = B.CreateCall4(MemCpy, Dst, Src, Len, ObjSize); in EmitMemCpyChk()
212 Value *llvm::EmitMemChr(Value *Ptr, Value *Val, Value *Len, IRBuilder<> &B, in EmitMemChr() argument
217 Module *M = B.GetInsertBlock()->getParent()->getParent(); in EmitMemChr()
221 LLVMContext &Context = B.GetInsertBlock()->getContext(); in EmitMemChr()
223 "memchr", AttributeSet::get(M->getContext(), AS), B.getInt8PtrTy(), in EmitMemChr()
224 B.getInt8PtrTy(), B.getInt32Ty(), DL.getIntPtrType(Context), nullptr); in EmitMemChr()
225 CallInst *CI = B.CreateCall3(MemChr, CastToCStr(Ptr, B), Val, Len, "memchr"); in EmitMemChr()
234 Value *llvm::EmitMemCmp(Value *Ptr1, Value *Ptr2, Value *Len, IRBuilder<> &B, in EmitMemCmp() argument
239 Module *M = B.GetInsertBlock()->getParent()->getParent(); in EmitMemCmp()
246 LLVMContext &Context = B.GetInsertBlock()->getContext(); in EmitMemCmp()
248 "memcmp", AttributeSet::get(M->getContext(), AS), B.getInt32Ty(), in EmitMemCmp()
249 B.getInt8PtrTy(), B.getInt8PtrTy(), DL.getIntPtrType(Context), nullptr); in EmitMemCmp()
250 CallInst *CI = B.CreateCall3(MemCmp, CastToCStr(Ptr1, B), CastToCStr(Ptr2, B), in EmitMemCmp()
278 Value *llvm::EmitUnaryFloatFnCall(Value *Op, StringRef Name, IRBuilder<> &B, in EmitUnaryFloatFnCall() argument
283 Module *M = B.GetInsertBlock()->getParent()->getParent(); in EmitUnaryFloatFnCall()
286 CallInst *CI = B.CreateCall(Callee, Op, Name); in EmitUnaryFloatFnCall()
300 IRBuilder<> &B, const AttributeSet &Attrs) { in EmitBinaryFloatFnCall() argument
304 Module *M = B.GetInsertBlock()->getParent()->getParent(); in EmitBinaryFloatFnCall()
307 CallInst *CI = B.CreateCall2(Callee, Op1, Op2, Name); in EmitBinaryFloatFnCall()
317 Value *llvm::EmitPutChar(Value *Char, IRBuilder<> &B, in EmitPutChar() argument
322 Module *M = B.GetInsertBlock()->getParent()->getParent(); in EmitPutChar()
323 Value *PutChar = M->getOrInsertFunction("putchar", B.getInt32Ty(), in EmitPutChar()
324 B.getInt32Ty(), nullptr); in EmitPutChar()
325 CallInst *CI = B.CreateCall(PutChar, in EmitPutChar()
326 B.CreateIntCast(Char, in EmitPutChar()
327 B.getInt32Ty(), in EmitPutChar()
339 Value *llvm::EmitPutS(Value *Str, IRBuilder<> &B, in EmitPutS() argument
344 Module *M = B.GetInsertBlock()->getParent()->getParent(); in EmitPutS()
352 B.getInt32Ty(), in EmitPutS()
353 B.getInt8PtrTy(), in EmitPutS()
355 CallInst *CI = B.CreateCall(PutS, CastToCStr(Str, B), "puts"); in EmitPutS()
363 Value *llvm::EmitFPutC(Value *Char, Value *File, IRBuilder<> &B, in EmitFPutC() argument
368 Module *M = B.GetInsertBlock()->getParent()->getParent(); in EmitFPutC()
377 B.getInt32Ty(), in EmitFPutC()
378 B.getInt32Ty(), File->getType(), in EmitFPutC()
382 B.getInt32Ty(), in EmitFPutC()
383 B.getInt32Ty(), in EmitFPutC()
385 Char = B.CreateIntCast(Char, B.getInt32Ty(), /*isSigned*/true, in EmitFPutC()
387 CallInst *CI = B.CreateCall2(F, Char, File, "fputc"); in EmitFPutC()
396 Value *llvm::EmitFPutS(Value *Str, Value *File, IRBuilder<> &B, in EmitFPutS() argument
401 Module *M = B.GetInsertBlock()->getParent()->getParent(); in EmitFPutS()
412 B.getInt32Ty(), in EmitFPutS()
413 B.getInt8PtrTy(), in EmitFPutS()
416 F = M->getOrInsertFunction(FPutsName, B.getInt32Ty(), in EmitFPutS()
417 B.getInt8PtrTy(), in EmitFPutS()
419 CallInst *CI = B.CreateCall2(F, CastToCStr(Str, B), File, "fputs"); in EmitFPutS()
428 Value *llvm::EmitFWrite(Value *Ptr, Value *Size, Value *File, IRBuilder<> &B, in EmitFWrite() argument
433 Module *M = B.GetInsertBlock()->getParent()->getParent(); in EmitFWrite()
439 LLVMContext &Context = B.GetInsertBlock()->getContext(); in EmitFWrite()
445 DL.getIntPtrType(Context), B.getInt8PtrTy(), DL.getIntPtrType(Context), in EmitFWrite()
449 B.getInt8PtrTy(), DL.getIntPtrType(Context), in EmitFWrite()
453 B.CreateCall4(F, CastToCStr(Ptr, B), Size, in EmitFWrite()