Skip to content

Commit

Permalink
[Flang][OpenMP] NFC: Use ConstructQueue::const_iterator (llvm#102612)
Browse files Browse the repository at this point in the history
This patch replaces `ConstructQueue::iterator` arguments with
`ConstructQueue::const_iterator` where it's used as a pointer to an
element inside of a `const ConstructQueue &` passed along with it.

Since these functions don't intend to modify the list or any elements in
it, keeping constness consistent between both makes it simpler to work
with.
  • Loading branch information
skatrak committed Aug 12, 2024
1 parent 32a62eb commit ebf530c
Show file tree
Hide file tree
Showing 3 changed files with 60 additions and 54 deletions.
2 changes: 1 addition & 1 deletion flang/lib/Lower/OpenMP/Decomposer.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -124,7 +124,7 @@ ConstructQueue buildConstructQueue(
return constructs;
}

bool isLastItemInQueue(ConstructQueue::iterator item,
bool isLastItemInQueue(ConstructQueue::const_iterator item,
const ConstructQueue &queue) {
return std::next(item) == queue.end();
}
Expand Down
2 changes: 1 addition & 1 deletion flang/lib/Lower/OpenMP/Decomposer.h
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ ConstructQueue buildConstructQueue(mlir::ModuleOp modOp,
llvm::omp::Directive compound,
const List<Clause> &clauses);

bool isLastItemInQueue(ConstructQueue::iterator item,
bool isLastItemInQueue(ConstructQueue::const_iterator item,
const ConstructQueue &queue);
} // namespace Fortran::lower::omp

Expand Down
Loading

0 comments on commit ebf530c

Please sign in to comment.