Lines Matching refs:DFS

384   DataFlowSanitizer &DFS;  member
407 DFSanFunction(DataFlowSanitizer &DFS, Function *F, bool IsNativeABI) in DFSanFunction()
408 : DFS(DFS), F(F), IA(DFS.getInstrumentedABI()), IsNativeABI(IsNativeABI) { in DFSanFunction()
966 Value *Ne = IRB.CreateICmpNE(V, DFSF.DFS.ZeroShadow); in runOnModule()
970 ThenIRB.CreateCall(DFSF.DFS.DFSanNonzeroLabelFn, {}); in runOnModule()
981 if (DFS.ArgTLS) in getArgTLSPtr()
982 return ArgTLSPtr = DFS.ArgTLS; in getArgTLSPtr()
985 return ArgTLSPtr = IRB.CreateCall(DFS.GetArgTLS, {}); in getArgTLSPtr()
991 if (DFS.RetvalTLS) in getRetvalTLS()
992 return RetvalTLSPtr = DFS.RetvalTLS; in getRetvalTLS()
995 return RetvalTLSPtr = IRB.CreateCall(DFS.GetRetvalTLS, {}); in getRetvalTLS()
1005 return DFS.ZeroShadow; in getShadow()
1010 return DFS.ZeroShadow; in getShadow()
1015 DFS.ArgTLS ? &*F->getEntryBlock().begin() in getShadow()
1027 assert(Shadow->getType() == DFS.ShadowTy); in getShadow()
1033 Shadow = DFS.ZeroShadow; in getShadow()
1041 assert(Shadow->getType() == DFS.ShadowTy); in setShadow()
1064 if (V1 == DFS.ZeroShadow) in combineShadows()
1066 if (V2 == DFS.ZeroShadow) in combineShadows()
1098 CallInst *Call = IRB.CreateCall(DFS.DFSanCheckedUnionFn, {V1, V2}); in combineShadows()
1109 Ne, Pos, /*Unreachable=*/false, DFS.ColdCallWeights, &DT)); in combineShadows()
1111 CallInst *Call = ThenIRB.CreateCall(DFS.DFSanUnionFn, {V1, V2}); in combineShadows()
1117 PHINode *Phi = PHINode::Create(DFS.ShadowTy, 2, "", &Tail->front()); in combineShadows()
1146 return DFS.ZeroShadow; in combineOperandShadows()
1172 uint64_t ShadowAlign = Align * DFS.ShadowWidth / 8; in loadShadow()
1186 return DFS.ZeroShadow; in loadShadow()
1188 Value *ShadowAddr = DFS.getShadowAddress(Addr, Pos); in loadShadow()
1191 return DFS.ZeroShadow; in loadShadow()
1199 Value *ShadowAddr1 = IRB.CreateGEP(DFS.ShadowTy, ShadowAddr, in loadShadow()
1200 ConstantInt::get(DFS.IntptrTy, 1)); in loadShadow()
1205 if (!AvoidNewBlocks && Size % (64 / DFS.ShadowWidth) == 0) { in loadShadow()
1209 BasicBlock *FallbackBB = BasicBlock::Create(*DFS.Ctx, "", F); in loadShadow()
1212 DFS.DFSanUnionLoadFn, in loadShadow()
1213 {ShadowAddr, ConstantInt::get(DFS.IntptrTy, Size)}); in loadShadow()
1220 IRB.CreateBitCast(ShadowAddr, Type::getInt64PtrTy(*DFS.Ctx)); in loadShadow()
1222 Value *TruncShadow = IRB.CreateTrunc(WideShadow, DFS.ShadowTy); in loadShadow()
1223 Value *ShlShadow = IRB.CreateShl(WideShadow, DFS.ShadowWidth); in loadShadow()
1224 Value *ShrShadow = IRB.CreateLShr(WideShadow, 64 - DFS.ShadowWidth); in loadShadow()
1247 for (uint64_t Ofs = 64 / DFS.ShadowWidth; Ofs != Size; in loadShadow()
1248 Ofs += 64 / DFS.ShadowWidth) { in loadShadow()
1249 BasicBlock *NextBB = BasicBlock::Create(*DFS.Ctx, "", F); in loadShadow()
1252 WideAddr = NextIRB.CreateGEP(Type::getInt64Ty(*DFS.Ctx), WideAddr, in loadShadow()
1253 ConstantInt::get(DFS.IntptrTy, 1)); in loadShadow()
1262 PHINode *Shadow = PHINode::Create(DFS.ShadowTy, 2, "", &Tail->front()); in loadShadow()
1270 DFS.DFSanUnionLoadFn, {ShadowAddr, ConstantInt::get(DFS.IntptrTy, Size)}); in loadShadow()
1279 DFSF.setShadow(&LI, DFSF.DFS.ZeroShadow); in visitLoadInst()
1297 if (Shadow != DFSF.DFS.ZeroShadow) in visitLoadInst()
1314 uint64_t ShadowAlign = Align * DFS.ShadowWidth / 8; in storeShadow()
1316 Value *ShadowAddr = DFS.getShadowAddress(Addr, Pos); in storeShadow()
1317 if (Shadow == DFS.ZeroShadow) { in storeShadow()
1318 IntegerType *ShadowTy = IntegerType::get(*DFS.Ctx, Size * DFS.ShadowWidth); in storeShadow()
1326 const unsigned ShadowVecSize = 128 / DFS.ShadowWidth; in storeShadow()
1329 VectorType *ShadowVecTy = VectorType::get(DFS.ShadowTy, ShadowVecSize); in storeShadow()
1333 ShadowVec, Shadow, ConstantInt::get(Type::getInt32Ty(*DFS.Ctx), i)); in storeShadow()
1348 IRB.CreateConstGEP1_32(DFS.ShadowTy, ShadowAddr, Offset); in storeShadow()
1426 DFSF.AllocaShadowMap[&I] = IRB.CreateAlloca(DFSF.DFS.ShadowTy); in visitAllocaInst()
1428 DFSF.setShadow(&I, DFSF.DFS.ZeroShadow); in visitAllocaInst()
1456 IRB.CreateCall(DFSF.DFS.DFSanSetLabelFn, in visitMemSetInst()
1458 *DFSF.DFS.Ctx)), in visitMemSetInst()
1459 IRB.CreateZExtOrTrunc(I.getLength(), DFSF.DFS.IntptrTy)}); in visitMemSetInst()
1464 Value *DestShadow = DFSF.DFS.getShadowAddress(I.getDest(), &I); in visitMemTransferInst()
1465 Value *SrcShadow = DFSF.DFS.getShadowAddress(I.getSource(), &I); in visitMemTransferInst()
1468 ConstantInt::get(I.getLength()->getType(), DFSF.DFS.ShadowWidth / 8)); in visitMemTransferInst()
1469 Type *Int8Ptr = Type::getInt8PtrTy(*DFSF.DFS.Ctx); in visitMemTransferInst()
1476 MTI->setDestAlignment(I.getDestAlignment() * (DFSF.DFS.ShadowWidth / 8)); in visitMemTransferInst()
1477 MTI->setSourceAlignment(I.getSourceAlignment() * (DFSF.DFS.ShadowWidth / 8)); in visitMemTransferInst()
1479 MTI->setDestAlignment(DFSF.DFS.ShadowWidth / 8); in visitMemTransferInst()
1480 MTI->setSourceAlignment(DFSF.DFS.ShadowWidth / 8); in visitMemTransferInst()
1516 if (F == DFSF.DFS.DFSanVarargWrapperFn) in visitCallSite()
1522 DFSF.DFS.UnwrappedFnMap.find(CS.getCalledValue()); in visitCallSite()
1523 if (i != DFSF.DFS.UnwrappedFnMap.end()) { in visitCallSite()
1525 switch (DFSF.DFS.getWrapperKind(F)) { in visitCallSite()
1528 IRB.CreateCall(DFSF.DFS.DFSanUnimplementedFn, in visitCallSite()
1530 DFSF.setShadow(CS.getInstruction(), DFSF.DFS.ZeroShadow); in visitCallSite()
1534 DFSF.setShadow(CS.getInstruction(), DFSF.DFS.ZeroShadow); in visitCallSite()
1546 TransformedFunction CustomFn = DFSF.DFS.getCustomFunctionType(FT); in visitCallSite()
1549 Constant *CustomF = DFSF.DFS.Mod->getOrInsertFunction( in visitCallSite()
1557 DFSF.DFS.ReadOnlyNoneAttrs); in visitCallSite()
1574 Constant *T = DFSF.DFS.getOrBuildTrampolineFunction(ParamFT, TName); in visitCallSite()
1577 IRB.CreateBitCast(*i, Type::getInt8PtrTy(*DFSF.DFS.Ctx))); in visitCallSite()
1589 auto *LabelVATy = ArrayType::get(DFSF.DFS.ShadowTy, in visitCallSite()
1606 new AllocaInst(DFSF.DFS.ShadowTy, in visitCallSite()
1626 if (CustomCI->getArgOperand(ArgNo)->getType() == DFSF.DFS.ShadowTy) in visitCallSite()
1645 if (DFSF.DFS.getInstrumentedABI() == DataFlowSanitizer::IA_TLS) { in visitCallSite()
1667 if (DFSF.DFS.getInstrumentedABI() == DataFlowSanitizer::IA_TLS) { in visitCallSite()
1678 if (DFSF.DFS.getInstrumentedABI() == DataFlowSanitizer::IA_Args) { in visitCallSite()
1679 FunctionType *NewFT = DFSF.DFS.getArgsFunctionType(FT); in visitCallSite()
1694 ArrayType *VarArgArrayTy = ArrayType::get(DFSF.DFS.ShadowTy, VarArgSize); in visitCallSite()
1716 *DFSF.DFS.Ctx, AttributeList::ReturnIndex, in visitCallSite()
1738 PHINode::Create(DFSF.DFS.ShadowTy, PN.getNumIncomingValues(), "", &PN); in visitPHINode()
1741 Value *UndefShadow = UndefValue::get(DFSF.DFS.ShadowTy); in visitPHINode()