Lines Matching refs:IRB
704 Instruction *genAMDGPUReportBlock(IRBuilder<> &IRB, Value *Cond,
718 Value *createSlowPathCmp(IRBuilder<> &IRB, Value *AddrLong,
724 Value *memToShadow(Value *Shadow, IRBuilder<> &IRB);
842 void instrumentGlobals(IRBuilder<> &IRB, Module &M, bool *CtorComdat);
843 void InstrumentGlobalsCOFF(IRBuilder<> &IRB, Module &M,
846 void instrumentGlobalsELF(IRBuilder<> &IRB, Module &M,
850 void InstrumentGlobalsMachO(IRBuilder<> &IRB, Module &M,
854 InstrumentGlobalsWithMetadataArray(IRBuilder<> &IRB, Module &M,
1020 IRBuilder<> IRB(InstBefore); in unpoisonDynamicAllocasBeforeInst() local
1021 Value *DynamicAreaPtr = IRB.CreatePtrToInt(SavedStack, IntptrTy); in unpoisonDynamicAllocasBeforeInst()
1031 Value *DynamicAreaOffset = IRB.CreateCall(DynamicAreaOffsetFunc, {}); in unpoisonDynamicAllocasBeforeInst()
1033 DynamicAreaPtr = IRB.CreateAdd(IRB.CreatePtrToInt(SavedStack, IntptrTy), in unpoisonDynamicAllocasBeforeInst()
1037 IRB.CreateCall( in unpoisonDynamicAllocasBeforeInst()
1039 {IRB.CreateLoad(IntptrTy, DynamicAllocaLayout), DynamicAreaPtr}); in unpoisonDynamicAllocasBeforeInst()
1139 IRBuilder<> &IRB, Value *ShadowBase);
1141 size_t Begin, size_t End, IRBuilder<> &IRB,
1145 size_t End, IRBuilder<> &IRB, Value *ShadowBase);
1147 void poisonAlloca(Value *V, uint64_t Size, IRBuilder<> &IRB, bool DoPoison);
1149 Value *createAllocaForLayout(IRBuilder<> &IRB, const ASanStackFrameLayout &L,
1151 PHINode *createPHI(IRBuilder<> &IRB, Value *Cond, Value *ValueIfTrue,
1237 Value *AddressSanitizer::memToShadow(Value *Shadow, IRBuilder<> &IRB) { in memToShadow() argument
1239 Shadow = IRB.CreateLShr(Shadow, Mapping.Scale); in memToShadow()
1248 return IRB.CreateOr(Shadow, ShadowBase); in memToShadow()
1250 return IRB.CreateAdd(Shadow, ShadowBase); in memToShadow()
1255 InstrumentationIRBuilder IRB(MI); in instrumentMemIntrinsic() local
1257 IRB.CreateCall(isa<MemMoveInst>(MI) ? AsanMemmove : AsanMemcpy, in instrumentMemIntrinsic()
1259 IRB.CreateIntCast(MI->getOperand(2), IntptrTy, false)}); in instrumentMemIntrinsic()
1261 IRB.CreateCall( in instrumentMemIntrinsic()
1264 IRB.CreateIntCast(MI->getOperand(1), IRB.getInt32Ty(), false), in instrumentMemIntrinsic()
1265 IRB.CreateIntCast(MI->getOperand(2), IntptrTy, false)}); in instrumentMemIntrinsic()
1501 IRBuilder<> IRB(I); in instrumentPointerComparisonOrSubtraction() local
1506 i = IRB.CreatePointerCast(i, IntptrTy); in instrumentPointerComparisonOrSubtraction()
1508 IRB.CreateCall(F, Param); in instrumentPointerComparisonOrSubtraction()
1571 [&](IRBuilderBase &IRB, Value *Index) { in instrumentMaskedLoadOrStore() argument
1572 Value *MaskElem = IRB.CreateExtractElement(Mask, Index); in instrumentMaskedLoadOrStore()
1581 MaskElem, &*IRB.GetInsertPoint(), false); in instrumentMaskedLoadOrStore()
1582 IRB.SetInsertPoint(ThenTerm); in instrumentMaskedLoadOrStore()
1590 InstrumentedAddress = IRB.CreateExtractElement(Addr, Index); in instrumentMaskedLoadOrStore()
1592 Index = IRB.CreateMul(Index, Stride); in instrumentMaskedLoadOrStore()
1593 InstrumentedAddress = IRB.CreatePtrAdd(Addr, Index); in instrumentMaskedLoadOrStore()
1595 InstrumentedAddress = IRB.CreateGEP(VTy, Addr, {Zero, Index}); in instrumentMaskedLoadOrStore()
1597 doInstrumentAddress(Pass, I, &*IRB.GetInsertPoint(), in instrumentMaskedLoadOrStore()
1664 InstrumentationIRBuilder IRB(InsertBefore); in generateCrashCode() local
1665 Value *ExpVal = Exp == 0 ? nullptr : ConstantInt::get(IRB.getInt32Ty(), Exp); in generateCrashCode()
1669 Call = IRB.CreateCall(AsanErrorCallbackSized[IsWrite][0], in generateCrashCode()
1672 Call = IRB.CreateCall(AsanErrorCallbackSized[IsWrite][1], in generateCrashCode()
1677 IRB.CreateCall(AsanErrorCallback[IsWrite][0][AccessSizeIndex], Addr); in generateCrashCode()
1679 Call = IRB.CreateCall(AsanErrorCallback[IsWrite][1][AccessSizeIndex], in generateCrashCode()
1687 Value *AddressSanitizer::createSlowPathCmp(IRBuilder<> &IRB, Value *AddrLong, in createSlowPathCmp() argument
1693 IRB.CreateAnd(AddrLong, ConstantInt::get(IntptrTy, Granularity - 1)); in createSlowPathCmp()
1696 LastAccessedByte = IRB.CreateAdd( in createSlowPathCmp()
1700 IRB.CreateIntCast(LastAccessedByte, ShadowValue->getType(), false); in createSlowPathCmp()
1702 return IRB.CreateICmpSGE(LastAccessedByte, ShadowValue); in createSlowPathCmp()
1716 IRBuilder<> IRB(InsertBefore); in instrumentAMDGPUAddress() local
1717 Value *IsShared = IRB.CreateCall(AMDGPUAddressShared, {Addr}); in instrumentAMDGPUAddress()
1718 Value *IsPrivate = IRB.CreateCall(AMDGPUAddressPrivate, {Addr}); in instrumentAMDGPUAddress()
1719 Value *IsSharedOrPrivate = IRB.CreateOr(IsShared, IsPrivate); in instrumentAMDGPUAddress()
1720 Value *Cmp = IRB.CreateNot(IsSharedOrPrivate); in instrumentAMDGPUAddress()
1727 Instruction *AddressSanitizer::genAMDGPUReportBlock(IRBuilder<> &IRB, in genAMDGPUReportBlock() argument
1729 Module &M = *IRB.GetInsertBlock()->getModule(); in genAMDGPUReportBlock()
1732 auto Ballot = M.getOrInsertFunction(kAMDGPUBallotName, IRB.getInt64Ty(), in genAMDGPUReportBlock()
1733 IRB.getInt1Ty()); in genAMDGPUReportBlock()
1734 ReportCond = IRB.CreateIsNotNull(IRB.CreateCall(Ballot, {Cond})); in genAMDGPUReportBlock()
1738 SplitBlockAndInsertIfThen(ReportCond, &*IRB.GetInsertPoint(), false, in genAMDGPUReportBlock()
1746 IRB.SetInsertPoint(Trm); in genAMDGPUReportBlock()
1747 return IRB.CreateCall( in genAMDGPUReportBlock()
1748 M.getOrInsertFunction(kAMDGPUUnreachableName, IRB.getVoidTy()), {}); in genAMDGPUReportBlock()
1764 InstrumentationIRBuilder IRB(InsertBefore); in instrumentAddress() local
1770 Module *M = IRB.GetInsertBlock()->getParent()->getParent(); in instrumentAddress()
1771 IRB.CreateCall( in instrumentAddress()
1773 {IRB.CreatePointerCast(Addr, PtrTy), in instrumentAddress()
1778 Value *AddrLong = IRB.CreatePointerCast(Addr, IntptrTy); in instrumentAddress()
1781 IRB.CreateCall(AsanMemoryAccessCallback[IsWrite][0][AccessSizeIndex], in instrumentAddress()
1784 IRB.CreateCall(AsanMemoryAccessCallback[IsWrite][1][AccessSizeIndex], in instrumentAddress()
1785 {AddrLong, ConstantInt::get(IRB.getInt32Ty(), Exp)}); in instrumentAddress()
1792 Value *ShadowPtr = memToShadow(AddrLong, IRB); in instrumentAddress()
1795 Value *ShadowValue = IRB.CreateAlignedLoad( in instrumentAddress()
1796 ShadowTy, IRB.CreateIntToPtr(ShadowPtr, ShadowPtrTy), Align(ShadowAlign)); in instrumentAddress()
1798 Value *Cmp = IRB.CreateIsNotNull(ShadowValue); in instrumentAddress()
1806 auto *Cmp2 = createSlowPathCmp(IRB, AddrLong, ShadowValue, TypeStoreSize); in instrumentAddress()
1807 Cmp = IRB.CreateAnd(Cmp, Cmp2); in instrumentAddress()
1809 CrashTerm = genAMDGPUReportBlock(IRB, Cmp, Recover); in instrumentAddress()
1817 IRB.SetInsertPoint(CheckTerm); in instrumentAddress()
1818 Value *Cmp2 = createSlowPathCmp(IRB, AddrLong, ShadowValue, TypeStoreSize); in instrumentAddress()
1845 InstrumentationIRBuilder IRB(InsertBefore); in instrumentUnusualSizeOrAlignment() local
1846 Value *NumBits = IRB.CreateTypeSize(IntptrTy, TypeStoreSize); in instrumentUnusualSizeOrAlignment()
1847 Value *Size = IRB.CreateLShr(NumBits, ConstantInt::get(IntptrTy, 3)); in instrumentUnusualSizeOrAlignment()
1849 Value *AddrLong = IRB.CreatePointerCast(Addr, IntptrTy); in instrumentUnusualSizeOrAlignment()
1852 IRB.CreateCall(AsanMemoryAccessCallbackSized[IsWrite][0], in instrumentUnusualSizeOrAlignment()
1855 IRB.CreateCall(AsanMemoryAccessCallbackSized[IsWrite][1], in instrumentUnusualSizeOrAlignment()
1856 {AddrLong, Size, ConstantInt::get(IRB.getInt32Ty(), Exp)}); in instrumentUnusualSizeOrAlignment()
1858 Value *SizeMinusOne = IRB.CreateSub(Size, ConstantInt::get(IntptrTy, 1)); in instrumentUnusualSizeOrAlignment()
1859 Value *LastByte = IRB.CreateIntToPtr( in instrumentUnusualSizeOrAlignment()
1860 IRB.CreateAdd(AddrLong, SizeMinusOne), in instrumentUnusualSizeOrAlignment()
1871 IRBuilder<> IRB(&GlobalInit.front(), in poisonOneInitializer() local
1876 IRB.CreateCall(AsanPoisonGlobals, ModuleNameAddr); in poisonOneInitializer()
2106 IRBuilder<> IRB(*C); in initializeCallbacks() local
2110 M.getOrInsertFunction(kAsanPoisonGlobalsName, IRB.getVoidTy(), IntptrTy); in initializeCallbacks()
2112 M.getOrInsertFunction(kAsanUnpoisonGlobalsName, IRB.getVoidTy()); in initializeCallbacks()
2116 kAsanRegisterGlobalsName, IRB.getVoidTy(), IntptrTy, IntptrTy); in initializeCallbacks()
2118 kAsanUnregisterGlobalsName, IRB.getVoidTy(), IntptrTy, IntptrTy); in initializeCallbacks()
2123 kAsanRegisterImageGlobalsName, IRB.getVoidTy(), IntptrTy); in initializeCallbacks()
2125 kAsanUnregisterImageGlobalsName, IRB.getVoidTy(), IntptrTy); in initializeCallbacks()
2128 M.getOrInsertFunction(kAsanRegisterElfGlobalsName, IRB.getVoidTy(), in initializeCallbacks()
2131 M.getOrInsertFunction(kAsanUnregisterElfGlobalsName, IRB.getVoidTy(), in initializeCallbacks()
2203 IRBuilder<> &IRB, Module &M, ArrayRef<GlobalVariable *> ExtendedGlobals, in InstrumentGlobalsCOFF() argument
2236 IRBuilder<> &IRB, Module &M, ArrayRef<GlobalVariable *> ExtendedGlobals, in instrumentGlobalsELF() argument
2288 IRB.CreateCall(AsanRegisterElfGlobals, in instrumentGlobalsELF()
2289 {IRB.CreatePointerCast(RegisteredFlag, IntptrTy), in instrumentGlobalsELF()
2290 IRB.CreatePointerCast(StartELFMetadata, IntptrTy), in instrumentGlobalsELF()
2291 IRB.CreatePointerCast(StopELFMetadata, IntptrTy)}); in instrumentGlobalsELF()
2298 {IRB.CreatePointerCast(RegisteredFlag, IntptrTy), in instrumentGlobalsELF()
2299 IRB.CreatePointerCast(StartELFMetadata, IntptrTy), in instrumentGlobalsELF()
2300 IRB.CreatePointerCast(StopELFMetadata, IntptrTy)}); in instrumentGlobalsELF()
2305 IRBuilder<> &IRB, Module &M, ArrayRef<GlobalVariable *> ExtendedGlobals, in InstrumentGlobalsMachO() argument
2352 IRB.CreateCall(AsanRegisterImageGlobals, in InstrumentGlobalsMachO()
2353 {IRB.CreatePointerCast(RegisteredFlag, IntptrTy)}); in InstrumentGlobalsMachO()
2360 {IRB.CreatePointerCast(RegisteredFlag, IntptrTy)}); in InstrumentGlobalsMachO()
2365 IRBuilder<> &IRB, Module &M, ArrayRef<GlobalVariable *> ExtendedGlobals, in InstrumentGlobalsWithMetadataArray() argument
2382 IRB.CreateCall(AsanRegisterGlobals, in InstrumentGlobalsWithMetadataArray()
2383 {IRB.CreatePointerCast(AllGlobals, IntptrTy), in InstrumentGlobalsWithMetadataArray()
2391 {IRB.CreatePointerCast(AllGlobals, IntptrTy), in InstrumentGlobalsWithMetadataArray()
2401 void ModuleAddressSanitizer::instrumentGlobals(IRBuilder<> &IRB, Module &M, in instrumentGlobals() argument
2466 Type *RightRedZoneTy = ArrayType::get(IRB.getInt8Ty(), RightRedzoneSize); in instrumentGlobals()
2500 Indices2[0] = IRB.getInt32(0); in instrumentGlobals()
2501 Indices2[1] = IRB.getInt32(0); in instrumentGlobals()
2530 new GlobalVariable(M, IRB.getInt8Ty(), false, Linkage, in instrumentGlobals()
2531 Constant::getNullValue(IRB.getInt8Ty()), in instrumentGlobals()
2577 instrumentGlobalsELF(IRB, M, NewGlobals, Initializers, in instrumentGlobals()
2586 InstrumentGlobalsCOFF(IRB, M, NewGlobals, Initializers); in instrumentGlobals()
2588 InstrumentGlobalsMachO(IRB, M, NewGlobals, Initializers); in instrumentGlobals()
2590 InstrumentGlobalsWithMetadataArray(IRB, M, NewGlobals, Initializers); in instrumentGlobals()
2661 IRBuilder<> IRB(AsanCtorFunction->getEntryBlock().getTerminator()); in instrumentModule() local
2662 instrumentGlobals(IRB, M, &CtorComdat); in instrumentModule()
2664 IRBuilder<> IRB(*C); in instrumentModule() local
2665 instrumentGlobals(IRB, M, &CtorComdat); in instrumentModule()
2694 IRBuilder<> IRB(*C); in initializeCallbacks() local
2718 FunctionType::get(IRB.getVoidTy(), Args2, false), AL2); in initializeCallbacks()
2722 FunctionType::get(IRB.getVoidTy(), Args2, false), AL2); in initializeCallbacks()
2730 FunctionType::get(IRB.getVoidTy(), Args1, false), AL1); in initializeCallbacks()
2735 FunctionType::get(IRB.getVoidTy(), Args1, false), AL1); in initializeCallbacks()
2750 PtrTy, PtrTy, IRB.getInt32Ty(), IntptrTy); in initializeCallbacks()
2753 M.getOrInsertFunction(kAsanHandleNoReturnName, IRB.getVoidTy()); in initializeCallbacks()
2756 M.getOrInsertFunction(kAsanPtrCmp, IRB.getVoidTy(), IntptrTy, IntptrTy); in initializeCallbacks()
2758 M.getOrInsertFunction(kAsanPtrSub, IRB.getVoidTy(), IntptrTy, IntptrTy); in initializeCallbacks()
2761 ArrayType::get(IRB.getInt8Ty(), 0)); in initializeCallbacks()
2764 M.getOrInsertFunction(kAMDGPUAddressSharedName, IRB.getInt1Ty(), PtrTy); in initializeCallbacks()
2766 M.getOrInsertFunction(kAMDGPUAddressPrivateName, IRB.getInt1Ty(), PtrTy); in initializeCallbacks()
2780 IRBuilder<> IRB(&F.front(), F.front().begin()); in maybeInsertAsanInitAtFunctionEntry() local
2781 IRB.CreateCall(AsanInitFunction, {}); in maybeInsertAsanInitAtFunctionEntry()
2792 IRBuilder<> IRB(&F.front().front()); in maybeInsertDynamicShadowAtFunctionEntry() local
2802 IRB.CreateCall(Asm, {AsanShadowGlobal}, ".asan.shadow"); in maybeInsertDynamicShadowAtFunctionEntry()
2805 IRB.CreatePointerCast(AsanShadowGlobal, IntptrTy, ".asan.shadow"); in maybeInsertDynamicShadowAtFunctionEntry()
2810 LocalDynamicShadow = IRB.CreateLoad(IntptrTy, GlobalDynamicAddress); in maybeInsertDynamicShadowAtFunctionEntry()
2976 IRBuilder<> IRB(CI); in instrumentFunction() local
2977 IRB.CreateCall(AsanHandleNoReturnFunc, {}); in instrumentFunction()
3008 IRBuilder<> IRB(*C); in initializeCallbacks() local
3021 IRB.getVoidTy(), IntptrTy, IntptrTy); in initializeCallbacks()
3026 kAsanPoisonStackMemoryName, IRB.getVoidTy(), IntptrTy, IntptrTy); in initializeCallbacks()
3028 kAsanUnpoisonStackMemoryName, IRB.getVoidTy(), IntptrTy, IntptrTy); in initializeCallbacks()
3037 M.getOrInsertFunction(Name.str(), IRB.getVoidTy(), IntptrTy, IntptrTy); in initializeCallbacks()
3041 kAsanAllocaPoison, IRB.getVoidTy(), IntptrTy, IntptrTy); in initializeCallbacks()
3043 kAsanAllocasUnpoison, IRB.getVoidTy(), IntptrTy, IntptrTy); in initializeCallbacks()
3049 IRBuilder<> &IRB, in copyToShadowInline() argument
3089 Value *Ptr = IRB.CreateAdd(ShadowBase, ConstantInt::get(IntptrTy, i)); in copyToShadowInline()
3090 Value *Poison = IRB.getIntN(StoreSizeInBytes * 8, Val); in copyToShadowInline()
3091 IRB.CreateAlignedStore( in copyToShadowInline()
3092 Poison, IRB.CreateIntToPtr(Ptr, PointerType::getUnqual(Poison->getContext())), in copyToShadowInline()
3101 IRBuilder<> &IRB, Value *ShadowBase) { in copyToShadow() argument
3102 copyToShadow(ShadowMask, ShadowBytes, 0, ShadowMask.size(), IRB, ShadowBase); in copyToShadow()
3108 IRBuilder<> &IRB, Value *ShadowBase) { in copyToShadow() argument
3125 copyToShadowInline(ShadowMask, ShadowBytes, Done, i, IRB, ShadowBase); in copyToShadow()
3126 IRB.CreateCall(AsanSetShadowFunc[Val], in copyToShadow()
3127 {IRB.CreateAdd(ShadowBase, ConstantInt::get(IntptrTy, i)), in copyToShadow()
3133 copyToShadowInline(ShadowMask, ShadowBytes, Done, End, IRB, ShadowBase); in copyToShadow()
3153 IRBuilder<> IRB(CopyInsertPoint); in copyArgsPassedByValToAllocas() local
3161 AllocaInst *AI = IRB.CreateAlloca( in copyArgsPassedByValToAllocas()
3169 IRB.CreateMemCpy(AI, Alignment, &Arg, Alignment, AllocSize); in copyArgsPassedByValToAllocas()
3174 PHINode *FunctionStackPoisoner::createPHI(IRBuilder<> &IRB, Value *Cond, in createPHI() argument
3178 PHINode *PHI = IRB.CreatePHI(IntptrTy, 2); in createPHI()
3187 IRBuilder<> &IRB, const ASanStackFrameLayout &L, bool Dynamic) { in createAllocaForLayout() argument
3190 Alloca = IRB.CreateAlloca(IRB.getInt8Ty(), in createAllocaForLayout()
3191 ConstantInt::get(IRB.getInt64Ty(), L.FrameSize), in createAllocaForLayout()
3194 Alloca = IRB.CreateAlloca(ArrayType::get(IRB.getInt8Ty(), L.FrameSize), in createAllocaForLayout()
3201 return IRB.CreatePointerCast(Alloca, IntptrTy); in createAllocaForLayout()
3206 IRBuilder<> IRB(dyn_cast<Instruction>(FirstBB.begin())); in createDynamicAllocasInitStorage() local
3207 DynamicAllocaLayout = IRB.CreateAlloca(IntptrTy, nullptr); in createDynamicAllocasInitStorage()
3208 IRB.CreateStore(Constant::getNullValue(IntptrTy), DynamicAllocaLayout); in createDynamicAllocasInitStorage()
3225 IRBuilder<> IRB(APC.InsBefore); in processDynamicAllocas() local
3226 poisonAlloca(APC.AI, APC.Size, IRB, APC.DoPoison); in processDynamicAllocas()
3305 IRBuilder<> IRB(InsBefore); in processStaticAllocas() local
3388 DoDynamicAlloca ? nullptr : createAllocaForLayout(IRB, L, false); in processStaticAllocas()
3397 IRB.CreateAlloca(IntptrTy, nullptr, "asan_local_stack_base"); in processStaticAllocas()
3405 kAsanOptionDetectUseAfterReturn, IRB.getInt32Ty()); in processStaticAllocas()
3406 Value *UseAfterReturnIsEnabled = IRB.CreateICmpNE( in processStaticAllocas()
3407 IRB.CreateLoad(IRB.getInt32Ty(), OptionDetectUseAfterReturn), in processStaticAllocas()
3408 Constant::getNullValue(IRB.getInt32Ty())); in processStaticAllocas()
3417 IRB.SetInsertPoint(InsBefore); in processStaticAllocas()
3418 FakeStack = createPHI(IRB, UseAfterReturnIsEnabled, FakeStackValue, Term, in processStaticAllocas()
3426 FakeStack = IRB.CreateCall(AsanStackMallocFunc[StackMallocIdx], in processStaticAllocas()
3430 IRB.CreateICmpEQ(FakeStack, Constant::getNullValue(IntptrTy)); in processStaticAllocas()
3437 IRB.SetInsertPoint(InsBefore); in processStaticAllocas()
3438 LocalStackBase = createPHI(IRB, NoFakeStack, AllocaValue, Term, FakeStack); in processStaticAllocas()
3439 IRB.CreateStore(LocalStackBase, LocalStackBaseAlloca); in processStaticAllocas()
3446 DoDynamicAlloca ? createAllocaForLayout(IRB, L, true) : StaticAlloca; in processStaticAllocas()
3465 Value *NewAllocaPtr = IRB.CreateIntToPtr( in processStaticAllocas()
3466 IRB.CreateAdd(LocalStackBase, ConstantInt::get(IntptrTy, Desc.Offset)), in processStaticAllocas()
3473 Value *BasePlus0 = IRB.CreateIntToPtr(LocalStackBase, IntptrPtrTy); in processStaticAllocas()
3474 IRB.CreateStore(ConstantInt::get(IntptrTy, kCurrentStackFrameMagic), in processStaticAllocas()
3477 Value *BasePlus1 = IRB.CreateIntToPtr( in processStaticAllocas()
3478 IRB.CreateAdd(LocalStackBase, in processStaticAllocas()
3484 Value *Description = IRB.CreatePointerCast(StackDescriptionGlobal, IntptrTy); in processStaticAllocas()
3485 IRB.CreateStore(Description, BasePlus1); in processStaticAllocas()
3487 Value *BasePlus2 = IRB.CreateIntToPtr( in processStaticAllocas()
3488 IRB.CreateAdd(LocalStackBase, in processStaticAllocas()
3491 IRB.CreateStore(IRB.CreatePointerCast(&F, IntptrTy), BasePlus2); in processStaticAllocas()
3496 Value *ShadowBase = ASan.memToShadow(LocalStackBase, IRB); in processStaticAllocas()
3499 copyToShadow(ShadowAfterScope, ShadowAfterScope, IRB, ShadowBase); in processStaticAllocas()
3511 IRBuilder<> IRB(APC.InsBefore); in processStaticAllocas() local
3514 IRB, ShadowBase); in processStaticAllocas()
3579 IRBuilder<> &IRB, bool DoPoison) { in poisonAlloca() argument
3581 Value *AddrArg = IRB.CreatePointerCast(V, IntptrTy); in poisonAlloca()
3583 IRB.CreateCall( in poisonAlloca()
3597 IRBuilder<> IRB(AI); in handleDynamicAllocaCall() local
3613 IRB.CreateMul(IRB.CreateIntCast(AI->getArraySize(), IntptrTy, false), in handleDynamicAllocaCall()
3617 Value *PartialSize = IRB.CreateAnd(OldSize, AllocaRzMask); in handleDynamicAllocaCall()
3620 Value *Misalign = IRB.CreateSub(AllocaRzSize, PartialSize); in handleDynamicAllocaCall()
3623 Value *Cond = IRB.CreateICmpNE(Misalign, AllocaRzSize); in handleDynamicAllocaCall()
3624 Value *PartialPadding = IRB.CreateSelect(Cond, Misalign, Zero); in handleDynamicAllocaCall()
3629 Value *AdditionalChunkSize = IRB.CreateAdd( in handleDynamicAllocaCall()
3633 Value *NewSize = IRB.CreateAdd(OldSize, AdditionalChunkSize); in handleDynamicAllocaCall()
3636 AllocaInst *NewAlloca = IRB.CreateAlloca(IRB.getInt8Ty(), NewSize); in handleDynamicAllocaCall()
3641 IRB.CreateAdd(IRB.CreatePtrToInt(NewAlloca, IntptrTy), in handleDynamicAllocaCall()
3645 IRB.CreateCall(AsanAllocaPoisonFunc, {NewAddress, OldSize}); in handleDynamicAllocaCall()
3649 IRB.CreateStore(IRB.CreatePtrToInt(NewAlloca, IntptrTy), DynamicAllocaLayout); in handleDynamicAllocaCall()
3651 Value *NewAddressPtr = IRB.CreateIntToPtr(NewAddress, AI->getType()); in handleDynamicAllocaCall()