From 362e509a74d8b7bf4bca6344f8d838da2df98bf2 Mon Sep 17 00:00:00 2001
From: DeLesley Hutchins <delesley@google.com>
Date: Wed, 5 Nov 2014 23:09:28 +0000
Subject: [PATCH] Thread Safety Analysis: move warnings on range-based for
 loops out of beta and into -Wthread-safety.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@221410 91177308-0d34-0410-b5e6-96231b3b80d8
---
 lib/Analysis/ThreadSafety.cpp | 20 +++++++++-----------
 1 file changed, 9 insertions(+), 11 deletions(-)

diff --git a/lib/Analysis/ThreadSafety.cpp b/lib/Analysis/ThreadSafety.cpp
index 285b8924a0f..4ddc21d1fb8 100644
--- a/lib/Analysis/ThreadSafety.cpp
+++ b/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)) {
-- 
GitLab