Home | History | Annotate | Download | only in Analysis

Lines Matching defs:vd

35 static bool isTrackedVar(const VarDecl *vd, const DeclContext *dc) {
36 if (vd->isLocalVarDecl() && !vd->hasGlobalStorage() &&
37 !vd->isExceptionVariable() && !vd->isInitCapture() &&
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);
267 const VarDecl *vd;
270 FindVarResult(const VarDecl *vd, const DeclRefExpr *dr) : vd(vd), dr(dr) {}
273 const VarDecl *getDecl() const { return vd; }
295 if (const VarDecl *VD = dyn_cast<VarDecl>(DRE->getDecl()))
296 if (isTrackedVar(VD, DC))
297 return FindVarResult(VD, DRE);
317 bool isTrackedVar(const VarDecl *VD) const {
318 return ::isTrackedVar(VD, DC);
340 const VarDecl *VD = dyn_cast<VarDecl>(DRE->getDecl());
341 if (!VD || !isTrackedVar(VD))
349 static const DeclRefExpr *getSelfInitExpr(VarDecl *VD) {
350 if (Expr *Init = VD->getInit()) {
352 = dyn_cast<DeclRefExpr>(stripCasts(VD->getASTContext(), Init));
353 if (DRE && DRE->getDecl() == VD)
377 VarDecl *VD = dyn_cast<VarDecl>(DI);
378 if (VD && isTrackedVar(VD))
379 if (const DeclRefExpr *DRE = getSelfInitExpr(VD))
449 void reportUse(const Expr *ex, const VarDecl *vd);
459 bool isTrackedVar(const VarDecl *vd) {
460 return ::isTrackedVar(vd, cast<DeclContext>(ac.getDecl()));
467 UninitUse getUninitUse(const Expr *ex, const VarDecl *vd, Value v) {
540 Value AtPredExit = vals.getValue(Pred, B, vd);
545 vals.getValue(B, nullptr, vd) == Uninitialized) {
588 vals.getValue(Block, Succ, vd) == Uninitialized) {
618 void TransferFunctions::reportUse(const Expr *ex, const VarDecl *vd) {
619 Value v = vals[vd];
621 handler.handleUseOfUninitVariable(vd, getUninitUse(ex, vd, v));
627 const VarDecl *VD = cast<VarDecl>(DS->getSingleDecl());
628 if (isTrackedVar(VD))
629 vals[VD] = Initialized;
636 const VarDecl *vd = I.getVariable();
637 if (!isTrackedVar(vd))
640 vals[vd] = Initialized;
643 reportUse(be, vd);
689 if (const VarDecl *VD = Var.getDecl())
690 vals[VD] = Initialized;
696 VarDecl *VD = dyn_cast<VarDecl>(DI);
697 if (VD && isTrackedVar(VD)) {
698 if (getSelfInitExpr(VD)) {
709 vals[VD] = Uninitialized;
710 } else if (VD->getInit()) {
712 vals[VD] = Initialized;
724 vals[VD] = Uninitialized;
792 void handleUseOfUninitVariable(const VarDecl *vd,
801 void handleSelfInit(const VarDecl *vd) override {