r215704 - Adding const-qualifiers to auto declarations. NFC.

Aaron Ballman aaron at aaronballman.com
Fri Aug 15 05:29:39 PDT 2014


Author: aaronballman
Date: Fri Aug 15 07:29:39 2014
New Revision: 215704

URL: http://llvm.org/viewvc/llvm-project?rev=215704&view=rev
Log:
Adding const-qualifiers to auto declarations. NFC.

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=215704&r1=215703&r2=215704&view=diff
==============================================================================
--- cfe/trunk/lib/Analysis/ThreadSafety.cpp (original)
+++ cfe/trunk/lib/Analysis/ThreadSafety.cpp Fri Aug 15 07:29:39 2014
@@ -1337,10 +1337,10 @@ void BuildLockset::checkAccess(const Exp
   if (Analyzer->Handler.issueBetaWarnings()) {
     // Local variables of reference type cannot be re-assigned;
     // map them to their initializer.
-    while (auto *DRE = dyn_cast<DeclRefExpr>(Exp)) {
-      auto *VD = dyn_cast<VarDecl>(DRE->getDecl()->getCanonicalDecl());
+    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 (auto *E = VD->getInit()) {
+        if (const auto *E = VD->getInit()) {
           Exp = E;
           continue;
         }





More information about the cfe-commits mailing list