Skip to content

Commit 4ce2f98

Browse files
[Serialization] Use traditional for loops (NFC) (#102761)
The use of _ requires either: - (void)_ and curly braces, or - [[maybe_unused]]. For simple repetitions like these, we can use traditional for loops for readable warning-free code.
1 parent ac83582 commit 4ce2f98

File tree

1 file changed

+2
-6
lines changed

1 file changed

+2
-6
lines changed

clang/lib/Serialization/ASTReader.cpp

Lines changed: 2 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -11468,10 +11468,8 @@ void OMPClauseReader::VisitOMPNumTeamsClause(OMPNumTeamsClause *C) {
1146811468
unsigned NumVars = C->varlist_size();
1146911469
SmallVector<Expr *, 16> Vars;
1147011470
Vars.reserve(NumVars);
11471-
for ([[maybe_unused]] auto _ : llvm::seq<unsigned>(NumVars)) {
11472-
(void)_;
11471+
for (unsigned I = 0; I != NumVars; ++I)
1147311472
Vars.push_back(Record.readSubExpr());
11474-
}
1147511473
C->setVarRefs(Vars);
1147611474
}
1147711475

@@ -11481,10 +11479,8 @@ void OMPClauseReader::VisitOMPThreadLimitClause(OMPThreadLimitClause *C) {
1148111479
unsigned NumVars = C->varlist_size();
1148211480
SmallVector<Expr *, 16> Vars;
1148311481
Vars.reserve(NumVars);
11484-
for (auto _ : llvm::seq<unsigned>(NumVars)) {
11485-
(void)_;
11482+
for (unsigned I = 0; I != NumVars; ++I)
1148611483
Vars.push_back(Record.readSubExpr());
11487-
}
1148811484
C->setVarRefs(Vars);
1148911485
}
1149011486

0 commit comments

Comments
 (0)