r221410 - Thread Safety Analysis: move warnings on range-based for loops out of beta

DeLesley Hutchins delesley at google.com
Wed Nov 5 15:09:28 PST 2014


Author: delesley
Date: Wed Nov  5 17:09:28 2014
New Revision: 221410

URL: http://llvm.org/viewvc/llvm-project?rev=221410&view=rev
Log:
Thread Safety Analysis: move warnings on range-based for loops out of beta
and into -Wthread-safety.

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=221410&r1=221409&r2=221410&view=diff
==============================================================================
--- cfe/trunk/lib/Analysis/ThreadSafety.cpp (original)
+++ cfe/trunk/lib/Analysis/ThreadSafety.cpp Wed Nov  5 17:09:28 2014
@@ -1403,19 +1403,17 @@ void BuildLockset::checkAccess(const Exp
 
   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)) {





More information about the cfe-commits mailing list