]> granicus.if.org Git - clang/commitdiff
Refactoring another for loop to use a range-based for loop instead. Also cleaned...
authorAaron Ballman <aaron@aaronballman.com>
Thu, 15 May 2014 20:58:55 +0000 (20:58 +0000)
committerAaron Ballman <aaron@aaronballman.com>
Thu, 15 May 2014 20:58:55 +0000 (20:58 +0000)
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@208918 91177308-0d34-0410-b5e6-96231b3b80d8

lib/Sema/Sema.cpp

index 7533b39ce619076d61dcd0264c4b1d44cdba62f9..b0d1023b0119f5ca16b35009023d16aa79b43f39 100644 (file)
@@ -1086,19 +1086,12 @@ void Sema::PopFunctionScopeInfo(const AnalysisBasedWarnings::Policy *WP,
   // Issue any analysis-based warnings.
   if (WP && D)
     AnalysisWarnings.IssueWarnings(*WP, Scope, D, blkExpr);
-  else {
-    for (SmallVectorImpl<sema::PossiblyUnreachableDiag>::iterator
-         i = Scope->PossiblyUnreachableDiags.begin(),
-         e = Scope->PossiblyUnreachableDiags.end();
-         i != e; ++i) {
-      const sema::PossiblyUnreachableDiag &D = *i;
-      Diag(D.Loc, D.PD);
-    }
-  }
+  else
+    for (const auto &PUD : Scope->PossiblyUnreachableDiags)
+      Diag(PUD.Loc, PUD.PD);
 
-  if (FunctionScopes.back() != Scope) {
+  if (FunctionScopes.back() != Scope)
     delete Scope;
-  }
 }
 
 void Sema::PushCompoundScope() {