forked from OSchip/llvm-project
Thread safety analysis: move smart pointer checks from -Wthread-safety-beta
to -Wthread-safety. llvm-svn: 203510
This commit is contained in:
parent
ce376c0fcb
commit
d1c9b37db9
|
@ -1857,11 +1857,9 @@ void BuildLockset::checkAccess(const Expr *Exp, AccessKind AK) {
|
|||
}
|
||||
|
||||
if (const ArraySubscriptExpr *AE = dyn_cast<ArraySubscriptExpr>(Exp)) {
|
||||
if (Analyzer->Handler.issueBetaWarnings()) {
|
||||
checkPtAccess(AE->getLHS(), AK);
|
||||
return;
|
||||
}
|
||||
}
|
||||
|
||||
if (const MemberExpr *ME = dyn_cast<MemberExpr>(Exp)) {
|
||||
if (ME->isArrow())
|
||||
|
@ -1884,7 +1882,6 @@ void BuildLockset::checkAccess(const Expr *Exp, AccessKind AK) {
|
|||
|
||||
/// \brief Checks pt_guarded_by and pt_guarded_var attributes.
|
||||
void BuildLockset::checkPtAccess(const Expr *Exp, AccessKind AK) {
|
||||
if (Analyzer->Handler.issueBetaWarnings()) {
|
||||
while (true) {
|
||||
if (const ParenExpr *PE = dyn_cast<ParenExpr>(Exp)) {
|
||||
Exp = PE->getSubExpr();
|
||||
|
@ -1902,9 +1899,6 @@ void BuildLockset::checkPtAccess(const Expr *Exp, AccessKind AK) {
|
|||
}
|
||||
break;
|
||||
}
|
||||
}
|
||||
else
|
||||
Exp = Exp->IgnoreParenCasts();
|
||||
|
||||
const ValueDecl *D = getValueDecl(Exp);
|
||||
if (!D || !D->hasAttrs())
|
||||
|
@ -2134,11 +2128,9 @@ void BuildLockset::VisitCallExpr(CallExpr *Exp) {
|
|||
case OO_Star:
|
||||
case OO_Arrow:
|
||||
case OO_Subscript: {
|
||||
if (Analyzer->Handler.issueBetaWarnings()) {
|
||||
const Expr *Obj = OE->getArg(0);
|
||||
checkAccess(Obj, AK_Read);
|
||||
checkPtAccess(Obj, AK_Read);
|
||||
}
|
||||
break;
|
||||
}
|
||||
default: {
|
||||
|
|
Loading…
Reference in New Issue