From: Aaron Ballman Date: Thu, 15 May 2014 20:58:55 +0000 (+0000) Subject: Refactoring another for loop to use a range-based for loop instead. Also cleaned... X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=3d86cecbb6e01f24b8754fc2f51becd83f0baedf;p=clang Refactoring another for loop to use a range-based for loop instead. Also cleaned up a bit of formatting. No functional changes intended. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@208918 91177308-0d34-0410-b5e6-96231b3b80d8 --- diff --git a/lib/Sema/Sema.cpp b/lib/Sema/Sema.cpp index 7533b39ce6..b0d1023b01 100644 --- a/lib/Sema/Sema.cpp +++ b/lib/Sema/Sema.cpp @@ -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::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() {