r197681 - Switching getAttrs calls over to using a specific_attr_iterator. No functional changes intended.
Aaron Ballman
aaron at aaronballman.com
Thu Dec 19 07:35:31 PST 2013
Author: aaronballman
Date: Thu Dec 19 09:35:31 2013
New Revision: 197681
URL: http://llvm.org/viewvc/llvm-project?rev=197681&view=rev
Log:
Switching getAttrs calls over to using a specific_attr_iterator. No functional changes intended.
Modified:
cfe/trunk/lib/Analysis/ThreadSafety.cpp
Modified: cfe/trunk/lib/Analysis/ThreadSafety.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/Analysis/ThreadSafety.cpp?rev=197681&r1=197680&r2=197681&view=diff
==============================================================================
--- cfe/trunk/lib/Analysis/ThreadSafety.cpp (original)
+++ cfe/trunk/lib/Analysis/ThreadSafety.cpp Thu Dec 19 09:35:31 2013
@@ -1900,10 +1900,10 @@ void BuildLockset::checkAccess(const Exp
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.
@@ -1938,10 +1938,10 @@ void BuildLockset::checkPtAccess(const E
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);
}
More information about the cfe-commits
mailing list