Skip to content

Commit 5a36f5a

Browse files
committed
Use range-based for loops. NFC
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@254133 91177308-0d34-0410-b5e6-96231b3b80d8
1 parent 31bddff commit 5a36f5a

File tree

1 file changed

+7
-7
lines changed

1 file changed

+7
-7
lines changed

lib/Basic/Diagnostic.cpp

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -278,8 +278,8 @@ bool DiagnosticsEngine::setDiagnosticGroupWarningAsError(StringRef Group,
278278
return true;
279279

280280
// Perform the mapping change.
281-
for (unsigned i = 0, e = GroupDiags.size(); i != e; ++i) {
282-
DiagnosticMapping &Info = GetCurDiagState()->getOrAddMapping(GroupDiags[i]);
281+
for (diag::kind Diag : GroupDiags) {
282+
DiagnosticMapping &Info = GetCurDiagState()->getOrAddMapping(Diag);
283283

284284
if (Info.getSeverity() == diag::Severity::Error ||
285285
Info.getSeverity() == diag::Severity::Fatal)
@@ -309,8 +309,8 @@ bool DiagnosticsEngine::setDiagnosticGroupErrorAsFatal(StringRef Group,
309309
return true;
310310

311311
// Perform the mapping change.
312-
for (unsigned i = 0, e = GroupDiags.size(); i != e; ++i) {
313-
DiagnosticMapping &Info = GetCurDiagState()->getOrAddMapping(GroupDiags[i]);
312+
for (diag::kind Diag : GroupDiags) {
313+
DiagnosticMapping &Info = GetCurDiagState()->getOrAddMapping(Diag);
314314

315315
if (Info.getSeverity() == diag::Severity::Fatal)
316316
Info.setSeverity(diag::Severity::Error);
@@ -329,9 +329,9 @@ void DiagnosticsEngine::setSeverityForAll(diag::Flavor Flavor,
329329
Diags->getAllDiagnostics(Flavor, AllDiags);
330330

331331
// Set the mapping.
332-
for (unsigned i = 0, e = AllDiags.size(); i != e; ++i)
333-
if (Diags->isBuiltinWarningOrExtension(AllDiags[i]))
334-
setSeverity(AllDiags[i], Map, Loc);
332+
for (diag::kind Diag : AllDiags)
333+
if (Diags->isBuiltinWarningOrExtension(Diag))
334+
setSeverity(Diag, Map, Loc);
335335
}
336336

337337
void DiagnosticsEngine::Report(const StoredDiagnostic &storedDiag) {

0 commit comments

Comments
 (0)