Analyzer->Handler.handleNoMutexHeld(D, POK_VarAccess, AK,
Exp->getExprLoc());
- const AttrVec &ArgAttrs = D->getAttrs();
- for (unsigned i = 0, Size = ArgAttrs.size(); i < Size; ++i)
- if (GuardedByAttr *GBAttr = dyn_cast<GuardedByAttr>(ArgAttrs[i]))
- warnIfMutexNotHeld(D, Exp, AK, GBAttr->getArg(), POK_VarAccess);
+ for (specific_attr_iterator<GuardedByAttr>
+ I = D->specific_attr_begin<GuardedByAttr>(),
+ E = D->specific_attr_end<GuardedByAttr>(); I != E; ++I)
+ warnIfMutexNotHeld(D, Exp, AK, (*I)->getArg(), POK_VarAccess);
}
/// \brief Checks pt_guarded_by and pt_guarded_var attributes.
Analyzer->Handler.handleNoMutexHeld(D, POK_VarDereference, AK,
Exp->getExprLoc());
- const AttrVec &ArgAttrs = D->getAttrs();
- for (unsigned i = 0, Size = ArgAttrs.size(); i < Size; ++i)
- if (PtGuardedByAttr *GBAttr = dyn_cast<PtGuardedByAttr>(ArgAttrs[i]))
- warnIfMutexNotHeld(D, Exp, AK, GBAttr->getArg(), POK_VarDereference);
+ for (specific_attr_iterator<PtGuardedByAttr>
+ I = D->specific_attr_begin<PtGuardedByAttr>(),
+ E = D->specific_attr_end<PtGuardedByAttr>(); I != E; ++I)
+ warnIfMutexNotHeld(D, Exp, AK, (*I)->getArg(), POK_VarDereference);
}