diff options
author | DeLesley Hutchins <delesley@google.com> | 2014-11-05 23:09:28 +0000 |
---|---|---|
committer | DeLesley Hutchins <delesley@google.com> | 2014-11-05 23:09:28 +0000 |
commit | 6d41f38c7489a2da36f6ca634e8260fe623a088f (patch) | |
tree | 5641ac97791832b23698a6c09c9c069995090458 /clang/lib/Analysis | |
parent | 70f3897b0ab525b603cd702533f64a32bde1911f (diff) | |
download | bcm5719-llvm-6d41f38c7489a2da36f6ca634e8260fe623a088f.tar.gz bcm5719-llvm-6d41f38c7489a2da36f6ca634e8260fe623a088f.zip |
Thread Safety Analysis: move warnings on range-based for loops out of beta
and into -Wthread-safety.
llvm-svn: 221410
Diffstat (limited to 'clang/lib/Analysis')
-rw-r--r-- | clang/lib/Analysis/ThreadSafety.cpp | 20 |
1 files changed, 9 insertions, 11 deletions
diff --git a/clang/lib/Analysis/ThreadSafety.cpp b/clang/lib/Analysis/ThreadSafety.cpp index 285b8924a0f..4ddc21d1fb8 100644 --- a/clang/lib/Analysis/ThreadSafety.cpp +++ b/clang/lib/Analysis/ThreadSafety.cpp @@ -1403,19 +1403,17 @@ void BuildLockset::checkAccess(const Expr *Exp, AccessKind AK, SourceLocation Loc = Exp->getExprLoc(); - if (Analyzer->Handler.issueBetaWarnings()) { - // Local variables of reference type cannot be re-assigned; - // map them to their initializer. - while (const auto *DRE = dyn_cast<DeclRefExpr>(Exp)) { - const auto *VD = dyn_cast<VarDecl>(DRE->getDecl()->getCanonicalDecl()); - if (VD && VD->isLocalVarDecl() && VD->getType()->isReferenceType()) { - if (const auto *E = VD->getInit()) { - Exp = E; - continue; - } + // Local variables of reference type cannot be re-assigned; + // map them to their initializer. + while (const auto *DRE = dyn_cast<DeclRefExpr>(Exp)) { + const auto *VD = dyn_cast<VarDecl>(DRE->getDecl()->getCanonicalDecl()); + if (VD && VD->isLocalVarDecl() && VD->getType()->isReferenceType()) { + if (const auto *E = VD->getInit()) { + Exp = E; + continue; } - break; } + break; } if (const UnaryOperator *UO = dyn_cast<UnaryOperator>(Exp)) { |