llvm.org GIT mirror llvm / 84c70a7
[asan] temporary disable generating __asan_loadN/__asan_storeN git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@206741 91177308-0d34-0410-b5e6-96231b3b80d8 Kostya Serebryany 6 years ago
1 changed file(s) with 6 addition(s) and 11 deletion(s). Raw diff Collapse all Expand all
612612 if (Size->getType() != IntptrTy)
613613 Size = IRB.CreateIntCast(Size, IntptrTy, false);
614614 // Check the first byte.
615 instrumentAddress(OrigIns, InsertBefore, Addr, 8, IsWrite, Size, UseCalls);
615 instrumentAddress(OrigIns, InsertBefore, Addr, 8, IsWrite, Size, false);
616616 // Check the last byte.
617617 IRB.SetInsertPoint(InsertBefore);
618618 Value *SizeMinusOne = IRB.CreateSub(Size, ConstantInt::get(IntptrTy, 1));
619619 Value *AddrLong = IRB.CreatePointerCast(Addr, IntptrTy);
620620 Value *AddrLast = IRB.CreateAdd(AddrLong, SizeMinusOne);
621 instrumentAddress(OrigIns, InsertBefore, AddrLast, 8, IsWrite, Size,
622 UseCalls);
621 instrumentAddress(OrigIns, InsertBefore, AddrLast, 8, IsWrite, Size, false);
623622 }
624623
625624 // Instrument memset/memmove/memcpy
767766 ConstantInt::get(IntptrTy, TypeSize / 8 - 1)),
768767 OrigPtrTy);
769768 Value *Size = ConstantInt::get(IntptrTy, TypeSize / 8);
770 instrumentAddress(I, I, Addr, 8, IsWrite, Size, UseCalls);
771 instrumentAddress(I, I, LastByte, 8, IsWrite, Size, UseCalls);
769 instrumentAddress(I, I, Addr, 8, IsWrite, Size, false);
770 instrumentAddress(I, I, LastByte, 8, IsWrite, Size, false);
772771 }
773772
774773 // Validate the result of Module::getOrInsertFunction called for an interface
824823 size_t AccessSizeIndex = TypeSizeToSizeIndex(TypeSize);
825824
826825 if (UseCalls) {
827 if (SizeArgument)
828 IRB.CreateCall2(AsanMemoryAccessCallbackSized[IsWrite], AddrLong,
829 SizeArgument);
830 else
831 IRB.CreateCall(AsanMemoryAccessCallback[IsWrite][AccessSizeIndex],
832 AddrLong);
826 IRB.CreateCall(AsanMemoryAccessCallback[IsWrite][AccessSizeIndex],
827 AddrLong);
833828 return;
834829 }
835830