Lines Matching refs:Addr

107   bool addrPointsToConstantData(Value *Addr);
108 int getMemoryAccessFuncIndex(Value *Addr, const DataLayout &DL);
305 static bool shouldInstrumentReadWriteFromAddress(const Module *M, Value *Addr) { in shouldInstrumentReadWriteFromAddress() argument
307 Addr = Addr->stripInBoundsOffsets(); in shouldInstrumentReadWriteFromAddress()
309 if (GlobalVariable *GV = dyn_cast<GlobalVariable>(Addr)) { in shouldInstrumentReadWriteFromAddress()
327 if (Addr) { in shouldInstrumentReadWriteFromAddress()
328 Type *PtrTy = cast<PointerType>(Addr->getType()->getScalarType()); in shouldInstrumentReadWriteFromAddress()
336 bool ThreadSanitizer::addrPointsToConstantData(Value *Addr) { in addrPointsToConstantData() argument
338 if (GetElementPtrInst *GEP = dyn_cast<GetElementPtrInst>(Addr)) in addrPointsToConstantData()
339 Addr = GEP->getPointerOperand(); in addrPointsToConstantData()
341 if (GlobalVariable *GV = dyn_cast<GlobalVariable>(Addr)) { in addrPointsToConstantData()
347 } else if (LoadInst *L = dyn_cast<LoadInst>(Addr)) { in addrPointsToConstantData()
376 Value *Addr = Store->getPointerOperand(); in chooseInstructionsToInstrument() local
377 if (!shouldInstrumentReadWriteFromAddress(I->getModule(), Addr)) in chooseInstructionsToInstrument()
379 WriteTargets.insert(Addr); in chooseInstructionsToInstrument()
382 Value *Addr = Load->getPointerOperand(); in chooseInstructionsToInstrument() local
383 if (!shouldInstrumentReadWriteFromAddress(I->getModule(), Addr)) in chooseInstructionsToInstrument()
385 if (WriteTargets.count(Addr)) { in chooseInstructionsToInstrument()
390 if (addrPointsToConstantData(Addr)) { in chooseInstructionsToInstrument()
395 Value *Addr = isa<StoreInst>(*I) in chooseInstructionsToInstrument() local
398 if (isa<AllocaInst>(GetUnderlyingObject(Addr, DL)) && in chooseInstructionsToInstrument()
399 !PointerMayBeCaptured(Addr, true, true)) { in chooseInstructionsToInstrument()
520 Value *Addr = IsWrite in instrumentLoadOrStore() local
527 if (Addr->isSwiftError()) in instrumentLoadOrStore()
530 int Idx = getMemoryAccessFuncIndex(Addr, DL); in instrumentLoadOrStore()
546 {IRB.CreatePointerCast(Addr, IRB.getInt8PtrTy()), in instrumentLoadOrStore()
553 IRB.CreatePointerCast(Addr, IRB.getInt8PtrTy())); in instrumentLoadOrStore()
560 Type *OrigTy = cast<PointerType>(Addr->getType())->getElementType(); in instrumentLoadOrStore()
567 IRB.CreateCall(OnAccessFunc, IRB.CreatePointerCast(Addr, IRB.getInt8PtrTy())); in instrumentLoadOrStore()
629 Value *Addr = LI->getPointerOperand(); in instrumentAtomic() local
630 int Idx = getMemoryAccessFuncIndex(Addr, DL); in instrumentAtomic()
637 Value *Args[] = {IRB.CreatePointerCast(Addr, PtrTy), in instrumentAtomic()
639 Type *OrigTy = cast<PointerType>(Addr->getType())->getElementType(); in instrumentAtomic()
644 Value *Addr = SI->getPointerOperand(); in instrumentAtomic() local
645 int Idx = getMemoryAccessFuncIndex(Addr, DL); in instrumentAtomic()
652 Value *Args[] = {IRB.CreatePointerCast(Addr, PtrTy), in instrumentAtomic()
658 Value *Addr = RMWI->getPointerOperand(); in instrumentAtomic() local
659 int Idx = getMemoryAccessFuncIndex(Addr, DL); in instrumentAtomic()
669 Value *Args[] = {IRB.CreatePointerCast(Addr, PtrTy), in instrumentAtomic()
675 Value *Addr = CASI->getPointerOperand(); in instrumentAtomic() local
676 int Idx = getMemoryAccessFuncIndex(Addr, DL); in instrumentAtomic()
687 Value *Args[] = {IRB.CreatePointerCast(Addr, PtrTy), in instrumentAtomic()
717 int ThreadSanitizer::getMemoryAccessFuncIndex(Value *Addr, in getMemoryAccessFuncIndex() argument
719 Type *OrigPtrTy = Addr->getType(); in getMemoryAccessFuncIndex()