Home | History | Annotate | Download | only in Instrumentation

Lines Matching refs:IRB

287   Value *createSlowPathCmp(IRBuilder<> &IRB, Value *AddrLong,
296 Value *memToShadow(Value *Shadow, IRBuilder<> &IRB);
299 void emitShadowMapping(Module &M, IRBuilder<> &IRB) const;
516 void poisonRedZones(const ArrayRef<AllocaInst*> &AllocaVec, IRBuilder<> IRB,
518 void poisonAlloca(Value *V, uint64_t Size, IRBuilder<> IRB, bool DoPoison);
565 Value *AddressSanitizer::memToShadow(Value *Shadow, IRBuilder<> &IRB) {
567 Shadow = IRB.CreateLShr(Shadow, Mapping.Scale);
572 return IRB.CreateOr(Shadow, ConstantInt::get(IntptrTy, Mapping.Offset));
574 return IRB.CreateAdd(Shadow, ConstantInt::get(IntptrTy, Mapping.Offset));
580 IRBuilder<> IRB(InsertBefore);
582 Size = IRB.CreateIntCast(Size, IntptrTy, false);
586 IRB.SetInsertPoint(InsertBefore);
587 Value *SizeMinusOne = IRB.CreateSub(Size, ConstantInt::get(IntptrTy, 1));
588 Value *AddrLong = IRB.CreatePointerCast(Addr, IntptrTy);
589 Value *AddrLast = IRB.CreateAdd(AddrLong, SizeMinusOne);
606 IRBuilder<> IRB(InsertBefore);
608 Value *Cmp = IRB.CreateICmpNE(Length,
679 IRBuilder<> IRB(I);
680 Value *LastByte = IRB.CreateIntToPtr(
681 IRB.CreateAdd(IRB.CreatePointerCast(Addr, IntptrTy),
703 IRBuilder<> IRB(InsertBefore);
705 ? IRB.CreateCall2(AsanErrorCallbackSized[IsWrite], Addr, SizeArgument)
706 : IRB.CreateCall(AsanErrorCallback[IsWrite][AccessSizeIndex], Addr);
711 IRB.CreateCall(EmptyAsm);
715 Value *AddressSanitizer::createSlowPathCmp(IRBuilder<> &IRB, Value *AddrLong,
720 Value *LastAccessedByte = IRB.CreateAnd(
724 LastAccessedByte = IRB.CreateAdd(
727 LastAccessedByte = IRB.CreateIntCast(
730 return IRB.CreateICmpSGE(LastAccessedByte, ShadowValue);
737 IRBuilder<> IRB(InsertBefore);
738 Value *AddrLong = IRB.CreatePointerCast(Addr, IntptrTy);
743 Value *ShadowPtr = memToShadow(AddrLong, IRB);
745 Value *ShadowValue = IRB.CreateLoad(
746 IRB.CreateIntToPtr(ShadowPtr, ShadowPtrTy));
748 Value *Cmp = IRB.CreateICmpNE(ShadowValue, CmpVal);
758 IRB.SetInsertPoint(CheckTerm);
759 Value *Cmp2 = createSlowPathCmp(IRB, AddrLong, ShadowValue, TypeSize);
784 IRBuilder<> IRB(GlobalInit->begin()->getFirstInsertionPt());
788 IRB.CreateCall(AsanPoisonGlobals, ModuleNameAddr);
859 IRBuilder<> IRB(*C);
862 kAsanPoisonGlobalsName, IRB.getVoidTy(), IntptrTy, NULL));
865 kAsanUnpoisonGlobalsName, IRB.getVoidTy(), NULL));
869 kAsanRegisterGlobalsName, IRB.getVoidTy(),
874 IRB.getVoidTy(), IntptrTy, IntptrTy, NULL));
922 IRBuilder<> IRB(CtorFunc->getEntryBlock().getTerminator());
949 Type *RightRedZoneTy = ArrayType::get(IRB.getInt8Ty(), RightRedzoneSize);
974 Indices2[0] = IRB.getInt32(0);
975 Indices2[1] = IRB.getInt32(0);
1007 IRB.CreateCall2(AsanRegisterGlobals,
1008 IRB.CreatePointerCast(AllGlobals, IntptrTy),
1019 IRB.CreatePointerCast(AllGlobals, IntptrTy),
1028 IRBuilder<> IRB(*C);
1039 FunctionName, IRB.getVoidTy(), IntptrTy, NULL));
1043 kAsanReportLoadN, IRB.getVoidTy(), IntptrTy, IntptrTy, NULL));
1045 kAsanReportStoreN, IRB.getVoidTy(), IntptrTy, IntptrTy, NULL));
1048 kAsanHandleNoReturnName, IRB.getVoidTy(), NULL));
1050 EmptyAsm = InlineAsm::get(FunctionType::get(IRB.getVoidTy(), false),
1055 void AddressSanitizer::emitShadowMapping(Module &M, IRBuilder<> &IRB) const {
1062 IRB.CreateLoad(asan_mapping_offset, true);
1069 IRB.CreateLoad(asan_mapping_scale, true);
1091 IRBuilder<> IRB(ReturnInst::Create(*C, AsanCtorBB));
1093 M.getOrInsertFunction(kAsanInitName, IRB.getVoidTy(), NULL));
1095 IRB.CreateCall(AsanInitFunction);
1098 emitShadowMapping(M, IRB);
1113 IRBuilder<> IRB(F.begin()->begin());
1114 IRB.CreateCall(AsanInitFunction);
1210 IRBuilder<> IRB(CI);
1211 IRB.CreateCall(AsanHandleNoReturnFunc);
1273 IRBuilder<> IRB(*C);
1277 kAsanStackFreeName, IRB.getVoidTy(),
1280 kAsanPoisonStackMemoryName, IRB.getVoidTy(), IntptrTy, IntptrTy, NULL));
1282 kAsanUnpoisonStackMemoryName, IRB.getVoidTy(), IntptrTy, IntptrTy, NULL));
1286 const ArrayRef<AllocaInst*> &AllocaVec, IRBuilder<> IRB, Value *ShadowBase,
1301 IRB.CreateStore(PoisonLeft, IRB.CreateIntToPtr(ShadowBase, RZPtrTy));
1317 Ptr = IRB.CreateAdd(
1333 IRB.CreateStore(PartialPoison, IRB.CreateIntToPtr(Ptr, RZPtrTy));
1337 Ptr = IRB.CreateAdd(ShadowBase,
1341 IRB.CreateStore(Poison, IRB.CreateIntToPtr(Ptr, RZPtrTy));
1356 IRBuilder<> IRB(InsBefore);
1359 Type *ByteArrayTy = ArrayType::get(IRB.getInt8Ty(), LocalStackSize);
1366 Value *OrigStackBase = IRB.CreatePointerCast(MyAlloca, IntptrTy);
1370 LocalStackBase = IRB.CreateCall2(AsanStackMallocFunc,
1386 IRBuilder<> IRB(II);
1387 poisonAlloca(AI, APC.Size, IRB, APC.DoPoison);
1401 Value *NewAllocaPtr = IRB.CreateIntToPtr(
1402 IRB.CreateAdd(LocalStackBase, ConstantInt::get(IntptrTy, Pos)),
1412 Value *BasePlus0 = IRB.CreateIntToPtr(LocalStackBase, IntptrPtrTy);
1413 IRB.CreateStore(ConstantInt::get(IntptrTy, kCurrentStackFrameMagic),
1416 Value *BasePlus1 = IRB.CreateIntToPtr(
1417 IRB.CreateAdd(LocalStackBase, ConstantInt::get(IntptrTy, ASan.LongSize/8)),
1421 Value *Description = IRB.CreatePointerCast(StackDescriptionGlobal,
1423 IRB.CreateStore(Description, BasePlus1);
1425 Value *BasePlus2 = IRB.CreateIntToPtr(
1426 IRB.CreateAdd(LocalStackBase, ConstantInt::get(IntptrTy,
1429 IRB.CreateStore(IRB.CreatePointerCast(&F, IntptrTy), BasePlus2);
1432 Value *ShadowBase = ASan.memToShadow(LocalStackBase, IRB);
1433 poisonRedZones(AllocaVec, IRB, ShadowBase, true);
1463 IRBuilder<> IRB, bool DoPoison) {
1465 Value *AddrArg = IRB.CreatePointerCast(V, IntptrTy);
1467 IRB.CreateCall2(DoPoison ? AsanPoisonStackMemoryFunc