Lines Matching refs:vd
35 static bool isTrackedVar(const VarDecl *vd, const DeclContext *dc) {
36 if (vd->isLocalVarDecl() && !vd->hasGlobalStorage() &&
37 !vd->isExceptionVariable() &&
38 vd->getDeclContext() == dc) {
39 QualType ty = vd->getType();
71 const VarDecl *vd = *I;
72 if (isTrackedVar(vd, &dc))
73 map[vd] = count++;
131 ValueVector::reference operator[](const VarDecl *vd);
134 const VarDecl *vd) {
135 const Optional<unsigned> &idx = declToIndex.getValueIndex(vd);
195 ValueVector::reference CFGBlockValues::operator[](const VarDecl *vd) {
196 const Optional<unsigned> &idx = declToIndex.getValueIndex(vd);
268 const VarDecl *vd;
271 FindVarResult(const VarDecl *vd, const DeclRefExpr *dr) : vd(vd), dr(dr) {}
274 const VarDecl *getDecl() const { return vd; }
296 if (const VarDecl *VD = dyn_cast<VarDecl>(DRE->getDecl()))
297 if (isTrackedVar(VD, DC))
298 return FindVarResult(VD, DRE);
318 bool isTrackedVar(const VarDecl *VD) const {
319 return ::isTrackedVar(VD, DC);
341 const VarDecl *VD = dyn_cast<VarDecl>(DRE->getDecl());
342 if (!VD || !isTrackedVar(VD))
350 static const DeclRefExpr *getSelfInitExpr(VarDecl *VD) {
351 if (Expr *Init = VD->getInit()) {
353 = dyn_cast<DeclRefExpr>(stripCasts(VD->getASTContext(), Init));
354 if (DRE && DRE->getDecl() == VD)
379 VarDecl *VD = dyn_cast<VarDecl>(*DI);
380 if (VD && isTrackedVar(VD))
381 if (const DeclRefExpr *DRE = getSelfInitExpr(VD))
451 void reportUse(const Expr *ex, const VarDecl *vd);
461 bool isTrackedVar(const VarDecl *vd) {
462 return ::isTrackedVar(vd, cast<DeclContext>(ac.getDecl()));
469 UninitUse getUninitUse(const Expr *ex, const VarDecl *vd, Value v) {
535 if (vals.getValue(Pred, B, vd) == Initialized)
572 vals.getValue(Block, Succ, vd) == Uninitialized) {
602 void TransferFunctions::reportUse(const Expr *ex, const VarDecl *vd) {
603 Value v = vals[vd];
605 handler.handleUseOfUninitVariable(vd, getUninitUse(ex, vd, v));
611 const VarDecl *VD = cast<VarDecl>(DS->getSingleDecl());
612 if (isTrackedVar(VD))
613 vals[VD] = Initialized;
621 const VarDecl *vd = i->getVariable();
622 if (!isTrackedVar(vd))
625 vals[vd] = Initialized;
628 reportUse(be, vd);
674 if (const VarDecl *VD = Var.getDecl())
675 vals[VD] = Initialized;
682 VarDecl *VD = dyn_cast<VarDecl>(*DI);
683 if (VD && isTrackedVar(VD)) {
684 if (getSelfInitExpr(VD)) {
695 vals[VD] = Uninitialized;
696 } else if (VD->getInit()) {
698 vals[VD] = Initialized;
710 vals[VD] = Uninitialized;
776 virtual void handleUseOfUninitVariable(const VarDecl *vd,
785 virtual void handleSelfInit(const VarDecl *vd) {