Home | History | Annotate | Download | only in Instrumentation

Lines Matching defs:DFS

267   DataFlowSanitizer &DFS;
280 DFSanFunction(DataFlowSanitizer &DFS, Function *F, bool IsNativeABI)
281 : DFS(DFS), F(F), IA(DFS.getInstrumentedABI()),
466 std::string GVName = GV->getName(), Prefix = "dfs$";
639 // Instrumented functions get a 'dfs$' prefix. This allows us to more
785 Value *Ne = IRB.CreateICmpNE(*i, DFSF.DFS.ZeroShadow);
789 ThenIRB.CreateCall(DFSF.DFS.DFSanNonzeroLabelFn);
800 if (DFS.ArgTLS)
801 return ArgTLSPtr = DFS.ArgTLS;
804 return ArgTLSPtr = IRB.CreateCall(DFS.GetArgTLS);
810 if (DFS.RetvalTLS)
811 return RetvalTLSPtr = DFS.RetvalTLS;
814 return RetvalTLSPtr = IRB.CreateCall(DFS.GetRetvalTLS);
824 return DFS.ZeroShadow;
829 return DFS.ZeroShadow;
834 DFS.ArgTLS ? &*F->getEntryBlock().begin()
846 assert(Shadow->getType() == DFS.ShadowTy);
852 Shadow = DFS.ZeroShadow;
860 assert(Shadow->getType() == DFS.ShadowTy);
907 return DFS.ZeroShadow;
911 Shadow = DFS.combineShadows(Shadow, getShadow(Inst->getOperand(i)), Inst);
934 uint64_t ShadowAlign = Align * DFS.ShadowWidth / 8;
936 GetUnderlyingObjects(Addr, Objs, DFS.DL);
949 return DFS.ZeroShadow;
951 Value *ShadowAddr = DFS.getShadowAddress(Addr, Pos);
954 return DFS.ZeroShadow;
963 IRB.CreateGEP(ShadowAddr, ConstantInt::get(DFS.IntptrTy, 1));
964 return DFS.combineShadows(IRB.CreateAlignedLoad(ShadowAddr, ShadowAlign),
969 if (Size % (64 / DFS.ShadowWidth) == 0) {
973 BasicBlock *FallbackBB = BasicBlock::Create(*DFS.Ctx, "", F);
976 DFS.DFSanUnionLoadFn, ShadowAddr, ConstantInt::get(DFS.IntptrTy, Size));
983 IRB.CreateBitCast(ShadowAddr, Type::getInt64PtrTy(*DFS.Ctx));
985 Value *TruncShadow = IRB.CreateTrunc(WideShadow, DFS.ShadowTy);
986 Value *ShlShadow = IRB.CreateShl(WideShadow, DFS.ShadowWidth);
987 Value *ShrShadow = IRB.CreateLShr(WideShadow, 64 - DFS.ShadowWidth);
1000 for (uint64_t Ofs = 64 / DFS.ShadowWidth; Ofs != Size;
1001 Ofs += 64 / DFS.ShadowWidth) {
1002 BasicBlock *NextBB = BasicBlock::Create(*DFS.Ctx, "", F);
1004 WideAddr = NextIRB.CreateGEP(WideAddr, ConstantInt::get(DFS.IntptrTy, 1));
1013 PHINode *Shadow = PHINode::Create(DFS.ShadowTy, 2, "", &Tail->front());
1021 DFS.DFSanUnionLoadFn, ShadowAddr, ConstantInt::get(DFS.IntptrTy, Size));
1027 uint64_t Size = DFSF.DFS.DL->getTypeStoreSize(LI.getType());
1032 Align = DFSF.DFS.DL->getABITypeAlignment(LI.getType());
1040 Shadow = DFSF.DFS.combineShadows(Shadow, PtrShadow, &LI);
1042 if (Shadow != DFSF.DFS.ZeroShadow)
1060 uint64_t ShadowAlign = Align * DFS.ShadowWidth / 8;
1062 Value *ShadowAddr = DFS.getShadowAddress(Addr, Pos);
1063 if (Shadow == DFS.ZeroShadow) {
1064 IntegerType *ShadowTy = IntegerType::get(*DFS.Ctx, Size * DFS.ShadowWidth);
1072 const unsigned ShadowVecSize = 128 / DFS.ShadowWidth;
1075 VectorType *ShadowVecTy = VectorType::get(DFS.ShadowTy, ShadowVecSize);
1079 ShadowVec, Shadow, ConstantInt::get(Type::getInt32Ty(*DFS.Ctx), i));
1101 DFSF.DFS.DL->getTypeStoreSize(SI.getValueOperand()->getType());
1106 Align = DFSF.DFS.DL->getABITypeAlignment(SI.getValueOperand()->getType());
1114 Shadow = DFSF.DFS.combineShadows(Shadow, PtrShadow, &SI);
1167 DFSF.AllocaShadowMap[&I] = IRB.CreateAlloca(DFSF.DFS.ShadowTy);
1169 DFSF.setShadow(&I, DFSF.DFS.ZeroShadow);
1179 &I, DFSF.DFS.combineShadows(
1181 DFSF.DFS.combineShadows(TrueShadow, FalseShadow, &I), &I));
1190 DFSF.setShadow(&I, DFSF.DFS.combineShadows(CondShadow, ShadowSel, &I));
1198 DFSF.DFS.DFSanSetLabelFn, ValShadow,
1199 IRB.CreateBitCast(I.getDest(), Type::getInt8PtrTy(*DFSF.DFS.Ctx)),
1200 IRB.CreateZExtOrTrunc(I.getLength(), DFSF.DFS.IntptrTy));
1205 Value *DestShadow = DFSF.DFS.getShadowAddress(I.getDest(), &I);
1206 Value *SrcShadow = DFSF.DFS.getShadowAddress(I.getSource(), &I);
1209 ConstantInt::get(I.getLength()->getType(), DFSF.DFS.ShadowWidth / 8));
1214 DFSF.DFS.ShadowWidth / 8));
1217 DFSF.DFS.ShadowWidth / 8);
1219 Type *Int8Ptr = Type::getInt8PtrTy(*DFSF.DFS.Ctx);
1259 DFSF.DFS.UnwrappedFnMap.find(CS.getCalledValue());
1260 if (i != DFSF.DFS.UnwrappedFnMap.end()) {
1262 switch (DFSF.DFS.getWrapperKind(F)) {
1265 IRB.CreateCall(DFSF.DFS.DFSanUnimplementedFn,
1267 DFSF.setShadow(CS.getInstruction(), DFSF.DFS.ZeroShadow);
1272 DFSF.setShadow(CS.getInstruction(), DFSF.DFS.ZeroShadow);
1286 FunctionType *CustomFT = DFSF.DFS.getCustomFunctionType(FT);
1290 DFSF.DFS.Mod->getOrInsertFunction(CustomFName, CustomFT);
1297 DFSF.DFS.ReadOnlyNoneAttrs);
1314 Constant *T = DFSF.DFS.getOrBuildTrampolineFunction(ParamFT, TName);
1317 IRB.CreateBitCast(*i, Type::getInt8PtrTy(*DFSF.DFS.Ctx)));
1330 new AllocaInst(DFSF.DFS.ShadowTy, "labelreturn",
1356 if (DFSF.DFS.getInstrumentedABI() == DataFlowSanitizer::IA_TLS) {
1370 SplitEdge(II->getParent(), II->getNormalDest(), &DFSF.DFS);
1377 if (DFSF.DFS.getInstrumentedABI() == DataFlowSanitizer::IA_TLS) {
1388 if (DFSF.DFS.getInstrumentedABI() == DataFlowSanitizer::IA_Args) {
1389 FunctionType *NewFT = DFSF.DFS.getArgsFunctionType(FT);
1404 ArrayType *VarArgArrayTy = ArrayType::get(DFSF.DFS.ShadowTy, VarArgSize);
1424 *DFSF.DFS.Ctx, AttributeSet::ReturnIndex,
1447 PHINode::Create(DFSF.DFS.ShadowTy, PN.getNumIncomingValues(), "", &PN);
1450 Value *UndefShadow = UndefValue::get(DFSF.DFS.ShadowTy);